hiddenGem

Resonance Curve

Jul 16th, 2020
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.85 KB | None | 0 0
  1. %% Resonance Curve
  2. % Determines the resitance of an RLC circuit, the inductance when given
  3. % capacitance, and the power of the circuit at its resonance
  4.  
  5. % Inputs and Variables
  6. Vrms = input('What is the voltage of the generator?\n');
  7.     % These next two values should be given from a curve
  8. Irms = input('What is the value of I_RMS? \n');
  9. f = input('What is the frequency?\n');
  10. C = input('What is the capacitance?\n');
  11.  
  12. % Outputs and Equations
  13. R = Vrms/Irms;
  14. L = 1/(4*pi^2*f^2*C);
  15. power = Vrms*Irms;
  16. fprintf(['The resistance, inductance, and power of the circuit are:\n',...
  17.          '%.3e Ohm, %.4e H, and %.3f W\n '], R, L, power)
  18.  
  19. %{
  20. This should go without saying but the values at which the curve intersects
  21. the graph should be at the point(frequency, I_RMS). This script works when
  22. the user gives the cooridnate points at the peak of the graph
  23.  
  24. %}
Add Comment
Please, Sign In to add comment