Question: How to plot approximate solution for the following Runge-Kutta code

Dear all, I have been trying to use Runge-Kutta method to plot an approximate solution with the following code. However, although I can get the numerical approximation the plot would not show.

h := .1;

x[0] := 0;

y[0] := 1;

xf := 3;

n := floor(xf/h)

f:= (x,y)->1/(3 y-x-2)

x := x[0]

y := y[0]

for i to n do

k1 := f(x, y);

k2 := f(x+(1/2)*h, y+(1/2)*h*k1);

k3 := f(x+(1/2)*h, y+(1/2)*h*k2);

k4 := f(x+h, h*k3+y);

k := (k1+2*k2+2*k3+k4)*(1/6);

y := h*k+y;

x := x+h

end do;

y[n]

data := [seq([x[n], y[n]], n = 0 .. 30)];

p[2] := plot(data, style = point, color = blue);

p[3] := plot(data, style = line, color = blue);
display(seq(p[n], n = 2 .. 3));

Please Wait...