@Tamour_Zubair The formal parameters used in a procedure cannot be changed inside a procedure:
Let us take a very simple example:
p:=proc(h) h:=h/2 end proc;
The formal parameter in the procedure p is h. When you apply p to 8 as in p(8), the first that happens is that h is replaced all over the body of the procedure by the number 8. So you have the nonsens assignment 8:=4.
Thus the error message that fortunately reveals the error.
The solution could be this revised version:
p:=proc(h1) local h;
p(8); # 4
This you can do in RKF45 where the same happens.
RKF45 := proc(f, y0, t0, tn, h1) local k1, k2, k3, k4, k5, k6, y, t, Ynext, h_new, tol, ttt1,h;
##The rest unchanged
You now have a new problem, however. The computation appears to take forever.
Who wrote the code?