You are on page 1of 10

1.

PARTIAL FRACTIONS USING MATLAB:


(i) B(s)/A(s)=(2*s^3+5*s^2+3*s+6)/(s^3+6*s^2+11*s+6)
>> b=[2 5 3 6];
>> a=[1 6 11 6];
>> [r,p,k]=residue(b,a)
RESULT:
r=
-6.0000
-4.0000
3.0000
p=
-3.0000
-2.0000
-1.0000
k=
2
Complete partial form: -6/(s+3) 4/(s+2) + 3/(s+1) + 2
Inverse laplace transform: - 6*exp(-3*t) 4*exp(-2*t) + 3*exp(-t)
(ii)B(s)/A(s)=(s^2+2*s+3)/(s+1)^3
>> b=[1 2 3];
>> a=[1 3 3 1];
>> [r,p,k]=residue(b,a)
RESULT:
r=
1.0000
0.0000
2.0000
p=
-1.0000
-1.0000
-1.0000

k=
[]
Complete partial form: 1/(s+1) + 2/(s+1)^3
Inverse laplace transform: exp(-t) + t^2*exp(-2*t)

2(i) GENERATION OF TRIANGULAR WAVE:


x=0:0.005:2;
y=x;
plot(x,y)
hold on
x=2:.005:6;
y=-x+4;
plot(x,y);
x=6:0.005:8;
y =x-8;
plot(x,y);
RESULT:
TRIANGULAR WAVEFORM

2
1.5
1
0.5
0
-0.5
y

-1
-1.5
-2

2(ii) GENERATION OF SQUARE WAVE:


t = 0:.0001:.0625;
y = SQUARE(2*pi*30*t);
plot(t,y)
SUARE WAVEFORM

2
1.5
1

0.5
0
-0.5
-1
-1.5
-2

0.01

0.02

0.03

0.04

0.05

3.TIME RESPONSE OF R-L SERIES CIRCUIT:


DERIVATION:

0.06

0.07

i=I + i(t) where I=V/R; steady state current & i(t)= transient current & i=resultant
i(t)R + Ldi(t)/dt=0
=> di(t)/i(t)= -(R/L)dt
=> di(t)/i(t)= -(R/L) dt
=> ln(i(t))= -(R/L)t + k
Now at t=0, i(t)=I; K=ln I
=> ln(i(t)/I)= -(R/L)t= -t/
=> i(t)=I*exp(-t/) where =L/R (time constant)
Also,

i=I*(1-exp(-t/))

M-FILE
V=input('Voltage=');
R=input('Resistance=');
L=input('Inductance=');
I=V/R;
lambda=L/R;
t=0:0.001:5;
plot(t,I)
hold on
i=-I*exp(-t/lambda);
plot(t,i)
p=i+I;
plot(t,p)

RESULT:
Voltage=3.35
Resistance=5
Inductance=11.5
>>

R-L SERIES CIRCUIT

0.8
0.6
I=V/R
0.4

i=I*(1-exp(-t/l)

0.2
0
i(amp) -0.2

i=-I*exp(-t/l)

-0.4
-0.6
-0.8

0.5

1.5

2
t(sec)

2.5

3.5

4. TIME RESPONSE OF SERIES R-C CIRCUIT:

i(t)R+q(t)/C=0
=> Rd(i(t))/dt+(1/C)dq(t)/dt=0
=>d(i(t))/dt= -(1/CR)dq(t)/dt= -(1/CR)i(t)
=> di(t)/i(t)= -dt/CR
=> i(t)=I*exp(-t/CR)=I*exp(-t/) => =CR=time constant

4.5

Charging circuit:
At t=0 , i(t)=I

I=V/R

i(t)=I*exp(-t/)

M-FILE:
V=input('Voltage=');
R=input('Resistance=');
C=input('Capacitance=');
I=V/R;
lambda=C*R;
t=0:0.001:5;
plot(t,I)
hold on
i=I*exp(-t/lambda);
plot(t,i)

RESULT:
Voltage=3
Resistance=5
Capacitance=.46

>>

WAVEFORM FOR RC SERIES CHARGING CIRCUIT

0.7
0.6

i(amp)

0.5

I=V/R

0.4
0.3
i=I*exp(-t/l)

0.2
0.1
0

0.5

Discharging circuit:
I= -V/R
i(t)= -(V/R)exp(-t/lambda)
M-FILE:
V=input('Voltage=');
R=input('Resistance=');
C=input('Capacitance=');
I=V/R;
lambda=C*R;
t=0:0.001:5;
i=-I*exp(-t/lambda);
plot(t,i)

RESULT:
Voltage=3
Resistance=5
Capacitance=.46
>>

1.5

2.5
t(sec)

3.5

4.5

WAVEFORM FOR RC DISCHARGING SERIES CIRCUIT

0
-0.1

i(amp)

-0.2

i=-I*exp(-t/l)

-0.3
-0.4
-0.5
I=-V/R

-0.6
-0.7

0.5

1.5

2.5
t(sec)

3.5

4.5

5. TIME RESPONSE OF R-L-C SERIES CIRCUIT (SECOND ORDER SYSTEM):


R=input('Resistance=');
L=.120;
C=0.000001;
wn=1/sqrt(L*C);
e=R/2*sqrt(C/L);
wd=wn*sqrt(1-e^2);
a=acos(e);
t=0:.00001:.02;
C=1-((exp(-e.*wn.*t)/sqrt(1-e^2)).*sin(wd*t+a));
plot(t,C)

RESULT:
Resistance=100

>>

RESPONSE FOR UNDERDAMPED RLC CIRCUIT

1.8
1.6
1.4

C(t)

1.2
1
0.8
0.6
0.4
0.2
0

0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009


t(sec)

0.01

Resistance=650
>>
RESPONSE FOR CRITICALLY DAMPED RLC SERIES CIRCUIT

1.4
1.2
1

C(t)

0.8
0.6
0.4
0.2
0

0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009


t(sec)

0.01

Resistance=1500
>>
OVERDAMPED RESPONSE OF RLC SERIES CIRCUIT
1

C(t)

0.8

0.6

0.4

0.2

0.002 0.004 0.006 0.008

0.01 0.012 0.014 0.016 0.018


t(sec)

0.02

You might also like