ODE system - shooting for a terminal point

• To: mathgroup at smc.vnet.net
• Subject: [mg121141] ODE system - shooting for a terminal point
• From: The Mighty Algernon <joaopereira9 at gmail.com>
• Date: Wed, 31 Aug 2011 06:04:30 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com

```Hi,

I wonder if you could help me.

I have a system of ODE in which I have to figure out the initial
conditions of part of the differential equations. I managed to do this
by the shooting method by writing the system as a function of the
initial conditions.

For example solution[yini_,zini_]:=NDSolve[......

then I used FindRoot on the set of terminal restrictions to find yini
and zini (these are the initial conditions). This procedure worked
although it is terribly sensitive to the first guesses on the FindRoot
and some results I get are obviously wrong. But this is something I
can refine.

Now I have a similar goal but the variable I'm trying to guess is not
an initial condition of a differential equation but the terminal value
of the range of the exogenous variable. For example,

If I have a system of 2 ODE , y[x] and z[x], I want to know for {x,
0,xtarget} what is my xtarget. Think of x as time and I want to figure
when is the terminal time of the system such that some restrictions at
the terminal time are met.

My first ideia was to adapt the above procedure, writing

solution[xtarget_]:=NDSolve[......
then giving the set of restrictions and then using FindRoot to get
xtarget, but Mathematica gives me an error message the xtarget is not
a real value.

My question is :

Is it possible to adapt the procedure outlined above, meaning that
I'm just doing some kind of error here (that I'll have to correct), or
Mathematica does not handle this kind of problems directly in NDSolve
and I have to write some sort of loop with ever more refined guesses
for xtarget?

My best regards

Joao Pereira

```

• Prev by Date: Sudden memory-usage increase with SparseArray
• Next by Date: Shooting for the endpoint of a ODE system
• Previous by thread: Re: Sudden memory-usage increase with SparseArray
• Next by thread: Shooting for the endpoint of a ODE system