Consider an RC circuit with resistance R and capacitance C. Thecircuit is stimulated with a pulse of amplitude A and width T.
The purpose of this study is to understand what happens to theimpulse response, capacitor voltage, and resistor voltage forvarious resistor values: 600 ?, 1000 ?, and 1200 ?. The name of theMATLAB script will be called project2a. Excite the circuit with arectangular pulse voltage of amplitude=5 V and pulse width of 10ms. Plot the results of each resistor value from t=0 to t=20 ms onthe same graph (3 graphs-impulse response, capacitor voltage, andresistor voltage). Label all axes, put a grid on the graph, andapply 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