extract state velocity from flat outputs.  started on extracting inputs, but did not finish