HP Forums
Solve App and ABS() and IP() - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Solve App and ABS() and IP() (/thread-4975.html)



Solve App and ABS() and IP() - cclinus - 10-20-2015 12:53 PM

Hello,

I have two equations.
E1: S=(IP(X/L)*IP(Y/M)+IP(X/M)*IP(Y/L)+ABS(IP(X/L)*IP(Y/M)-IP(X/M)*IP(Y/L)))*0.5

E2:C=IP(X/L)*IP(Y/(2*M-2) )+IP(X/(2*M-2))*IP(Y/L)+ABS(IP(X/L)*IP(Y/(2*M-2))-IP(X/(2*M-2))*IP(Y/L))

When I solve them one by one, the answer is correct:
[attachment=2679]
[attachment=2680]

But, if I solve them at the same time, the answer of E2 is not correct.
[attachment=2681]

Is it a bug?
[attachment=2684]
21-10-2015 attachment updated

Updated on 22-10-2015
I modify the equations to as follows. They have the same problem.
E1:C=IP(X/(2*M-2))*IP(Y/L)*2
E2:B=A

If solve E1 and E2 at the same time, the answer or E1 is not correct.


RE: Solve App and ABS() and IP() - roadrunner - 10-24-2015 11:04 AM

Replace every instance of IP() with hIP() where hIP() is defined:

Code:
EXPORT hIP(x)
BEGIN
 return IP(x);
END;

You will then get the correct answer. I believe your problem is because sometimes the calculator is deciding to use CAS to calculate the integer part. The program forces the calculator to use HOME for that calculation.

That should work in your other post with a similar issue but I haven't tried it.

-road


RE: Solve App and ABS() and IP() - cclinus - 10-24-2015 03:28 PM

Hi,

It works, amazing.

Thank you very much!


RE: Solve App and ABS() and IP() - cyrille de brébisson - 10-26-2015 06:41 AM

Hello,

In Solve app,
When solving a single equation, Prime uses a numerical Zero finder (inherited from the HP48 and previous calculators).
When solving multiple equations, it uses the CAS.

This has 2 side effects:
1) the CAS is not great at dealing with discontinuities in solving (Discontinuities are very hard!)
2) Cas version of the functions are used, nor numerical ones. As a general rules, this is not a problem as they yield identical results. But this is only a general rules as some edge cases for lesser used function might differ.

Cyrille