Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Dear Collegues:
I have a system with linear equations but the matrix is ill conditionned so the solution I get using lsolve is not the correct answer. See attached sheet
Any suggestion on how to solve this with meaninful results. The answer I get is very large where It suppose to be very small. Thanks
There seems to be something wrong in your worksheet. I have just use a solve block and got different answers again.
Mike
I do not see what can be wrong. I started with:
B=A*Y but when
Y=lsolve(B,A) gives a different answer than above. There is a a big difference between the right answer very small and the incorrect one very large
The only thing like I mentionned is the matrix is ill conditionned so may have multiple solutions. Iam checking if there is a way to zone in the correct answer or how Mathcad handle these as far as sensitivity.
In a paper that used Matlab to solve this mentionned using least square g inverse. There are no other details. Is that different than Mathcad?
Take a look at singular value decomposition {svd(A).}
Can you please elaborate more on this function and how It might help. It does not work for complex I can convert to real and imaginary but not sure what I am looking for. Thanks
Take the symbolic determinant of the matrix A, with no numerical assignments. It is 0, so your matrix is not just badly conditioned, it is perfectly singular. Your problem is indeterminate.
This is weird. When I took the determinant of A numerically It is a large number. The symbolic one give near 0. Which one is right?
Working backward seems there are multiple answers to this based on lsolve and the answer I know is correct since both solution satisfy the equation. Having multiple answers seem to fill the ill condition matrix. Also I checked the condition of the matrix and It is very high suggesting ill condition.
This is weird. When I took the determinant of A numerically It is a large number. The symbolic one give near 0. Which one is right?
Neither. It's floating point error (even with the higher precision floating point arithmetic used by the symbolic processor). What is correct is exactly 0.
Working backward seems there are multiple answers to this based on lsolve and the answer I know is correct since both solution satisfy the equation. Having multiple answers seem to fill the ill condition matrix. Also I checked the condition of the matrix and It is very high suggesting ill condition.
The limit of ill-conditioned is singular. Absent roundoff error in the processing, the matrix is perfectly singular. Just take it's determinant using the symbolic processor with no variable assignments. It's zero. I also checked that with the old Maple symbolic processor in version 11.
Thanks for checking and confirming the singularity. I guess from now on I will use the symbolic tool as a check as well
Symbolic math is a very powerful tool. But be aware that if your expression contains floating point numbers it still does floating point arithmetic, it just does arbitrary precision (default 20 decimal places) floating point arithmetic. If your expression contains only undefined variables and integers, if you get a solution, it is exact.
And here what result has turned out in Mathcad Prime: