フィルターのクリア

how to solve the equation: Exdot=AX+Bu; with E is a singular matrix ? thank you

5 ビュー (過去 30 日間)
khawla mrad
khawla mrad 2023 年 2 月 2 日
編集済み: Sam Chak 2023 年 2 月 2 日
Exdot=AX+Bu; with E is a singular matrix ?

回答 (1 件)

Sam Chak
Sam Chak 2023 年 2 月 2 日
編集済み: Sam Chak 2023 年 2 月 2 日
If your system is linear, then try using dss() command. See example below:
If the system are nonlinear, then you need to specify 'MassSingular' and 'maybe', or 'yes' in the odeset().
A = [0 1; -1 -2]
A = 2×2
0 1 -1 -2
B = [0; 1]
B = 2×1
0 1
C = [1 0]
C = 1×2
1 0
D = 0;
E = [2 4; 4 8]
E = 2×2
2 4 4 8
rank(E) % Rank of matrix E is less than 2
ans = 1
inv(E)
Warning: Matrix is singular to working precision.
ans = 2×2
Inf Inf Inf Inf
% Descriptor state-space system
sys = dss(A, B, C, D, E)
sys = A = x1 x2 x1 0 1 x2 -1 -2 B = u1 x1 0 x2 1 C = x1 x2 y1 1 0 D = u1 y1 0 E = x1 x2 x1 2 4 x2 4 8 Continuous-time state-space model.
% Step Response
step(sys)
  2 件のコメント
John D'Errico
John D'Errico 2023 年 2 月 2 日
編集済み: John D'Errico 2023 年 2 月 2 日
A comment: Do not test for singularity using det. This is simply a bad idea, and one that should NEVER be recommended to others, as that only propagates a terrible idea. Yes, teachers teach it. But they had to learn from someone else. And every time someone propagates a bad idea, it gets further entrenched in the minds of those who will read what you write.
If you want to test for a matrix being numerically singular, then use rank, or cond. If the condition number is sufficiently large (the limiting value depends on whether the matrix is single or double), then it is singular. If rank(A) is smaller than min(size(A)), then the array A is numerically singular.
If you don't believe me, then a simple example may suffice. Is the matrix A singular?
A = eye(1200);
Is the matrix B singular?
B = A/2;
Finally, is the matrix C singular?
C = A*2;
Surey you would agree that all are perfectly well behaved matrices, and as far from being singular as you could imagine. Test each of them using det.
det(A)
ans = 1
det(B)
ans = 0
det(C)
ans = Inf
Note that det(B) is returned as an EXACT zero. Not even just a small number.
det(B) == 0
ans = logical
1
And these are not the only reasons why det is a bad method to employ.
Remember that those who you will teach today will be teaching others tomorrow.
Sam Chak
Sam Chak 2023 年 2 月 2 日
Thank you @John D'Errico. I had a 'bad' math teacher in Grade 9. 😅

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

カテゴリ

Help Center および File ExchangeSparse Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by