This MATLAB package demos the "swimmer" dynamical system
========================================================
The learning algorithm which was used to teach the swimmers to swim is 
described in the NIPS 2007 paper "Receding Horizon Differential Dynamic 
Programming" by Yuval Tassa, Tom Erez and Bill Smart, available at 
http://books.nips.cc/nips20.html

The package includes - 
select:  The top-level function which runs the simulation.
f:       The dynamics function dxdt = f(E,x,u).
initE:   Initializes the E structure required by f.
A bunch of other functions used by "select" to run the simulation.

"Swimmer Dynamics.pdf" derives the dynamical equations implemented by f.m


Notes:
=====
Was tested on MATLAB 2007a on a Windows XP Machine. The .mat files which 
contain the learned controllers were created on 2007a and may not load on 
earlier releases. Due to a known bug, MATLAB version 2007b on Windows XP 
does not display the button names.
http://www.mathworks.com/support/bugreports/details.html?rp=404151

'lag (seconds) = xxx' messages are measures of how much "overtime" your CPU
needed to complete a frame. With a fast machine, you won't see them.

The "Hard Limiting" option limits the angular velocities and prevents 
divergence events. In principle limiting the torques, which is biologically
justifiable, would achieve the same thing, but would require a stiffer 
integrator than the 4th-order Runge Kutta used here.

Author: Yuval Tassa <tassa@alice.nc.huji.ac.il>