Advertisement
hiddenGem

Function: Pendulum in Electric Field

May 28th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.54 KB | None | 0 0
  1. %% Function: Pendulum in Electric Field
  2. % Can calculate the angle of deflection in degrees and radians of a
  3. % pendulum in an electric field. If there is not a relative
  4. % permittivity, Er should be 1. It should be noted that this is
  5. % different than my paste " Pendulum in an Electric Field" which
  6. % asks users for multiple inputs and will print outputs.
  7.  
  8.  
  9. function [radians, degrees] = AnglePen(q,E,m,Er)
  10. g = 9.81;            %[m/s^2] Acceleration due to gravity on earth
  11. radians = atan((q*E/Er)/(m*g));
  12. degrees = atand((q*E/Er)/(m*g))
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement