How exactly does the shooting method work?

Click For Summary

Discussion Overview

The discussion centers around the shooting method, a numerical technique used to solve boundary value problems for differential equations. Participants seek to understand its fundamentals, applications, and mathematical formulation.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification
  • Homework-related

Main Points Raised

  • One participant describes the distinction between initial value problems and boundary value problems, emphasizing the uniqueness of solutions based on given conditions.
  • The shooting method is analogized to aiming a rifle at a target, where adjustments to the aim are made based on the results of previous shots to reach the desired boundary condition.
  • Another participant expresses understanding of the shooting method in principle but struggles to formulate it mathematically, presenting an equation that they suspect may not be dimensionally correct.
  • A request is made for an extension of the explanation to include direct multiple shooting methods, indicating interest in further details about variations of the shooting method.

Areas of Agreement / Disagreement

Participants generally agree on the basic concept of the shooting method and its analogy, but there is no consensus on the mathematical formulation or the specifics of direct multiple shooting methods. The discussion remains unresolved regarding the latter.

Contextual Notes

Some participants express uncertainty about the mathematical expressions used in the shooting method, indicating potential limitations in their understanding or formulation. The discussion also highlights the dependence on the specific differential equation being solved.

Who May Find This Useful

Readers interested in numerical methods for solving differential equations, particularly in the context of boundary value problems, may find this discussion beneficial.

Cinimod
Messages
34
Reaction score
0
I have an assignment which requires using the shooting method, but the problem is, I've read numerous things on the internet about exactly how the shooting method works, and I still don't understand it. I was hoping that someone would be kind enough to explain to me the fundamentals of how it works.
 
Physics news on Phys.org
First a description of the difference between "initial value" problems and "boundary value" problems. In an initial value problem, you are told the value of the function and enough of its derivatives at some "initial" value of the independent variable. For a second order differential equation that would mean that you are given the value of both y and y' at some specific value of x. As long as the functions in the differential equation are "nice", there exists a unique solution no matter what the initial conditions are.
For a "boundary value" problem you are given the value of y at more than one value of x. For a second order differential equation, you would be given the y value at two different values of x (the "boundary" of the interval in question). Even for a very simple differential equation, there might not exist a unique solution, or any solution at all for different boundary conditions.
For example, the differential equation y"+ y= 0 has y= Ccos(x)+ Dsin(x) as "general solution". Given y(0)= A, y'(0)= B, y= Acos(x)+ Dsin(x) is the unique solution. However, y"+ y= 0, with y(0)= 0, [itex]y(\pi)= 0[/itex] has an infinite number of solutions (y= C sin(x) satisfies the differential equation and the boundary conditions for every value of C) while the boundary value problem y"+ y= 0, with y(0)= 0, [itex]y(\pi)= 0[/itex] has NO solution at all.

Now, for "shooting".

Imagine setting a rifle on an "aiming block" where you can adjust the angle of fire. An "initial value problem" would be where you are given the initial position (on the aiming block) and given an initial angle, which you can set. You then fire the bullet and wherever the bullet goes, its trajectory is the solution to that "intial value problem".

A "boundary value problem", however, would correspond to aiming at a specific target. One "boundary" is the position of the rifle on the aiming block and the other is the target. Since the bullet flies in an arc, not a straight line, you cannot just "point" the rifle at the target. Of course, you can set your sights up so that, for that particular distance, aiming the sights at the target makes the bullet hit the target but how do you set the sights correctly?

You "aim" the gun at the target, fire, and see where the bullet hits. Use that information to correct your aiming slightly (in this case, if the bullet is high, aim slightly lower). Fire again, and again use the information about where the bullet its the target to adjust your sights. (Of course, the target might be beyond the range of the rifle- the boundary value problem might not have a solution. And, in general, there are two different angles at which you could fire and hit the same target- there is no unique solution.)

The basic idea of the "shooting method" is that you take one of your given "boundary values", y(a) for some a, and add an arbitrarily chosen y'(a) and do any of many numerical integration schemes (4th order Runge-Kutta is most popular) to solve that "initial value problem". You then check to see how close you came to the other "boundary value" (the "target") and use that information to decide how to change y'(a). After altering y'(a), you "shoot again" and see how close that came.
What you really want to know, I suspect, is that last part- how do you use the information from your first "shot" to correct y'(a)? Unfortunately that depends strongly on the precise differential equation! From the "shooting" analogy, it might seem reasonable that if, after your first "shot", you are too high (y(b) as calculated is larger than the y(b) you want) then you "lower your sights"- choose y'(a) slightly smaller. However, it is easy to make up example differential equations where that would make the next "shot" worse. The best I can suggest for complete generality is that you "shoot" 3 times. First pick an arbitrary (but "reasonable") y'(a), do your numerical integration, and see how far off the target y(b) it is. Reduce y'(a) a little and repeat. Increase y'(a) a little and repeat. Use that information- whether increasing or decreasing y'(a) gets you closer to your "target" to decide how to change y'(a).
Using that new y'(a), repeat: "shoot" three times, once with that y'(a), once with a little larger, once with y'(a) a little lower and use that information to adjust y'(a) again.
"Repeat as desired."
 
wow. That was a great post. It makes a lot more sense now. (he says that, and then talks a load of crap, lol)
I have to write a program to do calculate the wavefunction of an electron. so, I understand it in principle, and it makes a lot of sense, but now an attempt to put that into mathematical form:

[tex]y_{n+1} = \int y_n + y'(a)) dy[/tex]

Where [itex]0< n < \frac{x_1 - x_0}{a}[/itex], where the x values represent the limits of the range (technically there should be equals signs on those equalities, but I don't know how to put them on). I take a value [itex]y_0[/itex], and then by using guessed (or rather, estimated) values of y'(a), I have to try and get [itex]y_N[/itex] equal what it should, as defined by the boundary conditions defined in the problems. ([itex]y_N[/itex] is the last value to calculate).

If that's how it works, It doesn't seem too bad, but have I got the right idea as how it works?
I've got a feeling that the maths I wrote above isn't right, just because it doesn't make sense dimensionally, nm.
 
Last edited:
I have to agree with the person who originally asked about the shooting method: great post!

Could you extend your explanation to direct multiple shooting methods? How does the direct multiple shooting method work?
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K