332:505 Control Theory I

Numerical Integration Example

Let's investigate the behavior of some numerical techniques for solving the the nonlinear first order system described by

x' = t x2 – x

which was mentioned in the first lecture. You will need to copy two files to your computer. numint_example.m calculates several approximations for the function x(t) whose derivative is given by the above equation encoded in f.m. After starting Matlab, you type `numint_example' at the prompt to start executing the script.

There are several ways to augment this example:

  • add another `for' loop that uses the Runge-Kutta method to see how this method compares to the others;
  • change the stepsize h and see how this affects the results;
  • change the initial value problem by changing the initial conditions in `numint_example.m' or the derivative in `f.m' to see whether the accuracy of the various approximations;
  • compare results for different matlab solvers. (You can get a list of these by typing help ode23s.)

Can you implement the Backward Euler Method?


Page last modified 07/18/07.