MAT 275 Extra Credit: MATLAB Euler’s Method And Improvements ✓ Solved
MAT 275 Extra Credit MatLab Euler’s Method and Improved Euler’s Method
Determine the Euler’s approximations for problem #7 in written exam 1 using the euler.m file and the code below. In your command window, use the Matlab command code (filling in the proper information) to obtain the results that you need for the report. >> f=inline(’input function here’,’t’,’y’); >> [t4,y4]=euler(f,[0,1],?input y0 value? , 4); % solves the ODE using Euler with 4 steps >> [ti4(:),yi4(:)]% shows results of the method
Repeat the process by determining the Improved Euler’s approximations for problem #8 in written exam 1 using the impeuler.m file and the code below. >> f=inline(’input function here’,’t’,’y’); >> [ti4,yi4]=impeuler(f,[0,1],?input y0 value? , 4); % solves using Improved Euler w/4 steps >> [ti4(:),yi4(:)]% shows results of the method
Lab Write up: Submit the following as a word document or PDF file using the submit link in Blackboard. Build the following tables with the approximated values you obtained with Euler’s method and Improved Euler’s method, including the actual solution values, absolute errors, and percentage relative errors. Generate a MATLAB plot that compares the Euler’s method, Improved Euler’s Method, and the exact solution, ensuring each curve is properly labeled. Additionally, submit scanned pages from your written exam 1 as specified. The entire report should be formatted professionally and submitted via the Blackboard link.
Sample Paper For Above instruction
The task involves implementing Euler’s method and the Improved Euler’s method to approximate solutions to ordinary differential equations (ODEs) over a specified interval, and then analyzing and comparing these approximations to the exact solution. Euler’s method, a straightforward numerical technique, estimates the solution by advancing stepwise based on the slope at the previous point, providing a simple yet often less accurate approximation. Conversely, the Improved Euler’s method, also known as Heun’s method, refines this process by averaging slopes at the start and end of each step, offering enhanced accuracy. Both methods are fundamental in numerical analysis for solving initial value problems where analytic solutions are difficult or impossible to obtain.
Initially, the MATLAB code utilizes an inline function to define the differential equation, followed by calls to the custom functions `euler` and `impeuler` to perform the respective approximations with a specified number of steps. The user must specify the initial conditions, such as the initial y-value, and the target interval, typically `[0, 1]`, with four subdivisions. The output matrices contain the computed solution values at each step, which will be compared against the exact solution at these points.
The report's core academic analysis centers on building comprehensive tables that display the approximation results—the calculated values, the exact solution's true values at corresponding points, the absolute errors, and the percentage relative errors. These tables allow for visual and quantitative assessment of each method’s accuracy and convergence behavior. Additionally, a MATLAB-generated plot integrates the three solution curves, illustrating how the approximations approach the true solution over the interval.
The fundamental comparison between Euler’s and Improved Euler’s methods highlights both the strengths and limitations of straightforward explicit techniques versus more refined approaches that yield higher accuracy with similar computational effort. This contrast underscores the importance of selecting appropriate numerical methods based on the desired precision, computational resources, and specific problem characteristics. Numerical experiments, such as those performed in this assignment, reinforce understanding by illustrating the practical implications of method choice in differential equation modeling applications across engineering, physics, and other sciences.
References
- Butcher, J. C. (2008). Numerical Methods for Ordinary Differential Equations. John Wiley & Sons.
- Press, W. H., Teukolsky, S. A., Vetterling, W. T., & Flannery, B. P. (2007). Numerical Recipes: The Art of Scientific Computing. Cambridge University Press.
- Ascher, U. M., & Petzold, L. R. (1998). Computer methods for ordinary differential equations and differential-algebraic equations. SIAM.
- Higham, D. J. (2002). An Algorithmic Introduction to Numerical Simulation of Stochastic Differential Equations. SIAM Review.
- Quarteroni, A., Sacco, R., & Saleri, F. (2007). Numerical Mathematics. Springer.
- Salas, S., Hille, D., & Etgen, R. (2012). Differential Equations: A Model Approach. Pearson.
- Thompson, J. M. T., & Stewart, H. B. (2002). Nonlinear Dynamics and Chaos. Wiley.
- Burden, R. L., & Faires, J. D. (2010). Numerical Analysis. Brooks/Cole.
- Gerald, C. F., & Wheatley, P. O. (2004). Applied Numerical Analysis. Addison Wesley.
- Chapra, S. C., & Canale, R. P. (2010). Numerical Methods for Engineers. McGraw-Hill Education.