Post Reply 
HP42s first major program (Double Integral) Best way to approach?
05-28-2020, 03:14 PM (This post was last modified: 05-28-2020 03:31 PM by DM48.)
Post: #25
RE: HP42s first major program (Double Integral) Best way to approach?
(05-28-2020 07:28 AM)Werner Wrote:  Or you could use this, and use it interactively:

Code:
00 { 98-Byte Prgm }
01▸LBL "BORE"
02 MVAR "A"
03 MVAR "B"
04 MVAR "C"
05 1ᴇ-5
06 STO "ACC"
07 CLX
08 STO "LLIM"
09 PGMINT "FX"
10▸LBL 10
11 VARMENU "BORE"
12 STOP
13 RCL "C"
14 STO "ULIM"
15 INTEG "X"
16 4
17 ×
18 GTO 10
19▸LBL "FX"
20 RCL "B"
21 XEQ 01
22 RCL "A"
23 XEQ 01
24 -
25 RCL "C"
26 XEQ 01
27 ×
28 RTN
29▸LBL 01
30 X↑2
31 RCL "X"
32 X↑2
33 -
34 SQRT
35 END

Cheers, Werner

I am going to ask some really basic and dumb questions about the above code.

Lines 00 - 08 I understand.

Line 09 This calls which program to integrate from within the program? Integrate "FX" which will be between lines 19 - 28?

Lines 10 - 12 This brings up the VARMENU that populates the softmenu with MVAR data and stops (pauses) the program. This allows me to enter the data (be interactive).

Lines 13 - 14 puts C in the X register and stores it to the ULIM (upper limit) and leaves C in the x register.

Line 15 tells what variable to integrate with respect to. X in this case.

How am I doing so far?

A few notes. a, b, and c are radii. On my 48G program, I would enter the diameters, 48, 58 and 24. The first thing the program does is half each one of them and stores them in a local variable It was because my integration was a quarter rotation.

I bring this up because of Lines 16 and 17.

Hear you multiply the ULIM or C by 4. Why? I feel this is related to my explanation above and the fact I am multiplying the final answer by 4.

I'll stop here.

HP48GX, HP42s and DM42.
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? - DM48 - 05-28-2020 03:14 PM



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