Particle-in-cell simulacija trajektorije nabitega delca.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
593 B

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 boris import *
B = lambda x: np.array([0.,0.,x[0]**2+x[1]**2])
E = lambda x: np.array([0.,0.,0.])
x0 = np.array([0.,-1.,0.])
v0 = np.array([-0.2,2.5,0.])
X,V = boris(x0,v0,E,B,1e-2, 100)
B = lambda x: np.array([0.,0.,1.])
E = lambda x: np.array([-0.,0.8,0.])
x0 = np.array([0.,0.,0.])
v0 = np.array([0.,2.5,0.])
X,V = boris(x0,v0,E,B,1e-2, 20)