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

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. dy-ty-3y dt where y = 1 at t= 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 t, and (b) write either a C++ or a MATLAB program to obtain analytical solution as well as numerical solution of y for t from 0 to 2 using three different time step sizes (At = 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 Yt)-el-31) 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/files 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 (examples shown below) and x-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 your computer programs to Blackboard, and follow the instruction in the syllabus to name the folder. Table 1: Comparison of y values calculated from different numerical methods (At = 0.5) + Yana Y'Euler &E (%) Y'heuncu (%) PRK2 ERK2 (%) YRK4 ERK4 (%) 0.5 (yana: analytical solution; YEuler: numerical solution using the Euler method; &: true percent relative error for the Euler method; YHeun: numerical solution using the single-step Heun's method; &: true percent relative error for the single-step Heun's method; yrkz: numerical solution using the 2nd-order Runge-Kutta method; &,pko: true percent relative error for the 2nd order Runge-Kutta method; yrka: numerical solution using the 4h-order Runge-Kutta method; ERKA: true percent relative error for the 4"-order Runge-Kutta method) Table 2: Comparison of y values calculated from different numerical methods (At = 0.2) Yana Yeuler &E (%) YHeun &u (%) Yrk2 ,Rk2 (%) YRK4 Erk4 (%) 0 Table 3: Comparison of y values calculated from different numerical methods (At = 0.1) t Yana YEuler &(%) Yheun %) Yrk2_E,RK2 (%) rk4 8RK4 (%) 0 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. dy-ty-3y dt where y = 1 at t= 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 t, and (b) write either a C++ or a MATLAB program to obtain analytical solution as well as numerical solution of y for t from 0 to 2 using three different time step sizes (At = 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 Yt)-el-31) 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/files 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 (examples shown below) and x-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 your computer programs to Blackboard, and follow the instruction in the syllabus to name the folder. Table 1: Comparison of y values calculated from different numerical methods (At = 0.5) + Yana Y'Euler &E (%) Y'heuncu (%) PRK2 ERK2 (%) YRK4 ERK4 (%) 0.5 (yana: analytical solution; YEuler: numerical solution using the Euler method; &: true percent relative error for the Euler method; YHeun: numerical solution using the single-step Heun's method; &: true percent relative error for the single-step Heun's method; yrkz: numerical solution using the 2nd-order Runge-Kutta method; &,pko: true percent relative error for the 2nd order Runge-Kutta method; yrka: numerical solution using the 4h-order Runge-Kutta method; ERKA: true percent relative error for the 4"-order Runge-Kutta method) Table 2: Comparison of y values calculated from different numerical methods (At = 0.2) Yana Yeuler &E (%) YHeun &u (%) Yrk2 ,Rk2 (%) YRK4 Erk4 (%) 0 Table 3: Comparison of y values calculated from different numerical methods (At = 0.1) t Yana YEuler &(%) Yheun %) Yrk2_E,RK2 (%) rk4 8RK4 (%) 0 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

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

Evaluate 3x - x for x = -2 Answer:

Answered: 1 week ago

Question

What is group replacement? Explain with an example. (2-3 lines)

Answered: 1 week ago