Advertisement
hiddenGem

Power Dissipated by an RLC Circuit

Jul 16th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.56 KB | None | 0 0
  1. %% Power Dissipated by an RLC Circuit
  2. % Determines the power dissipated and the power factor at a specific
  3. % frequency
  4.  
  5. % Inputs and Variables
  6. Vmax = input('What is the voltage?\n');
  7. C = input('What is the capacitance?\n');
  8. L = input('What is the inductance?\n');
  9. R = input('What is the resistance?\n');
  10. f = input('What is the frequency?\n');
  11.  
  12. % Outputs and Equations
  13. w = 2*pi*f;
  14. VRMS = Vmax*.707;
  15. Xc = 1/(w*C);
  16. Xl = w*L;
  17. Z = sqrt(R^2+(Xl-Xc)^2);
  18. PF = R/Z;
  19. P = VRMS^2*PF/Z;
  20. fprintf('The power dissipated and the power factor are:\n %.3e W and %.3e \n', P, PF)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement