-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error solving nonlinear system of equations #1019
Comments
Not a solution only a comment for Symja syntax usage.
Internally I get division by 0 problems for this expression. |
@iils-jdinkelacker can you list the guess-values that lead to these good results? |
Thanks for the syntax tip. Now I also get a lot of errors liks "Power: Indeterminate expression (-1.7710^-6qw+th^4-tw^4)/(-1.13589*10^-24) encountered.", which I assume are the division by 0 problems. The start values for scipy fsolve are (th = 2400, tw = 2000, t1 = 1400, t2 = 1200, t3 = 1000, tb = 800, tk = 320, qw = 400000, qs = 30000) and get results (2400.000000000453, 2399.9993912855166, 2385.212934513328, 708.4971515532554, 680.6456294208236, 320.04024139792955, 319.99999999963455, 461594.8472077818, 31317.919159643687) |
If I'm doing a "cross-check" with your scipy results by inserting the variable values into the expressions: {th^4 - tw^4 -1.77*^-6*qw,
tw^2 - t1^2 +2454*(tw - t1) - 0.2319 *qw,
t1^4 - t2^4 +4.601*^6*(t1^2 - t2^2) + 1.129*^10*(t1 - t2) - 1.6229*^8 * qw,
t2^2 - t3^2 + 2454 *(t2 -t3) -0.2319 *qw,
tw -t3 -0.0549*qs,
t3^4 - tb^4 -4.141*^5*(qs + qw),
tb - tk -8.164*^-8*(qs +qw)} /. {th->2400.000000000453,tw->2399.9993912855166,t1->2385.212934513328,t2->708.4971515532554,t3->680.6456294208236,tb->320.04024139792955,tk->319.99999999963455,qw->461594.8472077818,qs->31317.919159643687} I get: {33659487.499802814,-1.544947365003024,22487008.039317191,-6.4688450895313243,0.0000000002545837,20731337.636887173,0.00000000004876339} Is the result really sufficient for your purposes? |
No, you are right. It seems, that this solution is pretty far of. The full output of fsolve gives the same picture for the errors [ 6.36292317e+10, 1.26735730e+04, -2.89330158e+11, 1.12445091e+03, -1.42911858e-07, -1.04461625e+10, -2.97211720e-08, -2.73585556e-07, 2.03255468e-07] So there seems to be something wrong with the set up of this system of equation. |
I had one more look at the equation system:
(the last equation the wrong factor 8.164*^-8 --> 8.164*^-6) Yields the following Error: with scipy.optimize least_squares, I get good results with initial values for th, tw, t1, t2, t3, tb, tk, qw, qs result:
with small errors:
Maybe least squares method with initial values would be a good addition to the functionality. |
or |
Solver fails to solve the following nonlinear system of equations (4th order terms)
Error result:
This system of equations might to be solvable with the current alvailable algorithms in Symja. Trust-region algorithms with start values (fsolve) in Matlab and Pyhton SciPy get good approximate results. I could not find any such functions in Symja, but they might be a good addition to the functionality.
The text was updated successfully, but these errors were encountered: