val nu thetare, dd, qq
number ang
number xp,p2
number remains # check for an even pole number input
standard..sp sp_thar[*],ns_thar[*]
parameters {
xp = argbp("gte_w","undef_w","inf_w",p,"p",2,2)
# check for an even pole number input
remains= xp-2*int(xp/2)
if (remains == 1) {
saber_message("TMPL_W_NPOLES_EQ_ODD",instance())
}
p2 = xp/2
ang = 2*math_pi/3
sp_thar = [(-500meg,10),(-1meg,1),(-10k,100u*math_pi/xp),\
(-1k,10u*math_pi/xp),(0,1u*math_pi/xp),\
(1k,10u*math_pi/xp),(10k,100u),(1meg,1),(500meg,0)]
ns_thar = [(-1meg,math_pi/xp),(1meg,0)]
}
values {
if (p == 1) {
thetare = thetarm
}
else {
thetare = thetarm*p/2
}
dd = (a*sin(thetare) + b*sin(thetare -ang) + c*sin(thetare +ang))*2/3.0
qq = (a*cos(thetare) + b*cos(thetare -ang) + c*cos(thetare +ang))*2/3.0
}
control_section {
pl_set( (dd,qq) , (a,b,c,thetarm) )
sample_points(thetarm,sp_thar)
}
equations {
d: d = dd
q: q = qq
}
}