Floating Point scalar error while trying to find Grammians
1 回表示 (過去 30 日間)
古いコメントを表示
This is my code, I'm trying to find the controllability and observability Grammians of the following system where k is unknown. Since i have k, i can't use the function gram(sys,'c'). So i'm trying to use the Grammian equation but i keep getting these errors:
Error using integral (line 85)
A and B must be floating-point scalars.
Error in control (line 15)
Wc = integral(fun,0,T)
Can anyone help me with this please?
syms k tau T
A = [0 1 0; 0 0 1; -6.63*k -171 -101.71];
B = [0;0;6.63*k];
C = [1 0 0];
D = 0;
A_T = A.';
B_T = B.';
C_T = C.';
fun =@(tau) expm(-A*taw).* B .* B_T .* expm(-A_T*taw);
Wc = integral(fun,0,T)
det_Wc = det(Wc)
fun1 = @(tau) expm(A_T*taw) .* C_T .* C .* expm(A*taw);
Wo = integral(fun1,0,T)
det_Wo = det(Wo)
0 件のコメント
回答 (1 件)
Shraddha Jain
2020 年 12 月 22 日
Hi Hussain,
You are experiencing this error because k is undefined, as a result, A and B are computed as symbolic variables and not matrices as expected by the function expm.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!