#!/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_pr
q = e
i = 800 # tok v ovoju
N = 1000 # stevilo ovojev
I = i*N

a = .8 # ovoj
b = 0.5 + 0.5*a 

v0 = np.array([-0.1,0.15,+0.])*c/2/2
x0 = np.array([1., 0.,0.4])
E = lambda x: np.array([0.,0.,0.])
B = lambda x: tokamak(x, a, b, I, 16)
dt = 1.5e-8
dt = 1.5e-4
tdur = 3e0
dt = 2e-11
tdur = 1e-6

X,V = boris(x0, v0, E, B, dt, tdur, q, m)
plot3(X,lim=[-b-a,b+a],tokamak=[a,b,16])
