# GVEC parameter file for W7x
# with current optimization

ProjectName = "W7X"
init_LA = true
PHIEDGE = 2.15
whichInitEquilibrium = 0
minimize_tol = 1.0e-06
which_hmap = 1

X1X2_deg = 5
LA_deg = 5
degGP = 8

nfp = 5
LA_mn_max = [9, 10]
LA_sin_cos = "_sin_"
X1_mn_max = [9, 10]
X1_sin_cos = "_cos_"
X2_mn_max = [9, 10]
X2_sin_cos = "_sin_"

MinimizerType = 10
PrecondType = 1
start_dt = 0.5
maxIter = 1000
totalIter = 5000

# Three stages with radial refinement and current optimization
stages = [
    {minimize_tol = 1e-3, sgrid.nElems = 3, picard_current={target="iota",iota_tol=1e-3}, maxIter = 10},
    {minimize_tol = 1e-5, sgrid.nElems = 10, picard_current={iota_tol=1e-6}},
    {minimize_tol = 1e-6, sgrid.nElems = 20},
]

# optimize for zero-current with picard iterations
[I_tor]
type = "polynomial"
scale = 1000
coefs = [0.0]

[picard_current]
target = "iota_and_force"
iota_tol = 1e-10
maxRestarts = 30

[sgrid]
grid_type = 4
nElems = 16

[pres]
type = "polynomial"
coefs = [283943.0429001297, -383068.22871426406, 51821.46263165031, 41925.29538667481, 11968.151280591173, -6589.858465976756]

[X1_a_cos]
"(0,  0)" = 5.59625
"(0,  1)" = 0.3586
"(0,  2)" = 0.02013

[X1_b_cos]
"(0,  0)" = 5.5
"(0,  1)" = 0.2354
"(0,  2)" = 0.01265
"(0,  3)" = 0.00198
"(1, -2)" = -0.03135
"(1, -1)" = -0.2233
"(1,  0)" = 0.47685
"(1,  1)" = -0.0121
"(1,  2)" = -0.001705
"(2, -4)" = -0.00176
"(2, -3)" = -0.00187
"(2, -2)" = 0.055
"(2, -1)" = 0.10065
"(2,  0)" = 0.0616
"(2,  1)" = 0.001375
"(3, -4)" = 0.001265
"(3, -3)" = -0.006765
"(3, -2)" = 0.006435
"(3, -1)" = 0.011165
"(3,  0)" = 0.0002035
"(4, -3)" = -0.002739
"(4, -2)" = -0.006875

[X2_a_sin]
"(0,  1)" = 0.28765
"(0,  2)" = 0.02035

[X2_b_sin]
"(0,  1)" = 0.1155
"(0,  2)" = 0.01265
"(0,  3)" = 0.00198
"(1, -2)" = 0.03135
"(1, -1)" = 0.2233
"(1,  0)" = 0.62315
"(1,  1)" = -0.0121
"(1,  2)" = -0.001705
"(2, -4)" = 0.00176
"(2, -3)" = 0.00176
"(2, -2)" = -0.055
"(2, -1)" = 0.132
"(2,  0)" = 0.06435
"(2,  1)" = 0.001375
"(3, -4)" = -0.001265
"(3, -3)" = 0.006765
"(3, -2)" = 0.006435
"(3, -1)" = -0.011165
"(3,  0)" = 0.0002035
"(4, -3)" = 0.002739
"(4, -2)" = -0.006875
