Skip to content

v0.9.2

Latest

Choose a tag to compare

@jurasic-pf jurasic-pf released this 25 Oct 15:05
· 11 commits to main since this release
b33193b

Use consistent, regularized radial derivatives for lbsubs.
breaking: behavior now deviates from Fortran vmec, and requires different regularized interpolation in user code. the resulting currents are more trustworthy. details in docs/reports/lbsubs/.

For current-dependent calculations, use exported currents instead of differentiating covariant B. For example, at an interior full-grid surface j in a stellarator-symmetric equilibrium (w = output.wout):

h = 1 / (w.ns - 1)
c = np.cos(w.xm_nyq * theta - w.xn_nyq * zeta)
sqrtg = (0.5 * (w.gmnc[:, j] + w.gmnc[:, j + 1])) @ c

- # Before: plain finite differences (incompatible with updated lbsubs=True).
- dBu = (w.bsubumnc[:, j + 1] - w.bsubumnc[:, j]) / h
- Jzeta = ((dBu - w.xm_nyq * w.bsubsmns[:, j]) @ c) / (mu_0 * sqrtg)
+ # After: exported sqrt(g) J^zeta already includes 1/mu_0.
+ Jzeta = (w.currvmnc[:, j] @ c) / sqrtg

For asymmetric equilibria, also include the sine series from currvmns and gmns.

What's Changed

Full Changelog: v0.9.1...v0.9.2