Question: Maple Implementation of Euler's method

my_euler := proc (func_y, x_value, y_value, n, h) 
local point_list, d_x, true_f, true_f_v; point_list := [10^(-n), 0, n]; 
true_f := unapply(func_y, x, y); 
d_x := abs(point_list[2]-point_list[3]); 
while d_x < point_list[1] do 
    true_f_v := true_f(x_value, y_value); 
    y_value := y_value+h*true_f_v; 
    x_value := x_value+h 
end do; 
return y_value 
end proc

I am using Maple to implement Euler's method, it requires 5 parameters:

  • func_y (The general form of ODE)
  • x_value
  • y_value
  • n (The accurate digits, I do not know how to control the accurate digits)
  • h (The step size)

So, I do not how to control accurate digits (4 accurate digits), can you teach me how to finish this part?

Please Wait...