Problem 3 25 pts Solve the following differential equation u

Problem 3 (25 pts.) Solve the following differential equation using Euler\'s method over the interval from x-otox-1 with a step size h 0.5 and h 0.25. Consider and initial value of y 1 atx o Also, calculate the absolute relative error of your approximations only at x-1, for each time step considering that the analytical solution is obtained employing the following equation 1.63733 General form of Euler\'s Method: New value old value slope x step size ton 0.5 632 3 O + 1 51 r)07322243

Solution

Given, x0 = 0 and y0 = 1

and let f(x,y) = slope = y\' = yx2 - y

For Step Size (h) of 0.5

f0 = f(0,1) = 1 (0)2 - 1 = -1

y1 = y0 + h * f0 = 1 + 0.5 (-1) = 0.5

and x1 = x0 + h = 0.5

Now f1 = f(0.5, 0.5) = 0.5 (0.5)2 - 0.5 = -0.375

y2 = y1 + h * f1 = 0.5 + 0.5 (-0.375) = 0.3125

and x2 = x1 + h = 1

Thus for x2 = 1, y2 = 0.3125

Also, from given analytical solution, y(1) = e(1/3 - 1) = 0.513417119

Absolute error = |0.513417119 - 0.3125| = 0.200917119

For Step Size (h) of 0.25

f0 = f(0,1) = 1 (0)2 - 1 = -1

y1 = y0 + h * f0 = 1 + 0.25 (-1) = 0.75

and x1 = x0 + h = 0.25

Now f1 = f(0.25, 0.75) = 0.75 (0.25)2 - 0.75 = -0.70313

y2 = y1 + h * f1 = 0.75 + 0.25 (-0.70313) = 0.574219

and x2 = x1 + h = 0.5

Now f2 = f(0.5, 0.574219) = -0.43066

y3 = y2 + h * f2 = 0.574219 + 0.25 (-0.43066) = 0.466553

and x3 = x2 + h = 0.75

Now f3 = f(0.75, 0.466553) = -0.20412

y4 = y3 + h * f3 = 0.466553 + 0.25 (-0.20412) = 0.415524

and x4 = x3 + h = 1

Thus for x2 = 1, y2 = 0.415524

Also, from given analytical solution, y(1) = e(1/3 - 1) = 0.513417119

Absolute error = |0.513417119 - 0.415524| = 0.09789358998

 Problem 3 (25 pts.) Solve the following differential equation using Euler\'s method over the interval from x-otox-1 with a step size h 0.5 and h 0.25. Consider
 Problem 3 (25 pts.) Solve the following differential equation using Euler\'s method over the interval from x-otox-1 with a step size h 0.5 and h 0.25. Consider

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site