I have a code written but it isn\'t working correctly, so I will be able to tell
ID: 3565113 • Letter: I
Question
I have a code written but it isn't working correctly, so I will be able to tell if your code fake.
Function ODE45 is needed. If wanted, I can send my code and someone help debug for me.
We will learn to simulate time domain signals using stale variable analysts in this assignment. Because there are two storage elements in the circuit below, we could have a second order differential equation. We can always decompose a second order differential equation into a system of first order differential equations. This done in circuit analysis by assigning appropriate state variables to the circuit. State variables are always capacitor voltage and inductor current. Using a few rules of linear algebra we can convert the system into matrix form and solve using standard numerical technique. This assignment will require a lot of work as there are numerous obstacles that you will have to overcome because of unfamiliarity with the concepts. This can be analyzed by writing a KVL and a KCL. Doing state variable analysis means writing these equations in terms of the derivatives and the state variables v1(t) and v2(t). This results in matrix equations in the standard form of Use MATLAB to simulate this circuit by numerically solving the system of differential equations given above. You will drive them with the following parameters: Plot the result over a time period of interest. Verify your results obtained numerically with Multisim.Explanation / Answer
%Function file that defines equation 3
%and save as transient_analysis.m
%and represent the function as xdot=Ax+BU
function[xdot]= transient_analysis(t,x)
xdot=zeros(2,1);
x1=[x(1);x(2)];
R1=input('enter the value of R1 : ');
R2=input('enter the value of R2 : ');
C1=input('enter the value of C1 : ');
C2=input('enter the value of C2 : ');
v=t*exp(-t);
A=[-(1/R1+1/R2) -1/R2; -1/(R2*C2) 1/(R2*C2)];
B=[1/(R1*C1);0];
U=v;
xdot=A*x1+B*U;
%Calling program that evaluates equation12
%and save as transient_analysiscall
to=0;
tf=2;
tinterval=0.001;
x0=[0;0];
tspan=to:tinterval:tf;
[T,x]=ode23('transient_analysis',tspan,x0);
%Graph of loop currents against time
figure(1)
plot(T,x(:,1),'k')
grid on
title('Loop 1 Current Against Time')
xlabel('Time [sec.]')
ylabel('Current [A]')
figure(2)
plot(T,x(:,2),'k')
grid on ;
title(' Loop 2 Current Against Time')
xlabel('Time [sec.]')
ylabel('Current [A]')
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.