add dynamics change callback to ode