ExB Drifts

Initialization Cell (must be executed first)

Needs["Calculus`VectorAnalysis`"]
SetOptions[ParametricPlot,DefaultFont->{"Helvetica",14}];
SetOptions[ParametricPlot3D,DefaultFont->{"Helvetica",14}];
SetOptions[Plot,DefaultFont->{"Helvetica",14}];

Parameters

tmax=20 Pi;
x0=0;
y0=0;
z0=0;
vz0=.1;
vx0=1;
vy0=1;
nsteps=1000;
El[t_]:={.1,0,0}
B[t_]:= {0,0,1}
v[t_]:={vx[t],vy[t],vz[t]}
r[t_]:={x[t],y[t],z[t]}

rule=NDSolve[{x'[t]== vx [t],vx'[t]==CrossProduct[v[t],B[t]][[1]]+El[t][[1]],
y'[t]== vy [t],vy'[t]==CrossProduct[v[t],B[t]][[2]]+El[t][[2]],
z'[t]== vz [t],vz'[t]==CrossProduct[v[t],B[t]][[3]]+El[t][[3]]
,x[0]==x0,vx[0]==vx0,y[0]==y0,vy[0]==vy0,z[0]==z0,vz[0]==vz0}
,{x,y,z,vx,vy,vz},{t,0,tmax}]

Projection of Particle Orbit in X-Y Plane

ParametricPlot[Evaluate[{x[t],y[t]} /. rule],{t,0,tmax}
,AspectRatio->10/3,AxesLabel->{X,Y}]

Particle Trajectory in 3D

ParametricPlot3D[Evaluate[r[t] /. rule],{t,0,tmax},
PlotPoints->200,AxesLabel->{X,Y,Z}]

??ParametricPlot3D