Having troubles with symbols in creating statespace model

3 views (last 30 days)
here is my code and error:
clc
clear
syms a L
A = [-10 0 -10/a; 0 0 1;-6/a -70/a^2 -14.4/a^2];
B = [10 ;0 ;6/a];
C = [0 0 1/a; 0 25 3];
D = [0; 0];
Ceq = charpoly(A)
sys = ss(A,B,C,D)
Error using ss (line 260)
The value of the "a" property must be a numeric array
without any Inf's or NaN's.
Error in Project_1 (line 10)
sys = ss(A,B,C,D)

Answers (1)

Star Strider
Star Strider on 1 Dec 2014
The Control System Toolbox wants only numeric functions, so you have to define a numeric value for ‘a’.
You can calculate the output symbolically:
y = ((C*expm(A*t)*B)+D)*u
but the output is too long to fit into the Command Window, giving a long (incomplete) symbolic expression followed by ... Output truncated. Text exceeds maximum line length of 25,000 characters for Command Window display..

Categories

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

Community Treasure Hunt

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

Start Hunting!