Solving system of non-linear equations
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I'm trying to solve system of 12 non-linear equations with 19 unknown code I have written is :
clc
clear all
close all
so1=solve('b1+b2+b3+b4+b5-1','b2*c2+b3*c3+b4*c4+b5*c5-0.5','b2*c2^2+b3*c3^2+b4*c4^2+b5*c5^2-1/3','b3*a32*c2+b4*a42*c2+b4*a43*c3+b5*a52*c2+b5*a53*c3+b5*a54*c4-0.090360516032402','b2*c2^3+b3*c3^3+b4*c4^3+b5*c5^3-1/4','b3*c3*a32*c2+b4*c4*a42*c2+b4*c4*a43*c3+b5*c5*a52*c2+b5*c5*a53*c3+b5*c5*a54*c4-1/8','b3*a32*c2^2+b4*a42*c2^2+b4*a43*c3^2+b5*a52*c2^2+b5*a53*c3^2+b5*a54*c4^2-1/12','b4*a43*a32*c2+b5*a53*a32*c2+b5*a54*a42*c2+b5*a54*a43*c3-0.005314317272449','c2-a21','c3-a31-a32','a41+a42+a43-c4','a51+a52+a53+a54-c5');
But its taking very long time to execute. Is there any alternative way to solve this? Please help me to solve this.
2 Commenti
Torsten
il 4 Nov 2015
You forgot to specify for which 12 out of the 19 unknowns MATLAB should solve.
Best wishes
Torsten.
Risposte (1)
John D'Errico
il 4 Nov 2015
Modificato: John D'Errico
il 4 Nov 2015
Of course it takes along time to solve! Even if the equations were linear, the symbolic solver is not fast, nor can it be so.
But the fact is, you have an underdetermined set of equations. There are INFINiTELY many solutions in general. Assuming that any solution exists at all, there will be a 7 dimensional manifold of solutions, all of which are equally viable. That solution, COULD you compute it, will be messy, HUGE, insanely nasty looking, and pretty much unusable. The solution will reduce, IF it were possible to get, to the roots of a VERY high order polynomial. So no analytical solution can exist at all, since the roots of a general 5th order polynomial (or above) are provably impossible to find analytically.
So, yes, it is taking a long time to solve. I'm not even remotely surprised.
If anyone else comes along and tells you that you can use fsolve (or any other numerical solver) to solve it, they would simply be kidding you (or kidding themselves.) While you MIGHT get a solution, it would be only one numerical solution that satisfies the tolerances of fsolve. The solution arrived at will vary with your starting values. Change a starting value, get a completely different answer. Since there are infinitely many solutions, this is expected.
You need to reformulate your problem. I'm sorry, but you do. There is no mathe-magical trick you can use.
0 Commenti
Vedere anche
Categorie
Scopri di più su Calculus 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!