Question

Use MATLAB to write a function that takes inputs R, L, C, TO, Tf, DeltaT and f and produces as output the charge on the capac

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB code is given below in bold letters.

clc;
close all;
clear all;

% prompt the user to enter the parameters
R = input('Enter R: ');
L = input('Enter L: ');
C = input('Enter C: ');
T0 = input('Enter T0: ');
Tf = input('Enter Tf: ');
DeltaT = input('Enter DeltaT: ');
f = input('Enter f: ');

% Compute alpha and beta,w
alpha = R/(2*L);
beta = 1/(L*C);
w = 2*pi*f;
% now define symbolic variable s
syms s;

% define Q(s), charge on the capacitor
Q = s/(L*(s^2+w^2)*(s^2+2*alpha*s+beta));

% obtain the inverse laplace transform of Q(s)
q = ilaplace(Q);

% define time vector
t = T0:DeltaT:Tf;

% substitute time in q(t)
q_t = subs(q);

% now plot the capacitor charge as a function of time
figure;
plot(t,q_t,'linewidth',2);title('charge on capacitor');
grid on;

RESULT:

Enter R: 20
Enter L: 80e-3
Enter C: 20e-6
Enter T0: 0
Enter Tf: 1
Enter DeltaT: 1e-3
Enter f: 20

01 0.2 0.3 04 0.5 06 0.7 08 0. 9 1

Add a comment
Know the answer?
Add Answer to:
Use MATLAB to write a function that takes inputs R, L, C, TO, Tf, DeltaT and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. A series RLC circuit has R = 1009, L = 15 mH and C =...

    1. A series RLC circuit has R = 1009, L = 15 mH and C = 10 uF. It is connected to an AC course with f= 60.0Hz and Vmax = 110 V. A. Calculate the phase angle between the current and the voltage. B. What is the maximum value of the current at this frequency? C. What source frequency in Hz) is needed for the series RLC circuit to be at resonance?

  • Assume we have a series RLC circuit. The model of the RLC circuit can be represented...

    Assume we have a series RLC circuit. The model of the RLC circuit can be represented by The circuit is driven by voltage source ean). And the crcuit elements are resistance R 0.4 capacitance C 0.04F, and inductance L 0.002H. At time t 0, the voltage source is stepped from zero to 2V (the circuit elements initially have zero charge and zero current). Determine the solution for charge q(t) stored in the capacitor using Laplace transform methods.

  • Consider a RLC circuit with R = 105 ohms, L = 518 mH, and C =...

    Consider a RLC circuit with R = 105 ohms, L = 518 mH, and C = 0.200 microF. This circuit is driven by an AC source with f = 120 Hz, and Vmax = 60.0 V. (a) What is Imax? (b) What is its average power? (c) At what frequency is this circuit in resonance? (d) Calculate (a) and (b) again if the circuit is driven with the resonant frequency and Vmax is unchanged.

  • The RLC circuit below is being driven by an AC source with a frequency of 47.77...

    The RLC circuit below is being driven by an AC source with a frequency of 47.77 Hz resulting in a maximum current Imax = 0.25 amps. 24)  In this circuit, the voltage across the capacitor __________ the current through the capacitor and the voltage across the resistor __________ the current through the resistor. leads, lags leads, leads lags, leads lags, lags lags, is in phase with is in phase with, leads Totally unrelated question.... 25)  A local radio station broadcasts at the...

  • For an RLC series circuit, R - 110 0, L 210 mH, and c- 0.29 uF....

    For an RLC series circuit, R - 110 0, L 210 mH, and c- 0.29 uF. = 0.29 (a) If an AC source of variable frequency is connected to the circuit, at what frequency (in Hz) is maximum power dissipated in the resistor? Hz (b) What is the quality factor of the circuit? Q=

  • R C L Doo HH HI Consider the RLC circuit shown. The power source provides a...

    R C L Doo HH HI Consider the RLC circuit shown. The power source provides a rms voltage of 210 V at a frequency of 75 Hz. The circuit values are as follows: R= 25 12, L = 30.0 mH, C1 = 95.0 uF, and C2 = 55.0 uF. a) (2 pts.) Determine the inductive reactance of this circuit. b) (2 pts.) Determine the capacitive reactance of this circuit. c) (2 pts.) Determine the total impedance of this circuit. d)...

  • 2. (14 marks total) This question deals with the series RLC circuit discussed in the classroom...

    2. (14 marks total) This question deals with the series RLC circuit discussed in the classroom and in the labs. Assume that the voltage source is arbitrary and there is a non-zero charge, g(0), on the capacitor at time t 0 when a switch is closed to start current flow. For this question assume variable R, L and C values. (a) Write down the differential equation that describes the charge on the capacitor as a function of time. (2 marks)...

  • Use MATLAB simulink 6.8 An RLC circuit with a parallel bypass resistor (Problems 3.10 and 5.11)...

    Use MATLAB simulink 6.8 An RLC circuit with a parallel bypass resistor (Problems 3.10 and 5.11) is shown in Fig. P6.8. At time t-0 the circuit has zero current in both loops and the capacitor C has a stored charge of 0.01 C. The system parameters are R1 = 0.4 Ω, R2-0.2 Ω, C = 0.04 F, and L = 0.01 H. Use Simulink to obtain the system response where the source voltage is a sinusoidal function, en()0.5 sin 10t...

  • 1. Use Laplace Transforms to determine the function modeling the current in an RLC circuit with L 10 Henries, R 20 ohms...

    1. Use Laplace Transforms to determine the function modeling the current in an RLC circuit with L 10 Henries, R 20 ohms, C = 0.02 Farads, the initial charge is Q(0) = 0, the initial current is I(0) = 0, there is an electromotive force forcing the RLC circuit via the voltage function E(t) letting the current alternate naturally through the circuit. Use the fact the differential 10 sin (t), nd then, at t = 2T seconds, the battery is...

  • USE MATLAB PLEASE Q4) (15 pts) An RLC circuit with an alternating voltage source is shown....

    USE MATLAB PLEASE Q4) (15 pts) An RLC circuit with an alternating voltage source is shown. The source voltage v, is given by vs = Vm sin(@dt), where on = 21fd, in which fo is the driving frequency. The ampli- tude of the current, 1, in this circuit is given by: Vm I = = R-+[waL-1/(waC)]* where R and C are the resistance of the resistor and capacitance of the capacitor, respectively. For the circuit in the figure C =...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT