how to solve the equation: Exdot=AX+Bu; with E is a singular matrix ? thank you
1 次查看(过去 30 天)
显示 更早的评论
Exdot=AX+Bu; with E is a singular matrix ?
回答(1 个)
Sam Chak
2023-2-2
编辑:Sam Chak
2023-2-2
Hi @khawla mrad
If your system
is linear, then try using dss() command. See example below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1282011/image.png)
If the system are nonlinear, then you need to specify 'MassSingular' and 'maybe', or 'yes' in the odeset().
A = [0 1; -1 -2]
B = [0; 1]
C = [1 0]
D = 0;
E = [2 4; 4 8]
rank(E) % Rank of matrix E is less than 2
inv(E)
% Descriptor state-space system
sys = dss(A, B, C, D, E)
% Step Response
step(sys)
2 个评论
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)
det(B)
det(C)
Note that det(B) is returned as an EXACT zero. Not even just a small number.
det(B) == 0
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.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!