You are on page 1of 25

EXPERIMENT NO.

1
AIM: To Study the time and frequency response of
a first order system (RC Circuit)
MODELLING:

For First Loop:

vin(t)=R i(t) + 1/C i(t)dt


Applying Laplace transformation
Vin(s)=R I(s) + I(s)/C
Second Loop equation

vout(t)= 1/C i(t)dt


Applying Laplace transformation
Vout(s)= I(s)/C

Therefore Transfer function is


Transfer function (TF)= Vout(s)/ Vin(s)=1/(1+RC)
PROGRAMMING:- for step or time response
C=0.0043, R=43
N=1
D= [R*C 1]
TF= tf(N,D)
step(TF)
hold on
grid on
C=0.0044, R=43
N=1
D= [R*C 1]
TF= tf(N,D)
step(TF)
hold on
C=0.0045, R=43
N=1
D= [R*C 1]
TF= tf(N,D)
step(TF)
hold on
C=0.0046,R=43
N=1
D= [R*C 1]
TF= tf(N,D)
step(TF)
hold on
C=0.0047, R=43
N=1
D= [R*C 1]
TF= tf(N,D)
step(TF)
hold on

Results:

Step Response

1
0.9
0.8
0.7

Amplitude

0.6
0.5
0.4
0.3
0.2
0.1
0

0.2

0.4

0.6

0.8

1.2

Time (sec)

PROGRAMMING:-for bode or frequency response


C=0.0043, R=43
N=1
D= [R*C 1]
TF= tf(N,D)
bode(TF)
hold on
grid on
C=0.0044, R=43
N=1
D= [R*C 1]
TF= tf(N,D)
bode(TF)
hold on
C=0.0045, R=43
N=1
D= [R*C 1]
TF= tf(N,D)

1.4

bode(TF)
hold on
C=0.0046,R=43
N=1
D= [R*C 1]
TF= tf(N,D)
step (TF)
hold on
C=0.0047, R=43
N=1
D= [R*C 1]
TF= tf(N,D)
bode(TF)
hold on

Results:

Bode Diagram

Magnitude (dB)

-5
-10
-15
-20
-25

Phase (deg)

-30
0

-45

-90

-1

10

10

10
Frequency (rad/sec)

10

EXPERIMENT NO. 2
AIM: Graphical representation of step function of
an RLC circuit using MATLAB.
MODELLING:

For First Loop:


vin(t)=R i(t)+L

+1/C i(t)dt

Applying Laplace transformation


Vin(s)=R I(s) + I(s)/C+L(s)I(s)
Second Loop equation

vout(t)= 1/C i(t)dt


Applying Laplace transformation
Vout(s)= I(s)/C

Therefore Transfer function is


Transfer function (TF) =

PROGRAMMING:- for step or time response


C=0.0043
L=0.01
R=43
while R<48
R=R+1
N=1
D=[L*C R*C 1]
TF=tf(N,D)
step(TF)
hold on
grid on
end

Results:
Step Response

1
0.9
0.8
0.7

Amplitude

0.6
0.5
0.4
0.3
0.2
0.1
0

0.2

0.4

0.6

0.8

Time (sec)

1.2

1.4

PROGRAMMING:-for bode or frequency response


C=0.0043
L=0.01
R=43
while R<48
R=R+1
N=1
D=[L*C R*C 1]
TF=tf(N,D)
bode(TF)
hold on
grid on
end

Results:
Bode Diagram

Magnitude (dB)

-20
-40
-60
-80
-100

Phase (deg)

-120
0
-45
-90
-135
-180

-1

10

10

10

10

Frequency (rad/sec)

10

10

10

EXPERIMENT NO. 3
AIM: Analyze first order transfer function using MATLAB.
MODELING: Governing equation of a first order system ia as
follow

or
Taking Laplace transform, we get,
(s+1)y(s) = K x(s)
Gain,
for simplicity we take k=1; =5;
we get

G(s)

PROGRAMING:-for step response


K=43, J=43
N=K
D=[J 1]
TF= tf(N,D)
step(TF)
hold on
grid on

K=44, J=43
N=K
D=[J 1]
TF= tf(N,D)
step(TF)
hold on
grid on
K=45, J=43
N=K
D=[J 1]
TF= tf(N,D)
step(TF)
hold on
grid on
K=46, J=43
N=K
D=[J 1]
TF= tf(N,D)
step(TF)
hold on
grid on
K=47, J=43
N=K
D=[J 1]
TF= tf(N,D)
step(TF)
hold on
grid on

Result:Step Response

50
45
40
35

Amplitude

30
25
20
15
10
5
0

50

100

150

200

250

Time (sec)

PROGRAMING:-for impulse response


K=43, J=43
N=K
D=[J 1]
TF= tf(N,D)
impulse(TF)
hold on
grid on
K=44, J=43
N=K
D=[J 1]
TF= tf(N,D)
impulse(TF)
hold on
grid on
K=45, J=43

300

N=K
D=[J 1]
TF= tf(N,D)
impulse(TF)
hold on
grid on
K=46, J=43
N=K
D=[J 1]
TF= tf(N,D)
impulse(TF)
hold on
grid on
K=47, J=43
N=K
D=[J 1]
TF= tf(N,D)
impulse(TF)
hold on
grid on

Result:-

Impulse Response

1.4

1.2

Amplitude

0.8

0.6

0.4

0.2

50

100

150
Time (sec)

COMMENT:-

200

250

300

EXPERIMENT NO. 4
AIM: To analyze second order transfer function using
MATLAB.

MODELLING: Governing equation of a second order system


ia as follow,

or,
In more generalized form

Taking Laplace transform we get,

so transfer function or gain,

PROGRAMING:-for step response


W=43
Z=43
K=43
while W<48
W=W+1
A=1/W^2
B=2*Z/W
N=K
D=[A B 1]
TF=tf(N,D)
step(TF)
grid on
hold on
end

Result:-

Step Response

45
40
35

Amplitude

30
25
20
15
10
5
0

10

Time (sec)

PROGRAMING:-for impulse response


W=43
Z=43
K=43
while W<48
W=W+1
A=1/W^2
B=2*Z/W
N=K
D=[A B 1]
TF=tf(N,D)
impulse(TF)
grid on
hold on
end

12

Result:Impulse Response

25

20

Amplitude

15

10

10

12

Time (sec)

COMMENT:-

EXPERIMENT NO. 5
AIM:

To print the given transfer function and convert time


domain into space domain.

MODELLING:

Given transfer function to be print:

tf2ss convert converts the parameters of a transfer function


representation of a given system to those of an equivalent
state-space representation.

in controller canonical form


x= A x +B u
y= C x + D u
[A,B,C,D] = tf2ss(b,a) returns the A, B, C, and D matrices of a
state space representation for the single-input transfer
function

ROGRAMING:-for step response


Clear all
Clc
N=[25 5];
D=[1 5 25 5];
TF=tf(N,D)
Step(TF),grid
[A,B,C,D]=tf2ss(N,D)

Step Response

1.4

1.2

Amplitude

0.8

0.6

0.4

0.2

Result:-

COMMENT:-

5
Time (sec)

10

EXPERIMENT NO. 6
AIM:

To model an analyze a first order system using


SIMULINK.

MODELLING :
system i a as

Governing equation of a first order


follow:

0r

This equation is modelled on SIMULINK as shown.

BLOCK DIAGRAM:

Following fig shows the block


diagram represented of the first order governing equation
stated above. We can see how the equation is modelled in
block diagram from the figure.

That is st first a we are using adding block for the


subtraction of term i.e. (x-cy) then we used gain block for
multiplying coefficient (1/) then we get the term dy/dt
(dot_y),for y we used a integrater or block that transform

dy/dt (dot_y) into y . then this output y is analysis and send


also as feedback.
for analysis we have selected random values of coefficient
,i.e. for above diagram

Applied input:

Output Response:

COMMENT:-

EXPERIMENT NO. 7
AIM:

To model and analyze a second order system using


SIMULINK.

MODELLING:

Governing equation of a first order

system ia as follow:

or

so using above equation we made block diagram of second


order system as shown below

BLOCK DIAGRAM:
As in previous Experiment here to we made block diagram
for second order system.

here we have taken two feedback i.e. dy/dt (dot_y) and y and
after gain coefficient get multiplied to them , then they are
added with the input and again multiplied with coefficient 1/a
using gain block.this gives d2y/dx2 (ddot_y) and to get
dy/dt(dot_y) and y from d2y/dx2 (ddot_y) we used integrator
block

Applied input:

Output Response:

COMMENT:-

EXPERIMENT NO. 8
AIM:

To make a cars FBD and find the speed of a car


against time using SIMULINK.

PROBLEM STATEMENT:

In this diagram:
V is the horizontal velocity of the car ( unit of m/s).
F is the force created by the car engine to propel it
forward (unit of N)
b is the damping coefficient for the car, which is
dependent on wind resistance wheel friction ,etc.
(unit of Ns/m) and is proportional to speed.

Take
M = 1000 kg
b = 40 Ns/m
and assume the car initially at rest, and that the engine
applies a step input of F
F = 400 N at t=0

MODELLING:

Applying Newton third law of motion we

get

Ma=F-bv

we get,

This is the governing equation of the problem .now using


SIMULINK block diagram is made as show.

BLOCK DIAGRAM:

Below figure show the block


diagram of cars FBD satisfying the condition given in
problem statement.

Step input RESPONSE:

OUTPUT RESPONSE:

COMMENT:

You might also like