Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% The Power and Power Factor of an AC Circuit
- % Determines the power factor and average power with a capacitor and then
- % an inductor
- % Inputs and Variables
- R = input('What is the resistance?\n');
- C = input('What is the capacitance?\n');
- V = input('What is the RMS voltage?\n');
- f = input('What is the frequency?\n');
- L = input('What is the inductance replacing the capacitor?\n');
- % Outputs and Equations
- w = f*2*pi;
- Xc = 1/(w*C);
- Zc = sqrt(R^2+Xc^2);
- PFc = R/Zc;
- Irms = V/Zc;
- Pc = V*Irms*PFc;
- Xl = (w*L);
- Zl = sqrt(R^2+Xl^2);
- PFl = R/Zl;
- Irms = V/Zl;
- Pl = V*Irms*PFl;
- fprintf(['The power factor and average power with a capacitor and inductor are:\n',...
- '%.3e, %.3e W, %.3e, %.3e W\n'],PFc, Pc, PFl, Pl )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement