PrincetonUniversity / SPEC

The Stepped-Pressure Equilibrium Code, an advanced MRxMHD equilibrium solver.
https://princetonuniversity.github.io/SPEC/
GNU General Public License v3.0
24 stars 4 forks source link

Bug in force gradient when Lrzaxis=1 ? #165

Closed abaillod closed 2 years ago

abaillod commented 2 years ago

Hi! I noticed that the test Lcheck=6 was broken on the master branch; not all elements of the force gradient were printed. I fixed it in a new branch, called FixLcheck=6.

Now, I found the following problem: when comparing the analytical force gradient (Lfindzero=2) with some finite differences (Lcheck=6), and using the centroid method for determining the coordinate axis position (Lrzaxis=1), I get a mismatch for some specific derivatives (I think the derivatives df_mn / dR_1-N and df_mn / dZ_1-N), of the order of ~1E-4. Changing the finite difference step does not fix the problem.

Some comments / questions :