COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### shooting method, boundary value problem

• Follow

```hi there,
im trying to solve a more involved differential equation that has a
whole family of solutions. so i started with a similar and more simple
example:

Manipulate[
Plot[Evaluate[{y[x]} /.
NDSolve[{y''[x] + y[x] == 0, y'[0] == 0, y[1] == 0}, y, x,
Method -> {"Shooting",
"StartingInitialConditions" -> {y[0] == b, y'[0] == a}}]], {x,
0, 1}, PlotRange -> All], {a, 0, 3}, {b, 0, 3}]

what i basically want is to get all the sinusoidal modes by varying
'some' parameter. i want to be able to tune one parameter so that i
get the mode with zero nods, one nod, two nods etc. how do i do that?

(i know that mathematica can solve this equation analytically, but as
mentioned above, this is just an example for a more involved
calculation.)

r.

```
 0

```Hello,
as stated, your problem has really only the trivial solution. But if you
replace the second boundary condition by y(Pi/2)=0, you get a whole
family of solutions y=A Cos[t].
In order to pick one of these, you could replace the second boundary
condition by a proper initial condition, say y[0]=A. The second boundary
condition would still be satisfied.

If you are thinking about nonlinear problems, the period of the solution
could vary. To state the problem as a standard BVP, you have to rescale
your x variable, e.g. by setting
x = T*tau,
where T satisfies the trivial ODE T'=0. tau is the rescaled time.
So you could also specify your problem as
y''[tau]+T[tau]^2 y[tau] ==0,
T'[tau]==0,
y[0]==A,
y'[0]==0,
y[1]==0

with the initial guess T[0]=Pi/2.

With this method you could also solve more difficult problems, like
e.g. the pendulum equation:
y''[tau]+T[tau]^2 Sin[y[tau]] == 0.

Good luck
Alois

```
 0

```This looks like normal modes for sound propagation in a waveguide. At
any rate, you have a 2nd order differential equation with two
conditions. This leads to a unique solution. If you are looking for
normal modes, you probably need to think about solving the more general case
y''[x]+alpha*y[x]==0

For different values of alpha. Here is my attempt.

Manipulate[
Y = y /. NDSolve[{y''[x] + \[Alpha] y[x] == 0, y[1] == 0,
y'[1] == a}, y, {x, 0, 1}][[1]];
Plot[Y[x], {x, 0, 1}, PlotRange -> {-10, 10}]
,
{a, -20, 20}, {\[Alpha], 0, 500, .1}
]

used initial conditions at the far end and then manipulate a and alpha.
You could do this automatically with a zero finder approach.

Kevin

On 11/11/2010 6:09 AM, Regina wrote:
> hi there,
> im trying to solve a more involved differential equation that has a
> whole family of solutions. so i started with a similar and more simple
> example:
>
> Manipulate[
>   Plot[Evaluate[{y[x]} /.
>      NDSolve[{y''[x] + y[x] == 0, y'[0] == 0, y[1] == 0}, y, x,
>       Method ->  {"Shooting",
>         "StartingInitialConditions" ->  {y[0] == b, y'[0] == a}}]], {x,
>     0, 1}, PlotRange ->  All], {a, 0, 3}, {b, 0, 3}]
>
> what i basically want is to get all the sinusoidal modes by varying
> 'some' parameter. i want to be able to tune one parameter so that i
> get the mode with zero nods, one nod, two nods etc. how do i do that?
>
> (i know that mathematica can solve this equation analytically, but as
> mentioned above, this is just an example for a more involved
> calculation.)
>
> r.
>

```
 0

2 Replies
650 Views

Similiar Articles:

7/22/2012 12:28:06 PM