moved ode from external to simulation