Example #1
0
pl.figure()
pl.axis('equal')
pl.axis('off')


conf = Config('SN')
sf = SF(conf)

conf = Config('X')
sf.conf = conf
conf.TF(sf)
#rb = RB(conf,sf,Np=200)
#rb.divertor_outline(False,plot=False,debug=False)
eq = EQ(sf,dCoil=0.5,limit=[5,12,-8,5.5],n=1e4)
eq.set_sf_psi()  # set psi
eq.gen()

inv = INV(sf,eq,configTF='X',config='X')
Lpf = inv.grid_PF(nPF=5)
Lcs = inv.grid_CS(nCS=5)
Lo = np.append(Lpf,Lcs)
inv.eq.coils()  # re-grid
inv.update_coils()

inv.fix_boundary_psi(N=31,alpha=1-1e-4,factor=1)  # add boundary points
#inv.fix_boundary_feild(N=31,alpha=1-1e-4,factor=1)  # add boundary points
inv.add_null(factor=1,point=sf.Xpoint)

R,arg = 1.5,20
target = (R,arg)
pl.plot(sf.Xpoint[0]+R*np.sin(arg*np.pi/180),
Example #2
0
pl.figure()
pl.axis('equal')
pl.axis('off')

conf = Config('SFm')
sf = SF(conf)
sf.contour(Nstd=1.5, color=next(Color))

eq = EQ([4, 13], [-6, 6], 1e4, sf)
eq.Vtarget = sf.Mpoint[1]

rbdry, zbdry = sf.get_boundary()  # update boundary
pl.plot(rbdry, zbdry)
pl.plot(sf.Mpoint[0], sf.Mpoint[1], 'o', markersize=1)

eq.gen(Verr=1e-4)

sf.contour(levels=sf.cs.levels, color=next(Color))
rbdry, zbdry = sf.get_boundary()  # update boundary
pl.plot(rbdry, zbdry)
pl.plot(sf.Mpoint[0], sf.Mpoint[1], 'ko', markersize=1)

pl.imshow(eq.b.reshape((eq.nr, eq.nz)).T,
          cmap='RdBu',
          vmin=eq.b.min(),
          vmax=eq.b.max(),
          extent=[eq.r[0], eq.r[-1], eq.z[0], eq.z[-1]],
          interpolation='nearest',
          origin='lower')