State Space model representation with symbolic matrices

21 visualizaciones (últimos 30 días)
Aybars
Aybars el 5 de Jun. de 2017
Respondida: Star Strider el 5 de Jun. de 2017
Hi everyone, I am trying to create state space model. The examples on Matlab website is pretty straightforward.I wanted to define my A,B,C and D matrixes with symbols, not numbers. Here is my code:
syms C R L
A = [0 1/C;-1/L -R/L]
B=[0;1/L]
C=[1 0;0 R]
D=0
A =
[ 0, 1/C]
[ -1/L, -R/L]
B =
0
1/L
C =
[ 1, 0]
[ 0, R]
D = 0
0
syms = ss(A,B,C,D)
However, I received that error:
Error using ss (line 259)
The value of the "a" property must be a numeric array without any Inf's or
NaN's.
Actually the problem isn't about the "a"; because even I change it to numerical matrixes, I receive same error for "b" and so on. Thanks for help in advance

Respuestas (1)

Star Strider
Star Strider el 5 de Jun. de 2017
You cannot use symbolic variables with Control System objects.
This works:
R = 1000;
L = 1E-3;
C = 1E-9;
A = [0 1/C;-1/L -R/L];
B = [0;1/L];
C = [1 0;0 R];
D = [0; 0];
sym_ss = ss(A,B,C,D);

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by