I'm not sure about dynamic programming, but optimal control type
problems of a finite horizon can be solved with AMPL if you discretize
the states and the inputs (it's called simultaneous dynamic
optimization/direct transcription/control vector parameterization of
both states and inputs). Many groups have been doing this for years,
and in practice, it works very well (with some caveats). As I
understand it, the NLP solver IPOPT was originally developed to solve
these types of problems. They are called "dynamic optimization"
problems -- and they do not involve Pontryagin's Max. principle or
solving Hamilton-Jacobi-Bellman equations.
See here for an AMPL example:
http://www.mcs.anl.gov/~vzavala/dynopt.html
The basic idea is to convert the differential equations into algebraic
equations using some sort of quadrature method. The simplest is of
course, to simply apply forward Euler.
Consider this ODE:
x' = -ax + u, x(0) = 0.
where a=0.2 is a parameter; x = state variable, between 0 and 9; u =
input variable, between 0 and 5. You can write this in AMPL as follows
(using textbook forward Euler):
param N := 10; # no. of integration steps
param dt := 0.01; # integration step size
param a := 0.2;
set kset ordered := 0..N;
var x{kset}, >= 0, <= 9;
var u{kset}, >= 0, <= 5;
minimize obj: 0;
subject to
c1{k in 1..N}: (x[k] - x[k-1])/dt = -a*x[k-1] + u[k-1];
option solver ipopt;
solve;
display x, u;
This is just a made-up example, but you get the idea. If you need a
more accurate or more stable integration scheme than Euler, you can
use Implicit Runge-Kutta (which can handle stiffness, and has good
stability properties). The idea is the same -- convert your
differential equations into a bunch of algebraic ones. You'll get a
sparse structured system that you can solve very efficiently using
large-scale sparse NLP solvers. Check out the research here:
http://numero.cheme.cmu.edu/Papers/
They've done a lot of work in this area. You may want to start there.
Paul