a) Euler’s Method to solve ODE
y – y’ + 0.5x = 0
i.e y’ = y + 0.5x ; at xo = 0, y0 = 2.5
thus, f(x,y) = y + 0.5x
for h = 0.5
at xo = 0, y0 = 2.5
Now, f(xo , y0 )= 2.5 + 0.5(0) = 2.5
At x1 = 0.5, y1 = y0 +h[f(xo , y0 )] = 2.5 + 0.5(2.5) = 3.75
Now, f(x1 , y1 ) = 3.75 + 0.5(0.5) = 4
At x2 = 1, y2 = y1 +h[f(x1 , y1 )] = 3.75 + 0.5(4) = 5.75
We continue iterating in excel and tabulate the result below
x | f(x,y) | y |
0 | 2.5 | 2.5 |
0.5 | 4 | 3.75 |
1 | 6.25 | 5.75 |
1.5 | 9.625 | 8.875 |
2 | 14.6875 | 13.6875 |
2.5 | 22.2813 | 21.0313 |
3 | 33.6719 | 32.1719 |
b) Runge Kutte of t order
y – y’ + 0.5x = 0
i.e y’ = y + 0.5x ;
thus, f(x,y) = y + 0.5x
Given : xo = 0, y0 = 2.5 and h =0.5
Iteration 1: at x = x0 + h = 0+0.5 = 0.5
K1 =hf(x0 , y0) = 0.5[2.5 + 0.5 (0)] = 1.25
K2 =hf(x0 +h/2, y0 + k1 /2) = 0.5 *f(0.25, 3.125) = 1.625
K3 =hf(x0 +h/2, y0 + k2 /2) =0.5 *f(0.25, 3.3125) = 1.71875
K4 =hf(x0 +h, y0 + k3 ) = 0.5 *f(0.5, 4.21875) = 2.2344
y1 = y0 + 1/ 6 (k1 + 2k2 + 2k3 + k4) = 2.5 + 1/6 (1.25 + 2x1.625 + 2x1.7188 + 2.2344) = 4.1953
We carry on with further iteration in excel and the results are as shown below:
x | y | k1 | x0 + h/2 | y0+k1/2 | k2 | yo+k2/2 | k3 | x0+h | y0+k3 | k4 |
0 | 2.5000 | 1.2500 | 0.2500 | 3.1250 | 1.6250 | 3.3125 | 1.7188 | 0.5000 | 4.2188 | 2.2344 |
0.5 | 4.1953 | 2.2227 | 0.7500 | 5.3066 | 2.8408 | 5.6157 | 2.9954 | 1.0000 | 7.1907 | 3.8453 |
1 | 7.1520 | 3.8260 | 1.2500 | 9.0650 | 4.8450 | 9.5746 | 5.0998 | 1.5000 | 12.2518 | 6.5009 |
1.5 | 12.1881 | 6.4691 | 1.7500 | 15.4227 | 8.1488 | 16.2625 | 8.5688 | 2.0000 | 20.7569 | 10.8784 |
2 | 20.6519 | 10.8260 | 2.2500 | 26.0649 | 13.5949 | 27.4494 | 14.2872 | 2.5000 | 34.9391 | 18.0946 |
2.5 | 34.7660 | 18.0080 | 2.7500 | 43.7701 | 22.5725 | 46.0523 | 23.7137 | 3.0000 | 58.4797 | 29.9898 |
3 | 58.1944 |
c) The curve y(x) is a smooth second degree curve in both the solutions
Runge Kutta method gives a much smoother approximation of the solution as compared to the Euler's method.
Question 4 A mathematical model has been described by an engineer into the following differential equation: dy 0.5x0 dx...
Help with these questions please. A mathematical model has been described by an engineer into the following differential equation: dy dx y(0) 2.5 Demonstrate an Euler method simulation of y versus x with a tabular algorithm using Ax 0.5 and 0.0 X 3.0. Demonstrate a 4th-order Runge Kutta method simulation of y versus x with a tabular algorithm using What can you say about y(x) and the methods used? a. b. Ax 0.5 and 0.0 3.0 x c. A mathematical...
The differential equation : dy/dx = 2x -3y , has the initial conditions that y = 2 , at x = 0 Obtain a numerical solution for the differential equation, correct to 6 decimal place , using , The Euler-Cauchy method The Runge-Kutta method in the range x = 0 (0.2) 1.0
Problem Thre: 125 points) Consider the following initial value problem: dy-2y+ t The y(0) -1 ea dt ical solution of the differential equation is: y(O)(2-2t+3e-2+1)y fr exoc the differential equation numerically over the interval 0 s i s 2.0 and a step size h At 0.5.A Apply the following Runge-Kutta methods for each of the step. (show your calculations) i. [0.0 0.5: Euler method ii. [0.5 1.0]: Heun method. ii. [1.0 1.5): Midpoint method. iv. [1.5 2.0): 4h RK method...
For the following differential equation: (x^3)dy/dx+y^4+3=0 where dy/dx is the first derivative of y with respect to x, () means power. The equation has initial values y=2.00 at x=1.00 Using Euler method with a step in the x direction of h=0.30: Show the equation to use to generate values of (2 marks) Calculate the missing values of y in the table below I .1.30 1.00 2.00 1.60 For (2 marks)
3. Consider the differential equation dy 2x2y dx 0, y 1 In the following questions work to 4 decimal places with the initial conditions x = throughout and give your answer to 3 decimal places, or use exact fractions (a) Use the Euler method to calculate an estimate of the value of y after four steps of length h 0.5 [4 marks] (b) Use the Modified Euler method to calculate an estimate of the value of y after two steps...
Question l: Solve the differential equation y yx -.ly for y(0.5) and >(I), where () dy dx (c) Using Heun's method with h = 0.5. Perform 2 corrector iterations per step. (d) Using 4h-order RK method with h-0.5 (e) Using Non-Self Starting Heun's method with h 0.5 Question l: Solve the differential equation y yx -.ly for y(0.5) and >(I), where () dy dx (c) Using Heun's method with h = 0.5. Perform 2 corrector iterations per step. (d) Using...
Consider the following Ordinary Differential Equation (ODE): dy = 0.3 * x2 + 0.04 * 26 – 4* y? dx with initial condition at point 20 = 0.6875: yo = 0.0325 Apply Runge-Kutta method of the second order with h = 0.125 and the set of parameters given below to approximate the solution of the ODE at the three points given in the table below. Fill in the blank spaces. Round up your answers to 4 decimals. Yi 0.0325 0.6875...
6. The differential equation: y 4y 2x y(0) 1/16 has the exact solution given by the following equation: v = (1 /2)s, + (14)s +1.16 Calculate y (2.0) using a step size h-0.5 using the following methods: (a) Euler (b) Euler P-c (c)4h order Runge-Kutta (d) Compare the errors for each method. (e) Solve using Matlab's ode45.m function. Include your code and a print of the solution.
Question 4 Not yet answered Marked out of 1.5000 Flag question Consider the following Ordinary Differential Equation (ODE): dy dx = 4.0 * ** + 2.56* *10 - 4 * y? with initial condition at point Xo = 0.75: 3b = 0.1898 Apply Runge-Kutta method of the second order with h = 0.1 and the set of parameters given below to approximate the solution of the ODE at the three points given in the table below. Fill in the blank...
Consider the following initial value problem у(0) — 0. у%3D х+ у, (i) Solve the differential equation above in tabular form with h= 0.2 to approximate the solution at x=1 by using Euler's method. Give your answer accurate to 4 decimal places. Given the exact solution of the differential equation above is y= e-x-1. Calculate (ii) all the error and percentage of relative error between the exact and the approximate y values for each of values in (i) 0.2 0.4...