The detectors output current in micro amps. To compensate for detector differences, each detector is multiplied by a correction factor to normalize the channel. The sum is calculated and then averaged. Each quadrant is then divided by the average to normalize it to the average power of each sector. This way a sector that is generating more heat can be determined. The detectors for the quadrants are N41, N42, N43 and N44. and all numbers are to be calculated to 4 decimal places.

I have not written code for a HP calculator in years, even though I'm a longtime HP user. I am rather OCD about code optimization, probably due to the memory constraints of the calculators I initially learned to code on. The program I have written is rather brute force rather than elegant, and just sequentially solves my problem. Maybe one of you will be willing to take a look and see where I can trim code. Most especially I think there might be a way to use increment/decrement with the repetitive variables.

Code: Select all

```
00 { 299-Byte Prgm }
01▸LBL "QPTR"
02 FIX 04
03 INPUT "N41" @ 03-06 Input N41 to N44 Detector Current
04 INPUT "N42"
05 INPUT "N43"
06 INPUT "N44"
07 INPUT "C41" @ 07-10 Input N41 to N44 Correction Factors
08 INPUT "C42"
09 INPUT "C43"
10 INPUT "C44"
11 RCL "N41" @ 11-22 Calculate Current x Correction Factor
12 RCL× "C41"
13 STO "N41C"
14 RCL "N42"
15 RCL× "C42"
16 STO "N42C"
17 RCL "N43"
18 RCL× "C43"
19 STO "N43C"
20 RCL "N44"
21 RCL× "C44"
22 STO "N44C"
23 RCL "N41C" @ 23-30 Sum and Ave Corrected Detector currents
24 RCL+ "N42C"
25 RCL+ "N43C"
26 RCL+ "N44C"
27 STO "Total"
28 4
29 ÷
30 STO "Ave"
31 CLLCD
32 RCL "N41C" @ 32-47 Divide Corrected Detector Current by Ave Det Cur
33 RCL÷ "Ave" @ Round to 4 decimal places due to earlier FIX 4
34 RND
35 STO "Q41"
36 RCL "N42C"
37 RCL÷ "Ave"
38 RND
39 STO "Q42"
40 RCL "N43C"
41 RCL÷ "Ave"
42 RND
43 STO "Q43"
44 RCL "N44C"
45 RCL÷ "Ave"
46 RND
47 STO "Q44"
48 VIEW "N41C" @ 48-67 Display results using GETKEY to pause the
49 GETKEY @ program to allow a chance to record results
50 VIEW "N42C"
51 GETKEY
52 VIEW "N43C"
53 GETKEY
54 VIEW "N44C"
55 GETKEY
56 VIEW "Total"
57 GETKEY
58 VIEW "Ave"
59 GETKEY
60 VIEW "Q41"
61 GETKEY
62 VIEW "Q42"
63 GETKEY
64 VIEW "Q43"
65 GETKEY
66 VIEW "Q44"
67 GETKEY
68 END
```