Advertisement
hiddenGem

Triangle Loop

Jun 25th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.75 KB | None | 0 0
  1. %% Triangle Loop
  2. % Determines the size of the magnetic field at the center and at one of the
  3. %    corners of the triangle
  4.  
  5. % Constants
  6. muNaught = (4*pi)*10^-7 ;                %[T*m/A] Vacuum Permeability
  7. arb = muNaught/(2*pi*sqrt(3));
  8.  
  9. % Inputs and Variables
  10. a = input('What is the length of the side?\n');
  11. I = input('What is the current of the loop\n');
  12.  
  13. % Outputs and Equations
  14. Bcorn = arb*I/a;
  15. Bcent = Bcorn*9*sqrt(3);
  16. fprintf(['The magnitude at the center of the triangle and at one of the corners are:\n'...
  17.         '%4e T and %.4e T\n'], Bcent, Bcorn)
  18.  
  19. %{
  20. The variable 'arb' in the constants section is just a placeholder. It is
  21.     not an actual constant. It just makes the line in the outputs and equations
  22.     section less crowded
  23. %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement