0% found this document useful (0 votes)
36 views4 pages

Control Lab 1

This document discusses creating equations and transfer functions in MATLAB. It then summarizes: 1) Simulating an open loop control system using a unit step response with the transfer function s+1/(s^2 + 8s + 15). 2) Simulating a closed loop control system by converting the open loop transfer functions G and H to the closed loop transfer function (s+1)/(s^2 + 9s + 16) and plotting its unit step response.

Uploaded by

soumik Rayhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views4 pages

Control Lab 1

This document discusses creating equations and transfer functions in MATLAB. It then summarizes: 1) Simulating an open loop control system using a unit step response with the transfer function s+1/(s^2 + 8s + 15). 2) Simulating a closed loop control system by converting the open loop transfer functions G and H to the closed loop transfer function (s+1)/(s^2 + 9s + 16) and plotting its unit step response.

Uploaded by

soumik Rayhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Part-1: Creating equations, calculating roots and putting transfer functions as

output-

>> p1=[1 0 5 6]

p1 =

1 0 5 6

>> printsys(p1,[0 0 0 1],'s')

num/den =

s^3 + 5 s + 6
-------------
1
>> polyval(p1,1)

ans =

12

>> r1=roots(p1)

r1 =

0.5000 + 2.3979i
0.5000 - 2.3979i
-1.0000

>> p2=poly(r1)

p2 =

1.0000 0.0000 5.0000 6.0000

>> exp1=[1,1];
>> exp2=[1,2];
>> exp=conv(exp1,exp2)

exp =

1 3 2
Part-2: Simulating an open loop control system-

>> num=[1 1]
num =
1 1
>> den=conv([1 3],[1 5])

den =

1 8 15
>> printsys(num,den,'s')

num/den =

s+1
--------------
s^2 + 8 s + 15
>> [y,x,t]=step(num,den);
>> figure(1)
>> plot(t,y)
>> grid
>> title('Unit step response for open loop')
>> ylabel('y(t)')
>> xlabel('time in seconds')
Part-3: Simulating a closed loop control system-

>> G=[1 1]

G=

1 1

>> H=conv([1 3],[1 5])

H=

1 8 15

>> [num,den]=cloop(G,H)

num =

0 1 1

den =

1 9 16

>> printsys(num,den,'s')

num/den =

s+1
--------------
s^2 + 9 s + 16
>> [y,x,t]=step(num,den);
>> figure(2)
>> plot(t,y)
>> grid
>> title('Unit response for closed loop')
>> ylabel('y(t)')
>> xlabel('time in seconds')

You might also like