Crank-Nicolson simulation of dynamical system