Add parameter to shift the max B theta to Omnigenity objective#2167
Add parameter to shift the max B theta to Omnigenity objective#2167dpanici wants to merge 1 commit into
Conversation
Memory benchmark result| Test Name | %Δ | Master (MB) | PR (MB) | Δ (MB) | Time PR (s) | Time Master (s) |
| -------------------------------------- | ------------ | ------------------ | ------------------ | ------------ | ------------------ | ------------------ |
test_objective_jac_w7x | -1.14 % | 4.052e+03 | 4.005e+03 | -46.19 | 41.47 | 38.07 |
test_proximal_jac_w7x_with_eq_update | 0.94 % | 6.517e+03 | 6.578e+03 | 61.13 | 158.10 | 159.47 |
test_proximal_freeb_jac | 0.61 % | 1.337e+04 | 1.345e+04 | 81.61 | 88.15 | 86.25 |
test_proximal_freeb_jac_blocked | 0.61 % | 7.720e+03 | 7.767e+03 | 47.04 | 76.61 | 76.10 |
test_proximal_freeb_jac_batched | 0.21 % | 7.777e+03 | 7.793e+03 | 16.59 | 75.61 | 74.99 |
test_proximal_jac_ripple | -0.91 % | 3.614e+03 | 3.581e+03 | -32.83 | 61.28 | 59.86 |
test_proximal_jac_ripple_bounce1d | 2.19 % | 3.790e+03 | 3.873e+03 | 82.95 | 75.75 | 72.73 |
test_eq_solve | -0.65 % | 2.228e+03 | 2.213e+03 | -14.57 | 98.87 | 97.78 |For the memory plots, go to the summary of |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2167 +/- ##
=======================================
Coverage 94.45% 94.45%
=======================================
Files 101 101
Lines 28604 28606 +2
=======================================
+ Hits 27018 27020 +2
Misses 1586 1586
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
My preferred solution is to create equivalents of flip_theta and rotate_zeta for pyQSC & pyQIC. That would solve #1143 for @dpanici's use case and improve the functionality of those codes.
If we do use this solution, we need to also add a new parameter for shifting zeta_B in case B_max is not aligned with zeta_B=0 for OP equilibria.
| computation time during optimization and only ``eq`` is allowed to change. | ||
| If False, the field is allowed to change during the optimization and its | ||
| associated data are re-computed at every iteration (Default). | ||
| B_max_theta_location : float, optional |
There was a problem hiding this comment.
I don't like this name. Technically it isn't even the theta angle of B_max, since that will change as a function of the toroidal angle. I suggest B_max_theta_offset or something similar. Also you would need to add a similar option for the zeta offset.
| ( | ||
| jnp.zeros_like(theta_B), | ||
| theta_B, | ||
| theta_B + B_max_theta_location, |
There was a problem hiding this comment.
This will only work for toroidal and helical omnigenity. There is also the similar issue for poloidal omnigenity (aka QI) where you want to shift the toroidal angle zeta_B
|
Thanks for catching, I'll add a toroidal shift as well. Adding these here is easier than modifying both pyQSC and pyQIC, imo. |
Resolves #1143