How to get SciPy.integrate.odeint to stop when path is closed?
问题 The script below integrates magnetic field lines around closed paths and stops when it returns to original value within some tolerance, using Runge-Kutta RK4 in Python. I would like to use SciPy.integrate.odeint , but I can not see how I can tell it to stop when the path is approximately closed. Of course odeint may be much faster than integrating in Python, I could just let it go around blindly and look for closure in the results, but in the future I'll do much larger problems. Is there a