Lab-4 (Solution by Adnan)

11
Control Systems Lab 4. LTI Models & their Operations 1 Lab No. 04 LTI Models & their Operations TASK No. 4.1 Find the Step response and Transfer function by using M-file and also implement it on simulink (A). Series Configuration: S+1 / S+3 1 / 100S 2 Matlab Code & Result >> clear all >> close all >> numa=[1 1]; dena=[1 3]; numb=1; denb=[100 0 0]; A=tf(numa,dena); B=tf(numb,denb); s=series(A,B); >> step(s) >> Tf=tf(s) Transfer function: s + 1 ----------------- 100 s^3 + 300 s^2

Transcript of Lab-4 (Solution by Adnan)

Page 1: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 1

Lab No. 04 LTI Models & their Operations

TASK No. 4.1

Find the Step response and Transfer function by using M-file and also implement it on simulink

(A). Series Configuration:

S+1 / S+3 1 / 100S2

Matlab Code & Result >> clear all >> close all >> numa=[1 1]; dena=[1 3]; numb=1; denb=[100 0 0]; A=tf(numa,dena); B=tf(numb,denb); s=series(A,B); >> step(s) >> Tf=tf(s) Transfer function: s + 1 ----------------- 100 s^3 + 300 s^2

Page 2: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 2

Page 3: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 3

Simulink Diagram & Step Response Results

Page 4: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 4

(B). Parallel Configuration:

Matlab Code & Result >> clear all >>close all >> numa=[1]; dena=[1 1]; numb=[2]; denb=[3 0 9]; A=tf(numa,dena); B=tf(numb,denb); p=parallel(A,B) Transfer function: 3 s^2 + 2 s + 11 ----------------------- 3 s^3 + 3 s^2 + 9 s + 9 >> step(p) >>

1 / S+1

2 / 3S2+ 9

Page 5: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 5

Simulink Diagram & Result

Page 6: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 6

(C). Feedback System

Matlab Code & Result: >>clear all >>close all >>numc = [ 1 1] ; >> denc = [ 1 2 ] ; >>numg = [ 1 ] ; >> deng = [ 500 0 0] ; >>c = tf(numc, denc); >>g = tf(numg, deng); >>s = series(c, g) >>f=1;; >>r = feedback(s, 1)

S+ 1 / S+2 1 / 500S2 -

-

Page 7: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 7

Transfer function: s + 1 -------------------------- 500 s^3 + 1000 s^2 + s + 1

Simulink Diagram & Result

Page 8: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 8

… Use an alternate code for this implementation ( Lab Task No. 4.2

Find the step response on simulink of the diagram below

Simplify the Diagram & obtain a Transfer Function

Also plot the step response for the simplified one and compare these results.

6 s / s^2 + s + 4

s / s + 2

3 / s+3

R(s)

C(s)

--

+-

Page 9: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 9

Matlab Code & Results

>> clear all >>close all >> numa=[1 0]; >> dena=[1 2]; >> A=tf(numa,dena); >> numb=6; >> denb=1; >> B=tf(numa,denb); >> numc=3; >> denc=[1 3]; >> C=tf(numc,denc); >> numd=[1 0]; >> dend=[1 1 4]; >> D=tf(numd,dend); >> sys1=B-A; >> f=1; >> sys2=feedback(sys1,f); >> sys3=series(sys2,D) Transfer function: 5 s^2 + 12 s -------------------------- 6 s^3 + 20 s^2 + 38 s + 56 >> sys4=feedback(sys3,C) Transfer function: 5 s^3 + 27 s^2 + 36 s -------------------------------------- 6 s^4 + 38 s^3 + 113 s^2 + 206 s + 168 >> step(sys4) >>

Page 10: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 10

Simulink Diagram & Result

Page 11: Lab-4 (Solution by Adnan)

Control Systems

Lab 4. LTI Models & their Operations 11

Checked By: Date: