Example of an Euler - trapezoidal predictor-corrector method.
In this example = ,
First calculate an initial guess value via Euler:
Next, improve the initial guess through iteration of the trapezoidal rule. This iteration process normally converges quickly.
...
This iteration process is repeated until some fixed value n or until the guesses converge to within some error tolerance e :
then use the final guess as the next step:
Note that the overall error is unrelated to convergence in the algorithm but instead to the step size and the core method, which in this example is a trapezoidal, (linear) approximation of the actual function. The step size h ( ) needs to be relatively small in order to get a good approximation. See also stiff equation.