Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Energy in a Solenoid
- % Determines the energy stored in a solenoid
- % Constants
- muNaught = (4*pi)*10^-7; %[T*m/A] Vacuum Permeability
- % Inputs and Variables
- N = input('How many turns\n');
- r = input('The radius\n');
- l = input('The length\n');
- I = input('The current of the system\n');
- % Outputs and Equations
- A = pi*r*r;
- L = muNaught*A*N*N/l;
- Energy = 0.5*L*I^2;
- fprintf('The energy stored is %e J', Energy)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement