Unformatted text preview: 3 = hf ( t i-1 + 1 2 h,x i-1 + 1 2 k 2 ) Set k 4 = hf ( t i-1 + h,x i-1 + k 3 ) Set x i = x i + 1 6 ( k 1 + 2 k 2 + 2 k 3 + k 4 ) Set t i = t i-1 + h • Step Four return x. This algorithm returns an array of values, the ith element of the return array is an approximations of x ( t ) at t = a + ih. The following screen shot shows Mathcad code for implementing the algorithm. Again notice the line to line corresponding between the Mathcad and the algorithm....
View Full Document
- Spring '11
- Approximation, The Return, Runge–Kutta methods, 2k2, following simple algorithm