Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Objectives

1- Convert any system into partial fraction

2- Get the Laplace inverse for any system

3- Show the time response for the second order system at different input values and initial codition

4- Find the state space matrix for any system

5- Draw the bode diagram,root locus,nyquest for the system

6- Apply the PID controller on the system and show the response

7- Convert state space matrix into transfer function

Procedure
Part one: partial fraction
[r,p,g] = residue (num , den)

r : is vector for partial value

p : is vector for poles

g : is vector for polynomial coefficient

Example:
Write matlab programme on m-file

num = [ 1 2 1 0]

den = [1 3 2]

[r,p,g] = residue (num , den)

Result is

r = [ -2 2]

p = [-2 -1]

g = [1 -1]

rewrite the result as partial fraction

Part two: Laplace inverse


Example

Write matlab programme on m-file

syms s

f = (s+1)/(s^2+6*s+9)

a= ilaplace (f) find the Laplace inverse

b= simplify (a) simplify the answer

pretty (b) write the answer on the shape of fraction


Part three: time response for the system
Response to step input

The transfer function G(s) =

Write matlab program on m-file

n = [ 1 2] define numerator coefficient

d = [ 1 2 3] define denominator coefficient

v = tf (n,d) write the coefficient as transfer function

t = feedback (v,1) make the closed loop system with unity feedback

step(5*t , 20) plot the response due to step input which 5 represent

input value and 20 represent run time

Response to impulse input

The transfer function G(s) =

Write matlab program on m-file

n = [ 1 2] define numerator coefficient

d = [ 1 2 3] define denominator coefficient

v = tf (n,d) write the coefficient as transfer function

t = feedback (v,1) make the closed loop system with unity feedback

impulse (t , 20) plot the response due to impulse input which 20

represent run time


Response to any input function

Example 1:

The transfer function G(s) =

Write matlab program on m-file

n = [ 1 2] define numerator coefficient

d = [ 1 2 3] define denominator coefficient

v = tf (n,d) write the coefficient as transfer function

h = feedback (v,1) make the closed loop system with unity feedback

t=0 : 0.1 : 10 define t as variable from 0 to 10 with 0.1 step

u= 2*t define the function for input which represent ramp input

lsim(h ,u ,t) plot the response to input function in this example ramp input

Example 2:

The transfer function G(s) =

Write matlab program on m-file

n = [ 1 2] define numerator coefficient

d = [ 1 2 3] define denominator coefficient

v = tf (n,d) write the coefficient as transfer function

h = feedback (v,1) make the closed loop system with unity feedback

t=0 : 0.1 : 10 define t as variable from 0 to 10 with 0.1 step

u= sin(t) define the function for input which represent sin input

lsim(h ,u ,t) plot the response to input function in this example sin input
Part four: bode diagram for the system

The transfer function G(s) =

Write matlab program on m-file

n = [ 1 2] define numerator coefficient

d = [ 1 2 3] define denominator coefficient

v = tf (n,d) write the coefficient as transfer function

t = feedback (v,1) make the closed loop system with unity feedback

bode (t) plot the magnitude in db and phase angle due to frequency in rad/s

Part five: state space for the system

The transfer function G(s) =

Write matlab program on m-file

n = [ 1 2] define numerator coefficient

d = [ 1 2 3] define denominator coefficient

v = tf (n,d) write the coefficient as transfer function

t = feedback (v,1) make the closed loop system with unity feedback

ss (t) find the state space for system

Part six: root locus for the system:

The transfer function G(s) =

Write matlab program on m-file

n = [ 1 2] define numerator coefficient

d = [ 1 2 3] define denominator coefficient


v = tf (n,d) write the coefficient as transfer function

t = feedback (v,1) make the closed loop system with unity feedback

rlocus (t) find the root locus for system

Part seven: pole-zero map for the system

The transfer function G(s) =

Write matlab program on m-file

n = [ 1 2] define numerator coefficient

d = [ 1 2 3] define denominator coefficient

v = tf (n,d) write the coefficient as transfer function

t = feedback (v,1) make the closed loop system with unity feedback

pzmap (t) find the pole-zero map for system

Part eight: nyquist shape for the system

The transfer function G(s) =

Write matlab program on m-file

n = [ 1 2] define numerator coefficient

d = [ 1 2 3] define denominator coefficient

v = tf (n,d) write the coefficient as transfer function

t = feedback (v,1) make the closed loop system with unity feedback

nyquist (t) find the nyquist shape for system

You might also like