Peculiar Behaviour of solver on DM42

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
Mrspock
Posts: 4
Joined: Mon Mar 30, 2020 7:03 am

Peculiar Behaviour of solver on DM42

Post by Mrspock »

When trying to solve the equation ln(abs(cos(x)))=-2 suddenly the solver starts to produce “Not a number”.
Executing exactly the same programme with the solver on my old HP42s produced (one of the many) solutions after a few seconds.

Here are the keystokes of the program “FX”

LBL “FX”
MVAR “X”
MVAR “Y”
RCL “X”
COS
ABS
LN
RCL “Y”
-
.END.

Y contains -2
I solve for X

Where did I make a mistake ? Why does the calculator not find a solution but sticks with "Not a number"....
and does not get out of a seemingly endless loop ...?
How to avoid it ?

Any hint is welcome....
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: Peculiar Behaviour of solver on DM42

Post by Walter »

What are the start values you provide in the stack registers X and Y when you call the solver?

And, IIRC, the formula to solve should read f(x)=0. I.e. in your case ln(abs(cos(x)))+2=0. So your program shold look slightly different.
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
whuyse
Posts: 198
Joined: Thu Dec 21, 2017 1:23 pm

Re: Peculiar Behaviour of solver on DM42

Post by whuyse »

The program is correct, Walter.
But I can't reproduce it - we have to know the guess(es) introduced for X?
Also, what's the version of the DM42? (SETUP-About)
Cheers, Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L
User avatar
PierreMengisen
Posts: 305
Joined: Wed Nov 29, 2017 1:38 pm
Location: Neuchâtel CH

Re: Peculiar Behaviour of solver on DM42

Post by PierreMengisen »

Mrspock wrote:
Mon Mar 30, 2020 10:28 am
Why does the calculator not find a solution but sticks with "Not a number"....
really with "Not a number" or with "Invalid Data"?
What is the angle Mode : DEG, RAD or GRAD?
Perhaps is the calculator trying LN of Zero?
:shock:
Pierre
[TI59 with PC100C; TI-84 Plus CE-T; HP41CV with HP IL loop & 2*82161A DCD & 82162 TP; HP15C; HP28S; DM41; DM41L; DM42; DM41X]
Mrspock
Posts: 4
Joined: Mon Mar 30, 2020 7:03 am

Re: Peculiar Behaviour of solver on DM42

Post by Mrspock »

Dear all,

My calculator had the firmware DMCP-3.14 / DM42-3.14 with Free42 2.2

Today I loaded the latest firmware DMCP 3.18t01 with the Free42 version 2.5.16, suggested by Michael.

The problem is gone, and a correct solution appears nearly instantly !

Thanks to the developers that had apparantly already detected the problem.
Post Reply