Extremum and second derivative
Posted: Fri Sep 07, 2018 10:23 pm
Hello,
Since I wanted to experiment a way of producing d/dX using the complex variable method, I implement one of Thomas Klemm's post on my hp42s. Even if the structure of my program is quite messy, it gives me d/dX, the extremum and the sign of the second derivative. The main issue here is when I try to execute the same program on my DM42, it doesn't work as expected.
For instance, with a very simple equation like f(x)=2x^2-4, my hp42s gives me an extremum at (0,-4), an F(X)'' of 4 (a minimum) with an initial guess of any number. When I run the same data on the dm42 and Free42, with an initial guess of 1, I get an extremum at (0.9899,-4) and a f(x)'' of -39 196 080 396 (a maximum) witch is obviously false. The only way to get the correct minimum is to provide an initial guess of 0 or very close to 0, like 1E-6.
I know that there's a lot to do to improve my program, but it seems to be accurate on the hp42s.
What should be done to make it work on the DM42 ? I must be missing something.
Here attached is my program. Just enter the equation in EQ and execute dF.
Thanks for your help.
Since I wanted to experiment a way of producing d/dX using the complex variable method, I implement one of Thomas Klemm's post on my hp42s. Even if the structure of my program is quite messy, it gives me d/dX, the extremum and the sign of the second derivative. The main issue here is when I try to execute the same program on my DM42, it doesn't work as expected.
For instance, with a very simple equation like f(x)=2x^2-4, my hp42s gives me an extremum at (0,-4), an F(X)'' of 4 (a minimum) with an initial guess of any number. When I run the same data on the dm42 and Free42, with an initial guess of 1, I get an extremum at (0.9899,-4) and a f(x)'' of -39 196 080 396 (a maximum) witch is obviously false. The only way to get the correct minimum is to provide an initial guess of 0 or very close to 0, like 1E-6.
I know that there's a lot to do to improve my program, but it seems to be accurate on the hp42s.
What should be done to make it work on the DM42 ? I must be missing something.
Here attached is my program. Just enter the equation in EQ and execute dF.
Thanks for your help.