(71B) Euler-Taylor method for the HP-71B
12-13-2019, 02:12 PM (This post was last modified: 12-14-2019 07:11 PM by Albert Chan.)
Post: #4
 Albert Chan Senior Member Posts: 1,839 Joined: Jul 2018
RE: (71B) Euler-Taylor method for the HP-71B
(12-11-2019 10:07 PM)Namir Wrote:  3) It would be nice if someone can numerically approximate the d2y/dx2 for dy/dx = f(x,y). Any idea?

y'' ≈ Δy' / Δx = Δy' / h
Δy' ≈ y'(x+h, y + h y'(x,y)) - y'(x,y)

→ y + h y' + ½ h² y'' ≈ y + h y' + ½ h Δy'

10 DEF FND(X,Y)=X*Y
20 X=0 @ Y=1 @ X1=1 @ H=.01
30 N=INT((X1-X)/H+.5)
40 FOR I=1 TO N
50 D1=FND(X,Y)
60 X=X+H @ Y=Y+H*D1
70 Y=Y+H/2*(FND(X,Y)-D1)
80 NEXT I
90 Y1=EXP(.5*X*X)
100 DISP "y =";Y
110 DISP "exact=";Y1
120 DISP "%err =";100*(Y-Y1)/Y1

>RUN
y ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿= 1.64871423741
exact = 1.6487212707
%err =-4.26590602365E-4

Edit:To compare apples to apples, I removed the assumption final X=X1
So, both exact and estimate uses final X as end-point.

line 90: Y1=EXP(.5*X1*X1) changed to Y1=EXP(.5*X*X)
 « Next Oldest | Next Newest »

 Messages In This Thread (71B) Euler-Taylor method for the HP-71B - Namir - 12-07-2019, 04:36 PM RE: (71B) Euler-Taylor method for the HP-71B - Csaba Tizedes - 12-10-2019, 06:02 PM RE: (71B) Euler-Taylor method for the HP-71B - Namir - 12-11-2019, 10:07 PM RE: (71B) Euler-Taylor method for the HP-71B - Albert Chan - 12-13-2019 02:12 PM RE: (71B) Euler-Taylor method for the HP-71B - Namir - 12-13-2019, 04:10 PM RE: (71B) Euler-Taylor method for the HP-71B - Albert Chan - 12-13-2019, 04:43 PM RE: (71B) Euler-Taylor method for the HP-71B - Csaba Tizedes - 12-14-2019, 08:44 AM RE: (71B) Euler-Taylor method for the HP-71B - Namir - 12-15-2019, 12:23 AM RE: (71B) Euler-Taylor method for the HP-71B - Csaba Tizedes - 12-15-2019, 08:25 AM RE: (71B) Euler-Taylor method for the HP-71B - Albert Chan - 12-15-2019, 08:14 PM RE: (71B) Euler-Taylor method for the HP-71B - Namir - 12-13-2019, 04:07 PM RE: (71B) Euler-Taylor method for the HP-71B - Namir - 12-13-2019, 09:16 PM RE: (71B) Euler-Taylor method for the HP-71B - Namir - 12-14-2019, 03:33 AM RE: (71B) Euler-Taylor method for the HP-71B - Namir - 12-16-2019, 11:23 PM

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