Post Reply 
1-AUG-2019 SolveSys - Equation Library and Nonlinear Systems Solver
02-09-2017, 09:35 PM (This post was last modified: 02-09-2017 09:49 PM by Han.)
Post: #3
RE: SolveSys - Equation Library and Multiple Equations Solver
(02-09-2017 08:42 PM)akmon Wrote:  Hello, downloaded beta version. Thank you for your efforts on try to have a solvesys like HP50, one of the most important programs, I think.

First, a strange issue has happend sometimes: after inserting the equations, I push [Num] then OK, and it does not start to solve but it returns to the equation menu. ¿? I did a warmstart and it didn´t happen again, at the moment.

The system of this thread gives different results from the Wolfram, I get A=1,27E-10 and B=1,088E21. Wolfram: A: -3,675E-10, B: 9,438€-11 Perhaps too low values for iteration accuracy?
http://www.hpmuseum.org/forum/thread-767...t=solvesys

If I recall correctly, that pair of values results in a nearly-singular Jacobian (likely singular due to floating point issues). But getting there was likely due to a few other issues. The SVD program had a few bugs in it (update again, even if you already did so recently). The other issue is due to CAS corruption, for which the current workaround is to use the restart command in the CAS view and rebuild the SVD program by opening and closing its source file.

I can still get both solutions to this system (in the 0.500 version) by setting |x| to 1e-20 and |F| to 1e-10. The |F| value I think should be self-explanatory but the |x| labeling for the other tolerance may be a bit misleading. It is really a measure of the change in the x_i's relative to the norm of the previous solution. So if u want 4 digits of accuracy and your solution is in the order of 1e-10, then you should try setting |x| to 1e-16. May I can change this later on to "number of digits" rather than a "tolerance" value to reflect the true behavior of that value. Also, |F| should be set to be a 1e-10 (or smaller) since 1.27e-10 would be pretty close to the error itself (similar reasoning). When using (1,1) and (1,2) for initial values, I get the two separate solutions.

Lastly, keep in mind that the (now prior) version was just Newton's method and is highly likely to wander off into "la-la" land. In your case, you probably landed in a spot where the Jacobian is nearly singular (or in fact singular but not shown to be so due to typical floating point issues). You can check this by using svd2(ssJ) -- make sure to do this in the CAS view. The "middle" vector lists the singular values. If any of them are close to zero, then the Jacobian is (likely) rank-deficient.

The newer version has backtracking line search.

I still need to tweak the exit conclusions (i.e. how to classify supposed solutions).

I just updated the program; I appreciate your continued efforts to test the solver.

EDIT: I should mention that I am able to get it to run on the real calculator after having tweaked a few spots where iferr blocks were used. It would seem that iferr and return calls are currently misbehaving so that repeated instances would lead to a warmstart. I worked around that issue by modifying the code to not rely on iferr.

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: SolveSys - Equation Library and Multiple Equations Solver - Han - 02-09-2017 09:35 PM
Not able to solve a system - rrpalma - 05-05-2019, 08:10 PM



User(s) browsing this thread: 1 Guest(s)