Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the circuit of Figure 1. Determine the frequency response function H(jo

ID: 1716924 • Letter: C

Question

Consider the circuit of Figure 1. Determine the frequency response function H(jomega) = V_o(jomega)/V_i(jomega). Sketch the magnitude and phase characteristics (ie. | H(jomega) | and arg(H(jomega)) vs omega) using PSpice. Indicate the half-power frequency omega_t, where |H(jomega_c)| =1/Squareroot 2 | H(jomega) |_max. To plot magnitude and phase response in PSpice, run a logarithmic AC sweep simulation of your circuit. Go to Trace menu, delete all traces, and then add a new trace. Use the db() function to plot the gain of your system in dB's. Your function should be in DB(Vout/Vin) form. For example, DB(V(C1:2)/V(V1:+)) Go to Trace menu, delete all traces, and then add a new trace. Use the p() function to plot the gain of your system in degrees. Your function should be in P(Vout/Vin) form. For example, P(V(C1:2)/V(Vl:+))

Explanation / Answer

Now, to obtain the voltage across a charging capacitor, let us consider this figure that includes a voltage source

Again, using KCL, the equation describing the charging RC circuit is

If the capacitor is not charged initially, that is v0(t) = 0 when t = 0, then the solution to the equation above is given by

The following examples illustrate the use of Matlab for solving problems
related to RC circuits.

Example 1 – Charging circuit

Assume that for the charging RC circuit above Vs = 10 volts and C = 10 microfarads. Plot the voltage across the capacitor if R equals 5k ohm, 10k ohms and 20k ohms. This just means that we are going to explore three time constants.

This code is one simple solution to the problem  

% Define the voltage source
Vs = 10;
% Define the capacitor in the circuit
C = 10e-6;
% Define the time lapse that we're going to explore
t = 0 : 0.005 : 0.35;

% Define the resistors in each time constant and
% calculate the voltage across the capacitor
R1 = 5e3;
tau1 = R1*C;
V1 = Vs * ( 1 - exp(-t/tau1) );

R2 = 10e3;
tau2 = R2*C;
V2 = Vs * ( 1 - exp(-t/tau2) );

R3 = 20e3;
tau3 = R3*C;
V3 = Vs * ( 1 - exp(-t/tau3) );

% Plot the responses, all at once
plot(t, V1, 'b-', t, V2, 'ro', t, V3, 'k*')
grid on
title('Transient Analysis - RC circuit')
xlabel('Time (s)')
ylabel('Voltage across capacitor (V)')
legend(['RC_1 = ' num2str(tau1)],...
       ['RC_2 = ' num2str(tau2)],...
       ['RC_3 = ' num2str(tau3)], 'location', 'best')