Beispiel #1
0
sf.eq['ncoil'] = 0

if eqdsk == 'vde':
    eq = EQ(sf, dCoil=1, limit=[4.25, 8, -4.5, 2], n=8e3)
    #eq = EQ(sf,dCoil=1,limit=[3,9,-6,6],n=5e3)
else:
    eq = EQ(sf, dCoil=1, limit=[5, 13, -5.5, 5], n=1e3)

eq.set_eq_psi()

levels = eq.sf.contour()

psi_o = eq.psi.copy()
psi_flux = np.linspace(0, 1, 500)
eq.edgeBC()


def flux_fit(b, *args):

    eq.fP = b[0] * 1e2
    eq.fF = b[1] * 1e2
    '''
    b *= b_norm
    sf.Pprime = bern.spline(b[:bern.n+1])
    sf.FFprime = bern.spline(b[bern.n+1:])
    
    #sf.FFprime = bern.spline(b[:bern.n+1])
    b /= b_norm
    '''
    eq.coreBC()
Beispiel #2
0
eq.psi = eq.solve()     
eq.set_eq_psi()
sf.contour(levels=levels,color=color[0],Xnorm=False,lw=0.5)
sf.cfeild = cref
sf.contour(levels=levels,lw=1.5,Xnorm=False)
eq.plotj()
pl.tight_layout()
pl.savefig('../Figs/vde_j_smooth_zoom')
'''

#pl.figure()
#pl.axis('equal')
#pl.axis('off')
eq.sparseBC(sigma=sigma)  # smooth far feild
eq.coreBC()  # insert flux function core
eq.edgeBC()  # re-set edge

eq.psi = eq.solve()
eq.set_eq_psi()
sf.contour(levels=levels, color=color[0], Xnorm=False, lw=0.5)
sf.cfeild = cref
sf.contour(levels=levels, lw=1.5, Xnorm=False)
eq.plotj()
pl.tight_layout()
pl.savefig('../Figs/vde_j_eq_fit_zoom')

sf.eqwrite(config='vde_highres')
'''
pl.figure()
pl.subplot(2,1,1)
pl.plot(eq.psi_norm,eq.FFp)