Homework 3, due September 15, 2004.
Posted: Mon Sep 06, 2004 11:25 am
Unless otherwise indicated, all computer programs must be written in C, C++, FORTRAN or any other programming language that the course instructor explicitly allows. You may not use Matlab to compute any numerical approximation of the solution to any of the differential equations in this homework; however, you may use Matlab to create any plots that you need to submit. You also may use Matlab to check your the results from your code.
- Section 8.2, number 14.
- Consider
- Write and submit a listing of a computer program to compute a numerical approximation to the solution of this equation using
- Euler's method;
- 2nd order Runge-Kutta method (improved Euler); and,
- 4th order Runge-Kutta method.
- For each of the following time steps
- 0.5;
- 0.25;
- 0.125; and
- 0.01,
- Submit a plot illustrating the difference between the exact solution and the numerically computed solutions for the same time steps and time interval as in part b above. In each case indicate the factor by which the global error changes as the time step changes and indicate whether such a factor would be expected for the global truncation error for the corresponding method.
- What is the difference between the exact solution and the numerically computed solutions after the first time step for each method and time step size above? Determine the factor by which this error (the local truncation error) changes as the time step changes and indicate whether such a factor corresponds to what is theoretically expected.
- Consider
- Submit a plot illustrating the exact solution and the three numerically computed solutions for the case where the time step is equal to
- 0.5;
- 0.25;
- 0.125; and
- 0.01.
- Compare the local truncation error after the first time step for Euler's method with the local truncation error for Euler's method in problem 1 for the case where the time step is 0.5. Explain the cause of any difference.
- Explain any dramatic changes in the results that you observe.
- Consider
- In the case of an ordinary, second order, linear, constant coefficient nonhomogeneous differential equation where the course text and the course "decision tree" indicates that the method of undetermined coefficients is the appropriate solution technique, would the method of variation of parameters also provide the correct particular solution? Justify your answer and also provide either an example or counter-example as an illustration.
- In the case of an ordinary, first order, linear, constant coefficient nonhomogeneous differential equation where the nonhomogeneous term, i.e., g(t), is of the type that would work for undetermined coefficients if the equation were second order, would the method of undetermined coefficients provide the correct solution? Justify your answer and also provide either an example or counter-example as an illustration.