Professional Documents
Culture Documents
Particle In Electric
And Magnetic Field
Submitted By:
Harjot Kaur
Sukhwinder
Singh
DIFFERENCE BETWEEN
ELECTRIC AND MAGNETIC
FORCES
ELECTRIC FORCES
MAGNETIC FORCES
charge particle is
orthogonal to the
magnetic field vector.
of the particle.
x = (Vx)t
tan = Vyf / Vx
F=0
Circular Motion
The magnetic force, acting perpendicular to the velocity
of the particle, will cause circular motion.
F = qvB = qvB sin
= 900
F = qvB = mv/r
Helical Motion
If the velocity is not perpendicular to the magnetic field,
Component of vel. perpendicular to field produces circular motion
Component of velocity parallel to field remains unaffected
And thus resultant produces helical motion
Example -: Cyclotron
A cyclotron is a type of particle accelerator in
which charged particles accelerate outwards
from the center along a spiral path. The particles
are held to a spiral trajectory by a static
magnetic field and accelerated by a rapidly
varying electric field
Euler method
A numericalprocedure for
solvingordinary differential
equations(ODEs) with a giveninitial value.
For the initial value problem we begin by
approximating solution y = (t) at initial point t0
y y0 f t0 , y0 t t0
y f (t , y ), y (t0 ) y0 ,
(t1) by y1 y0 f t0 , y0 t1 t 0
method.
EULER FORMULA
For a point t2 close to t1, we approximate (t2) using the line passing
y2 y1 f t1 , y1 t 2 t1
y n 1 y n f n t n 1 t n
yn 1 yn f n h, n 0,1, 2,
yn 1 yn
yn '
, h t n 1 t n
h
yn yn 1
yn '
, h t n t n 1
h
yn 1 yn f n h 21! y '' h 2
yn f n h O(h 2 )
Eulers approx.
LIMITATIONS OF EULER
METHOD
Truncation errors It is approximately
proportional to h^2. This makes the Euler method
less accurate than other higher-order techniques
such asRunge-Kutta methods for which the local
truncation error is proportional to a higher power
of the step size.
Numericallyunstable - The numerical solution
grows very large for equations where the exact
solution does not. This can be illustrated using
the linear equation
The exact solution is
which decays
to zero as
.However if euler method is
applied with h=1 then numerical solution is
oscillates and grows.
ALGORITHM
include the header files.
Define class.
Declare q,m,E,ti,tf as an integer and x , y ,h ,vx ,vy
PROGRAM
#include<iostream>
#include<cmath>
#include<fstream>
ofstream output(o.txt);
using namespace::std;
using std::fstream;
class charge
{
int q,m,E,B,ti,tf;
float x,y,h,vx,vy,ax,ay,n,vy,t;
public:
void getdata();
void calculate();
};
void charge::getdata()
{
x=0;
y=0;
vx=5;
vy=0;
q=-1;
m=1;
E=0;
B=1;
ti=0;
tf=100;
h=0.001;
}
Void particle::calculate()
{
n=(tf-ti)/h;
for ( t=0;t<=n;t++)
{
ax=(q*vy*B)/m;
ay=((q*E)/m)-((q*vx*B)/m);
vx=vx+(ax*h);
vy=vy+(ay*h);
x=x+(h*vx);
y=y+(h*vy)
output<<x<< <<y<<endl;
}
}
int main()
{
charge p;
p.getdata();
p.calculate();
return 0;