SPEC icon indicating copy to clipboard operation
SPEC copied to clipboard

Implementing Sequential Quadratic Programming

Open zhisong opened this issue 6 years ago • 1 comments

I did an naive attempt to implement the SQP algorithm, using the package NLOPT. I have pushed the branch "sqp". To use the branch, please check if NLOPT is installed on your cluster and change the path of NLOPT in the Makefile accordingly. Otherwise is very easy to install from the link https://nlopt.readthedocs.io/en/latest/

The current problem is that, the dMA matrix is not positive definite (could easily seen by computing the eigenvalue of dMA). The final optimization result is always negative infinity. It is possible that the Lagrangian multiplier formalism for the boundary condition needs to change. Or some limitations should be placed on the Lagrangian multipliers a b c d e f. This is annoying.

zhisong avatar Mar 05 '19 08:03 zhisong

I am happy to announce I have a version of SQP that at least "seems to work".

I have removed all the Lagrangian multipliers in dMA, and moved them to form constraints of the problem.

The test case is InputFiles/Verification/helicity/Taylor/helicity20_SQP.sp

In the input file, I put LBeltrami=3. This means that first the SQP is called, then the result is used to initialize a Newton's method. The screen will output two lines of numbers, with the first in each one being the energy and second one being the helicity (constraint to 20). The first line is the result of SQP and second is the Newton's method. One can verify that in helicity20_SQP.sp.end, mu is indeed 3.13, the result of the Taylor relaxation noted earlier in #59 .

The results are

SQP: 59.420569927889716 19.999995061296641
Newton: 59.420585419870079 19.999999999999993

which seems to match

zhisong avatar Mar 06 '19 01:03 zhisong