How does state space form include input delay in MATLAB?

I got this code from 'Time Delays in Linear System' MATLAB help.
A=-2; B=3; C=[1;-1];D=0;
G = ss(A,B,C,D,'InputDelay',1.5)
Now I want to implement this in another model where matrix are-
A=[1 2 3;4 3 2;1 2 3]; C=[0 3 0];
D=[0 -1];
B=[3;5;7];
H = ss(A,B,C,D,'InputDelay',[1.5;2.1;3.2])
But after running the above code, we got an error. "The values of the "a" and "b" properties must be matrices with the same number of rows.".
Please help me in this regard. Thank you.

3 comentarios

I get a different error:
A=[1 2 3;4 3 2;1 2 3]; C=[0 3 0];
D=[0 -1];
B=[3;5;7];
H = ss(A,B,C,D,'InputDelay',[1.5;2.1;3.2])
Error using ss
The "C" and "D" matrices must have the same number of rows.
This is reasoinable because ‘B’ and ‘D’ are input arrays, so they must have the same sizes (rows and columns).
.
@Star Strider After correcting D=[-1]; again get this error-Error using ss (line 345)
The value of the "InputDelay" property must be a vector with as many entries as input channels.
Exactly.
And ‘B’ and ‘D’ are not the same sizes, an additional error.

Iniciar sesión para comentar.

 Respuesta aceptada

Sam Chak
Sam Chak el 9 de Abr. de 2022
Editada: Sam Chak el 9 de Abr. de 2022
If you look at the matrices for the desired state-space system
A =
1 2 3
4 3 2
1 2 3
B =
3
5
7
C =
0 3 0
D =
0 -1
you'll see that the system matrices C(1x3), B(3x1) and D(1x2) are definitely incompatible.
The dimension of D should be (1x1) because the dimension of is .
Another possibility is that if the dimension of D is (1x2), then it implies there are two inputs and the dimension of B must be (3x2).
In general, it should satisfy this:
when you type this out:
[A B; C D]

2 comentarios

Sol Elec
Sol Elec el 9 de Abr. de 2022
Editada: Sol Elec el 9 de Abr. de 2022
@Sam Chak After modifying D=[-1];
I got this error- Error using ss (line 345)
The value of the "InputDelay" property must be a vector with as many entries as input channels.
Sam Chak
Sam Chak el 10 de Abr. de 2022
Editada: Sam Chak el 10 de Abr. de 2022
The error stemmed from a set of 3 tau's for a single input, u1:
'InputDelay', [1.5; 2.1; 3.2]
If there is only 1 tau in the input u1, then your state-space model looks like this:
A = [1 2 3; 4 3 2; 1 2 3];
B = [3; 5; 7];
C = [0 3 0];
D = [-1];
sys = ss(A, B, C, D, 'InputDelay', 1.5)
sys =
A =
x1 x2 x3
x1 1 2 3
x2 4 3 2
x3 1 2 3
B =
u1
x1 3
x2 5
x3 7
C =
x1 x2 x3
y1 0 3 0
D =
u1
y1 -1
Input delays (seconds): 1.5
Continuous-time state-space model.
Please mathematically show how your time-delay LTI system looks like.
In transfer function form of the time-delayed SISO system looks like this:
[num, den] = ss2tf(A, B, C, D);
G = tf(num, den, 'InputDelay', 1.5)
G =
-s^3 + 22 s^2 + 18 s + 120
exp(-1.5*s) * ------------------------------------
s^3 - 7 s^2 - 7.47e-15 s + 4.174e-15
Continuous-time transfer function.
If you confirm that there are 3 inputs with time delays, then the sample code is given by:
A = [1 2 3; 4 3 2; 1 2 3];
B = eye(3);
C = [0 3 0];
D = [0 0 0];
sys = ss(A, B, C, D, 'InputDelay', [1.5; 2.1; 3.2])
sys =
A =
x1 x2 x3
x1 1 2 3
x2 4 3 2
x3 1 2 3
B =
u1 u2 u3
x1 1 0 0
x2 0 1 0
x3 0 0 1
C =
x1 x2 x3
y1 0 3 0
D =
u1 u2 u3
y1 0 0 0
Input delays (seconds): 1.5 2.1 3.2
Continuous-time state-space model.
Hope this clears up your confusion.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 9 de Abr. de 2022

Editada:

el 10 de Abr. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by