## MAE 384: Advanced Mathematical Methods for Engineers Spring 2015 Homework #8 Due: Wednesday, April 8, in or before class. Note: Problems 2 (extra credit) and 3 have to be solved by hand. Problems 1 and 5 require MATLAB. The item 1(a) must be shown by hand. Problem 4 can be done either in Matlab or by hand. 1. Consider the following ODE: d y d x = ?8 y with y(0) = 3 on 0 < x < 5, (a) Calculate the largest step size required to maintain stability of the numerical solution to this equation using explicit Euler method. (b) Choose a step size two times smaller than this value. Solve the ODE with explicit Euler method using this step size. (c) Choose a step size two times larger than this value. Solve the ODE with explicit Euler method using this step size. (d) Now repeat parts (b) and (c) with implicit Euler method. (e) Plot all the solutions, including the analytical solution to this problem, on the same plot. Discuss your results. 2. Extra credit. Investigate the stability of the following numerical schemes on the example of an ODE d y d x = ? y with > 0. Show whether the scheme is conditionally or unconditionally stable. Derive the stability threshold if the scheme is conditionally stable. (a) The semi-implicit trapezoidal method: yi+1 = yi + 1 2 (f(xi; yi) + f(xi+1; yi+1)) h (b) The explicit midpoint method: yi+1 = yi + f xi+1=2; yi + f(xi; yi) h 2 h 3. Solve Problem 25.1 from the textbook with third-order Runge-Kutta (page 734) and fourth-order Runge Kutta (page 735) methods with h = 0:5. Plot your results on the same plot. Also, include results from (a),(b),(c) from the two previous homeworks, on the same plot. 4. Solve Problem 25.2 from the textbook with third-order Runge-Kutta (page 734) and fourth-order Runge Kutta (page 735) methods with h = 0:25. Plot your results on the same plot. Also, include results from (a),(b),(c) from the two previous homeworks, on the same plot. There is a typo in this problem. The interval should be from t=0 to 1, not x=0 to 1. 5. For the following rst-order ODE d y d t = t2 ? 2 y t with y(1) = 2, the purpose will be to write MATLAB functions that solve this equation from t = 1 to t = 4 with 1 of 2 MAE 384: Advanced Mathematical Methods for Engineers Spring 2015 (a) Third-order Runge-Kutta (page 734) (b) Fourth-order Runge-Kutta (page 735) For each method, (a) Write the MATLAB function that solves the ODE by using the number of intervals N as an input argument. (b) Solve the ODE using your MATLAB function for N equal to 8, 16, 32, 64. Calculate the step size h inside the function. (c) Calculate the EL2 errors between the true solution and the numerical solution for each N (consult HW6 for the true solution). The following plots should be presented: 1. Plot your solutions for the methods (a), (b), along with the analytical solution, explicit Euler solution from HW6, and solutions to problem 5 (a) – (c) from HW7, on the same plot for N = 8. Do not print out the values at your grid points. 2. Plot your solutions for the methods (a), (b), along with the analytical solution, explicit Euler solution from HW6, and solutions to problem 5 (a) – (c) from HW7, on the same plot for N = 32. Do not print out the values at your grid points. 3. Plot the values of EL2 errors for the methods (a), (b), as well as for the explicit Euler method from HW6, and solutions to problem 5 (a) – (c) from HW7, as a function of h, on the same plot. What do you observe? 4. Plot the values of EL2 errors for all the methods (a)-(c), as well as for the explicit Euler method from HW6, and solutions to problem 5 (a) – (c) from HW7, as a function of h, on the same plot, but in log-log scale. Discuss how you can estimate the order of convergence for each method from this plot. Estimate the order of convergence for each method. 5. Plot the values of EL2 errors for all the methods (a)-(c), as well as for the explicit Euler method from HW6, and solutions to problem 5 (a) – (c) from HW7, as a function of N, on the same plot, but in log-log scale. Discuss how you can estimate the order of convergence for each method from this plot. Estimate the order of convergence for each method. 6. Discuss whether your convergence results for each method correspond to the known order of accuracy for each method. Explain why or why not. 2 of 2

Order of accuracy for Maximum step size for numerical stability … Read More...