Post Reply 
(71B) Euler-Taylor method for the HP-71B
12-13-2019, 04:10 PM (This post was last modified: 12-13-2019 04:11 PM by Namir.)
Post: #6
RE: (71B) Euler-Taylor method for the HP-71B
(12-13-2019 02:12 PM)Albert Chan Wrote:  
(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 ≈ 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*X1*X1)
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

Do I have your permission to update/adapt my HP-71B listing using your approximation for the second derivative? I will give you credit for that update (and also for the update of the HP-41C Listing).

Namir
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (71B) Euler-Taylor method for the HP-71B - Namir - 12-13-2019 04:10 PM



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