The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Solver for the HP-15C
Message #1 Posted by Thomas Klemm on 4 Mar 2012, 9:58 p.m.

There was a recent discussion comparing the HP-35s and the HP-15c: 33s, 35s or 15cLE--which to buy?

Then we were reminded of Valentin's 48-step routine for the HP-35s to find real and/or complex roots: 35s - find roots of 3rd and higher order equations

Only when I asked myself how would I do that for the HP-15C I realized its biggest drawback: there's no easy way to store complex numbers. My first idea was to use matrices but it turned out that it was easier to use plain registers.

The step-size h is stored in register 0, while the name/number of the program is specified in the variable I.

So let's assume we want to solve program B with step-size h = 10-4 and starting guess 2:

EEX 4 CHS
STO 0
RCL MATRIX B
STO I
2 A

Intermediate values of |dz| are displayed:

((  running  ))
0.148589460
((  running  ))
0.002695411
((  running  ))
0.000000017
((  running  ))
0.000000000
((  running  ))
1.854105968

Should that annoy you just remove the PSE-command in line 058.

Kind regards
Thomas


Some definitions:

  • z = x + i y
  • F+ = F(z + h) = F+x + i F+y
  • F-- = F(z - h) = F--x + i F--y
  • F = F(z) = Fx + i Fy

Intermedidate results are kept in these registers:

0: h
1: x
2: y
3: F-x
4: F-y
5: Fx
6: Fy


001 - 42,21,11   LBL A                  026 -   43  36   LASTx                  051 -       10          
002 -    44  1   STO 1                  027 -       30   -                      052 -    45  0   RCL 0   
003 -   42  30   Re<>Im                 028 -        2   2                      053 -       20          
004 -    44  2   STO 2                  029 -       10                         054 - 44,30, 1   STO - 1 
005 - 42,21, 0   LBL 0                  030 -       34   x<>y                   055 -   42  30   Re<>Im  
006 -    45  0   RCL 0                  031 -    45  5   RCL 5                  056 - 44,30, 2   STO - 2 
007 -       16   CHS                    032 -    45  6   RCL 6                  057 -   43  16   ABS     
008 -    32  1   GSB 1                  033 -   42  25   I                      058 -   42  31   PSE     
009 -    44  3   STO 3                  034 -       36   ENTER                  059 -    45  0   RCL 0   
010 -   42  30   Re<>Im                 035 -       40   +                      060 -   43  11   x^2     
011 -    44  4   STO 4                  036 -       30   -                      061 - 43,30, 8   TEST 8  
012 -        0   0                      037 -        1   1                      062 -    22  0   GTO 0   
013 -    32  1   GSB 1                  038 -   43  36   LASTx                  063 -    45  1   RCL 1   
014 -    44  5   STO 5                  039 -   43  33   R-^                    064 -    45  2   RCL 2   
015 -   42  30   Re<>Im                 040 -       10                         065 -   42  25   I       
016 -    44  6   STO 6                  041 -   43  33   R-^                    066 -   43  32   RTN     
017 -    45  0   RCL 0                  042 -   43  36   LASTx                  067 - 42,21, 1   LBL 1   
018 -    32  1   GSB 1                  043 -       10                         068 -    45  1   RCL 1   
019 -       36   ENTER                  044 -       34   x<>y                   069 -    45  2   RCL 2   
020 -       36   ENTER                  045 -       20                         070 -   42  25   I       
021 -    45  3   RCL 3                  046 -   43  36   LASTx                  071 -       40   +       
022 -    45  4   RCL 4                  047 -       33   R-v                    072 -       36   ENTER   
023 -   42  25   I                      048 -       30   -                      073 -       36   ENTER   
024 -       40   +                      049 -       11   SQRT x                 074 -       36   ENTER   
025 -       34   x<>y                   050 -       40   +                      075 -   22  25   GTO I   

These are examples from Valentin's paper "Boldly Going ... Going Back to the Roots":

076 - 42,21,12   LBL B        081 - 42,21,13   LBL C        105 - 42,21,14   LBL D        113 - 42,21,15   LBL E 
077 -       14   y^x          082 -        2   2            106 -   43  11   x^2          114 -        2   2     
078 -   43  26   PI           083 -       36   ENTER        107 -        6   6            115 -       40   +     
079 -       30   -            084 -        3   3            108 -       30   -            116 -       20        
080 -   43  32   RTN          085 -   42  25   I            109 -       20               117 -        1   1     
                              086 -       20               110 -        2   2            118 -        0   0     
                              087 -        1   1            111 -       30   -            119 -       40   +     
                              088 -       36   ENTER        112 -   43  32   RTN          120 -       20        
                              089 -        2   2                                          121 -        2   2     
                              090 -   42  25   I                                          122 -        0   0     
                              091 -       30   -                                          123 -       30   -     
                              092 -       20                                             124 -   43  32   RTN   
                              093 -        3   3     
                              094 -       36   ENTER 
                              095 -        4   4     
                              096 -   42  25   I     
                              097 -       30   -     
                              098 -       20        
                              099 -        6   6     
                              100 -       36   ENTER 
                              101 -        8   8     
                              102 -   42  25   I     
                              103 -       30   -     
                              104 -   43  32   RTN   


For those using nonpareil:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE state SYSTEM "nonpareil.dtd">
<state version="1.00" model="15C" platform="voyager" arch="nut">
 <ui/>
 <chip name="Nut">
  <registers>
   <reg name="a" data="000000fffff000"/>
   <reg name="b" data="000000fffff000"/>
   <reg name="c" data="00000000000eae"/>
   <reg name="m" data="00000000000000"/>
   <reg name="n" data="00000000000000"/>
   <reg name="g" data="04"/>
   <reg name="p" data="c"/>
   <reg name="q" data="4"/>
   <reg name="q_sel" data="0"/>
   <reg name="fo" data="00"/>
   <reg name="s" data="0800"/>
   <reg name="pc" data="0000"/>
   <reg name="stack" index="0" data="006d"/>
   <reg name="stack" index="1" data="0042"/>
   <reg name="stack" index="2" data="0000"/>
   <reg name="stack" index="3" data="0000"/>
   <reg name="decimal" data="0"/>
   <reg name="carry" data="0"/>
   <reg name="awake" data="0"/>
   <reg name="pf_addr" data="00"/>
   <reg name="ram_addr" data="007"/>
   <reg name="active_bank" index="0" data="0"/>
   <reg name="active_bank" index="1" data="0"/>
   <reg name="active_bank" index="2" data="0"/>
   <reg name="active_bank" index="3" data="0"/>
   <reg name="active_bank" index="4" data="0"/>
   <reg name="active_bank" index="5" data="0"/>
   <reg name="active_bank" index="6" data="0"/>
   <reg name="active_bank" index="7" data="0"/>
   <reg name="active_bank" index="8" data="0"/>
   <reg name="active_bank" index="9" data="0"/>
   <reg name="active_bank" index="a" data="0"/>
   <reg name="active_bank" index="b" data="0"/>
   <reg name="active_bank" index="c" data="0"/>
   <reg name="active_bank" index="d" data="0"/>
   <reg name="active_bank" index="e" data="0"/>
   <reg name="active_bank" index="f" data="0"/>
  </registers>
 </chip>
 <chip name="Voyager LCD">
 <registers>
  <reg name="enable" data="1"/>
  <reg name="blink" data="0"/>
 </registers>
 </chip>
 <memory as="ram">
  <loc addr="000" data="00000000000000"/>
  <loc addr="001" data="00000000000000"/>
  <loc addr="002" data="00000000000000"/>
  <loc addr="003" data="00000000000000"/>
  <loc addr="004" data="000000fffff000"/>
  <loc addr="005" data="00000000000008"/>
  <loc addr="006" data="0000000000000c"/>
  <loc addr="007" data="00000000000eae"/>
  <loc addr="008" data="00000000000000"/>
  <loc addr="009" data="2faf8befbe2280"/>
  <loc addr="00a" data="00000000000000"/>
  <loc addr="010" data="00000000000000"/>
  <loc addr="011" data="00000000000000"/>
  <loc addr="012" data="00000000000000"/>
  <loc addr="013" data="00000000000000"/>
  <loc addr="014" data="00000000000000"/>
  <loc addr="015" data="c0d2d2d2d2d2d2"/>
  <loc addr="016" data="000000000007ee"/>
  <loc addr="017" data="00000000000000"/>
  <loc addr="018" data="00000000000000"/>
  <loc addr="019" data="00000000000000"/>
  <loc addr="01a" data="00000000a00000"/>
  <loc addr="0c0" data="00000000000000"/>
  <loc addr="0c1" data="00000000000000"/>
  <loc addr="0c2" data="00000000000000"/>
  <loc addr="0c3" data="00000000000000"/>
  <loc addr="0c4" data="00000000000000"/>
  <loc addr="0c5" data="00000000000000"/>
  <loc addr="0c6" data="00000000000000"/>
  <loc addr="0c7" data="00000000000000"/>
  <loc addr="0c8" data="00000000000000"/>
  <loc addr="0c9" data="00000000000000"/>
  <loc addr="0ca" data="00000000000000"/>
  <loc addr="0cb" data="00000000000000"/>
  <loc addr="0cc" data="00000000000000"/>
  <loc addr="0cd" data="00000000000000"/>
  <loc addr="0ce" data="00000000000000"/>
  <loc addr="0cf" data="00000000000000"/>
  <loc addr="0d0" data="00000000000000"/>
  <loc addr="0d1" data="00000000000000"/>
  <loc addr="0d2" data="00000000000000"/>
  <loc addr="0d3" data="00000000000000"/>
  <loc addr="0d4" data="00000000000000"/>
  <loc addr="0d5" data="00000000000000"/>
  <loc addr="0d6" data="00000000000000"/>
  <loc addr="0d7" data="00000000000000"/>
  <loc addr="0d8" data="00000000000000"/>
  <loc addr="0d9" data="00000000000000"/>
  <loc addr="0da" data="00000000000000"/>
  <loc addr="0db" data="00000000000000"/>
  <loc addr="0dc" data="00000000000000"/>
  <loc addr="0dd" data="00000000000000"/>
  <loc addr="0de" data="00000000000000"/>
  <loc addr="0df" data="00000000000000"/>
  <loc addr="0e0" data="00000000000000"/>
  <loc addr="0e1" data="00000000000000"/>
  <loc addr="0e2" data="00000000000000"/>
  <loc addr="0e3" data="00000000000000"/>
  <loc addr="0e4" data="00000000000000"/>
  <loc addr="0e5" data="00000000000000"/>
  <loc addr="0e6" data="00000000000000"/>
  <loc addr="0e7" data="00000000000000"/>
  <loc addr="0e8" data="00000000000000"/>
  <loc addr="0e9" data="00000000000000"/>
  <loc addr="0ea" data="00000000000000"/>
  <loc addr="0eb" data="00000000000000"/>
  <loc addr="0ec" data="00000000000000"/>
  <loc addr="0ed" data="00000000000000"/>
  <loc addr="0ee" data="b2fbf0f2fcfaf0"/>
  <loc addr="0ef" data="f1fcfaf20eb2fb"/>
  <loc addr="0f0" data="f2fcfbf6ba0db2"/>
  <loc addr="0f1" data="fba4f8c1f6fcfb"/>
  <loc addr="0f2" data="a4f4c1f3fcfba4"/>
  <loc addr="0f3" data="f2c1f1fca4f3c1"/>
  <loc addr="0f4" data="f20cb2fbb6cd0b"/>
  <loc addr="0f5" data="88c1c1c1faa432"/>
  <loc addr="0f6" data="3101b2a4323110"/>
  <loc addr="0f7" data="78ba30dcb3a2df"/>
  <loc addr="0f8" data="dba1dffc30fdfa"/>
  <loc addr="0f9" data="cafbc4b1fcc5fd"/>
  <loc addr="0fa" data="b1b4fdb4b1f1fb"/>
  <loc addr="0fb" data="fac1a43433c5fd"/>
  <loc addr="0fc" data="f2fbb1c5faa434"/>
  <loc addr="0fd" data="33c1c1213046db"/>
  <loc addr="0fe" data="4521f044db4321"/>
  <loc addr="0ff" data="c3300042db410a"/>
 </memory>
</state>


[ Return to Index | Top of Index ]

Go back to the main exhibit hall