10 const double BFit::Z_nom[4] = {-2.37615687260664e-2, -1.86400109250045e-2, -1.80502358070104e-2, -1.60470955291956e-2};
12 const double BFit::B_nom[4] = {2.02156567013928,
17 const double BFit::C_nom[4][16] = {{1.0,
30 -8.83065447433858e-11,
31 -2.41380148377896e-12,
45 -6.12986034064675e-11,
46 -7.59031334826116e-11,
61 -5.72514160410955e-11,
62 -7.41998111228714e-11,
77 -5.48168162195020e-11,
78 -7.00249566028285e-11,
82 const double BFit::dZ_0 = -2.62328760352034e-2;
83 const double BFit::dZ_2 = 5.94363870284212e-4;
85 const double BFit::C_0[16] = {1.0,
98 -9.30914368388717e-11,
99 -5.20466591966397e-12,
102 const double BFit::C_2[16] = {0.0,
103 -2.96314154618866e-4,
104 -6.04246295125223e-7,
105 -2.22393436573694e-6,
107 -2.07090716476209e-7,
109 -1.06689136150163e-8,
110 -5.48842256680751e-9,
112 5.57809366992069e-10,
113 -8.25055601520632e-11,
114 -3.18509299957904e-11,
115 1.11714602344300e-12,
116 7.90102331886296e-13,
119 const double BFit::C_4[16] = {0.0,
125 -1.57711106312732e-9,
126 1.02715424120585e-11,
127 2.57261485255293e-10,
128 -2.41682937761163e-11,
129 -2.27894837943020e-11,
130 7.98570801347331e-13,
131 1.17889573705870e-12,
132 1.64571374852252e-14,
133 -2.60212133934707e-14,
139 memset(
C, 0, 16 *
sizeof(
double));
152 void BFit::SetField(
double B) {
162 for (
jj = 0;
jj < 16; ++
jj) {
165 }
else if (
B >= B_nom[3]) {
167 for (
jj = 0;
jj < 16; ++
jj) {
171 while (B_nom[
kk] <
B)
173 w_1 = (
B - B_nom[
kk - 1]) / (B_nom[
kk] - B_nom[
kk - 1]);
175 dZ = Z_nom[
kk - 1] * w_0 + Z_nom[
kk] * w_1;
176 for (
jj = 0;
jj < 16; ++
jj) {
177 C[
jj] =
B * (C_nom[
kk - 1][
jj] * w_0 + C_nom[
kk][
jj] * w_1);
182 dZ = dZ_0 + dZ_2 * B2;
183 for (
jj = 0;
jj < 16; ++
jj) {
184 C[
jj] =
B * ((C_4[
jj] * B2 + C_2[
jj]) * B2 + C_0[
jj]);
190 void BFit::GetField(
double r,
double z,
double phi,
double &Br,
double &Bz,
double &Bphi)
const {
197 Bz = Bz_base->GetSVal(
r, zc,
C);
198 Br = Br_base->GetSVal(
r, zc,
C + 1);
rz_poly Diff(int nvar, bool keep_empty=false)