Post Reply 
Solve with integrating an implicit function
07-20-2014, 02:02 PM
Post: #20
RE: Solve with integrating an implicit function
(06-20-2014 02:40 PM)Helge Gabert Wrote:  I recently came, by chance, across this interesting post from one of the hpmuseum archives, originally posted by Valentin Albillo

**********************************************

Test 7 - Solving a definite integral of an implicit function:
Find X in [0,1] such that

/X
|
| y(x).dx = 1/3
|
/0
where y(x) is an ultra-radical function (a member of the family of elliptic functions) implicitly defined by:
5
y + y = x
using precisions of 1E-3 and 1E-6 for the integral.

I took the liberty to implement it on a WP 34S. Since version 3.0 solve and integrate can be freely nested. The solution is relatively straight forward:
Code:


; y(x) using solver for label 00
LBL A
STO 00
# 000
# 001
SLV 00
RTN

; y^5 + y = x
LBL 00


INC X
×
RCL 0
-
RTN

; Integral - 1/3
LBL B
PSE 0
# 000
RCL Y
⎰ A
# 003
1/x
-
RTN

# Solve label B with timing
LBL C
TICKS
STO 01
# 000
# 001
SLV B
TICKS
RCL- 01
END

In FIX 03 mode, the result is 0.8540848... after 16.3 seconds.
In FIX 06 mode, the result is 0.8541387519... after 138.5 seconds.

The battery symbol flashes indicating that the button cells aren't fresh, probably degrading performance. It's still not bad. Interestingly, the time in FIX 06 mode is roughly ten times the time in FIX 03 mode. On the 71B higher accuracy just doubles the execution time. I guess this has to do with different integration and solving algorithms or at least a different handling of the requested accuracy.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Solve with integrating an implicit function - Marcus von Cube - 07-20-2014 02:02 PM



User(s) browsing this thread: 1 Guest(s)