MAT2680 Differential Equations, FA2013

You must be logged in to reply to this topic.

  • code for improved euler's method in maple
  • #13606

    Keven Deng
    Participant

    improved euler’s method

    f:= (t,y)->equation entered;
    t0:=initial t:
    y0:=initial y:
    n:=number of terms you want;
    h:=step size;
    t:=t0:
    y:=y0:
    for i from 1 to n do
    k1:=f(t,y):
    k2:=f(t+h,y+h*k1):
    y:=y+h*k:
    t:=t+h:
    print(t,y);
    od:

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.