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

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 = [2.2e7 0 0]; 0 %% Time parameters start_time = 0; dt = 1e-11; end_time = 8e-9; time(1) = start_time; % let us keep a list of time values w=2e9; %the omega that appears in parts d and e of Pset1/3 P %% integrate for motion % for t = start_time:dt:end_time f %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Describe the EM-field

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.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern