Post Reply 
(41C) Euler-Taylor method (updated)
12-18-2019, 08:12 PM
Post: #3
RE: (41C) Euler-Taylor method
A third version of the program uses approximations for the second and third function derivatives, yielding better accuracy.

Memory Map
==========

Code:
R00 = a,x
R01 = b
R02 = h
R03 = y
R04 = nsteps
R05 = D1
R06 = D2
R07 = D3

LABELS
======

Code:
A - Main routine.
B - calculate first derivative f'(x,y).
E - calculate exact f(x,y) (used for results comparison). If the exact solution is not known, then just have the label just return a value like 0 or insert "N/A" into register X.

Listing
=======

Code:
1    LBL "EULTL3"
2    LBL A
3    A/^B?
4    PROMPT
5    STO 01
6    RDN
7    STO 00
8    Y/^H?
9    PROMPT
10    STO 02
11    RDN
12    StO 03
13    RCL 01
14    RCL 00
15    -
16    RCL 02
17    /
18    0.5
19    +
20    INT  
21    0.001
22    +
23    STO 04  # calclate 
24    SF 00   # set flag 
25    LBL 00
26    XEQ B   # calculate
27    STO 05 # Calculate 
28    RCL 02
29    STO+ 00 # x = x +h
30    *
31    STO+ 03 # y = y + h
32    XEQ B   # calculate
33    RCL 05
34    -
35    RCL 02
36    *
37    2
38    /
39    STO 06
40    STO+ 03 # y = y + D
41    FS?C 00
42    GTO 01
43    RCL 06
44    RCL 07
45    -
46    3
47    /
48    STO+ 03  # y =y + (
49    LBL 01
50    VIEW 03
51    RCL 06
52    STO 07  # D3 = D2
53    DSE 04
54    GTO 00
55    CLD
56    RCL 01
57    XEQ E
58    RCL 03  # recall ca
59    RTN
60    LBL B  # calculate 
61    RCL 03
62    RCL 00
63    *
64    RTN
65    LBL E  # exact f(x,
66    X^2
67    2
68    /
69    EXP
70    RTN
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (41C) Euler-Taylor method - Namir - 12-15-2019, 01:33 AM
RE: (41C) Euler-Taylor method - Namir - 12-18-2019 08:12 PM



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