electron1 - % %-%This M-file,calculates the motion of an...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
% %--------------------------------------------------------------------------- %This M-file,calculates the motion of an electron in an EM-field % Force vector F=q{E+vXB} % q...charge of particle % E...electric field vector % B...magnetic field vector % v...velocity of particle % X...vector cross-product %--------------------------------------------------------------------------- % clear all; close all; %% forget previous MATLAB runs % disp('Motion of a charged particle in an EM-field'); d %%Parameters m = 9.11*10^(-31); %mass of electron q = -1.6*10^(-19); %charge of electron % %%Initial conditions: k = 1; % time index %% initial position; %% since we want to plot the paths of the particles we will %% store the x, y and z positions in vectors rx, ry and rz respectively. rx(k) = 0; ry(k) = 0; rz(k) = 0; %% Input initial velocity; we are not going to keep track of velocity for %% all times, so we will use only one vector v to store vx, vy and vz %% at current time. v
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

electron1 - % %-%This M-file,calculates the motion of an...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online