[SciPy-user] solving an ode with boundary conditions

Max Wainwright cwainwri at ucsc.edu
Tue Jun 23 20:37:34 EDT 2009


I have a 1D second-order differential equation that I'm trying to  
solve with the following boundary conditions: dy/dt = 0 at r = 0 and y 
(t) = 0 at t = infinity.  I can solve this by doing guess and check  
for the initial value of y at t = 0.  If I guess too high, then y  
goes to negative infinity at t = infinity.  If I guess too low, y  
never reaches zero and instead oscillates about some minimum.   
Therefore, to check if I've overshot or undershot the solution all I  
need to do is stop the integration once either y or -dy/dt goes  
negative.  Is there any way to do this with scipy?  I also tried  
looking at PyDSTool, but I had a hard time finding what I need.  I  
don't in principle know the time-scale of the solution (I'll be doing  
this for lots of different parameters), so I'd like to avoid using a  
fixed timestep.

Thanks.

-Max



More information about the SciPy-User mailing list