Advertisement
hiddenGem

A Very Humble Bumble Bee

Jun 24th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.89 KB | None | 0 0
  1. %% A Very Humble Bumble Bee
  2. % Determines the size of the magnetic force acting on a flying projectile
  3.  
  4. % Inputs and Variables
  5. v = input('What is the speed in m/s?\n');
  6. B = input('What is the magnetic field in Teslas?\n');
  7. theta = input('What is the angle between the magnetic field and the horzion in degrees?\n ');
  8. q = input('What is the charge on the bumblebee in Coulombs?\n ');
  9.  
  10. % Ouputs and Equations
  11. Fnat = q*v*B*sind(theta);
  12. Fturn = q*v*B;
  13. fprintf(['If the bee stays on its course the force is %.3e N \n'...
  14.         'and if the bee makes a 90 degrees turn the force is %.3e N \n'], Fnat, Fturn);
  15. %{
  16. The angle theta must be entered in degrees. Multiply radians by 180/pi to
  17.     get degrees
  18. Under the assumption that the bumblebee is flying North and the magnetic
  19. field is at theta degrees below the horizon. Fturn is if the bee turns West
  20. while it maintains its original speed.
  21. %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement