Q5.3-15E

Question

In Problems 14–24, you will need a computer and a programmed version of the vectorized classical fourth-order Runge–Kutta algorithm. (At the instructor’s discretion, other algorithms may be used.)†

Using the vectorized Runge–Kutta algorithm, approximate the solution to the initial value problem y''=t2+y2;y(0)=1,y'(0)=0 at  t=1. Starting with h=1, continue halving the step size until two successive approximations of both y1 and y'1 differ by at most 0.1.

Step-by-Step Solution

Verified
Answer

The solution is y1=1.69 and y'1=1.82.

1Transform the equation

Write the equation asy''=t2+y2

 

The equations can be written as:

x1t=ytx2t=y't=x'1


The transformation of the equation is:

x'1(t)=x2(t)x'2(t)=t2+x21


The initial conditions are:

x11=y11=1x21=y'1=0

2Apply Runge –Kutta method

For the solution, apply the Runge-Kutta method in MATLAB, and the solution is y1=1.69 and  y'1=1.82.

3Find that y 1 and y ' ( 1 ) differ by at most 0.01.

Subtracting the values of u1 and v1 then 

y'1-y1=1.82-1.69=0.13

 

Therefore, y1 and y'1 differ by at most 0.1.