Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Diameter of a Cyclotron
- % Determines the diameter of ions in a cyclotron and how many times the
- % ions complete their orbit in a given amount of time.
- % Constants
- elemCharge = 1.6*10^-19; %[C] Elementary Charge
- % Inputs and Variables
- q = input('Are the ions singly, doubly, or triply charged?\n')*elemCharge;
- B = input('What is the magnetic field?\n');
- mass = input('What is the mass of the ions in kg?\n');
- v = input('What is the speed\n');
- t = input('How many seconds?\n');
- % Ouputs and Equations
- r = mass*v/(q*B);
- d = 2*r;
- c = pi*d;
- orbits = v*t/c;
- fprintf('The diameter is %.3f m and the ions make %.4e revolutions', d, orbits);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement