Post Reply 
HP42s first major program (Double Integral) Best way to approach?
06-06-2020, 08:33 PM (This post was last modified: 06-08-2020 05:41 PM by Albert Chan.)
Post: #54
RE: HP42s first major program (Double Integral) Best way to approach?
(06-02-2020 08:31 AM)Werner Wrote:  Question: wouldn't the formula need to be

bore hole volume = hv(b,c) - hv(max(a,c),min(a,c))

so that it would work for a<c as well?

Amazingly, the answer is NO !

Example: a, b, c = 48, 58, 68

The drill bit is bigger than the pipe, and will cut it off.

48 Enter 58 Enter 68 XEQ "BORE"

→ HV(c,b) = 161316.6882015429652660165715495419
→ HV(c,a) = 114811.9333705716751263443462068749
Difference =   46504.754830971290139672225342667

My latest code update should handle complex numbers.
Now, remove the HV arguments sorting steps 14, 15, and redo above example

→ HV(c,b) = 161316.688201542965266016571549542 + 4944.10953174134265265013475228068i
→ HV(c,a) = 114811.9333705716751263443462068748 + 18153.27669892468194546755520844514i
Difference =   46504.7548309712901396722253426672 - 13209.16716718333929281742045616446i

The real part returns the same volume !
Bonus: imaginery part warned the user that pipe is cut off Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP42s first major program (Double Integral) Best way to approach? - Albert Chan - 06-06-2020 08:33 PM



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