Closed andrewgiuliani closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 91.28%. Comparing base (
d830719
) to head (f4c9931
). Report is 45 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
If the new vectorized routine is much better, did you consider removing the old routine?
The algorithms in BoozerSurface.minimize_boozer_penalty_constraints_ls
rely on the old routine and I preferred to leave it alone, rather than to do a larger refactor of the BoozerSurface class. Specifically, the old routines can return the residual evaluated at all collocation points (a vector) or the sum of all residuals squared (a scalar). The new routines only return the scalarized residual, while BoozerSurface.minimize_boozer_penalty_constraints_ls
require the vector residual.
Similarly, it sounds like the new weight_inv_modB option improves robustness, so you could consider making it the only option, so there are fewer cases to maintain.
The BoozerExact algorithm assumes that the residuals are unweighted, so I think we should maintain both options.
This PR introduces two capabilities:
\int residual(varphi, theta)^2 dvarphi dtheta
. This PR allows the user to weight the residual with 1/modB, preventing the residual from scaling with the coil currents, i.e.,\int [residual(varphi, theta)/modB(varphi, theta)]^2 dvarphi dtheta
.Computing the Hessian for surfaces with mpol, ntor = N, I obtain the following timings in seconds: