poskusil skalirat problem na nerelativisticen
parent
f94f50b282
commit
b4d231021a
Binary file not shown.
2
boris.py
2
boris.py
|
@ -63,7 +63,7 @@ def B_loop(p, a):
|
||||||
if r < 1e-15:
|
if r < 1e-15:
|
||||||
Bz = 2*np.pi*1e-7*a**2/(a**2+z**2)**1.5
|
Bz = 2*np.pi*1e-7*a**2/(a**2+z**2)**1.5
|
||||||
return np.array([0.,0.,Bz])
|
return np.array([0.,0.,Bz])
|
||||||
m = 4*a*r/( (r+a)**2+z**2)
|
m = np.sqrt(4*a*r/( (r+a)**2+z**2))
|
||||||
K = ellipk(m)
|
K = ellipk(m)
|
||||||
E = ellipe(m)
|
E = ellipe(m)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
from matplotlib import rc
|
||||||
|
#rc('font',**{'family':'serif','serif':['Computer Modern']})
|
||||||
|
#rc('text', usetex=True)
|
||||||
|
from scipy.special import ellipe,ellipk
|
||||||
|
from boris import *
|
||||||
|
|
||||||
|
m = m_el
|
||||||
|
q = e
|
||||||
|
i = 5 # tok v ovoju
|
||||||
|
|
||||||
|
a = 0.5 # ovoj
|
||||||
|
|
||||||
|
v0 = np.array([0.0,-0.2,0.1])
|
||||||
|
x0 = np.array([.1, 0.,0.])
|
||||||
|
E = lambda x: np.array([0.,0.,0.])
|
||||||
|
B = lambda x: B_bottle(x, a, a/2, i)
|
||||||
|
dt = 1e-2
|
||||||
|
tdur = 10
|
||||||
|
#print(tdur/dt)
|
||||||
|
|
||||||
|
X,V = boris(x0, v0, E, B, dt, tdur, q, m)
|
||||||
|
plot3(X)
|
14
tokamak.py
14
tokamak.py
|
@ -10,21 +10,21 @@ from boris import *
|
||||||
m = m_pr
|
m = m_pr
|
||||||
q = e
|
q = e
|
||||||
i = 80 # tok v ovoju
|
i = 80 # tok v ovoju
|
||||||
N = 15000 # stevilo ovojev
|
N = 150000 # stevilo ovojev
|
||||||
I = i*N
|
I = i*N
|
||||||
|
|
||||||
a = 1.5 # ovoj
|
a = 1.5 # ovoj
|
||||||
b = 0.8 + 0.5*a
|
b = 0.8 + 0.5*a
|
||||||
|
|
||||||
v0 = np.array([-0.1,-0.15,0.])*c
|
v0 = np.array([-0.1,-0.15,0.])*c
|
||||||
v0 = np.array([0.8, -0.48, 0.3595])*c
|
#v0 = np.array([0.8, -0.48, 0.3595])*c*0.2
|
||||||
x0 = np.array([2.3, 0.,0.])
|
x0 = np.array([2., 0.,0.])
|
||||||
x0 = np.array([0.,0.,0.8])
|
#x0 = np.array([0.,0.5,-0.8])
|
||||||
E = lambda x: np.array([0.,0.,0.])
|
E = lambda x: np.array([0.,0.,0.])
|
||||||
B = lambda x: tokamak(x, a, b, I, 16)
|
B = lambda x: tokamak(x, a, b, I, 16)
|
||||||
B = lambda x: B_bottle(x, 1., 5., I)
|
#B = lambda x: B_bottle(x, 1., 5., I) + B_loop(x,4.)*100*8000
|
||||||
dt = 2e-11
|
dt = 2e-12
|
||||||
tdur = 1e-6
|
tdur = 3e-7
|
||||||
#print(tdur/dt)
|
#print(tdur/dt)
|
||||||
|
|
||||||
X,V = boris(x0, v0, E, B, dt, tdur, q, m)
|
X,V = boris(x0, v0, E, B, dt, tdur, q, m)
|
||||||
|
|
Loading…
Reference in New Issue