0% found this document useful (0 votes)
172 views6 pages

MATLAB State-Space Phase-Variable

The document discusses converting transfer functions to state-space representations and writing the resulting state equations and output equations for two systems. For the first system, the state equations are given as ẋ = Ax + Bu and y = Cx. For the second system, the same state equations are provided but with different coefficient matrices derived from the given transfer function. Matlab code is also provided to calculate the state-space matrices directly from the transfer functions.

Uploaded by

Duy Khánh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
172 views6 pages

MATLAB State-Space Phase-Variable

The document discusses converting transfer functions to state-space representations and writing the resulting state equations and output equations for two systems. For the first system, the state equations are given as ẋ = Ax + Bu and y = Cx. For the second system, the same state equations are provided but with different coefficient matrices derived from the given transfer function. Matlab code is also provided to calculate the state-space matrices directly from the transfer functions.

Uploaded by

Duy Khánh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

3.10.

Find the state-space representation in phase-variable form using matlab


a.

Program:
'a'

num=100;

den=[1 20 10 7 100];

G=tf(num,den)

[Acc,Bcc,Ccc,Dcc]=tf2ss(num,den);

Af=flipud(Acc);

A=fliplr(Af)

B=flipud(Bcc)

C=fliplr(Ccc)

Computer response:
ans =

Transfer function:

100

---------------------------------

s^4 + 20 s^3 + 10 s^2 + 7 s + 100

A=

0 1 0 0

0 0 1 0

0 0 0 1

-100 -7 -10 -20


B =

0
0

C =

100 0 0 0

b.

Program:
'b'

num=30;

den=[1 8 9 6 1 30];

G=tf(num,den)

[Acc,Bcc,Ccc,Dcc]=tf2ss(num,den);

Af=flipud(Acc);

A=fliplr(Af)

B=flipud(Bcc)

C=fliplr(Ccc)

Computer response:
ans =

Transfer function:

30

------------------------------------

s^5 + 8 s^4 + 9 s^3 + 6 s^2 + s + 30

A=

0 1 0 0 0

0 0 1 0 0

0 0 0 1 0

0 0 0 0 1
-30 -1 -6 -9 -8
B =

C =

30 0 0 0 0

3.11. For each system write the state equations and the output equation for the
phase-variable representation
a.

Using the standard form derived in the textbook,

[ ] []
0 1 0 0 0
ẋ= 0 0 1 0 x+ 0 r ( t )
0 0 0 1 0
−13 −5 −1 −5 1

c= [ 10 8 0 0 0 ] x

b.

Using the standard form derived in the textbook,

[ ] []
0 1 0 0 0 0
0 0 1 0 0 0
ẋ= 0 0 0 1 0 x+ 0 r (t)
0 0 0 0 1 0
0 0 −8 −13 −9 1
c= [ 6 7 122 1 ] x

3.12. For each system write the state equations and the output equation for the
phase-variable representation using matlab
a.

Program:
'a'

num=[8 10];

den=[1 5 1 5 13]

G=tf(num,den)

[Acc,Bcc,Ccc,Dcc]=tf2ss(num,den);

Af=flipud(Acc);

A=fliplr(Af)

B=flipud(Bcc)

C=fliplr(Ccc)

Computer response:
ans =

den =

1 5 1 5 13

Transfer function:

8 s + 10

----------------------------

s^4 + 5 s^3 + s^2 + 5 s + 13

A=

0 1 0 0

0 0 1 0
0 0 0 1

-13 -5 -1 -5
B =

C =

10 8 0 0

b.

Program:
'b'

num=[1 2 12 7 6];

den=[1 9 13 8 0 0]

G=tf(num,den)

[Acc,Bcc,Ccc,Dcc]=tf2ss(num,den);

Af=flipud(Acc);

A=fliplr(Af)

B=flipud(Bcc)

C=fliplr(Ccc)

Computer response:
ans =

den =

1 9 13 8 0 0

Transfer function:

s^4 + 2 s^3 + 12 s^2 + 7 s + 6

------------------------------
s^5 + 9 s^4 + 13 s^3 + 8 s^2

A=

0 1 0 0 0

0 0 1 0 0

0 0 0 1 0

0 0 0 0 1

1
3 2 0 0 -8 -13 -9
s + 6 s + 10 s+5
B =

C =

6 7 12 2 1

You might also like