Question: Solving an initial value using the midpoint method error

I need to apply the midpoint method to an initial value problem. Heres my code:

>mp := proc (f, a, b, N)
local x, k1, k2, y, i, h;
y := array(0 .. N); k1 := array(0 .. N); k2 := array(0 .. N); x := array(0 .. N);
h := evalf(b-a)/N;
x[0] := 0; y[0] := .85;

k1[0] := h*f(0, .85);

k2[0] := h*f(0, .85+.5*k1[0]);

from i = 1 to N do

x[i] := x[i-1]+h;

k1[i] := h*f(0, y[i]);

k2[i] := h*f(0, y[i]+.5*k1[i]);
y[i] := y[i-1]+k2[i-1];
print(x[i], y[i]) end do
end proc

>f := (x,y)-> 1.3/(1+y^2);

>mp(f,0,1,10);

But i get an error message saying "Error, (in mp) initial value in for loop must be numeric or character"

Please Wait...