Closed logan-nc closed 5 years ago
I have a case in which the initial coils is close enough. Coil current scaling factor seems normal. Here is the output.
: Overlap of the realized Bn harmonics is: 99.998 %
: Average relative absolute Bn error is : 5.707379279974547E+00
: The most and least important coils are : 30.134% at coil 1 ; 9.933% at coil 3
: rescale coil currents with a factor of 3.99971E+00
: weight_bharm is normalized to 3.55731E+11
What's the order of magnitude for your target harmonics and input coil currents?
I am using __d3d_rmp__ in the "examples" directory. The coil currents are optimized, but shape are fixed. The currents are something like 4kA, 2kA.
Let me phrase this a different way: My realized b_n and realized harmonics do not match:
(note the difference better shows the size of the realized b_n since its color limits are not constrained to the initial b_n clims)
@logan-nc Do you have the input files that can be used to reproduce the problem? I checked with the d3d_RMP
example, and it looks normal. I will try to solve this.
This is caused by bad initial coils, leading to unrealistic auto-normalization in coil currents. The auto-normalization is now turned off and will be printing out as a suggestion.
I will close this issue @logan-nc .
When running FOCUS to optimize RMP coil currents, it is normalizing my input currents by hug numbers ~1e9.
The huge normalizer comes from the
solvers.h
lines that read,However, I think the problem is with the Bmn terms being fed into this (i.e. the logic in these lines is sound). I suspect that the either a) Bmnc and Bmns values have not been properly set prior to this line or b) the tBmnc and tBmns are already normalized to a unity modtBn. I kind of suspect some funny harmonic normalization elsewhere, since the Bn field outputs are correctly huge but the final Bmnc/Bmns are small (order 1e-4, similar to the target harmonics).
Note, if I print
sqrt(sum( bnc**2 + bns**2))
from my target.harmonics file it is 0.001 and matches thesqrt(sum( initial_Bmns**2 + intial_Bmnc**2))
from the h5 output.