nTF = 18 #,nPF,nCS = 18,6,5 config = {'TF': 'dtt', 'eq': 'SFp'} config, setup = select(config, nTF=nTF, update=False) # nPF=nPF,nCS=nCS sf = SF(setup.filename) rb = RB(setup, sf) pf = PF(sf.eqdsk) tf = TF( Profile(config['TF'], family='S', part='TF', nTF=nTF, obj='L', load=True)) rb.firstwall(symetric=True, DN=True, plot=True) #pf.plot(coils=pf.coil,label=False,plasma=False,current=True) tf.fill() #sf.cpasma *= 1.1 eq = EQ(sf, pf, dCoil=1.5, sigma=0, boundary=sf.get_sep(expand=1.1), n=3e3) eq.gen_bal() #eq.gen_opp() sf.contour() inv = INV(sf, eq, tf) L = inv.grid_coils(offset=0.3) #pf.plot(coils=pf.coil,label=False,plasma=False,current=True) inv.fix_boundary_psi(N=25, alpha=1 - 1e-4, factor=1) # add boundary points inv.fix_boundary_feild(N=25, alpha=1 - 1e-4, factor=1) # add boundary points #inv.add_null(factor=1,point=sf.Xpoint) inv.add_null(factor=1, point=sf.Xpoint_array[:, 0]) inv.add_null(factor=1, point=sf.Xpoint_array[:, 1])
part='TF', nTF=config['nTF'], obj='L', load=True)) #tf.fill() eq = EQ(sf, pf, dCoil=1.5, sigma=0, n=5e3, boundary=sf.get_sep(expand=1.1), zmin=-abs(sf.Xpoint[1]) - 2, zmax=abs(sf.Xpoint[1]) + 2) #eq.gen_opp(Zerr=5e-4) eq.gen_bal(Zerr=5e-4, tol=1e-4) ''' inv = INV(sf,eq,tf) Lpf = inv.grid_PF(nPF=config['nPF']) Lcs = inv.grid_CS(nCS=config['nCS'],Zbound=[-8,8],gap=0.1,fdr=1) L = np.append(Lpf,Lcs) inv.update_coils() inv.fit_PF(offset=0.3) inv.fix_boundary_psi(N=25,alpha=1-1e-2,factor=1) # add boundary points #inv.fix_boundary_feild(N=25,alpha=1-1e-2,factor=1) # add boundary points inv.add_null(factor=1,point=sf.Xpoint_array[:,0]) inv.add_null(factor=1,point=sf.Xpoint_array[:,1]) inv.set_swing() inv.update_limits(LCS=[-12,12])