Post Reply 
Sharp PC-1500A Compiler
12-02-2024, 08:41 PM
Post: #7
RE: Sharp PC-1500A Compiler
I must admit that I have absolutely no experience with this calculator, but it reminds me how we can use this Python to RPN - source code converter to translate a corresponding Python program:
Code:
def kepler(M):
  I = 0.01671 # Earth's eccentricity
  E = M # initial value
  while True:
    L = (M+I*SIN(E)-E)/(1-I*COS(E))
    E += L
    if ABS(L) > 1E-3:
      continue
    return E

The generated program for the HP-42S can be simplified a bit to:
Code:
00 { 72-Byte Prgm }
01▸LBL "kepler"
02 STO "M"
03 STO "E"
04 0.01671
05 STO "I"
06▸LBL 00
07 RCL "M"
08 RCL "I"
09 RCL "E"
10 SIN
11 ×
12 +
13 RCL "E"
14 -
15 1
16 RCL "I"
17 RCL "E"
18 COS
19 ×
20 -
21 ÷
22 STO+ "E"
23 ABS
24 0.001
25 X<Y?
26 GTO 00
27 RCL "E"
28 END

Example

RAD
0.5
XEQ "kepler"

0.50813

RCL "E"
RCL "I"
RCL "E"
SIN
×
-

0.50000



(11-30-2024 06:31 PM)Josef Wrote:  0 M=E

I could be wrong, but shouldn't that rather be:
Code:
0 E=M
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Sharp PC-1500A Compiler - Josef - 11-21-2024, 06:05 AM
RE: Sharp PC-1500A Compiler - Jeff_Birt - 11-21-2024, 03:34 PM
RE: Sharp PC-1500A Compiler - Josef - 11-22-2024, 05:49 AM
RE: Sharp PC-1500A Compiler - Josef - 11-27-2024, 08:25 PM
RE: Sharp PC-1500A Compiler - Josef - 11-30-2024, 06:31 PM
RE: Sharp PC-1500A Compiler - Josef - 12-03-2024, 07:45 PM
RE: Sharp PC-1500A Compiler - Josef - 12-01-2024, 12:32 PM
RE: Sharp PC-1500A Compiler - Thomas Klemm - 12-02-2024 08:41 PM
RE: Sharp PC-1500A Compiler - toml_12953 - 12-02-2024, 11:49 PM
RE: Sharp PC-1500A Compiler - Josef - 12-02-2024, 10:35 PM
RE: Sharp PC-1500A Compiler - Thomas Klemm - 12-03-2024, 03:09 AM
RE: Sharp PC-1500A Compiler - toml_12953 - 12-03-2024, 03:41 AM
RE: Sharp PC-1500A Compiler - Thomas Klemm - 12-03-2024, 04:55 AM
RE: Sharp PC-1500A Compiler - Josef - 12-03-2024, 08:00 PM
RE: Sharp PC-1500A Compiler - Josef - 12-04-2024, 06:57 AM



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