State Space model representation with symbolic matrices

19 次查看(过去 30 天)
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

回答(1 个)

Star Strider
Star Strider 2017-6-5
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);

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by