MathGroup Archive 1998

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

Search the Archive

odd behavior of NDSolve



I've discovered a very disturbing problem with NDSolve. I'd like to know
if others can reproduce this.

Here's an example:

f[x_, y_] := 1 - Exp[-(x^2 + y^2)]

fx[x_, y_] = D[f[x, y], x];  fy[x_, y_] = D[f[x, y], y];

Clear[x0, y0, u0, v0];
diffeqs =
   {x''[t] == -fx[x[t], y[t]],
    y''[t] == -fy[x[t], y[t]],
    x[0] == x0, x'[0] == u0, y[0] == y0, y'[0] == v0}

endTime = 12.03;
  {x0, y0, u0, v0} = {4, 3, -0.7, -0.17};
  soln = Flatten[NDSolve[diffeqs, {x, y}, {t, 0, endTime}]];
  r[t_] = {x[t], y[t]} /. soln;
  path = ParametricPlot[r[t], {t, 0, endTime},
    PlotRange -> {{-4, 4}, {-4, 4}}];

You should see a curve with a slight bend to it. Now change endTime to
12.04. The bend is gone. Shouldn't we get the same curve for 0 < t <
12.03? Either I'm missing something or NDSolve has a serious problem.

(BTW, I'm running Mathematica 3.0 and Mac OS 8.1)

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Dr. Selwyn Hollis
Associate Professor of Mathematics
Armstrong Atlantic State University
Savannah, GA 31419 USA
<http://www.math.armstrong.edu/faculty/hollis/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




  • Prev by Date: Re: mg11400 making MatrixForm the default
  • Next by Date: Installing Linux version with Win 95/NT version licensed
  • Prev by thread: Re: Calculus`FourierTransform`
  • Next by thread: Re: odd behavior of NDSolve