MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

NDSolve does not work in shooting method


This comes from a newbie in Mathematica, so have some mercy....

I'm trying to reproduce some examples of the shooting method that have been
published in this forum, but Mathematica 5.0 shows some strange behavior
with NDSolve.

In http://forums.wolfram.com/mathgroup/archive/2001/Aug/msg00128.html Brian
wrote:

The following code implements the shooting technique

system[a_] := {y1'[x] == y2[x], y2'[x] == -Sin[y2[x]] + Cos[5x],
y1[-1] == 0,
      y2[-1] == a};
myODEsoln[a_] := NDSolve[system[a], {y1[x], y2[x]}, {x, -1, 1}]
yend[a_] := (y1[x] /. myODEsoln[a]) /. x -> 1
bc = FindRoot[First[yend[a]] == 0, {a, -2, 2}];
Plot[Evaluate[y1[x] /. myODEsoln[a /. bc]], {x, -1, 1},
    AxesLabel -> {"x", "y1(x)"}];


While the code was working fine in v. 4.2, now it produces warnings of
"NDSolve::ndinnt :" or "RuleDelayed::rhs".
Can someone test this code in v5.0? Does anyone have some idea of what is
happening and should I implement a typical shooting method?
Thanks in advance.
Alexander Koulidis, Athens, Greece



  • Prev by Date: Re: InterpolatingFunctionAnatomy
  • Next by Date: Re: InterpolatingFunctionAnatomy
  • Previous by thread: Re: Why is this replacement not performed the first time?
  • Next by thread: Re: NDSolve does not work in shooting method