rkf45a:=proc(neqn,t0,tf,u0,nsteps,u) # # Procedure rkf45a computes an ODE solution by the fixed # step RK Fehlberg 45 method for a series of points along # the solution by repeatedly calling procedure ssrkf45 for # a single RK Fehlberg 45 step. # # Argument list # # neqn number of first order ODEs # # t0 initial value of independent variable # # tf final value of independent variable # # u0 initial condition vector of length neqn # # nsteps number of rkf45 steps # # u ODE solution vector of length neqn after # nsteps steps # # Type variables local e, h, i, j, tm, t: # # Size arrays e:=array(1..neqn): # # Integration step h:=(tf-t0)/nsteps: # # nsteps rkf45 steps tm:=t0: for j from 1 to nsteps do # # rkf45 step read "c:\\odelib\\maple\\ode1x1\\ssrkf45.txt": ssrkf45(neqn,tm,u0,h,u,e): t:=tm+h: # # Reset base point values for next rkf45 step for i from 1 to neqn do u0[i]:=u[i]: end do: tm:=t: # # Next rkf45 step end do: # # End of rkf45a end: