title: Dynamically access state while integrating (python)
body: <p>I am integrating a system using scipy's odeint.</p>
  
  <p>I would like to access the state during integration, and use it in the next step in the integration to modify the state accordingly.
  More specifically, I want to take a dot product of the previous state and current state, and if it satisfies a certain condition I may want to alter the current state. This has effect on the next step of the integration, etc...</p>
  
  <p>I am not sure how I can do this. That is, I want to dynamically access my state during the integration routine and modify it accordingly.</p>
  
  <p>EDIT: In MATLAB there is an argument "outputFcn" which might be useful. I am essentially looking for an outputFcn type solution in Python.</p>