Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Resistance and Reactance in an RLC Circuit
- % Determines the total resistance, total reactance, and average power in a
- % circuit
- % Inputs and Variables
- Irms = input('What is the RMS current?\n');
- Vrms = input('What is the RMS voltage?\n');
- phi = input('How much does the voltage lead the current in degrees?\n')*pi/180;
- % Outputs and Equations
- Z = Vrms/Irms;
- R = Z*cos(phi);
- X = Z*sin(phi);
- P = Vrms*Irms*cos(phi);
- fprintf('The resistance, reactance, and average power are:\n %.3e Ohm, %.3e Ohm, and %.3e W \n', R, X, P)
- %{
- For the variable 'phi' if the current leads the voltage enter value as a
- negative number. The variable is also entered in degrees but it saved in
- radians. To change this feature remove the *pi/180 after the input.
- %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement