Advertisement
hiddenGem

Charge of a Point Charge in an Magnetic Field

Jun 24th, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.61 KB | None | 0 0
  1. %% Point Charge Moving in a Uniform Magnetic Field
  2. % Determines magnitude of the charge
  3.  
  4. % Inputs and Variables
  5. B = input('What is the magnetic field in Teslas?\n');
  6. F = input('What is the force on the charge in Newtons?\n ');
  7. v = input('What is the speed of the point charge in meters per second?\n');
  8.  
  9. % Outputs and Equations
  10. q = F/(v*B);
  11. fprintf('The charge of the point charge is %.4e C \n', q)
  12.  
  13. %{
  14. Under the assumption that the speed of the point charge is perpendicular to the magnetic field
  15. The output is rounded to after the 4 decimal point to change this edit or remove
  16.     the .# in the fprintf line.
  17. %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement