# [SciPy-dev] BVP code

Anders Lyckegaard al at ime.auc.dk
Fri Apr 26 05:40:04 CDT 2002

```Hi all!

# A bit of background!
The shooting routine is for solving ordinary differential equations with
boundary conditions given at two different points in time/space.

In general a system of n first order equations.
y'(x) = y(x, y)

with the boundary conditions
r(y(a), y(b)) = 0

(in case of linear boundary conditions these can be written as
A y(a) + B y(b) = c )

The shooting routine is provided with an initial guess for the vector y(a).
It then uses an initial value problem solver to find y(b). (scipy.deint)
Then a it uses an interation proceedure to fit y(a) and y(b) to the boundary
conditions. (scipy.optimize.fsolve)

# Multi-point shooting
I have also implemented multi-point shooting. It is just a simple extension
to the simple shooting. You provide initial guesses for intermediate points
and fit those also.
This routine is not very well know, but it's supposed to have better
convergence properties and better acurracy in case of moderately stiff
problems, see:

@Book{stoer-numericalanalysis,
Author         = {Stoer, J. and Bulirsch, R.},
Title          = {Introduction to {N}umerical {A}nalysis},
Publisher      = {Springer-Verlag, New York},
isbn           = {0-387-90420-4},
year           = 1980,
}

# Best in class?
I'm not sure if this is a best in class algorithm. Shooting is very widely
used, and is recommended in Numerical Recipes as a good place to start.

Stoer and Bulirsch show that multi-point shooting compares quite well to
finite difference solutions, but it is a quite old reference and finite
difference approaces have evolved quite a lot in recent yeas.

Cash and Wright have implemented some algorithms base on collocation and
deferred corrections, that might be worth considering.

# Code
I have included a bit of code. It does not have any error checking and have
not been optimized in any way, but is works with the example that I have
included.

# Future plans
I plan to implement some continuation proceedure, based on the arch-length
method. This might be of intrest also, but more about that later!

--
Anders Lyckegaard, Ph.D student
Institute of Mechanical Engineering, Aalborg University
Pontoppidanstraede 101, DK-9220 Aalborg Oest, Denmark
Phone: +45 9635 8080 (direct: +45 9635 9325), fax: +45 9815 1675
Email: al at ime.auc.dk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_shoot.py
Type: text/x-java
Size: 1323 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-dev/attachments/20020426/148a454a/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shoot.py
Type: text/x-java
Size: 2177 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-dev/attachments/20020426/148a454a/attachment-0001.bin
```