An initial-value problem is given by the differential equation,
f(x,y) = x + y, y(0) = 1.64
The Euler-midpoint method is used to find an approximate value to y(0.1) with a step size of h = 0.1.
Then use the integrating factor method, to find the exact value of y(0.1).
Hence, determine the global error, giving your answer to 5 decimal places.
Note that Global Error = Approximate Value - Exact Value.
after calculating the y' and y'' values.
the values come up be 2.7731947639
which when rounded to 5 decimal places gives the answer as: 2.773195
after re-calculating the euler-midpoint method. the value I got was 1.8172 while using normal euler method is 1.968.
however, I can't seem to find the exact solution to minus off the 1.8172 value to get the global error.
To find an approximate value for y(0.1) using the Euler-midpoint method with a step size of h = 0.1, follow these steps:
Step 1: Set up the iteration formula
The Euler-midpoint method uses the iteration formula:
yn+1 = yn + h * f(xn + (h/2), yn + (h/2) * f(xn, yn))
where yn represents the approximate value of y at xn.
Step 2: Calculate the approximate values
Plug in the initial condition y(0) = 1.64 and the differential equation f(x, y) = x + y into the iteration formula. Start with n = 0, x0 = 0, and y0 = 1.64:
x1 = 0 + (0.1/2) = 0.05
y1 = 1.64 + 0.1 * (0.05 + 1.64) = 1.803
x2 = 0.1 + (0.1/2) = 0.15
y2 = 1.803 + 0.1 * (0.15 + 1.803) = 2.023
Continue this process until you reach x = 0.1:
x3 = 0.15 + (0.1/2) = 0.2
y3 = 2.023 + 0.1 * (0.2 + 2.023) = 2.2693
Based on this calculation, the approximate value of y(0.1) using the Euler-midpoint method is 2.2693.
To find the exact value of y(0.1) using the integrating factor method, follow these steps:
Step 1: Rewrite the differential equation in the form y' + p(x)y = q(x)
The given differential equation f(x, y) = x + y can be rewritten as:
y' - y = x
Here, p(x) = -1 and q(x) = x.
Step 2: Find the integrating factor (IF)
The integrating factor (IF) is given by:
IF = e^(∫p(x)dx)
In this case, p(x) = -1, so ∫p(x)dx = ∫(-1)dx = -x.
Therefore, the integrating factor is:
IF = e^(-x)
Step 3: Multiply the differential equation by the integrating factor and integrate
Multiply both sides of the differential equation by the integrating factor (IF):
e^(-x)y' - e^(-x)y = xe^(-x)
Integrate both sides:
∫(e^(-x)y')dx - ∫(e^(-x)y)dx = ∫(xe^(-x))dx
Applying integration by parts on the left side:
-e^(-x)y - ∫(-e^(-x)y')dx = ∫(xe^(-x))dx
Simplifying:
-e^(-x)y + ∫(e^(-x)y')dx = ∫(xe^(-x))dx
Using the fact that ∫(e^(-x)y')dx = ∫(d(e^(-x)y)) = e^(-x)y + C:
2e^(-x)y = ∫(xe^(-x))dx + C
Solving for y:
y = (1/2)e^x * ∫(xe^(-x))dx + Ce^x
Step 4: Evaluate the constants
To evaluate the constant C, plug in the initial condition y(0) = 1.64:
1.64 = (1/2)e^0 * ∫(0 * e^(-0))dx + Ce^0
1.64 = (1/2) * 0 + C
Therefore, C = 1.64.
Step 5: Calculate the exact value of y(0.1)
Using the formula for y obtained in Step 3, evaluate it at x = 0.1:
y(0.1) = (1/2)e^0.1 * ∫(0.1e^(-0.1))dx + 1.64e^0.1
Simplifying and evaluating the integral:
y(0.1) = (1/2)e^0.1 * (-e^(-0.1)) + 1.64e^0.1
At this point, you can use a calculator or software to evaluate this expression to get the exact value of y(0.1).
Finally, the global error is given by:
Global Error = Approximate Value - Exact Value
Substitute the values we obtained earlier:
Global Error = 2.2693 - y(0.1)
Calculate y(0.1) using the integrating factor method and subtract it from the approximate value to find the global error, and round the answer to 5 decimal places.