% LSODE insists on passing a column vector as the state to the equation of
% motion, EOM. Depending on how the EOM function is written, this might or
% might not matter. If it causes a problem, then lsode2 can be used. It
% just redefines the EOM function so that the state vector passed by lsode
% gets transposed before it is sent to EOM.
function [x, istate, msg] = lsode2(EOM, x0, t)

ODE = @(x,t) EOM(x',t);

[x, istate, msg] = lsode(ODE, x0, t);
