Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your homework assignment is to solve the following 1-order ordinary differential equation using four different numerical methods: (1) the Euler explicit method, (2) the single-

image text in transcribed

Your homework assignment is to solve the following 1"-order ordinary differential equation using four different numerical methods: (1) the Euler explicit method, (2) the single- step Heun's method, (3) 2"-order Ralston Runge-Kutta method, and (4) 4"-order Runge-Kutta method. dyty - 3y di where y-1 at 1-0. To complete your work, you need to (a) show the differencing equations of these four numerical methods you used to calculate the values of y at different I, and (b) write either a C++ or a MATLAB program to obtain analytical solution as well as numerical solution of y for from 0 to 2 using three different time step sizes (Af -0.5, 0.2, and 0.1). You also need to show the true percent relative error (,) for each numerical methods and time step sizes, where the analytical solution of the equation of motion is There are two items you need to submit for this homework. The first item is your computer program (M-file for MATLAB or a combination of C++ source code and its compiled executable, 50% grade). You should have enough comments in your program to describe the function of the code, input and output variables, and mathematical formulas for those critical computational operations. The second item is a typed report (45%) along with a typed readme file (5% grade). The readme file should describe how to run your computer code, including input variables Tiles needed and output information. Your report should include: (1) the homework title, your name and CWID, (2) discretized equations for 4 numerical methods, (3) tables dx-y plots of your results, and (4) some discussions about accuracy of your numerical solutions. All equations need to be typed, and a program statement cannot be used to substitute the equation. All figures and tables should have a number and title so that they can be cited in your discussion. Plot your results using symbols for the analytical solutions, and different line types and colors for your numerical solutions. It is preferable that both horizontal and vertical gridlines with major and minor ticks are used in the figure. Round your values listed in the table to the 4 decimal place. Submit the folder containing these two items to me through e-mail, and follow the instruction in the syllabus to name the folder. You can zip your folder and rename it to "xxx.txt" when you email me the ile since e-mail server may filter out ".zip" file. Table 1: Comparison of y values calculated from different numerical methods (A-0.5) Yana Yuler E %) 'Heun (%) YRK2 ERK2(%) YRKA ERK4 (%) an analytical solution; Yuler numerical solution using the Euler method; Es true percent relative error for the Euler method; Yun numerical solution using the single-step Heun's method; & true percent relative error for the single-step Heun's method; yrk2: numerical solution using the 2nd order Runge-Kutta method; Ex: true percent relative error for the 2010 order Runge-Kutta method; y numerical solution using the 4"-order Runge-Kutta method; ExK4 true percent relative error for the 4"-order Runge-Kutta method) Table 2: Comparison of y values calculated from different numerical methods (Ar-0.2) 1 Yana Yeule E (%) Heun (%) YRK2 .8K2(%) PRK ERK4%) 0.2 Table 3: Comparison of y values calculated from different numerical methods (Al-0.1) ! Yana Yuler E, F (%) 'Heun 3,4%) PRK2E, RK2(%) y'rK4 ERK4 (%) 0.1 Your homework assignment is to solve the following 1"-order ordinary differential equation using four different numerical methods: (1) the Euler explicit method, (2) the single- step Heun's method, (3) 2"-order Ralston Runge-Kutta method, and (4) 4"-order Runge-Kutta method. dyty - 3y di where y-1 at 1-0. To complete your work, you need to (a) show the differencing equations of these four numerical methods you used to calculate the values of y at different I, and (b) write either a C++ or a MATLAB program to obtain analytical solution as well as numerical solution of y for from 0 to 2 using three different time step sizes (Af -0.5, 0.2, and 0.1). You also need to show the true percent relative error (,) for each numerical methods and time step sizes, where the analytical solution of the equation of motion is There are two items you need to submit for this homework. The first item is your computer program (M-file for MATLAB or a combination of C++ source code and its compiled executable, 50% grade). You should have enough comments in your program to describe the function of the code, input and output variables, and mathematical formulas for those critical computational operations. The second item is a typed report (45%) along with a typed readme file (5% grade). The readme file should describe how to run your computer code, including input variables Tiles needed and output information. Your report should include: (1) the homework title, your name and CWID, (2) discretized equations for 4 numerical methods, (3) tables dx-y plots of your results, and (4) some discussions about accuracy of your numerical solutions. All equations need to be typed, and a program statement cannot be used to substitute the equation. All figures and tables should have a number and title so that they can be cited in your discussion. Plot your results using symbols for the analytical solutions, and different line types and colors for your numerical solutions. It is preferable that both horizontal and vertical gridlines with major and minor ticks are used in the figure. Round your values listed in the table to the 4 decimal place. Submit the folder containing these two items to me through e-mail, and follow the instruction in the syllabus to name the folder. You can zip your folder and rename it to "xxx.txt" when you email me the ile since e-mail server may filter out ".zip" file. Table 1: Comparison of y values calculated from different numerical methods (A-0.5) Yana Yuler E %) 'Heun (%) YRK2 ERK2(%) YRKA ERK4 (%) an analytical solution; Yuler numerical solution using the Euler method; Es true percent relative error for the Euler method; Yun numerical solution using the single-step Heun's method; & true percent relative error for the single-step Heun's method; yrk2: numerical solution using the 2nd order Runge-Kutta method; Ex: true percent relative error for the 2010 order Runge-Kutta method; y numerical solution using the 4"-order Runge-Kutta method; ExK4 true percent relative error for the 4"-order Runge-Kutta method) Table 2: Comparison of y values calculated from different numerical methods (Ar-0.2) 1 Yana Yeule E (%) Heun (%) YRK2 .8K2(%) PRK ERK4%) 0.2 Table 3: Comparison of y values calculated from different numerical methods (Al-0.1) ! Yana Yuler E, F (%) 'Heun 3,4%) PRK2E, RK2(%) y'rK4 ERK4 (%) 0.1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions