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

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

% %--------------------------------------------------------------------------- %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

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 10/03/2011 for the course ENGINEERIN 101 taught by Professor Piamonte during the Spring '11 term at Alabama.

### Page1 / 3

eahw1e - % %-%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
Ask a homework question - tutors are online