This is accomplished by
translating the dynamic problem into a nonlinear programming
problem, generating Matlab function files and a TOMLAB problem, that
can be passed to a numeric solver.
The final state could be computed by
integrating the ODE, however, as we use a DAE, it is more convenient
to go via the interpolating polynomial. Proofs that these methods
are mathematically equivalent have been published.