Question

In: Electrical Engineering

Consider an RC circuit with resistance R and capacitance C. The circuit is stimulated with a...

Consider an RC circuit with resistance R and capacitance C. The circuit is stimulated with a pulse of amplitude A and width T.

The purpose of this study is to understand what happens to the impulse response, capacitor voltage, and resistor voltage for various resistor values: 600 ?, 1000 ?, and 1200 ?. The name of the MATLAB script will be called project2a. Excite the circuit with a rectangular pulse voltage of amplitude=5 V and pulse width of 10 ms. Plot the results of each resistor value from t=0 to t=20 ms on the same graph (3 graphs-impulse response, capacitor voltage, and resistor voltage). Label all axes, put a grid on the graph, and apply the proper legend. Comment on and explain the results.

For all cases of the study, the capacitor will have a value of 1 µF. Use the function below to make graphs.

function [ Vc Vr t ] = rc_voltages( A,R,C,T,Tend )

t=0:0.0001:Tend;

for i=1:length(t)

if t(i)

Vc(i)=A*(1-exp(-t(i)/(R*C)));

Vr(i)=A*exp(-t(i)/(R*C));

else

Vc(i)=A*(exp(T/(R*C))-1)*exp(-t(i)/(R*C));

Vr(i)=A*(1-exp(T/(R*C)))*exp(-t(i)/(R*C));

end

end

end

Solutions

Expert Solution

Hello,
       Please find the answer attached below. If the answer has helped you please give a thumbs up rating. Thank you and have a nice day!

NOTE: The given function requires a minor tweak to give you the correct answer. The statement "if t(i)" is replaced by "if t(i)>T", because this part represents the decaying part of the reponse, which happens after the pulse input dies down.

******* Matlab Code *******

Function definition:

function [ Vc, Vr, t ] = rc_voltages( A,R,C,T,Tend )

    t=0:0.0001:Tend;

    for i=1:length(t)

        if t(i)>T

            Vc(i)=A*(1-exp(-t(i)/(R*C)));

            Vr(i)=A*exp(-t(i)/(R*C));

        else

            Vc(i)=A*(exp(T/(R*C))-1)*exp(-t(i)/(R*C));

            Vr(i)=A*(1-exp(T/(R*C)))*exp(-t(i)/(R*C));

        end

    end

end

Main file:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% pulse response of rc circuit

A = 5;              % amplitude
T = 10e-3;          % pulse width

R1 = 600;           % resistor values
R2 = 1000;
R3 = 1200;

C = 1e-6;           % capacitor value
Tend = 20e-3;

%%%%%%%% calling the function to calculate the responses
[ Vc1, Vr1, t ] = rc_voltages( A,R1,C,T,Tend );
[ Vc2, Vr2, t ] = rc_voltages( A,R2,C,T,Tend );
[ Vc3, Vr3, t ] = rc_voltages( A,R3,C,T,Tend );

sys1 = tf(1,[R1*C 1]);              % system description for RC circuit
sys2 = tf(1,[R2*C 1]);
sys3 = tf(1,[R3*C 1]);

imp1 = impulse(sys1,t);             % impulse response from system description
imp2 = impulse(sys2,t);
imp3 = impulse(sys3,t);

%%%%%%%%%%%% plots for R1-C %%%%%%%%%%%%%%
figure;
subplot(3,1,1);
plot(t,imp1);
grid;
xlabel('Time (s)');
ylabel('Amplitude');
title('Impulse plot for R1-C circuit')
subplot(3,1,2);
plot(t,Vc1);
grid;
xlabel('Time (s)');
ylabel('Amplitude');
title('Capacitor plot for R1-C circuit')
subplot(3,1,3);
plot(t,Vr1);
grid;
xlabel('Time (s)');
ylabel('Amplitude');
title('Resistor plot for R1-C circuit')

%%%%%%%%%%%% plots for R2-C %%%%%%%%%%%%%%
figure;
subplot(3,1,1);
plot(t,imp2);
grid;
xlabel('Time (s)');
ylabel('Amplitude');
title('Impulse plot for R2-C circuit')
subplot(3,1,2);
plot(t,Vc2);
grid;
xlabel('Time (s)');
ylabel('Amplitude');
title('Capacitor plot for R2-C circuit')
subplot(3,1,3);
plot(t,Vr2);
grid;
xlabel('Time (s)');
ylabel('Amplitude');
title('Resistor plot for R2-C circuit')

%%%%%%%%%%%% plots for R3-C %%%%%%%%%%%%%%
figure;
subplot(3,1,1);
plot(t,imp3);
grid;
xlabel('Time (s)');
ylabel('Amplitude');
title('Impulse plot for R3-C circuit')
subplot(3,1,2);
plot(t,Vc3);
grid;
xlabel('Time (s)');
ylabel('Amplitude');
title('Capacitor plot for R3-C circuit')
subplot(3,1,3);
plot(t,Vr3);
grid;
xlabel('Time (s)');
ylabel('Amplitude');
title('Resistor plot for R3-C circuit')

********** End of code*********

First, copy and paste both the above files to your working directory. Remember to save the first file as a function file, otherwise Matlab will throw an error. Now execute the main file. You will get the following output:

Explanation:

Since the given circuit is an RC circuit, The voltage across the resistor will rise exponentially as long as the pulse input is given. Once the pulse input is removed, the voltage drops to zero. The voltage across the capacitor can be found out by applying the Kirchoff's voltage law across the loop, which will be decaying as the voltage across the resistor rises. Since R1<R2<R3, the time constants of the circuits (R*C) will be the highest for circuit 3. This can be seen by a corresponding increase in the time it takes for the impulse response to decay, compared to the first circuit.


Related Solutions

A coil (resistance Rc), conductor (capacitance C) and a resistor (resistance Rr) are connected in a...
A coil (resistance Rc), conductor (capacitance C) and a resistor (resistance Rr) are connected in a series a circuit with sinusoidal alternating current (amplitude A) power supply. Calculate the theoretical current in the circuit by using Kirchhoff's 2nd law. Use a sinusoidal trial function for the current to solve the differential equation. Prove, that the sinusoidal current's amplitude depends heavily on the frequency.
Consider an RC circuit with E = 12.0 V ,R = 165 Ω , and C...
Consider an RC circuit with E = 12.0 V ,R = 165 Ω , and C = 55.6 μF . A) Find the time constant for the circuit. B) Find the maximum charge on the capacitor. C) Find the initial current in the circuit.
A resistor of resistance R and a capacitor of capacitance C are connected in series to...
A resistor of resistance R and a capacitor of capacitance C are connected in series to an EMF of voltage E. A switch is set to the open position and the capacitor is initially uncharged. The switch is then closed. Show that when the capacitor charges that half of the energy drawn from the EMF is dissipated in the resistor and that half of the energy is stored in the capacitor.
Consider an RLC circuit with resistance 20Ω20Ω  , inductance 0.05H0.05H , capacitance 2500μF2500μF , and an impressed...
Consider an RLC circuit with resistance 20Ω20Ω  , inductance 0.05H0.05H , capacitance 2500μF2500μF , and an impressed voltage, provided by an alternating current generator, with V=50V,120HzV=50V,120Hz. At t=0t=0 V=0V,Q=2C,I=1AV=0V,Q=2C,I=1A. a. Complete the ODE below in terms of the charge in the circuit Q(t)Q(t)    _____Q''+ _____Q' + _____Q = ______ b. Solve the ODE and complete the equation for the charge Q(t)=Q(t)=    c. Upload a file with your work for part b and a graph of the current I(t) d. Write...
An L-R-C circuit has an inductance of 0.430H , a capacitance of 3.00
An L-R-C circuit has an inductance of 0.430H , a capacitance of 3.00
4.2.2 What is an RC Circuit? Recall that the capacitance is defined as the proportionality constant...
4.2.2 What is an RC Circuit? Recall that the capacitance is defined as the proportionality constant between the total charge accumulated by a capacitor and the voltage difference across the circuit Q = C△V (4.2) In this equation, the charge Q is expressed in Coulomb (C), the voltage △V, in volts (V) and the capacitance C in farads (F). In this lab you will study both the charging and discharging process of an RC circuit. During the charging process, an...
A series RC circuit with R = 5 W and C = 0.02 F is connected...
A series RC circuit with R = 5 W and C = 0.02 F is connected with a battery of E = 100 V. At t = 0, the voltage across the capacitor is zero. (a) Obtain the subsequent voltage across the capacitor. (b) As t → ∞, find the charge in the capacitor. (DIFFERENTIAL EQUATIONS) SOLVE THIS USING MATLAB SOLVE THIS USING MATLAB SOLVE THIS USING MATLAB SOLVE THIS USING MATLAB SOLVE THIS USING MATLAB SOLVE THIS USING MATLAB...
Driven RC circuit in parallel. A capacitor C is connected in parallel to a resistor R...
Driven RC circuit in parallel. A capacitor C is connected in parallel to a resistor R and an AC source providing a voltage v(t) = V sin(ωt). (a) Make a phasor diagram at time t showing all relevant based on Kirchhoff’s rules. (b) Find the impedance of this circuit and make a plot of Z vs. ω. (c) What are the small and large frequency behaviors of the peak capacitor and resistor currents? (d) What is the phase difference between...
1. In an RC circuit, the battery has a voltage of 12.0V and the R =...
1. In an RC circuit, the battery has a voltage of 12.0V and the R = 5 MΩ and C= 2.5μF. How long will it take in seconds for the charge to build up to 22.3 microcoulombs? (Show work please) 2. Richard has a 200 V battery and two metal disks, both with an area of 0.86 m^2 each and a distance of 0.240 mm. How much charge in microCoulomb can his capacitor store? (please show work)
Consider a RC circuit. At time t=0, the circuit is closed. ( a) Draw how the...
Consider a RC circuit. At time t=0, the circuit is closed. ( a) Draw how the current behaves with time. (b) What about the power dissipated by the resistor ? (also draw it as a function of t)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT