**Reading**: sections 12.1-12.3 of the course text. Also, if you have not read it, section 1.6 has background information including Matlab examples.

**Exercises:**For all problems, be sure to run the program multiple times with a different time step sizes to ensure that your approximate answer has converged to the correct answer, i.e., keep reducing dt until the answer does not change significantly. Also, unless otherwise indicated, you must use a compiled language, such as FORTRAN, C, or C++.

- 12.1 (number 3 only and be sure to notice the paragraph at the end of the problem)
- Choose your favorite ordinary differential equation for which you can find the exact solution. If you are working with others, you must choose a different equation than they do. The only other condition is that it must be of the form x'(t) = f(x,t) and f must depend on BOTH x and t. It can be a single first order equation, or a higher-order equation converted to a system of first order equations. Write a program (or separate programs) that use a) Euler's method, 2) 2nd order R-K and iii) 4th order R-K and plot the error versus different time steps. Indicate whether the error is decreasing in a manner consistent with the order of the method.
- Consider the differential equation, which does not look all that bad:

x' = 40 x (1 - x)

where

x(-1) = 1/(1 + exp(40)).

Note that the initial condition is at t=-1. Use matlab and ode45() to solve this. Compare it to the exact answer, which is

x(t) = 1/(1 + exp(-40 t))

by plotting the two on the same graph. Verify the given exact answer really is the answer by substituting it into the differential equation. On a different graph, plot the error. Does matlab give a good solution?

Write a program using 4th order Runge-Kutta to determine the solution. Plot the error versus different sized time steps.

Main point: can you always trust matlab to give a good answer? Look at the original equation. Does it look suspicious in any way that would lead you to believe that it is problematics? (My answer is no, unless you ponder it for a long time). - Do the first stage of the project, as described on the project page.