_________________Problem Introduction Theory Code Results Discussion_______________
Solve the following ODE using the Heun's method for
Modify the code , euler.f ,for the application of the Heun's method.
Compare the numerical solutions with different step sizes, plot the relative errror distributions.
Compare the numerical solutions with increasing number of predictor-corrector steps, plot the relative error distributions.
Compare the solution for a given step size with that of Euler's method , plot the relative error distribution.
Discuss the results.
In this study Heun's method is used for the existing initial value problem to solve numerically. Heun's methodis a multi-step
numerical method with additonal predictor an corrector steps to euler solution. Heun's solution gives much better predictions than euler solutions as it is shown by
nature of this problem also.For numerical calculations fortram program is used.
The basic of the heun's method is that to prevent the main source of error in Euler's method which is the innitial slope is assumed
to apply accross the entire interval. Heuns method assumes the slope as the average of slopes at the beginning and the end of the interval. Improved Heun's
method is a more correct method which has predictor and corrector steps. Operational steps are as fallows:
After the the application of euler method,which is just calculation of slope at first point and predicting the y value at second x value.
As we calculated second y we can calculate slope also.After that taking averages of two slopes and with that calculating second poins y again is the basis of
heun.After this last step (corrector) we can return to predictor step and make calculations again. This will gives a better prediction which is close to higher order
predictions.
In the beginning of this study it is seen that stepsizes greater than 0.5 do not provide the required solution .As t increases v goes to minus or plus infinity.This is caused by the nture of ode function. When a stepsize is great it is difficult to capture required slope, especially for functions which present a rapid exponential change in slope.
In Heuns method increasing corrector-predictor steps do a considerable change in the solution while incresing it further for example more than 12 cycles do not make any change after all and start to oscillate around the exact solution. This is caused by aproaching the real value very much. So in this small interval sthe slope intends to approach to the point but not with that of a precision. Therefore a point after or before the exact point is shooted an this continiues like this.For better error distributions Heun's Method with stepsize 0.01 and C=15 is used because even decreasing the stepsize or increasing corrector-predictor steps do not any change in the solution whose diffrantiation can be sensed even after 7th-8th decimal after the point.
Error distribution have sharp changes: To compare great stepsize solutions with small stepsize solutions there is nothing to do to take corresponding datas of smaller stepsizes.Which is exactly caused by few data points greater stepsize solutions have.But this is not a problem when comparing equal or near stepsizes.
Eulers method cannot match with heuns method. In big stepsizes the differnce can be seen. But in stepsize 0.01 it can be seen that solution approaches to the real. But what if the slope field changed drastically after around the exact solution represented by the route pointed with the innitial condition? These slope fields can be obtained easilly. Then the solution will not present the real. If some super-precision eq.(200-300 decimals after the point) computers are used and if it is fast enough too than there is no need to have other methods than the euler method because by means of very very small stepsizes the exact solution may be obtained. Otherwise we have to use more precise methods like Heun or rk4 because of the computers which have decimal limitation and calculation limitation.