Skip to content

Conversation

@rogeriojorge
Copy link
Collaborator

This optimization with least-squares appears to be able to optimize particles from a cold start, starting from a tokamak to a stellarator.
The loss function includes a current penalty so that now that currents are optimized, they do not become too big.

@rogeriojorge
Copy link
Collaborator Author

The following changes were made:

  • There is an overall factor of 7e6 in the magnetic field. This allows us to change the current dofs using order 1 numbers instead of order 7e6
  • Currents are now being optimized. However, not the first coil current as these can increase together, leading to a larger magnetic field overall and better confinement that way
  • The tracing is done mainly on trapped particles, as the range of v_parallel was restricted only between -0.2 and 0.2 times v_thermal.
  • Least squares optimization appears to be stable, yielding better results than Adam. However, for now, both are being used in each optimization
  • Coils start to get increasingly bigger with optimization, regularization penalties may be needed.

Screenshot 2024-11-14 at 11 28 55 PM

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are the comments in functions "BdotGradTheta", "BdotGradPhi" and "BcrossGradBdotGradTheta" for?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does not seem to improve the efficiency.
Tested for an averaging of 10000 particles with the "compare_simsopt" file.

@rogeriojorge rogeriojorge force-pushed the rj/current_leastsquares_diffrax branch 3 times, most recently from cca3d15 to 0dd9264 Compare February 16, 2025 19:02
@rogeriojorge rogeriojorge force-pushed the rj/current_leastsquares_diffrax branch from 0dd9264 to affbcad Compare February 16, 2025 19:04
@rogeriojorge rogeriojorge deleted the rj/current_leastsquares_diffrax branch March 11, 2025 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants