Solve returns empty result although solution exists

21 Ansichten (letzte 30 Tage)
Hazem Abdelghany
Hazem Abdelghany am 19 Mär. 2019
Bearbeitet: Walter Roberson am 21 Mär. 2019
Hello I'm trying to solve the following system of equations,
This should be easy to solve by hand. However using solve returns an empty sym struct. what am i missing here?
variables used are attached.
Thank you.
EDIT: re-uploaded variables and added code.
EDIT2:provided working example as per @Walter Roberson's comment.
  5 Kommentare
Hazem Abdelghany
Hazem Abdelghany am 19 Mär. 2019
yes I installed Maple specifically to see if it produces different outcome.
same problem occurred.
Hazem Abdelghany
Hazem Abdelghany am 19 Mär. 2019
Bearbeitet: Hazem Abdelghany am 19 Mär. 2019
@Torsten do you mean linsolve()?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 19 Mär. 2019
You are accidentally using Maple's sym() and solve() calls. The .mat you provided for us is only useable by people who have installed "MATLAB Connector for Maple" .
You need to use pathtool to give the Maple functions a lower priority than the MATLAB functions and recreate the equations matrix and try again.
  5 Kommentare
Hazem Abdelghany
Hazem Abdelghany am 19 Mär. 2019
wow, thanks, finally some hope.
s there a way I can solve this? maybe some tolerance parameter?
i
Walter Roberson
Walter Roberson am 19 Mär. 2019
Bearbeitet: Walter Roberson am 21 Mär. 2019
The lines above show a solution in which the only inconsistency is on the order of 1E-13 , The order of the variables in sol will be the same as symvar(eqns)
Note: if you vpa(eqn) and compare that to your posted equations, you will see that they do not round exactly the same way. The equations in your .mat are not exactly the same as you would get by converting your posted equations to rationals. That matters because the correction you would need to make the equations consistent is less than the difference in stored versus posted values -- whatever round-off you have going in creating those coefficients is causing problems.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by