Q. How to vary size of h in Runge Kutta Fehlberg Method?
1
Expert's answer
2018-05-02T08:31:08-0400
Answer on Question #76733 – Math – Quantitative Methods
Question
How to vary size of h in Runge Kutta Fehlberg Method?
Solution
To approximate the solution to the 1st order IVP:
y′=f(x,y),y(x0)=y0
we seek:
yn+1=yn+hi=1∑sbiki+O(hs+1)
The Runge-Kutta-Fehlberg method is a one-step method with the approximations calculated using the Runge-Kutta method of order 4 and 5. For this method each step requires the use of the following six values:
At each step, two different approximations for the solution are made and compared (Question #76732 - Math - Quantitative Methods):
εn+1=h1∣∣yk+14−yk+15∣∣,δ<(εn+1ε)1/4
The optimal step size is (δ⋅h). The Runge-Kutta-Felberg method consists in the fact that at each step of the method the accuracy of the function is determined by the difference in values between the results of the methods RK-4 and RK-5. If they differ by no more than ε- the required accuracy, then the value is considered an approximate value of the function at the point at the considered step. Otherwise, in the considered step, the new step value and the new value of the function are recomputed with the subsequent error estimate (1).
Let's consider stepping on the example (Question #76730 - Math – Quantitative Methods). In order for inequality (1) to be satisfied, it is necessary to multiply the optimal step by the number α∈(0,1). When calculating a new step, use formula:
δ=(2⋅εn+1ε)1/4≅0.84⋅(εn+1ε)41(2)
In addition, the solution can impose restrictions on the range of step change to obtain the required number of values of the function at a given interval.
If the two answers are in close agreement (εn+1≤ε), then εn+1 is the error of a method that is 5-th order accurate, then if we replace h by δ⋅h, the error is multiplied by δ5. To calculate the new step and reduce the calculation time, it is used:
The solution by the classical method (2) requires 90000 steps:
fT(t) := 35 - 30·e-0.3·t
Z:= Runge45(y0,D,Hmin,Hmax)
i:=0… rows(Z)-1 timei :=Zi,0 T= fT(timei)
rows(Z)=9×104
step i:=Zi,2 AT i:=Zi,1 errRKF45 i:=Zi,3 calcCNT i:=Zi,4
∣T−AT∣=1.02013767067
iC:=∑icalcCNTi=9×104
if we analyze the inequality (εn+1≤ε) , then a solution with required accuracy will be obtained at 1528 points with the calculation of the coefficients 3781 times:
Comments