Q16E

Question

Use the fourth-order Runge–Kutta subroutine with = 0.1 to approximate the solution to\({\bf{y' = 3cos(y - 5x),y(0) = 0}}\) , at the points = 0, 0.1, 0.2, . . ., 4.0. Use your answers to make a rough sketch of the solution on [0, 4].

Step-by-Step Solution

Verified
Answer

\({{\rm{x}}_{\rm{n}}}\)

\({{\rm{y}}_{\rm{n}}}\)

0.5

1.177

1.0

0.376

1.5

1.359

2.0

2.667

2.5

2.007

3.0

2.723

3.5

4.112

4

3.721

 

The rough sketch is given below.

1Step 1: Find the values of \({{\bf{k}}_{\bf{i}}}{\bf{.i = 1,2,3,4}}\)

 Using the improved 4th order Runge-Kutta subroutine.

 

Since \({\bf{f(x,y) = 3cos(y - 5x)}}\) and \({\bf{x = }}{{\bf{x}}_{\bf{0}}}{\bf{ = 0,y = }}{{\bf{y}}_{\bf{o}}}{\bf{ = 0}}\) and h = 0.1, M = 40

 

\(\begin{array}{l}{{\bf{k}}_{\bf{1}}}{\bf{ = h}}{\rm{f}}{\bf{(x,y) = (0}}{\bf{.1)3(cosy - 5x)}}\\{{\bf{k}}_{\bf{2}}}{\bf{ = hf}}\left( {{\bf{x + }}\frac{{\bf{h}}}{{\bf{2}}}{\bf{,y + }}\frac{{{{\bf{k}}_{\bf{1}}}}}{{\bf{2}}}} \right){\bf{ = (0}}{\bf{.1)3}}\left( {{\bf{cos}}\left( {{\bf{y + }}\frac{{{{\bf{k}}_{\bf{1}}}}}{{\bf{2}}}} \right){\bf{ - 5(x + 0}}{\bf{.05)}}} \right)\\{{\bf{k}}_{\bf{3}}}{\bf{ = hf}}\left( {{\bf{x + }}\frac{{\bf{h}}}{{\bf{2}}}{\bf{,y + }}\frac{{{{\bf{k}}_{\bf{2}}}}}{{\bf{2}}}} \right){\bf{ = (0}}{\bf{.1)3}}\left( {{\bf{cos}}\left( {{\bf{y + }}\frac{{{{\bf{k}}_{\bf{2}}}}}{{\bf{2}}}} \right){\bf{ - 5(x + 0}}{\bf{.05)}}} \right)\\{{\bf{k}}_{\bf{4}}}{\bf{ = hf}}\left( {{\bf{x + h,y + }}{{\bf{k}}_{\bf{3}}}} \right){\bf{ = (0}}{\bf{.1)3cos(y + }}{{\bf{k}}_{\bf{3}}}{\bf{) - 5(x + 0}}{\bf{.1))}}\\{{\bf{k}}_{\bf{1}}}{\bf{ = h(x,y) = 0}}{\bf{.3}}\\{{\bf{k}}_{\bf{2}}}{\bf{ = hf}}\left( {{\bf{x + }}\frac{{\bf{h}}}{{\bf{2}}}{\bf{,y + }}\frac{{{{\bf{k}}_{\bf{1}}}}}{{\bf{2}}}} \right){\bf{ = 0}}{\bf{.298501}}\\{{\bf{k}}_{\bf{3}}}{\bf{ = hf}}\left( {{\bf{x + }}\frac{{\bf{h}}}{{\bf{2}}}{\bf{,y + }}\frac{{{{\bf{k}}_{\bf{2}}}}}{{\bf{2}}}} \right){\bf{ = 0}}{\bf{.298479}}\\{{\bf{k}}_{\bf{4}}}{\bf{ = hf}}\left( {{\bf{x + h,y + }}{{\bf{k}}_{\bf{3}}}} \right){\bf{ = 0}}{\bf{.293929}}\end{array}\)

2Step 2: Find the values of x and y

\(\begin{array}{c}{\bf{x = 0 + 0}}{\bf{.1 = 0}}{\bf{.1}}\\{\bf{y = 0 + }}\frac{{\bf{1}}}{{\bf{6}}}\left( {{{\bf{k}}_{\bf{1}}}{\bf{ + 2}}{{\bf{k}}_{\bf{2}}}{\bf{ + 2}}{{\bf{k}}_{\bf{3}}}{\bf{ + }}{{\bf{k}}_{\bf{4}}}} \right)\\{\bf{ = 0}}{\bf{.297}}\end{array}\)

 

The solution of the given IVP at x=0.1 is approx. 0.297.

 

3Step 3: Evaluate the other values of x and y

x

y

x

y

x

y                    x                    y

0.2

0.583

1.2

0.576

2.2

2.723            3.2           3.317

0.3

0.841

1.3

0.801

2.3

2.520           3.3           3.609

0.4

1.049

1.4

1.069

2.4

2.228           3.4           3.880

0.5

1.177

1.5

1.359

2.5

2.007           3.5           4.112

0.6

1.180

1.6

1.658

2.6

1.946           3.6           4.278

0.7

1.023

1.7

1.954

2.7

2.028           3.7           4.339

0.8

0.742

1.8

2.233

2.8

2.207           3.8           4.251

0.9

0.486

1.9

2.479

2.9

2.447           3.9           4.009

1

0.376

2

2.667

3

2.723             4             3.721

1.1

0.421

2.1

2.764

3.1

3.017

4Step 4: Plot the Graph


Hence the solution is  

\({{\rm{x}}_{\rm{n}}}\)

\({{\rm{y}}_{\rm{n}}}\)

0.5

1.177

1.0

0.376

1.5

1.359

2.0

2.667

2.5

2.007

3.0

2.723

3.5

4.112

4

3.721