State Space model representation with symbolic matrices

19 ビュー (過去 30 日間)
Aybars
Aybars 2017 年 6 月 5 日
回答済み: Star Strider 2017 年 6 月 5 日
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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by