Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Square Loop
- % Determines the size of the magnetic field at the center and at one of the
- % corners of the square
- % Constants
- muNaught = (4*pi)*10^-7 ; %[T*m/A] Vacuum Permeability
- arb = sqrt(2)*muNaught/pi
- % Inputs and Variables
- a = input('What is the length of the side?\n');
- I = input('What is the current of the loop\n');
- % Outputs and Equations
- Bcorn = arb*I/(4*a);
- Bcent = Bcorn*8;
- fprintf(['The magnitude at the center of the square and at one of the corners are:\n'...
- '%4e T and %.4e T\n'], Bcent, Bcorn)
- %{
- The variable 'arb' in the constants section is just a placeholder. It is
- not an actual constant. It just makes the line in the outputs and equations
- section less crowded
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement