Post Reply 
(41C) Euler-Taylor method (updated)
12-15-2019, 01:33 AM (This post was last modified: 12-15-2019 01:35 AM by Namir.)
Post: #2
RE: (41C) Euler-Taylor method
The next version of the Euler-Taylor program uses the approximation for the second derivative that Albert Chan came up with (click here). Thus we can eliminate LBL C and its code. The program interacts with the user like in the first version:

Code:

01    LBL "EULTLR"
02     LBL A
03    "A/^B?"
04     PROMPT
05     STO 01
06    RDN
07    STO 00
08    "Y/^H?"
09    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 and store nsteps
24    LBL 00
25    XEQ B   # calculate f'(x,y)
26    STO 05 # Calculate D1=f'(x,y)
27    RCL 02
28    STO+ 00 # x = x +h
29    *
30    STO+ 03 # y = y + h*D1
31    XEQ B   # calculate f'(x,y)
32    RCL 05
33    -
34    RCL 02
35    *
36    2
37    /
38    STO+ 03 # y = y + h/2*(f'(x,y)-D1)
39    VIEW 03
40     DSE 04
41    GTO 00
42    CLD
43    RCL 01
44    XEQ E
45    RCL 03  # recall calculated y at x=b
46    RTN
47    LBL B  # calculate f'(x,y) = y * x
48    RCL 03
49    RCL 00
50    *
51    RTN
52    LBL E  # exact f(x,y) = g(x) = exp(0.5*x^2)
53    X^2
54    2
55    /
56    EXP
57    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)