how to solve the equation: Exdot=AX+Bu; with E is a singular matrix ? thank you
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Exdot=AX+Bu; with E is a singular matrix ?
Risposte (1)
Sam Chak
il 2 Feb 2023
Modificato: Sam Chak
il 2 Feb 2023
Hi @khawla mrad
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]
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 Commenti
John D'Errico
il 2 Feb 2023
Modificato: John D'Errico
il 2 Feb 2023
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.
Vedere anche
Categorie
Scopri di più su Numerical Integration and Differential Equations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!