Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Repeat Problem 18 for the initial-value problem y'=e-y,y(0)=0.The analytic solution is y(x)=ln(x+1). Approximate y(0.5) See Problem 7

(a) Find a formula involving cand h for the local truncation error in the nth step if the RK4 method is used.

(b) Find a bound for the local truncation error in each step if h = 0.1is used to approximate

(c) Approximate y(1.5)using the RK4 method with h = 0 and h = 0.05 See Problem 3. You will need to carry more than six decimal places to see the effect of reducing the step size.

Short Answer

Expert verified

(a)The truncation error in the nth step if the RK4 method is used is y(5)(c)h55!.

(b)The approximatebound for the local truncation error is 2 x 10-6.

(c)The approximate values is for x = 0.5, h = 0.06 is y5 = 0.406007 and for x = 0.5, h = 0.06 is y10= 0.405608

Step by step solution

01

Obtaining the local truncation error

The difference between a truncated value and the actual value is referred to as a truncation error. A truncated quantity is represented by a numeral with a set number of allowed digits, with any extra digits "chopped off" (hence the expression "truncated").

y(5)(c)h55!

02

Obtaining the truncation error if RK4 method is used

We have the initial value problem

y'=f(x,y)=e-y,y(0)=0

With the analytical solution

y(x)=ln(x+1)

and we have to obtain the required points as the following technique :

(a)

We can obtain the local truncation erroe in the nth if the RK4 method from the formula

y(5)(c)h55! (a)

Wherec=valueofx.

After that, we have to find the fifth derivative of the given analytical solution as

y'(x)=1x+1''(x)=-1(x+1)2y'''(x)=2(x+1)3y(4)(x)=-6(x+1)4y(5)(x)=-24(x+1)5

Then replace x by c, then we have

y(5)(c)=-24(c+1)5

After that, substitute with y(5)(c) into (a) then we can have the genera local truncation error as

y(5)(c)h55!=24(c+1)5h55! (b)

Therefore, the truncation error in the nth step if the RK4 method is used is y(5)(c)h55!.

03

Determining the bound for the local truncation error

(b)

Now, with c=x0=1,we can obtain the truncation error in each step if h = 0.1 using equation (b) as

Error24(0+1)5(0.1)5120

=(0.1)5120=2×10-6

Therefore,the approximatebound for the local truncation error is 2 x 10-6.

04

Obtaining the approximate values

(c)

We can obtain the approximate values for ywith one step using the formula

yn+1=yn+h6k1+2k2+2k3+k4

But before that, we have to find the constant k and at and as the following

Since we have x0= 0 and y0 = 0 then we have

localid="1663962607588" k1=fx0,y0=e-y=e0=1

k2=fx0+12h,y0+12hk1=e-y0+12hk1=e-0+12×0.1×1=e-0.05=0.951229k3=fx0+12h,y0+12hk2=e-y0+12hk1=e-0+12×0.1×0.95123=e-0.0475615=0.953552

k4=fx0+h,y0+hk3=e-y0+hk1=e-(0+0.1×0.953552)=e-0.09533552=0.90905

After that when n = 0 since we have y0 = 0 then by substituting with the four constants we can obtain from equation (1) as

y1=y0+h6k1+2k2+2k3+k4=0+0.16[1+2(0.951229)+2(0.953552)+0.90905]=0+0.16×(5.718612)=0.09531

After that, we can obtain the value of y for each value of x with another four constants in the table shown below until x = 0.5 we can have y5= 0.406007

After that, we can obtain the approximate values with two steps using the formula

yn+1=yn+h6k1+2k2+2k3+k4

But before that, we have to find the constant k1, k2 and at and as the following

Since we have x0 = 1 and y0 = 0 then we have

k1=fx0,y0=e-y=e0=1

k2=fx0+12h,y0+12hk1=e-y0+12hk1=e-0+12×0.05×1=e-0.025=0.975310

k4=fx0+h,y0+hk3=2x0+h-3y0+hk1+1=[2(1+0.05)-3(5+0.05×(-11.12125))+1]=2.1-13.3318125+1=-10.2318125

After that when n = 0 since we have y0 = 5 then by substituting with the four constants we can obtain y1 from equation (1) as

y1=y0+h6k1+2k2+2k3+k4=0+0.056[1+2(0.975310)+2(0.975912)+0.952375]=0+0.056×(5.85482)=0.04879

After that, we can obtain the value of y for each value of x with another four constants in the table shown below until x = 0.5 we can have y = 0.405608

Therefore the approximate values is for x = 0.5, h = 0.06 is y4= 0.406007 and for x = 0.5, h = 0.06 is y10= 0.405608

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free