194k views
3 votes
Describe how to modify Euler's method to deal with the initial condition of y(5)=3 instead of y(0)=3. Use this on the equation y' = 1+t using a time step of 0.1 and initial condition of y(5)=3 and find y(5.4). Now find the exact solution of this equation using calculus and find what the exact answer is. What is the percentage error in the value Euler's method gave at t=5.4?

2 Answers

2 votes

Final answer:

To modify Euler's method for a different initial condition, start the approximation at the given initial time. The modified equation becomes y' = 1+t, y(5) = 3. Use Euler's method with a time step of 0.1 to find the approximate value of y(5.4). The exact solution can be found by integrating the equation. The percentage error in Euler's method is calculated by comparing the approximate value to the exact value at t=5.4.

Step-by-step explanation:

To modify Euler's method to deal with the initial condition of y(5)=3 instead of y(0)=3, we need to change the starting point of the approximation. Since we are given the initial condition at t=5, we need to start the approximation there. The modified equation becomes: y' = 1+t, y(5) = 3.

Using Euler's method with a time step of 0.1 and starting at t=5, we can calculate the values of y at each time step. Starting with the initial condition y(5) = 3, we can use the equation: y_n+1 = y_n + h * f(t_n, y_n), where h is the time step, f(t, y) is the derivative equation (1+t in this case), and t_n and y_n are the previous time and y values respectively.

Using this method, we can find the approximate value of y(5.4) to be approximately 4.03.

The exact solution of the equation y' = 1+t can be found by integrating the equation. Integrating both sides gives y = t + (t²)/2 + C, where C is the constant of integration. Using the initial condition y(5) = 3, we can solve for C and find the exact solution to be y = t + (t²)/2 - 17/2.

The exact value of y(5.4) is approximately 4.11.

To find the percentage error in Euler's method at t=5.4, we can calculate the absolute error by subtracting the approximate value from the exact value, take the absolute value, and divide it by the exact value. The percentage error is the absolute error multiplied by 100.

The percentage error in Euler's method at t=5.4 is approximately 1.94%.

User Meowgoesthedog
by
8.5k points
0 votes

Answer:

74.12%

Step-by-step explanation:

To modify Euler's method to deal with the initial condition of y(5)=3 instead of y(0)=3, you need to start at t=5 instead of t=0. The formula for Euler's method is yn+1=yn+hf(tn,yn), where h is the time step, f(tn,yn) is the derivative of the equation, and yn is the previous value of y. To find the value at t=5.4, you can calculate yn+1=3+0.1(1+5) = 8.1, which is the approximate value of y(5.4). To find the exact solution of this equation using calculus, you can integrate the equation with respect to t, which gives y = t2/2 + t + c, where c is a constant of integration. Since y(5)=3, c can be found to be 8/2. Therefore, the exact value of y(5.4) is 5.4^2/2 + 5.4 + 8/2 = 31.12. The percentage error in the value Euler's method gave at t=5.4 is (8.1 - 31.12)/31.12 x 100 = 74.12%.

User Slvnperron
by
7.9k points