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

Consider the circuit shown with input v_i(t) and output v_o(t). There is no init

ID: 2080261 • Letter: C

Question

Consider the circuit shown with input v_i(t) and output v_o(t). There is no initial stored energy. Let R_1 = R_L = 50 Ohm, L_1 = 6 mH, L_2 = 10 mH, and C = (1 + X.YZ) mu F, where XYZ are the last three digits of your student ID number. For example, if the last three digits of your ID number are 123, then C = (1 + 1.23) = 2.23 mu F Determine the state-space model {A, B, C, D} of the circuit. Using this model and MATLAB, obtain graphs of the impulse response, step response and Bode plot. Also using MATLAB, obtain the transfer function corresponding to this state space model, and the location of its poles and zeros.

Explanation / Answer

unction dcrl = RL (t,i)
%function for RL circuit calculations
clear all;
Vs=50;
R=1;
L=9;
t=1:1:100;
i0=0;

for x=1:30,
    i(x)=(Vs/R)*(1-exp(-(R/L)*t(x)));
end
for x=31:100,
    i(x)=i(30)*exp(-(R/L)*t(x));
end
plot (t,i)

I am using those coding above and I cannot get the right answer.
There is a simple R (resistance), L (inductance) circuit with switch.
The real formula for this equation to solve is di/dt=Vs/R-R*i/L. When
we solve this equation it comes up i(t)=(Vs/R)*(1-exp(-(R/L)*t). Then
I use matlab to plot i(t) and calculate potential of L and R and
their current. On the other hand I use ode45 to solve it directly(you
can see below)

function dcrl = inductansoff(t,i)
% function for RL circuit calculations
Vs=50;
i0=0;
L=9;
R=1;
X = Vs/L;
Y = i*R/L;
if t<30
    dcrl = X - Y;
else
   dcrl = -Y; %switched 0ff Vs=0
   if t>50
       dcrl = X - Y;
   else
       dcrl = -Y; %switched 0ff Vs=0
   end
end