Question #76899

Q. Use Runge Kutta Fehlberg method with tolerance TOL=〖10〗^(-4), hmax=0.25, and hmin=0.05 to approximate the solution to the following initial value problem. Compare the result to the actual value.
y^'=1+〖(t-y)〗^2, 2≤t≤3,y(2)=1, actual solution y(t)=t+1⁄((1-t)).

Expert's answer

Answer on Question #76899 – Math – Quantitative Methods

Question

Use Runge Kutta Fehlberg method with tolerance TOL=10\mathrm{TOL} = \llbracket 10\rrbracket ^(-4), hmax=0.25, and hmin=0.05 to approximate the solution to the following initial value problem. Compare the result to the actual value. y=1+(ty)y^{\wedge} = 1 + \llbracket (t - y)\rrbracket ^2, 2≤t≤3,y(2)=1, actual solution y(t)=t+1/((1t))y(t) = t + 1 / ((1 - t)).

Solution

Consider the IVP:


y=1+1(ty)2,y(2)=1,2t3y' = 1 + \frac{1}{(t - y)^2}, \quad y(2) = 1, \quad 2 \leq t \leq 3


we seek:


yn+1=yn+hi=1sbiki+O(hs+1)y_{n+1} = y_n + h \sum_{i=1}^{s} b_i k_i + O(h^{s+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:


k1=hf(tk,yk)k_1 = h \cdot f(t_k, y_k)k2=hf(tk+14h,yk+14k1)k_2 = h \cdot f\left(t_k + \frac{1}{4} h, y_k + \frac{1}{4} k_1\right)k3=hf(tk+38h,yk+332k1+932k2)k_3 = h \cdot f\left(t_k + \frac{3}{8} h, y_k + \frac{3}{32} k_1 + \frac{9}{32} k_2\right)k4=hf(tk+1213h,yk+19322197k172002197k2+72962197k3)k_4 = h \cdot f\left(t_k + \frac{12}{13} h, y_k + \frac{1932}{2197} k_1 - \frac{7200}{2197} k_2 + \frac{7296}{2197} k_3\right)k5=hf(tk+h,yk+439216k18k2+3680513k38454104k4)k_5 = h \cdot f\left(t_k + h, y_k + \frac{439}{216} k_1 - 8 k_2 + \frac{3680}{513} k_3 - \frac{845}{4104} k_4\right)k6=hf(tk+12h,yk827k1+2k235442565k3+18594104k41140k5)k_6 = h \cdot f\left(t_k + \frac{1}{2} h, y_k - \frac{8}{27} k_1 + 2 k_2 - \frac{3544}{2565} k_3 + \frac{1859}{4104} k_4 - \frac{11}{40} k_5\right)


Then we calculate the approximation to the solution with the help of the method of the fourth order:


yk+14=yk+25216k1+14082565k3+21974101k415k5,Error=O(h4)y_{k+1}^4 = y_k + \frac{25}{216} k_1 + \frac{1408}{2565} k_3 + \frac{2197}{4101} k_4 - \frac{1}{5} k_5, \quad Error = O(h^4)


And the approximation to the solution with the help of the method of the 5th order:


yk+15=yk+16135k1+665612825k3+2856156430k4950k5+255k6,Error=O(h5)y_{k+1}^5 = y_k + \frac{16}{135} k_1 + \frac{6656}{12825} k_3 + \frac{28561}{56430} k_4 - \frac{9}{50} k_5 + \frac{2}{55} k_6, \quad Error = O(h^5)


At each step, two different approximations for the solution are made and compared:


εn+1=1hyk+14yk+15,δ<(εεn+1)1/4\varepsilon_{n+1} = \frac{1}{h} \left| y_{k+1}^{4} - y_{k+1}^{5} \right|, \quad \delta < \left( \frac{\varepsilon}{\varepsilon_{n+1}} \right)^{1/4}


The optimal step size is (δh)(\delta \cdot 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 ε\varepsilon- 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 (2).

For IVP (1) the Runge-Kutta-Fehlberg method with step size 0.05h0.250.05 \leq h \leq 0.25 and tolerance ε=104\varepsilon = 10^{-4} gives a result in 9 points:

the graph of the approximate (yi)(y_i) and exact (f(ti))(f(t_i)) solutions:



the difference between the approximate (yi)(y_i) and the exact (f(ti))(f(t_i)) solutions:



step size:



the accuracy obtained in the calculations:



The result of calculations in the form of a table:



When calculating the step size, the method controls the accuracy of the solution within TOL=104TOL = 10^{-4} (errRKF45), as a result, when compared with the analytical solution, the maximum error is 3.6104\sim 3.6 \cdot 10^{-4}

Answer provided by https://www.AssignmentExpert.com

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS