Transition between turbulent and periodic states in the Lorenz model