Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New CG implemented and will be replaced #35

Open
zhucaoxiang opened this issue Aug 26, 2019 · 2 comments
Open

New CG implemented and will be replaced #35

zhucaoxiang opened this issue Aug 26, 2019 · 2 comments

Comments

@zhucaoxiang
Copy link
Collaborator

The current nonlinear conjugate gradient (CG) method was written by myself based on the strategy of Yuan & Dai. The line search subroutine is also written by myself based on Numerical Optimization. It is often observed un-converged line search.
In the develop branch, FOCUS is linked to another well-written library, CG-descent. If you want to use the old version CG, just compile with PFLAGS='-D oldcg'.

Here is a test using the rotating ellipse. Solid lines are the CG-descent, and dashed lines the old CG.

  1. Convergence over iterations.
    image

  2. Convergence over wall-time.
    image

  3. Poincare plots from CG-descent
    image

  4. Poincare plots from old CG
    image

The testing results show that the CG-descent is much faster in speed. My guess is that I didn't implement a very good line search subroutine. So I will encourage everyone to test the CG-descent and will merge it into master after some time.

git fetch
git checkout develop
make clean; make xfocus; make dfocus
@logan-nc
Copy link
Collaborator

Thanks @zhucaoxiang. Do all the namelist settings work exactly as before or are there any changes we should be aware of as users?

@zhucaoxiang
Copy link
Collaborator Author

@logan-nc Yes, I think so. CG_maxiter will determine the maximum iteration. CG_wolfe_c1 and CG_wolfe_c2 are for line searches. The only difference is that the default value of CG_wolfe_c1 is now 0.1 (previously is 1E-4) and 0<CG_wolfe_c1<0.5. I have updated the examples in d3d and rotating ellipse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants