sf.plot_coils(Color, coils=eq.coil, label=False, plasma=False) eq.coil_currents(fix) #sf.coil['Coil11']['I']*=0.8 eq.update_psi() # levels=sf.cs.levels sf.contour(Nstd=1.5) sf.get_Xpsi() rx, zx = sf.Xpoint #rx+=3 pl.plot(rx, zx, 'o', markersize=1.5) Bp = sf.Bcoil([rx, zx]) Bx = np.sqrt(Bp[0]**2 + Bp[1]**2) print(Bp[0], Bp[1], sf.Xpsi) Br, Bz, PsiX = 0, 0, 0 mu_o = 4 * np.pi * 1e-7 # magnetic constant [Vs/Am] pl.plot(rx, zx, 'o', markersize=1.5) for sub_name in eq.coil.keys(): r, z = eq.coil[sub_name]['r'], eq.coil[sub_name]['z'] I = eq.coil[sub_name]['I'] Br += mu_o * I * eq.green_feild(rx, zx, r, z, 'Br') Bz += mu_o * I * eq.green_feild(rx, zx, r, z, 'Bz') PsiX += 2 * np.pi * mu_o * I * eq.greens(rx, zx, r, z) print(Br, Bz, PsiX)
pl.axis('off') eqdsk = 'vde' eqdsk = 'SN' sf = SF(Config(eqdsk)) sf.eq['ncoil'] = 0 if eqdsk == 'vde': eq = EQ(sf,dCoil=1,limit=[4.25,8,-4.5,2],n=1e3) #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=5e4) eq.set_eq_psi() levels = eq.sf.contour() I = 0 R,Z = sf.get_boundary(1-1e-4) tR,tZ,R,Z = cc.tangent(R,Z,norm=False) for r,z,tr,tz in zip(R,Z,tR,tZ): B = sf.Bcoil((r,z)) t = np.array([tr,tz]) I += np.dot(B,t) I /= cc.mu_o print(I*1e-6)