フィルターのクリア

Problems with the controllability matrix.

6 ビュー (過去 30 日間)
Edoardo Panichi
Edoardo Panichi 2021 年 3 月 30 日
コメント済み: Edoardo Panichi 2021 年 3 月 30 日
The error I get is the following:
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.
Error in ctrb (line 33)
co(:,1:nu) = b;
Error in "Name_of_the_File" (line 47) Co = ctrb(A,B);
The script that I am trying to use is:
syms g L m Jx Jy Jz;
A = [0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 g 0 0 0 0 0 0 0 0;
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 -g 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0;
0 0 0 0 0 0 0 -g 0 0 0 0 g/L 0 0 0;
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1;
0 0 0 0 0 0 g 0 0 0 0 0 0 0 g/L 0];
B = [0 0 0 0;
0 0 0 0;
0 0 0 0;
0 0 0 0;
0 0 0 0;
-1/m 0 0 0;
0 0 0 0;
0 0 0 0;
0 0 0 0;
0 1/Jx 0 0;
0 0 1/Jy 0;
0 0 0 1/Jz;
0 0 0 0;
0 0 0 0;
0 0 0 0;
0 0 0 0];
Co = ctrb(A,B);
R = rank(Co);

採用された回答

Paul
Paul 2021 年 3 月 30 日
ctrb() in the Control System Toolbox only accepts numeric inputs. If you have numeric values for the variables, you can substitute them into A and B and the call ctrb with the resulting numeric matrices. If you can only do it symbolically, you'll have to form the contollability matrix yourself. However, it appears that using rank() on symbolic matrices can be tricky depending on the matrix and if you really want the rank or if you just want to know if the matrix is less than full rank. Check the doc page.
  1 件のコメント
Edoardo Panichi
Edoardo Panichi 2021 年 3 月 30 日
thanks, I will try!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by