Is there any function other than Fsolve to solve systems of nonlinear equations ????
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to solve the following system of 3 nonlinear equations:
XYZ(1)-A*(B*XYZ(2)^P1-C*XYZ(2)^P2)^(1/2)=0
XYZ(1)*F+G-XYZ(1)*XYZ(3)*H-I*XYZ(3)=0
XYZ(1)+E-D*XYZ(2)*XYZ(3)^(-1/2)=0
Where A,B,C,D,E,F,G,H,I,P1 and P2 are variables and X,Y and Z are the 3 unknowns to find.
I have tried using the function Fsolve with an m-file but the results were not good enough.
Is there any other function to solve this system ?????
3 commentaires
Walter Roberson
le 6 Mai 2012
Do not post duplicate questions: doing so leads to duplicated efforts, and to confusion and resentment in the volunteers who answer questions, and leads to extra work for the editors who have to merge the copies of the questions together.
Réponses (3)
Taniadi
le 3 Mai 2012
I agree with Friedrich, to test, you can see the value of your equations using: [yout, fval ] = fsolve('function',guess). where fval is the value of your function. If it is small enough near zero, fsolve is good.
another way maybe is to write another M-file using another numerical method. I don't know if there is another function in MATLAB for solving system of nonlinear eqs other than fsolve.
2 commentaires
Walter Roberson
le 6 Mai 2012
So add a couple of lines to the Function block to cross-check the accuracy of the result. Display the results to the command window if you need to.
Sargondjani
le 7 Mai 2012
the problem certainly has not converged as y is still jumping up and down, so there is some problem...
for a start, you should supply the Jacobian, because that will help the problem to converge
second: are you sure that there is only one unique solution to the problem??
0 commentaires
Walter Roberson
le 7 Mai 2012
Maple believes there is no solution to those equations. If you could supply specific test values for each of the variables, I could try again.
6 commentaires
Walter Roberson
le 9 Mai 2012
Simulation 1: you run into round-off problems that prevent you from finding an exact solution. To 10 digits, the solution is
X = 35.44161536, Y = 68798.38215, Z = 622.0811574
Simulation 2: you run into much worse round-off problems. To 10 digits the solution is
X = 49.36060688, Y = 1.359808683*10^5, Z = 1182.292856
I think about the most efficient way to handle this is to solve the last two equations for X and Y (yielding X and Y expressed entirely in terms of Z), and substituting those in to the first equation, yielding an expression in Z that must be equal to 0. You can then do a one-dimensional solver. You do need to be careful, though, as the expression goes imaginary below around 570, and again above around 5E8. The upper bound is easy to find, but the lower bound is tricky to establish; there is a first-order lower bound around 270 that is much easier to establish (values below the first-order lower-bound are certain to be imaginary; the actual lower bound depends on the fine balancing of exponentials.)
The expression to solve one-dimensionally in Z comes out as
(-A*(F-Z*H)*(B*(((I-E*H)*Z-G+E*F)*Z^(1/2)/(D*(F-Z*H)))^P1-C*(((I-E*H)*Z-G+E*F)*Z^(1/2)/(D*(F-Z*H)))^P2)^(1/2)-G+I*Z)/(F-Z*H)
Do be careful in the use of "I" as symbolic packages tend to treat "I" as the imaginary constant.
Voir également
Catégories
En savoir plus sur Systems of Nonlinear Equations dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!