Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Flux of a Solenoid
- % Determines the total magnetic flux through the curved surface of the
- % cylinder
- % Constants
- muNaught = (4*pi)*10^-7 ; %[T*m/A] Vacuum Permeability
- % Inputs and Variables
- N = input('How many turns does the wire make?\n');
- d = input('What is the diameter of the solenoid?\n');
- l = input('What is the length of the solenoid?\n');
- i = input('What is the current the wire is carrying?\n');
- % Outputs and Equations
- n = N/l;
- r = d/2;
- Flux = muNaught*n*i*pi*r^2;
- fprintf('The magnetic flux is %.4e Wb', Flux);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement