Problem with integral on WP 34s - Printable Version +- HP Forums ( https://www.hpmuseum.org/forum)+-- Forum: Not HP Calculators ( /forum-7.html)+--- Forum: Not quite HP Calculators - but related ( /forum-8.html)+--- Thread: Problem with integral on WP 34s ( /thread-17448.html)Pages: 1 2 |

Problem with integral on WP 34s - lrdheat - 09-08-2021 01:43 AM
Am I doing something wrong (quite possibly), or am I encountering a bug on the WP 34S? The integral from -2 to 3 of 1/(3ROOT X) should equal ~.739 (My WP 34S comes up with 0). I used the following: LBL ‘F0’ FILL 3ROOT 1/X RTN I tried several other alternative programs, and they all produced “0”. RE: Problem with integral on WP 34s - BINUBALL - 09-08-2021 02:07 AM
What a strange. I type your program 'F0' on emulator and got 0.72406877411. My keystroke is this. Code: `(suppose you entered F0 program)` RE: Problem with integral on WP 34s - lrdheat - 09-08-2021 03:48 AM
That is strange! I tried it on my iPad emulator, and on my DM 42 with the WP 34 loaded into the unit. My iPad emulated is 34S 3.3T 3913 I’m running the program now on my HP 30b that was converted into a WP 34S, and the integral is taking a long time to converge (perhaps 25 minutes into the integration), and it may be converging on the correct answer. The DM 42, and the IPad 34S 3.3T 3913 quickly produce “0”. I will let the HP 30b converted unit continue to run a while longer. After it finishes (or I give up), I will check it’s version of the WP 34S software. RE: Problem with integral on WP 34s - lrdheat - 09-08-2021 04:33 AM
My HP 30b WP 34S is version 3.3 3774. It gave up at the .724+ answer. RE: Problem with integral on WP 34s - lrdheat - 09-08-2021 04:35 AM
Curious as to if my WP 34S DM 42 and iPad versions do in fact, have a bug. RE: Problem with integral on WP 34s - toml_12953 - 09-08-2021 05:50 AM
(09-08-2021 01:43 AM)lrdheat Wrote: Am I doing something wrong (quite possibly), or am I encountering a bug on the WP 34S? Is that 1/(x^(3/2)) ? If so, the answer is 1.387+1.139 i https://www.integral-calculator.com/ RE: Problem with integral on WP 34s - pascal_meheut - 09-08-2021 06:12 AM
(09-08-2021 04:35 AM)lrdheat Wrote: Curious as to if my WP 34S DM 42 and iPad versions do in fact, have a bug. I get 0 on the iPad but the correct value on the OSX emulator. The source code should be the same as far as I know (and I should know as I wrote them) but the firmware version is different. Unfortunately, I do not have the programming environment nor the time to debug it. RE: Problem with integral on WP 34s - BINUBALL - 09-08-2021 07:11 AM
(09-08-2021 03:48 AM)lrdheat Wrote: That is strange! I tried it on my iPad emulator, and on my DM 42 with the WP 34 loaded into the unit. I used Windows emulator. (09-08-2021 05:50 AM)toml_12953 Wrote:(09-08-2021 01:43 AM)lrdheat Wrote: Am I doing something wrong (quite possibly), or am I encountering a bug on the WP 34S? I think it is 1/(x^(1/3)), Wolfram Alpha gives 4.31068-2.06209 i https://www.wolframalpha.com/input/?i2d=true&i=integral+Divide%5B1%2CPower%5Bx%2C%5C%2840%29Divide%5B1%2C3%5D%5C%2841%29%5D%5D+from+-2+to+3 RE: Problem with integral on WP 34s - Albert Chan - 09-08-2021 11:28 AM
(09-08-2021 06:12 AM)pascal_meheut Wrote: I get 0 on the iPad but the correct value on the OSX emulator. The source code should be the same as far as I know (and I should know as I wrote them) but the firmware version is different. There might not be a bug to debug. Most integration routine assumed no singularity within integral limits. (this is especially true for double-exponential integration, with sample points mostly on the edges) Convergence is based on previous estimate, not true result. (if we do know true result, there is no need to integrate ...) If we are lucky, "converged" result is close to true result. Unfortunately, we don't know how good the result really is. If not, routine may give up (thus the 0.0 result) We should break up integral to peices. In this case, surd(x,3) is odd function: ∫(1/surd(x,3), x=-2 .. +3) = ∫(x^(-1/3), x=+2 .. +3) = preval(x^(2/3)/(2/3), 2, 3) ≈ 0.7390 RE: Problem with integral on WP 34s - toml_12953 - 09-08-2021 11:49 AM
(09-08-2021 07:11 AM)BINUBALL Wrote:(09-08-2021 03:48 AM)lrdheat Wrote: That is strange! I tried it on my iPad emulator, and on my DM 42 with the WP 34 loaded into the unit. "3 root" is the cube root but "3root" = x^(3/2) RE: Problem with integral on WP 34s - lrdheat - 09-08-2021 02:03 PM
Doing the integral in parts is certainly a much better solution to a problem such as this! RE: Problem with integral on WP 34s - lrdheat - 09-11-2021 06:14 PM
More poor results, this with an endpoint. While the HP 30b unit converted to a WP 34S does fine, the WP 34S app for iPad produces an infinity error as does the WP 34S on the DM 42. Having the 1/0 occur at an endpoint precludes doing the integral in parts. The integral from 0 to pi for 1/sqrt(1+cos(x)) (radian mode) should be 2*sqrt(2)~=2.8284 The HP 42S does fine as does the Free 42 app on my iPad. The iPad and DM 42 versions of WP 34S should be used with caution for these types of problems. RE: Problem with integral on WP 34s - lrdheat - 09-11-2021 08:28 PM
Thanks to Albert Chan for pointing out my typo. The integral is from 0 to pi of (sin (x))/sqrt (1+cos(x)). RE: Problem with integral on WP 34s - Nigel (UK) - 09-12-2021 04:00 PM
(09-11-2021 06:14 PM)lrdheat Wrote: More poor results, this with an endpoint. While the HP 30b unit converted to a WP 34S does fine, the WP 34S app for iPad produces an infinity error as does the WP 34S on the DM 42. Having the 1/0 occur at an endpoint precludes doing the integral in parts. Try setting Flag D - this allows for infinite or NAN results without halting program execution. Quoting from the integrate.wp34s xrom code file: Quote:// - if the user has set the D flag, many errors when evaluating theOn doing this, I get 2.8284 on my DM42 WP34S for your integral. Nigel (UK) RE: Problem with integral on WP 34s - Nigel (UK) - 09-12-2021 04:16 PM
A little more information: the integration routine was changed to the double exponential method in release 3893. To save people poking about in the code, here are the complete comments from the integration code file: Quote:// Double Exponential Integration for the wp34s calculator Nigel (UK) RE: Problem with integral on WP 34s - lrdheat - 09-12-2021 07:56 PM
Wow! Thanks, Nigel! That worked. RE: Problem with integral on WP 34s - lrdheat - 09-12-2021 08:10 PM
Nigel...is there any downside that I should be aware of with flag D set? RE: Problem with integral on WP 34s - Nigel (UK) - 09-12-2021 08:41 PM
Glad it helped! With flag D set, 1/0 is returned as infinity and the square root of -5 is NaN (when not using CPX). I don't think that this is a problem when working from the keyboard, but it does mean that a program that would be halted by an error will continue to run when Flag D is set. If a program's logic relies on it being halted by an error, this could be a problem. The first integral above \[\int_{-2}^3x^{-1/3}\,{\rm d}x\] still doesn't work properly even with Flag D set. The comments from the integration code state that Quote:the double exponential method relies on the function to beand so, with this integration method, the problem is unavoidable. The comments also suggest that the Romberg method might be better in this respect, but would in general be slower. Do you think it would be helpful to provide the old Romberg code as an alternative for situations like this? Nigel (UK) RE: Problem with integral on WP 34s - lrdheat - 09-12-2021 08:53 PM
I do think that alternate methods would be great to have...unlikely I would imagine on the HP 30b due to limited space, but would be welcome on the DM 42 and iPad versions. How do I find the +Infinity/-infinity choices on the DM 42 version of WP 34S? RE: Problem with integral on WP 34s - Nigel (UK) - 09-12-2021 09:28 PM
I have no control over the iPad version, but I'll look at adding the older Romberg method to the DM42. To enter \(+\infty\) or \(-\infty\) on the DM42, do shift shift 5 to bring up the constants menu. Press up-arrow 3 or 4 times, and you'll find them. Nigel (UK) |