Skip to content

Commit

Permalink
Merge branch 'master' into rc/freeb
Browse files Browse the repository at this point in the history
  • Loading branch information
f0uriest authored Feb 2, 2024
2 parents a7c81f9 + 872fff3 commit c837cc5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions desc/objectives/nae_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def _calc_1st_order_NAE_coeffs(qsc, desc_eq, N=None):
since Z(-theta,-phi) = - Z(theta,phi) for Z stellarator symmetry.
"""
phi = qsc.phi
dphi = phi[1] - phi[0]

R0 = qsc.R0_func(phi)
dR0_dphi = qsc.R0p
Expand Down Expand Up @@ -159,8 +160,14 @@ def _calc_1st_order_NAE_coeffs(qsc, desc_eq, N=None):
k_dot_Z - k_dot_phi * dZ0_dphi / R0
)

L_1_1 = X1c * (-k_dot_phi / R0) + Y1c * (-tau_dot_phi / R0)
L_1_neg1 = Y1s * (-tau_dot_phi / R0) + X1s * (-k_dot_phi / R0)
# from integrating eqn A20 in
# Constructing stellarators with quasisymmetry to high order 2019
# Landreman and Sengupta
# take derivative of that form d(nu0)_dphi
nu_0 = np.cumsum(qsc.B0 / qsc.G0 * qsc.d_l_d_phi - 1) * np.ones_like(phi) * dphi
nu0p = np.diff(np.append(nu_0, nu_0[0])) / dphi
L_1_1 = qsc.iota * (X1c * (k_dot_phi) + Y1c * (tau_dot_phi)) / R0 * (nu0p + 1)
L_1_neg1 = qsc.iota * (X1s * (k_dot_phi) + Y1s * (tau_dot_phi)) / R0 * (nu0p + 1)

nfp = qsc.nfp
if desc_eq.sym:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def test_NAE_QSC_solve():
verbose=3,
ftol=1e-2,
objective=obj,
maxiter=100,
maxiter=175,
xtol=1e-6,
constraints=constraints,
)
Expand Down

0 comments on commit c837cc5

Please sign in to comment.