Advertisement
hiddenGem

Current in RL Circuit

Jul 7th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.48 KB | None | 0 0
  1. %% Current in RL Circuit
  2. % Determines the maximum current in the circuit and the current at a
  3. % specific time
  4.  
  5. % Inputs and Variables
  6. R = input('What is the resistance in the circuit?\n');
  7. L = input('What is the value of inductance?\n ');
  8. V = input('What is the voltage?\n');
  9. t = input('What is the specific time?\n');
  10.  
  11. % Outputs and Equations
  12. Imax = V/R;
  13. Tau = L/R;
  14. I = V*(1-exp(-t/Tau))/R;
  15. fprintf('The maximum current is %.4e A and the specific current is %.4e A \n', Imax, I)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement