Skip to content
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

Make Linear Objective to Constrain Sum of Coil Currents #1111

Closed
Tracked by #496
dpanici opened this issue Jul 8, 2024 · 2 comments · Fixed by #1130
Closed
Tracked by #496

Make Linear Objective to Constrain Sum of Coil Currents #1111

dpanici opened this issue Jul 8, 2024 · 2 comments · Fixed by #1130
Assignees
Labels
coil stuff relating to coils and coil optimization low priority Nice to have, but not needed right away objectives Adding or improving objective functions

Comments

@dpanici
Copy link
Collaborator

dpanici commented Jul 8, 2024

Instead of using ToroidalFlux or fixing a single coil current to avoid the trivial solution of zero current in a stage two vacuum coil optimization, you can also calculate the line integral of the covariant zeta component of the field, which is related to the sum of coil currents through an amperean loop as

$$ \begin{align} \oint_{\partial A} \mathbf{B} \cdot d\mathbf{l}&= I_{pol}= \mu_0 \sum_{i=1}^{N_{coils}} I_{i}^{coil} N_i^{poloidal~ transits}\\ &\text{$\mathbf{B} \cdot d\mathbf{l} = \mathbf{B}\cdot \frac{\partial \mathbf{r}}{\partial \zeta} d\zeta = B_{\zeta} d\zeta$, LHS becomes}\\ \Aboxed{N_{FP}\int_{0}^{2\pi/N_{FP}} B_{\zeta}d\zeta &= \mu_0 \sum_{i=1}^{N_{coils}} I_{i}^{coil} N_i^{poloidal~transits}} \end{align} $$

Where $N_i^{poloidal~transits}$ is the number of poloidal transits a coil makes (this is one for modular coils and equal to the winding number for helical coils). This constraint and a good quadratic flux optimization ensures the coils exactly create the correct magnetic field magnitude. Of course this is not strictly needed for vacuum optimization but is a 3rd way of avoiding the trivial solution

@dpanici dpanici self-assigned this Jul 8, 2024
@dpanici dpanici mentioned this issue Jul 8, 2024
9 tasks
@dpanici dpanici changed the title Make Linear Objective to Constraint Sum of Coil Currents Make Linear Objective to Constrain Sum of Coil Currents Jul 8, 2024
@dpanici dpanici added objectives Adding or improving objective functions coil stuff relating to coils and coil optimization labels Jul 8, 2024
@ddudt
Copy link
Collaborator

ddudt commented Jul 8, 2024

This functionality is already trivial to implement with LinearObjectiveFromUser, but we can still make a standalone objective for it since this is a common use case.

@dpanici dpanici added the low priority Nice to have, but not needed right away label Jul 8, 2024
@dpanici dpanici assigned ddudt and unassigned dpanici Jul 10, 2024
@dpanici
Copy link
Collaborator Author

dpanici commented Jul 16, 2024

Possibly subclass FixParameters and override compute method to be sum over the x[indices] = target instead of x[indices] = target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
coil stuff relating to coils and coil optimization low priority Nice to have, but not needed right away objectives Adding or improving objective functions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants