PS 6

  1. The Euler Method is a straighforward though rather inaccurate approach to integrating differential equations. For the equation y_dot=f(y,t) it starts at some initial value y(a)=y_a and update y so that y(t+delta_t)=y(t)+delta_t * f(y(t),t). Write a programme to do Euler integration for the differential equation y_dot=5-y with y(0)=0.
  2. Along with the value of y in the above programme, print out the real solution, which is y=5-5e^{-t}.
  3. Write a programme that calculates pi using the power series approximation pi^2/6=sum_{k=1}^infty (1/k^2).