Math 2280-2, Project #1, Problem #6 This problem shows that even an accurate numerical method like Runge-Kutta 4, is susceptible to problems that are unstable. x0:=0.; xn:=4.; # first and last points in the interval y0:=1; # initial condition n:=80; # number of steps h:=(xn-x0)/n; # step size JCIiIUYj JCIiJSIiIQ== IiIi IiMhKQ== JCIrKysrK10hIzY= x:=x0; y:=y0; f:=(x,y)->5*y - 6*exp(-x); # slope function (rhs in DE dy/dx = f(x,y)) printf("%15s, %15s, %15s\134n","x_i","y_i","y(x_i)"); for i from 1 to n do k1:= f(x,y): # left hand slope k2:= f(x+h/2,y+h*k1/2): # midpoint slope: first approx. k3:= f(x+h/2,y+h*k2/2): # midpoint slope: second approx. k4:= f(x+h,y+h*k3): # right hand slope approx. k:=(k1+2*k2+2*k3+k4)/6: # Simpson's integration rule y:= y + h*k: # RK4 update x:= x+h: # increase x if frac(i/8)=0 then printf("%15.2f, %15.10f, %15.10f\134n",x,y,exp(-x)); end if; od: # end for i loop JCIiIUYj IiIi Zio2JEkieEc2IkkieUdGJUYlNiRJKW9wZXJhdG9yR0YlSSZhcnJvd0dGJUYlLCY5JSIiJi1JJGV4cEc2JCUqcHJvdGVjdGVkR0koX3N5c2xpYkdGJTYjLCQ5JCEiIiEiJ0YlRiVGJQ== x_i, y_i, y(x_i) 0.40, 0.6703113029, 0.6703200460 0.80, 0.4492585034, 0.4493289641 1.20, 0.3006696723, 0.3011942119 1.60, 0.1980182369, 0.2018965180 2.00, 0.1066781969, 0.1353352832 2.40, -0.1210208487, 0.0907179533 2.80, -1.5036578640, 0.0608100626 3.20, -11.5185681600, 0.0407622040 3.60, -85.3806995000, 0.0273237224 4.00, -631.0329796000, 0.0183156389