Taking the Inverse of 6x6 Symbolic Real Symmetric Matrix Crashes MATLAB
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Zach Bortoff
am 10 Jun. 2022
Kommentiert: Walter Roberson
am 12 Jun. 2022
I am trying to compute the inverse of a 6x6 symbolic real-symmetric matrix, M, but everytime I run inv(M), MATLAB becomes unresponsive.
Does anyone have any suggestions for computing the inverse of a 6x6 symbolic real-symmetric matrix?
Each element of the matrix is a very long expression involving cos(...) and sin(...) of symbolic variables. Are there any algorithms or round-about ways of exploiting the real-symmetric properties of the matrix to compute its inverse that might involve fewer symbolic computations, thereby reducing the chance of causing MATLAB to hang?
I have tried eig(M), but that doesn't seem to work either. I have also tried expanding the Java heap size under "Preferences", but that doesn't seem to have had any observable effects.
4 Kommentare
Akzeptierte Antwort
Walter Roberson
am 10 Jun. 2022
create a framework matrix to take the inverse of, and then subs()
syms M [6 6]
iM = inv(M) ;
imat = subs(iM, M, YourMatrix);
With the trig terms it would likely be tempting to simplify(imat) but that is likely to take a long time.
The results you get back will be correct (assuming the matrix is not singular). However, chances are high that the results will be useless for all practical purposes. You would have a matrix of huge expressions; then what? What will halving the analytic inverse do for you? If someone were to give you the thousands-of-terms result, except that they miscopied one sign, then how would you ever even notice? If you get back a megabyte of answer, what will you do with it?
2 Kommentare
Walter Roberson
am 12 Jun. 2022
Kinematics are notorious for fragile, for being numerically unstable.
When I glanced at the paper, it looked as if they were placing constraints and solving within those constraints, in areas that are numerically well behaved. But... when you switch over to the symbolic equations, the symbolic equations do not encode the constraints, and the expressions that result will not necessarily be stable. For example the general form might have an (x-1)/(x-1) when x might pass through 1, with the paper perhaps demonstrating that it is not a problem under the rest of the conditions, but the Symbolic Toolbox going ahead and producing 0/0 in that term and failing over...
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!