Sei sulla pagina 1di 13

Group No: 11

Student No: 0906055



Experiment No: 09

Name of the Experiment:
Solutions to Linear Differential Equation


Name: Shahnewaz Karim Sakib
Date of performance: 15.09.2012 Section:A
2

Date of submission: 22.09.2012 Level/Term: 2/2
Department: EEE
Partners Roll No: 0906056

The circuit can be drawn as below:

Applying Kirchoffs voltage rule we get,
V1=IR+L(dI/dt)+(1/C)Idt
Differentiating both side we get,
(dV1/dt)=R(dI/dt)+L(d
2
I/dt
2
)+(I/C)
Now, let (dI/dt)=z..(i)
So, the previous equation becomes
(dV1/dt)=Rz+L(dz/dt)+(I/C);
(dz/dt) =(1/L)((dV1/dt)-Rz-(I/C))..(ii)
Thus we got two differential equations. Solving these two equations
simultaneously will result in the solution.

The values of circuit parameters of the RLC series circuit are:
R =10
L =10mH
C =1F
The main code is given below:
For frequency=10KHz
close all;
clear all;
clc;

f=10*1000;
t=1/ f;
time=0:(t/ 20):(20*t);
h=t/ 20;
i(1)=0;
z(1)=0;

for j=1:length(time)-1
inew(j)=i(j)+(h*ypredic(time(j),i(j),z(j)));
znew(j)=z(j)+(h*xpredic(time(j),i(j),z(j)));
i(j+1)=i(j)+((h/ 2)*(ypredic(time(j),i(j),z(j))+ypredic(time(j+1),inew(j),znew(j))));
z(j+1)=z(j)+((h/ 2)*(xpredic(time(j),i(j),z(j))+xpredic(time(j+1),inew(j),znew(j))));
end

Two user defined function was used to generate znew and inew.

User defined function to generate znew:

(Assuming sinusoidal source with frequency of 10KHz)

function xnew_09=xpredic(time,i,z)
f=10*1000;
l=(10/ 1000);
r=10;
cap=(10/ 1000);
Vmax=1;
h=0.0001;
period=1/ f;
k=floor(time/ period);
c=Vmax*(sin(2*pi*f*(time+h)));
d=Vmax*(sin(2*pi*f*(time-h)));
p=(c-d)/ (2*h);
xnew_09=(1/ l)*(p-(r*z)-(i/ cap));
end

Using this value of znew we have found the values of (dz/ dt) after each
iteration.
User defined function to generate xnew:

function ynew_09=ypredic(time,i,z)
ynew_09=z;
end

Using this value of xnew we have generated the value of z after each iteration.




Here,

VR=voltage across resistance
VL=voltage across inductor
VC=voltage across capacitor.














1. The source is DC:

Output curve:
Output curve of I:
Output curve of VR:

Output curve of VL:


Output curve of VC:

2. The source is sine wave (f=10KHz, Vpeak=1)
Output curve of I:

Output curve of VR:







Output curve of VL:

Output curve of VC:

3. The source is sine wave (f=5KHz, Vpeak=1)
Output curve for I:


Output curve for VR:

Output curve for VL:

Output curve for VC:






4. The source is sine wave (f=20KHz, vpeak=1)
Output curve of I:

Output of VR:

Output curve of VL:



Output curve of VC:

5. The source is a 10 kHz square wave (peak value = 1 V, bipolar)
Output Curve of I:

Output Curve of VR:


Output Curve of VL:

Output curve of VC:

6. The source is a 20 kHz triangular wave (peak value = 1 V, bipolar)
Output curve of I:




Output curve of VR:

Output curve of VL:

Output curve of VC:



Limitation:
The shape of some of the curves is distorted. There may be slight
mistake in generating the source or getting the values of z or (di/ dz).
This has caused this distortion.

Potrebbero piacerti anche