Anyone have a "little" shooting-method function to share
David L Goldsmith
David.L.Goldsmith at noaa.gov
Wed Nov 8 19:08:17 EST 2006
Hi! I tried to send this earlier: it made it into my sent mail folder,
but does not appear to have made it to the list.
I need to numerically solve:
(1-t)x" + x' - x = f(t), x(0) = x0, x(1) = x1
I've been trying to use (because it's the approach I inherited) an
elementary finite-difference discretization, but unit tests have shown
that that approach isn't working. After a little review, I believe I
understand the problem: near t=0, the thing is like an
advection-diffusion equation with diffusion as strong as advection (a
case I'm sure is treated somewhere in the literature, but not as easily
findable as:) near t=1, the thing is like the advection-diffusion
equation I did easily find treated, namely one where advection
dominates. Based on that treatment, I understand why an FD approach
(with a uniform grid) would fail around t=0, and from there it is easy
to accept that the fact that the thing changes its "nature" over the
course of its "life," implies that (a uniform grid) FD is probably not a
very good approach for this equation anywhere on its domain. I could
try (and maybe will have to) a variable grid FD approach, but I'd first
like to try a "shooting" method (for some reason my intuition is telling
me that in this case this might be more efficient). This is where you
all come in: I understand the algorithm and could (may have to) code it
myself, but if anyone out there already has code for this (in Python
using numpy, and preferably already under test), might you be willing to
share? Thanks in advance,
David Goldsmith
PS: In the interim, I realized that if something like this "pre-exists"
in a module, that module might be scipy. Sure enough, scipy has
integrate.ode and integrate.odeint; Google-ing scipy: integrate.odeint
help led me to Travis's 2004 "SciPy Tutorial," where I find "There are
many optional inputs and outputs available when using odeint which can
help tune the solver. These additional inputs and outputs are not
needed much of the time, however..." Well, is one of those inputs an
algorithm specifier? Alternatively, is there a "shooting" algorithm
implemented elsewhere in scipy?
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
More information about the NumPy-Discussion
mailing list