Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

State-variable representation-Two systems with transfer functions H_1(z) = 0.2/1

ID: 2084258 • Letter: S

Question

State-variable representation-Two systems with transfer functions H_1(z) = 0.2/1 + 0.5z^-1, H_2(z) = 0.8 - 0.2z^-1/1 - z^-1 + 0.5z^-2 are connected in parallel. (a) Use MATLAB to determine the transfer function H(z) of the overall system. (b) use the function tf2ss to obtain state-variable representations for H_1(z) and H_2(z), and the use ss2tf to verify these transfer functions are the transfer functions obtained from the models. (c) obtain a state-variable representation for H(z) and compare it with the one you would obtain from the state variable models for H_1(z) and H_2(z). Answers: H(z) H_1(z) H_2(z) = 1/(1 - 0.5z^-1 0.25z^-3).

Explanation / Answer

type the following commands in MATLAB

num1= 0.2;
den1= [1 0.5];
num2= [0.8 -0.2];
den2= [1 -1 0.5];

H1 = tf(num1,den1,0.01,'variable','z^-1');

H2 = tf(num2,den2,0.01,'variable','z^-1');

You will get,

num1 =

0.2000


den1 =

1.0000 0.5000


num2 =

0.8000 -0.2000


den2 =

1.0000 -1.0000 0.5000

Transfer function: H1
0.2
------------
1 + 0.5 z^-1

Transfer function:H2
0.8 - 0.2 z^-1
-------------------
1 - z^-1 + 0.5 z^-2

Sampling time (seconds): 0.01

How put H! and H2 in parallel using following command

H = parallel(H1,H2);


Transfer function: H
1
------------------------
1 - 0.5 z^-1 + 0.25 z^-3

Sampling time (seconds): 0.01

(b)

Check tf2ss and ss2tf functions in MATLAB as below.

H1(z):

>> [A1,B1,C1,D1]=tf2ss(num1,den1) % convert from transfer function model to state space.

A1 =

-0.5000


B1 =

1


C1 =

0.2000


D1 =

0

>> [test_num1,test_den1]=ss2tf(A1,B1,C1,D1) % get back numerator and denominator from the matrices A1,B1,C1,D1

test_num1 =

0 0.2000


test_den1 =

1.0000 0.5000

We got the system with numerator and denominator.

H2(z):

>> [A2,B2,C2,D2]=tf2ss(num2,den2) % convert from transfer function model to state space.

A2 =

1.0000 -0.5000
1.0000 0


B2 =

1
0


C2 =

0.8000 -0.2000


D2 =

0

>> [test_num2,test_den2]=ss2tf(A2,B2,C2,D2)  % get back numerator and denominator from the matrices A2,B2,C2,D2

test_num2 =

0 0.8000 -0.2000


test_den2 =

1.0000 -1.0000 0.5000

(C)

type the following commands in MATLAB command window for state space representatio for H(z)

>> ss(H)

a =
x1 x2 x3
x1 0.5 0 -0.5
x2 0.5 0 0
x3 0 1 0

b =
u1
x1 1
x2 0
x3 0

c =
x1 x2 x3
y1 0.5 0 -0.5

d =
u1
y1 1

Sampling time (seconds): 0.01

It is evident that H(z) is a third order system, meaning that H(z) has three state variables as given above. Now lets compare it with the H1(z) and H2(z).

H1(z) is a first order system and H2(z) is a second order system. Hence the overall system (H) will be of third order.

Type the following command in matlab to generate state space equivalant of (H1+H2)

>> ss(H1+H2)

a =
x1 x2 x3
x1 0.5 0 -0.5
x2 0.5 0 0
x3 0 1 0

b =
u1
x1 1
x2 0
x3 0

c =
x1 x2 x3
y1 0.5 0 -0.5

d =
u1
y1 1

Sampling time (seconds): 0.01
Discrete-time model.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote