How do I find the the zero state diretion and the zero input direction of a transfer matrix in Matlab?

I want to compute using matlab the Rosenbrock System Matrix, and in particular I am trying to do a an analysis similar to the one at the end of http://people.duke.edu/~hpgavin/ce263/zeros.pdf . So, starting from a transfer matrix I would like to show that if there is a zero at a certain position, there is a zero blocking property.
To do so, as written in the link, I have to find the zeros state direction and the zero input direction, and I am having troubles doing do.
I am considering a different system from the one in the link, so I am trying to do a similar analysis applied to another system, and I am doing this:
s = tf('s');
P = 1/(s+5);
C = 6/s;
S = 1/(1+P*C);
T = P*C/(1+P*C);
G_2 = [T S; S -S]; %transfer matrix
Now, I have that my transfer matrix is :
G_2
and for it I would like to do the analysis to find the zero state diretion and the zero input direction, but I am having troubles doing so.
Can somebody please help me? Thanks in advance.

 Accepted Answer

I have not done anything with Rosenbrock System Matrices since my multivariable control course in graduate school. We used the Maciejowski textbook, that I still have.
To reproduce that analysis:
s = tf('s');
P = [2/(s^2+3*s+2) 2*s/(s^2+3*s+2); -2*s/(s^2+3*s+2) -2/(s^2+3*s+2)]
S = ss(P)
Smr = minreal(S)
A = Smr.A
B = Smr.B
C = Smr.C
D = Smr.D
trz = tzero(A,B,C,D)
RSM_1 = [eye(3)-A B; -C D]
rRSM_1 = rank(RSM_1)
producing:
P =
From input 1 to output...
2
1: -------------
s^2 + 3 s + 2
-2 s
2: -------------
s^2 + 3 s + 2
From input 2 to output...
2 s
1: -------------
s^2 + 3 s + 2
-2
2: -------------
s^2 + 3 s + 2
Continuous-time transfer function.
S =
A =
x1 x2 x3 x4
x1 -3 -2 0 0
x2 1 0 0 0
x3 0 0 -3 -2
x4 0 0 1 0
B =
u1 u2
x1 2 0
x2 0 0
x3 0 2
x4 0 0
C =
x1 x2 x3 x4
y1 0 1 1 0
y2 -1 0 0 -1
D =
u1 u2
y1 0 0
y2 0 0
Continuous-time state-space model.
1 state removed.
Smr =
A =
x1 x2 x3
x1 -1.222 -0.4444 -0.5556
x2 1.556 -2.889 -1.111
x3 -1.556 0.8889 -0.8889
B =
u1 u2
x1 1 0.3333
x2 -1 1.667
x3 1 0.3333
C =
x1 x2 x3
y1 1 1 -6.939e-16
y2 -0.3333 0.3333 -1.333
D =
u1 u2
y1 0 0
y2 0 0
Continuous-time state-space model.
A =
-1.2222 -0.44444 -0.55556
1.5556 -2.8889 -1.1111
-1.5556 0.88889 -0.88889
B =
1 0.33333
-1 1.6667
1 0.33333
C =
1 1 -6.9389e-16
-0.33333 0.33333 -1.3333
D =
0 0
0 0
trz =
1
RSM_1 =
2.2222 0.44444 0.55556 1 0.33333
-1.5556 3.8889 1.1111 -1 1.6667
1.5556 -0.88889 1.8889 1 0.33333
-1 -1 6.9389e-16 0 0
0.33333 -0.33333 1.3333 0 0
rRSM_1 =
4
Verifying the analysis in the zeros PDF.

6 Comments

As always, my pleasure!
The reason your code is throwing the error is because this assignment:
null = null(RSM_1)
creates ‘null’ as a variable, overshadowing the MATLAB null function. Then the next time you call the null function, you will get that error.
Do this instead:
RSM_1_null = null(RSM_1)
and the problem will not recur.
Hi, sorry if I bother again with this question, but I have tried to do the simulation of my problem using the rest of the code in the paper, so I have done the following:
s = tf('s');
P = 1/(s+5);
C = 6/s;
S = 1/(1+P*C);
T = P*C/(1+P*C);
G_2 = [T S; S -S]; %transfer matrix
S = ss(G_2)
Smr = minreal(S)
A = Smr.A
B = Smr.B
C = Smr.C
D = Smr.D
trz = tzero(A,B,C,D)
RSM_1 = [0*eye(2)-A B; -C D]
rRSM_1 = rank(RSM_1)
null = null(RSM_1)
%verifying zero blocking property
x0 = [-0.4388; -0.1482];
u0 = [-0.0000; 0.8863];
t = linspace(0,5);
u = exp(t);
[y,x] = lsim(A,B*u0,C,D*u0,u,t,x0);
plot(t,y)
axis([0 5 -1 1])
xlabel('time, seconds')
title('response to x_{0} and u(t)=u_{0}e^{t}')
In order to verify the zero blocking property as it is done in the paper. But when I do this, I obtain:
which does not make sense since the output should go to zero.
I know this answer should be closed, so sorry if I write again here. Can I ask you why does this happen to me even if the code is almost the same? Thanks in advance.
When I run your code in R2019b (although without the axis call), I get this result:
I do not understand the problem.

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!