DESC icon indicating copy to clipboard operation
DESC copied to clipboard

Rc/toroidal angle

Open f0uriest opened this issue 2 years ago • 22 comments

  • [ ] near axis constraints with omega
  • [ ] constant offset surface
  • [ ] Proximal projection
  • [ ] Add stuff for spectral condensation / optimal fitting
  • [x] Default to fixing zeta==phi? Default to an empty W_lmn, modes_W.
  • [ ] to_FourierRZCurve methods should now be possible?
  • [ ] Fix calculation of A, a_major/a_minor, other stuff that needs to be computed at const phi, not const zeta. (this should already be done in other prs)
  • [ ] changing continuation/perturbation to work with the new coordinates (changing regularization)
  • [ ] make the new API compatible with this PR
  • [ ] different resolutions for omega?
  • [ ] Revert change to plot_surfaces map_coordinates call once toroidal angle is generalized #1952

Resolves #465

f0uriest avatar Jul 05 '23 18:07 f0uriest

Are you sure that DSHAPE should have non positive curvature? tests/test_objective_funs.py::test_mean_curvature is failing

unalmis avatar Jul 21 '23 18:07 unalmis

|             benchmark_name             |         dt(%)          |         dt(s)          |        t_new(s)        |        t_old(s)        | 
| -------------------------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
 test_build_transform_fft_lowres         |     +0.44 +/- 5.26     | +2.33e-03 +/- 2.81e-02 |  5.37e-01 +/- 2.0e-02  |  5.35e-01 +/- 1.9e-02  |
 test_build_transform_fft_midres         |     -0.36 +/- 4.18     | -2.25e-03 +/- 2.58e-02 |  6.16e-01 +/- 2.2e-02  |  6.18e-01 +/- 1.4e-02  |
 test_build_transform_fft_highres        |     +0.43 +/- 3.38     | +4.39e-03 +/- 3.41e-02 |  1.01e+00 +/- 2.9e-02  |  1.01e+00 +/- 1.7e-02  |
 test_equilibrium_init_lowres            |     -0.58 +/- 2.92     | -2.26e-02 +/- 1.13e-01 |  3.86e+00 +/- 5.7e-02  |  3.88e+00 +/- 9.8e-02  |
 test_equilibrium_init_medres            |     +0.20 +/- 3.63     | +8.58e-03 +/- 1.59e-01 |  4.37e+00 +/- 9.0e-02  |  4.37e+00 +/- 1.3e-01  |
 test_equilibrium_init_highres           |     +1.96 +/- 2.08     | +1.12e-01 +/- 1.19e-01 |  5.84e+00 +/- 9.9e-02  |  5.73e+00 +/- 6.5e-02  |
-test_objective_compile_dshape_current   |     +9.36 +/- 1.41     | +3.61e-01 +/- 5.44e-02 |  4.21e+00 +/- 4.7e-02  |  3.85e+00 +/- 2.8e-02  |
-test_objective_compile_atf              |    +37.31 +/- 1.25     | +3.12e+00 +/- 1.05e-01 |  1.15e+01 +/- 9.0e-02  |  8.36e+00 +/- 5.4e-02  |
 test_objective_compute_dshape_current   |    +19.74 +/- 6.98     | +2.62e-04 +/- 9.26e-05 |  1.59e-03 +/- 4.7e-05  |  1.33e-03 +/- 8.0e-05  |
-test_objective_compute_atf              |    +41.36 +/- 6.77     | +1.77e-03 +/- 2.90e-04 |  6.06e-03 +/- 2.4e-04  |  4.29e-03 +/- 1.6e-04  |
-test_objective_jac_dshape_current       |    +88.80 +/- 15.22    | +3.24e-02 +/- 5.56e-03 |  6.89e-02 +/- 4.3e-03  |  3.65e-02 +/- 3.5e-03  |
-test_objective_jac_atf                  |    +76.56 +/- 2.48     | +1.46e+00 +/- 4.72e-02 |  3.37e+00 +/- 4.2e-02  |  1.91e+00 +/- 2.2e-02  |
-test_perturb_1                          |     +9.63 +/- 2.33     | +1.32e+00 +/- 3.19e-01 |  1.50e+01 +/- 1.8e-01  |  1.37e+01 +/- 2.6e-01  |
-test_perturb_2                          |    +11.95 +/- 1.54     | +2.26e+00 +/- 2.90e-01 |  2.12e+01 +/- 1.7e-01  |  1.89e+01 +/- 2.4e-01  |
-test_proximal_jac_atf                   |    +123.23 +/- 2.37    | +9.97e+00 +/- 1.92e-01 |  1.81e+01 +/- 1.8e-01  |  8.09e+00 +/- 5.8e-02  |
-test_proximal_freeb_compute             |     +9.17 +/- 0.91     | +1.64e-02 +/- 1.62e-03 |  1.95e-01 +/- 1.4e-03  |  1.79e-01 +/- 8.1e-04  |
-test_proximal_freeb_jac                 |    +313.17 +/- 5.85    | +2.31e+01 +/- 4.31e-01 |  3.05e+01 +/- 4.2e-01  |  7.37e+00 +/- 7.4e-02  |
-test_solve_fixed_iter                   |    +76.09 +/- 19.61    | +1.37e+01 +/- 3.54e+00 |  3.18e+01 +/- 3.1e+00  |  1.81e+01 +/- 1.7e+00  |

github-actions[bot] avatar Feb 23 '24 06:02 github-actions[bot]

test_compute_everything try also with omega nonzero or something

dpanici avatar Apr 10 '24 19:04 dpanici

just load and resave all the eqs after merge, dont resolve as there is not consistnecy to set omega to zero yet on this branch

dpanici avatar May 01 '24 18:05 dpanici

Note to self:

  • [x] in bounce integrals you used d zeta / B dot grad zeta for field line differential length where the zeta in dzeta denotes the field line zeta, and the zeta in B dot grad zeta denotes DESC's coordinate zeta. this is fine currently, but work through the math when desc zeta is generalized with stream function. nothing changes with bounce/field line stuff.
  • [x] and check for any 2d divergence theorems in zeta surface. Edit: The integration over boundaries we do (2d divergence theorems etc.) no longer work. I have done the math to fix them. Once this gets up to date with master, feel free to ping me and I'll push the update

unalmis avatar May 04 '24 17:05 unalmis

alpha_t should be corrected to data["alpha_t"] = data["theta_PEST_t"] - data["iota"] * data["phi_t"]

unalmis avatar Jun 15 '24 18:06 unalmis

Also the formula for alpha uses zeta while its derivatives use phi.

unalmis avatar Jun 19 '24 23:06 unalmis

@unalmis I merged master, gonna see which tests fail but I think there needs to be some extra logic added to "A" and "A(z)" to prevent ZernikeRZToroidalSection objects from getting an error when they try to compute "A", or at least there is a test failing due to that. They have no W_lmn attribute but somewhere we try to access it when computing with those objects

dpanici avatar Aug 20 '24 16:08 dpanici

@unalmis I merged master, gonna see which tests fail but I think there needs to be some extra logic added to "A" and "A(z)" to prevent ZernikeRZToroidalSection objects from getting an error when they try to compute "A", or at least there is a test failing due to that. They have no W_lmn attribute but somewhere we try to access it when computing with those objects

Note they aren't computed correctly here yet because you need to use source grids to do coordinate mapping. I think the error you see is due to #1127 . Also A(z) and A` compute functions will change in #1094 .

unalmis avatar Aug 20 '24 16:08 unalmis

couple omega to theta pest somehow?

dpanici avatar Aug 28 '24 20:08 dpanici

  • lower L of omega basis but keep M,N large enough to match boundary
  • penalty on omega amplitude potentially (but would rather not have it be an explicit penalty)

dpanici avatar Mar 26 '25 20:03 dpanici