Professional Documents
Culture Documents
Simultion Lab Ioe
Simultion Lab Ioe
Source code:
s1=[];
s2=[]
a11= -50.0;
a21 = -19000.00;
a22 = -21.5;
ein = 1.5;
v10 = 0.0;
v20 = 0.0;
h=0.0002;
t = [];
t=[t 0];
s1 = [s1 v10]
s2 = [s2 v20]
for i=[1:800]
m11 = a11*v10-a11*ein;
m12 = a11*(v10+m11*h/2)-a11*ein;
m13 = a11*(v10+m12*h/2)-a11*ein;
m14 = a11*(v10+m13*h)-a11*ein;
v11 = v10+((m11+2*m12+2*m13+m14)/6)*h;
v10=v11;
s1 = [s1 v10]
m21 = a21*v10+a22*v20-a21*ein;
m22 = a21*(v10+h/2)+a22*(v20+m21*h/2)-a21*ein;
m23 = a21*(v10+h/2)+a22*(v20+m22*h/2)-a21*ein;
m24 = a21*(v10+h)+a22*(v20+m23*h)-a21*ein;
v21 = v20+((m21+2*m22+2*m23+m24)/6)*h;
v20=v21;
s2 = [s2 v20];
t=[t h*i];
end
plot(t,s1);
figure(2)
plot(t,s2);
bekrumed1@gmail.com(071/BCT/505) Page 1 | 3
Simulation and Modeling Lab-II
Output:
bekrumed1@gmail.com(071/BCT/505) Page 2 | 3
Simulation and Modeling Lab-II
Discussion:
In this lab we conducted simulation of RC amplifier circuit for the continuous system where at
first a mathematical model for the representation of the RC amplifier was developed. Which was
then implemented for the simulation of the amplifier. As seen in the above figure, RC amplifier
characteristics was obtained in the output graph from the simulation. Using this model, we can
check how an RC amplifier will behave beforehand in a system to get the desired effect in a system.
`Conclusion:
Hence, from this lab, we conducted a simulation of RC amplifier and by first creating a
mathematical model and then implementing the simulation.
bekrumed1@gmail.com(071/BCT/505) Page 3 | 3