-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LinkingCurrent
objective
#1222
base: master
Are you sure you want to change the base?
LinkingCurrent
objective
#1222
Conversation
| benchmark_name | dt(%) | dt(s) | t_new(s) | t_old(s) |
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
test_build_transform_fft_midres | +5.82 +/- 4.75 | +3.48e-02 +/- 2.84e-02 | 6.33e-01 +/- 1.8e-02 | 5.99e-01 +/- 2.2e-02 |
test_build_transform_fft_highres | +2.85 +/- 5.18 | +2.75e-02 +/- 5.00e-02 | 9.92e-01 +/- 4.4e-02 | 9.64e-01 +/- 2.4e-02 |
test_equilibrium_init_lowres | +7.16 +/- 7.23 | +2.78e-01 +/- 2.80e-01 | 4.16e+00 +/- 4.0e-02 | 3.88e+00 +/- 2.8e-01 |
test_objective_compile_atf | +2.79 +/- 3.71 | +2.19e-01 +/- 2.92e-01 | 8.09e+00 +/- 2.2e-01 | 7.87e+00 +/- 1.9e-01 |
test_objective_compute_atf | +3.80 +/- 1.76 | +3.98e-04 +/- 1.84e-04 | 1.09e-02 +/- 1.5e-04 | 1.05e-02 +/- 1.0e-04 |
test_objective_jac_atf | +3.37 +/- 1.61 | +6.30e-02 +/- 3.01e-02 | 1.93e+00 +/- 2.4e-02 | 1.87e+00 +/- 1.8e-02 |
-test_perturb_1 | +7.24 +/- 2.34 | +1.02e+00 +/- 3.29e-01 | 1.51e+01 +/- 6.1e-02 | 1.40e+01 +/- 3.2e-01 |
test_proximal_jac_atf | +0.76 +/- 1.18 | +6.16e-02 +/- 9.52e-02 | 8.15e+00 +/- 7.9e-02 | 8.09e+00 +/- 5.4e-02 |
test_proximal_freeb_compute | -0.78 +/- 0.76 | -1.53e-03 +/- 1.48e-03 | 1.94e-01 +/- 1.1e-03 | 1.96e-01 +/- 1.0e-03 |
test_solve_fixed_iter_compiled | -0.37 +/- 2.13 | -6.30e-02 +/- 3.58e-01 | 1.68e+01 +/- 1.6e-01 | 1.68e+01 +/- 3.2e-01 |
test_build_transform_fft_lowres | -0.90 +/- 5.43 | -5.04e-03 +/- 3.06e-02 | 5.57e-01 +/- 2.1e-02 | 5.62e-01 +/- 2.2e-02 |
test_equilibrium_init_medres | -0.79 +/- 6.99 | -3.49e-02 +/- 3.10e-01 | 4.40e+00 +/- 2.2e-01 | 4.44e+00 +/- 2.2e-01 |
test_equilibrium_init_highres | +2.46 +/- 5.34 | +1.37e-01 +/- 2.97e-01 | 5.71e+00 +/- 1.9e-01 | 5.57e+00 +/- 2.3e-01 |
test_objective_compile_dshape_current | -1.12 +/- 6.91 | -4.43e-02 +/- 2.73e-01 | 3.91e+00 +/- 2.2e-01 | 3.95e+00 +/- 1.6e-01 |
test_objective_compute_dshape_current | +0.68 +/- 2.37 | +2.46e-05 +/- 8.54e-05 | 3.63e-03 +/- 5.1e-05 | 3.60e-03 +/- 6.8e-05 |
test_objective_jac_dshape_current | -0.27 +/- 7.72 | -1.14e-04 +/- 3.22e-03 | 4.16e-02 +/- 1.5e-03 | 4.17e-02 +/- 2.8e-03 |
test_perturb_2 | +0.11 +/- 3.42 | +2.21e-02 +/- 6.85e-01 | 2.01e+01 +/- 3.1e-01 | 2.01e+01 +/- 6.1e-01 |
test_proximal_freeb_jac | -0.30 +/- 2.06 | -2.33e-02 +/- 1.57e-01 | 7.64e+00 +/- 9.3e-02 | 7.66e+00 +/- 1.3e-01 |
test_solve_fixed_iter | -0.37 +/- 3.61 | -1.07e-01 +/- 1.05e+00 | 2.90e+01 +/- 8.9e-01 | 2.91e+01 +/- 5.5e-01 |
test_LinearConstraintProjection_build | -0.50 +/- 1.99 | -1.16e-01 +/- 4.62e-01 | 2.30e+01 +/- 2.9e-01 | 2.32e+01 +/- 3.6e-01 | |
do #1231 |
Any progress on this @daniel-dudt ? |
Use Linking number calc for linear objective for sum coil currents as well, to use as weights for sum |
I think an equivalent sort of objective to ensure that the coils are creating the necessary current, without needing the linking number calculation (though I'd still like that in sometime), is to directly calculate $\int_{o}^{2\pi/NFP} \mathbf{B}{coil} \cdot \mathbf{e}{\zeta} d\zeta - \int_{o}^{2\pi/NFP} \mathbf{B}{DESC} \cdot \mathbf{e}{\zeta} d\zeta$ which is the relation that Ampere's law tells us (the second term here is This being zero means the coils are consistent with Ampere's law and avoids needing to worry about the linking currents (though this is a bit more expensive, as it relies on biot-savart integration over the coils to get |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1222 +/- ##
==========================================
+ Coverage 95.59% 95.63% +0.03%
==========================================
Files 96 96
Lines 24601 24675 +74
==========================================
+ Hits 23518 23597 +79
+ Misses 1083 1078 -5
|
We had talked about adding the linking number stuff to |
…to dd/linking_current
This is a nonlinear form of the existing linear objective
FixSumCoilCurrent
. It ensures the total current through the coils matches the poloidal current of the equilibrium. This is necessary for single-stage optimization where the equilibrium and coils are changing simultaneously.