From: Hans F. <H.F...@so...> - 2005-06-27 19:55:41
|
Hi Gary, > I've been wondering if there would be a programming, accuracy, or > performance benefit to using a fancy ode solver with vpython rather than > the canonical v = v + F/m * dt especially as the number of objects > grows. My thinking was that I could call the solver once per "frame" > (say, 1/30 sec), solve for all of the variables all at once, and perhaps > have better accuracy, and perhaps get more objects into the simulation. > > I began to experiment with scipy's odeint, and got some demos working. > I ran across some instabilites that I tracked down, but before going any > further I thought I'd ask: > > Does this seem worth the effort? We used scipy.integrate.odeint quite successfully (in a teaching context). > Is there something I haven't considered that dooms this idea? Not sure. What doesn't work? > Has someone already done this? > > The instablilty I found is related to in the way odeint (LSODA??) > manages the independent variable. I'd like to look at other solvers. Are saying, it takes too large steps? > Any suggestions? In particular I'd like to look at a 4th order > Runge-Kutta solver, but the only RK4s that I've found are written in > python. Does anyone know where there's a python-wrapped C or Fortran RK > solver? My feeling is that the solver in odeint is far more sophisticated than a RK4 solver. However, I would need more information as to what is 'instable' and what you have tried to overcome this. Cheers, Hans |