Page 1 of 2

Problem with the solver

Posted: Thu Apr 11, 2019 4:03 pm
by Giuseppe Casale
I'm trying to use the DM42 solver but I always have the same problem.
Even with this simple equation taken from the manual, after inserting A and B, pressing 'C' I always get 0, it works correctly on Free42 but not on DM42.
What am I doing wrong?

Code: Select all

01 LBL "SIMPLE"
02 MVAR "A"
03 MVAR "B"
04 MVAR "C"
05 RCL "A"
06 RCL+ "B"
07 RCL- "C"
08 END

Re: Problem with the solver

Posted: Thu Apr 11, 2019 4:31 pm
by Logan
You've probably double-checked already, but is everything entered correctly? I entered what you had into the DM42 with 15 for A and 5 for B and pressing C resulted in 20 as expected.

Re: Problem with the solver

Posted: Thu Apr 11, 2019 4:49 pm
by Giuseppe Casale
Double and n-checked!
The result is always C=0

Re: Problem with the solver

Posted: Thu Apr 11, 2019 5:13 pm
by Giuseppe Casale
Nothing to do, I've tried again and again but always C = 0!
Maybe I'm doing something wrong, but I don't understand where.

Re: Problem with the solver

Posted: Thu Apr 11, 2019 6:06 pm
by Giuseppe Casale
Well, I loaded some old programs and they also did not work properly.
I don't know what happened so I made a reset and now those programs and the solver works correctly.
I really would like to understand what happened; maybe I made some incorrect operation, but what?

Re: Problem with the solver

Posted: Thu Apr 11, 2019 6:07 pm
by Walter
There is a step missing containig VARMENU, isn't it?

Re: Problem with the solver

Posted: Thu Apr 11, 2019 6:25 pm
by Giuseppe Casale
No, VARMENU is not required if you are writing a program for the solver.

Re: Problem with the solver

Posted: Thu Apr 11, 2019 7:38 pm
by Walter
On my DM42, it works as it should: [f] [SOLVER] SIMPL displays a menu with A, B, C; e.g. 4 [A] 7 [ B ] [C] returns 11.

Re: Problem with the solver

Posted: Thu Apr 11, 2019 8:05 pm
by Giuseppe Casale
Walter wrote:
Thu Apr 11, 2019 7:38 pm
On my DM42, it works as it should: [f] [SOLVER] SIMPL displays a menu with A, B, C; e.g. 4 [A] 7 [ B ] [C] returns 11.
Mine too, after the Reset.

Re: Problem with the solver

Posted: Thu Apr 11, 2019 9:04 pm
by Thomas Okken
Giuseppe Casale wrote:
Thu Apr 11, 2019 6:06 pm
Well, I loaded some old programs and they also did not work properly.
Were those old programs functions for use with SOLVE as well, or did you have trouble running programs in general?
If they were SOLVE programs, were you solving for the same parameter each time?
Giuseppe Casale wrote:
Thu Apr 11, 2019 6:06 pm
I don't know what happened so I made a reset and now those programs and the solver works correctly.
I really would like to understand what happened; maybe I made some incorrect operation, but what?
The failure mode sounds unfamiliar, but the one thing I could imagine happening is pathological guesses, left behind from a previous SOLVE execution, causing the solver to give up immediately. You can make sure that isn't happening by providing two starting guesses; in your example, you could have tried 0 [C] 0 [C] [C]. (The two starting guesses do not have to be different.)