Advertisement
hiddenGem

Magnetic Field of a Toroid

Jun 25th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.53 KB | None | 0 0
  1. %% Magnetic Field of a Toroid
  2. % Determines the magnetic field halfway between the inner and outer eadii
  3. %    inside the toroid.
  4.  
  5. % Constants
  6. muNaught = (4*pi)*10^-7 ;                %[T*m/A] Vacuum Permeability
  7.  
  8. % Inputs and Variables
  9. N = input('Number of turns\n');
  10. I = input('Current inside the wire\n');
  11. rInner = input('Inner radius\n');
  12. rOuter = input('Outer radius\n');
  13.  
  14. % Outputs and Equations
  15. r = (rInner+rOuter)/2;
  16. B = muNaught*N*I/(2*pi*r);
  17. fprintf('The magnetic field halfway through the the toroid is %.4e T \n', B)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement