WP-34S Integration Richard Berler Member Posts: 109 Threads: 38 Joined: Dec 2012 03-06-2013, 12:46 PM Just curious (I love the 34S). When integrating a definite integral from 0 to pi the function (3/(2-cos(x))^2 , the 34S takes a long time to converge on ~10.88. On my HP 15C Limited Edition, the same integral produces the correct result almost immediately. f LBL 1 3 ENTER 2 Roll up COS - / 2 Y^x RTN Why is this? By the way, thanks for the answer concerning setting "dx" interval from default value! Walter B Posting Freak Posts: 4,587 Threads: 105 Joined: Jul 2005 03-06-2013, 01:31 PM Quote: When integrating a definite integral from 0 to pi the function (3/(2-cos(x))^2 , the 34S takes a long time to converge on ~10.88. On my HP 15C Limited Edition, the same integral produces the correct result almost immediately. ```f LBL 1 3 ENTER 2 Roll up COS - / 2 Y^x RTN ``` Why is this? First, the formatting is due to the "preformatted" button here ;-) Second, with ALL 00 set, your integral takes some seconds to return 10.8827961854 on my WP 34S v3.2 build 3363. When I replace the last three steps by x^2 RTN, it runs a bit faster. When I replace build 3363 with v2.2 build 2738, it runs significantly faster (<2s). Seems the price for having a lot of free space in flash memory. d:-/ Gerson W. Barbosa Posting Freak Posts: 2,761 Threads: 100 Joined: Jul 2005 03-06-2013, 11:09 PM ```ALL 00 RAD f LBL 01 3 ENTER 2 Roll up COS - / x^2 RTN / 0 pi g | 01 --> 9.19705925621 (after 25 minutes) / ``` V3.2r3371 here. The exact result is 2*pi*sqrt(3) = 10.8827961854. I wonder what I'm doing wrong. Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-06-2013, 11:19 PM Quote: When I replace build 3363 with v2.2 build 2738, it runs significantly faster (<2s). Seems the price for having a lot of free space in flash memory. This is not the reason at all. The algorithms used by the two different integration routines are completely different. Version 2.2 firmware uses a non-adaptive Gauss-Kronrod quadrature. Version 3 uses an adaptive Romberg method. The former makes exactly 21 function evaluations and returns its result. The latter can do hundreds or thousands of function evaluations. For well behaved, relatively smooth functions the Gauss-Kronrod method is better -- it is exact for polynomials of degree 20 or less (forget the precise order). For less well behaved functions, Romberg is better. As usual things are a trade off. The space saving changes essential to version 3 firmware have not created orders of magnitude of performance loss. Sure, they slow things down but not nearly by as much as you see here. - Pauli Edited: 7 Mar 2013, 5:09 a.m. Walter B Posting Freak Posts: 4,587 Threads: 105 Joined: Jul 2005 03-07-2013, 02:32 AM Olá Gerson, my WP 34S v3.2 b3363 takes ~15s for the integral using the program you listed and returns the correct result. The emulator b3371 returns the result you got. This points to a bug introduced recently! We'll take care of it. d:-/ Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-07-2013, 03:47 AM Found the problem and committed the fix. Build will have to wait for Marcus since I can't access the build server at present. In the meantime, begin your routine with FILL and all will be happy again. - Pauli Gerson W. Barbosa Posting Freak Posts: 2,761 Threads: 100 Joined: Jul 2005 03-07-2013, 05:04 AM Thank you, Walter and Paul. I remember the built-in FILL was missing in SSIZE8, but not in SSIZE4 mode, according to a recent discussion. With the workaround I get a result correct to 15 digits in about 10 seconds.Amazing Bug-fixing Department! :-) Gerson. Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-07-2013, 05:05 AM The built in fill went missing for all stack sizes :-( - Pauli Marcus von Cube, Germany Posting Freak Posts: 3,283 Threads: 104 Joined: Jul 2005 03-07-2013, 12:56 PM Built and released... Richard Berler Member Posts: 109 Threads: 38 Joined: Dec 2012 03-07-2013, 02:19 PM Thanks for the "FILL"! Now the integration is fast! Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-07-2013, 02:48 PM I'd be more concerned that the integration is again correct. - Pauli Richard Berler Member Posts: 109 Threads: 38 Joined: Dec 2012 03-07-2013, 03:17 PM Correct and fast! Do any other built in functions require the FILL command? This forum is quite a neat resource! Paul Dale Posting Freak Posts: 3,229 Threads: 42 Joined: Jul 2006 03-07-2013, 03:52 PM Solve, f', f", product and sum will require the workaround. At least until the latest firmware is installed. - Pauli Gerson W. Barbosa Posting Freak Posts: 2,761 Threads: 100 Joined: Jul 2005 03-07-2013, 09:01 PM The emulator says release 3375, yet calculator shows it's still 3371 (using calc_ir_full.bin here). Walter B Posting Freak Posts: 4,587 Threads: 105 Joined: Jul 2005 03-08-2013, 02:29 AM Works now with build 3376. d:-) Walter B Posting Freak Posts: 4,587 Threads: 105 Joined: Jul 2005 03-08-2013, 02:32 AM Said workaround is required no longer - build 3376 works as advertised. d:-) « Next Oldest | Next Newest »

 Possibly Related Threads... Thread Author Replies Views Last Post [WP-34S] Unfortunate key damage with update to V3 :( svisvanatha 5 1,946 12-10-2013, 11:37 PM Last Post: Les Bell WP-34S (Emulator Program Load/Save) Barry Mead 1 1,083 12-09-2013, 05:29 PM Last Post: Marcus von Cube, Germany Integration question and "RPN" mode comment Craig Thomas 16 3,765 12-05-2013, 02:32 AM Last Post: Nick_S DIY HP 30b WP 34s serial flash/programming cable Richard Wahl 2 1,425 12-04-2013, 11:14 AM Last Post: Barry Mead WP 34S/43 ?'s Richard Berler 3 1,349 11-10-2013, 02:27 AM Last Post: Walter B My FrankenCulator (wp-34s) FORTIN Pascal 4 1,425 11-09-2013, 06:18 PM Last Post: FORTIN Pascal WP 34S Owner's Handbook Walter B 5 1,821 11-09-2013, 05:34 PM Last Post: Harald wp 34s overlay and programming. FORTIN Pascal 6 1,965 11-08-2013, 01:28 PM Last Post: Nick_S m.dy in display of WP-34S Harold A Climer 3 1,298 11-05-2013, 11:28 AM Last Post: Andrew Nikitin WP 34s : An old problem coming back Miguel Toro 2 1,157 11-05-2013, 03:00 AM Last Post: Marcus von Cube, Germany

Forum Jump: