PlasmaControl / DESC

Stellarator Equilibrium and Optimization Suite
MIT License
86 stars 22 forks source link

`Coilset` when a coil is given on the `phi=0` plane #1103

Closed dpanici closed 1 month ago

dpanici commented 1 month ago

Our CoilSet class, when a coil is given at phi=0, does not seem to give the correct result.

from desc.coils import CoilSet, FourierPlanarCoil
import numpy as np
tf_coil = FourierPlanarCoil(current=3, center=[2, 0, 0], normal=[0, 1, 0], r_n=[1])
tf_coilset = CoilSet(tf_coil, NFP=2, sym=True)

I would expect this to yield, when plotted, 4 coils that are spaced np.pi/2 apart. However, plot_coils fails when called on this coilset, and the CoilsetMinDistance objective calculates that every coil overlaps eachother.

rotating the first coil by pi/4 makes everything work as expected, so something weird is happening when the coil is at phi=0

from desc.coils import CoilSet, FourierPlanarCoil
import numpy as np
tf_coil = FourierPlanarCoil(current=3, center=[2, 0, 0], normal=[0, 1, 0], r_n=[1])
tf_coil.rotate(angle=np.pi/4)
tf_coilset = CoilSet(tf_coil, NFP=2, sym=True)
f0uriest commented 1 month ago

I thought if sym=True then there can't be a coil on the symmetry planes? Since it would get reflected into itself?

dpanici commented 1 month ago

Yes that is correct and is why this fails, I will close as resolved