symbolic variables into double array, observability matrix

11 vues (au cours des 30 derniers jours)
Stina Ravdna Lorås
Stina Ravdna Lorås le 25 Nov 2021
Réponse apportée : Paul le 25 Nov 2021
When I run this program I get the message: The following error occurred converting from sym to double:
Unable to convert expression containing symbolic variables into double array. Apply 'subs' function first to substitute values for variables.
My code:
syms u d3 d5 m Iy;
A = [0 -u 1 0 1;
0 0 0 1 0;
0 0 -d3/m 0 -d3/m;
0 0 0 d5/Iy 0;
0 0 0 0 0];
C = [1 0 0 0 0;
0 1 0 0 0];
Ob = obsv(A, C);
Tried to put C into sym(), that did not help. I guess it should be a simple problem to solve?

Réponses (2)

Star Strider
Star Strider le 25 Nov 2021
The variable values need to be provided in order to use the Control System Toolbox funcitons.
To do this symbolically, create the observability and controllability matrices using the defined matrices. There is no other option.
.

Paul
Paul le 25 Nov 2021
The function obsv() in the Control System Toolbox only accepts numeric input. If you want the symbolic form of the observability matrix you'll have to compute it yourself. The form of Ob is shown on the doc page for obsv. Either hard code it or write a few-line function to compute it from A and C.

Catégories

En savoir plus sur Formula Manipulation and Simplification dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by