Clear Filters
Clear Filters

State Space model representation with symbolic matrices

21 views (last 30 days)
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

Answers (1)

Star Strider
Star Strider on 5 Jun 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);

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!