Advertisement
hiddenGem

Circular Wire Loop

Jun 25th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.74 KB | None | 0 0
  1. %% Circular Wire Loop
  2. % Determines the magnitude Of the magnetic field at the center of the
  3. %    circular loop and the maximum value of the torque the loop might experience
  4.  
  5. % Constants
  6. muNaught = (4*pi)*10^-7 ;                %[T*m/A] Vacuum Permeability
  7.  
  8. % Inputs and Variables
  9. r = input('What is the radius of the circle?\n');
  10. I = input('What is the current of the loop?\n');
  11. Bext = input('What is the magnitude of the external magnetic field?\n');
  12.  
  13. % Outputs and Equations
  14. B = muNaught*I/(2*r);
  15. A = pi*r^2;
  16. T = Bext*I*A;
  17. fprintf('The magnitude is %.3e T and the max torque is %.3e N*m\n', B, T)
  18.  
  19. %{
  20. Under the assumption that the external magnetic field is perpendicular to
  21.     the magnetic moment of the loop where sin(90) = 1
  22. %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement