stan-dev/stan — pull request #1022 by bob-carpenter (2014-09-09 20:06:18+00:00)
Title: Feature/issue 771 ode solver

#### Summary:

Adds the `integrate_ode` expression for solving ODEs.

#### Intended Effect:

1. Allow users to encode non-stiff ODEs in Stan as functions with unknown initial positions and/or unknown parameters.

2. Also had to update the way reverse-mode autodiff works to allow nested autodiff evaluation. This is used to carry out the system derivatives required for the coupled system in the ODE.

#### How to Verify:

There are extensive unit tests for both the ODE solving testing against finite differences and for the updates to the language in terms of parsability and throwing the right error messages.

#### Side Effects:

None.

#### Documentation:

User-facing doc:

* new section in the expression chapter of the language reference manual,
* added new expressions to BNF for language,
* new chapter in the programming language manual working through a full example, and
* example models under the manual (these will move to the example models repo after merging)

#### Reviewer Suggestions:

Someone other than Peter or me. It involves fairly extensive review on the parser/code generator, solver functions, and doc.