Wed Oct 22 09:16:10 EDT 2014

Serializing equations

Given a set of equations:

- For each d/dt, make sure the variable is naked.  Otherwise add new
  variables and an extra equation.

- Equations have a set of inputs.  Separate parameters from variables.

- Solve set of equations

- Repeat

Looks like this will need some appropriate data structure traversals.
Tree processing is always the big hurdle, so let's do it right this

mapAccum[1] seems appropriate: process datastructure + update
accumulator.  however, when this is a tree, there seems to be a
conflict between substitution and traversal.  i.e. when a node
processing function prunes a subtree, should the old one be traversed

Let's bypass the d/dt rewriting and just assume d/dt operates on naked
variables first.

[1] http://www.haskell.org/hoogle/?hoogle=mapAccum