Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16001 > unrolled thread

Re: Plot artifact of NDSolve result

Started byBob Hanlon <hanlonr@cox.net>
First post2011-02-03 10:30 +0000
Last post2011-02-03 10:30 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  Re: Plot artifact of NDSolve result Bob Hanlon <hanlonr@cox.net> - 2011-02-03 10:30 +0000

#16001 — Re: Plot artifact of NDSolve result

FromBob Hanlon <hanlonr@cox.net>
Date2011-02-03 10:30 +0000
SubjectRe: Plot artifact of NDSolve result
Message-ID<iie03u$blm$1@smc.vnet.net>
eqn4 = y''[t] == -y[t]^2 + t;

sol4 = NDSolve[{eqn4, y[0] == 0, y'[0] == 1}, y, {t, 0, 70},
   WorkingPrecision -> 20, MaxStepSize -> 0.01];

Change (increase) the number of initial sample points (PlotPoints).

Plot[Evaluate[{y[t], y'[t], y''[t]} /. sol4], {t, 0, 70},
 PlotRange -> All, ImageSize -> 400,
 PlotPoints -> 25]


Bob Hanlon

---- Bert RAM Aerts <bert.ram.aerts@gmail.com> wrote: 

=============
Both in Mathematica 8.0.0 and 7.0.1 the plot of NDSolve result is
wrong near x-axis point 60. But when zooming in, plot is correct.

Notebook and screenshot of result are available on http://users.skynet.be/fa991376/

eqn4 = y''[t] == -y[t]^2 + t

sol4 = NDSolve[{eqn4, y[0] == 0, y'[0] == 1}, y, {t, 0, 70},
  WorkingPrecision -> 20, MaxStepSize -> 0.01]

Below plot contains the artifact:

Plot[Evaluate[{y[t], y'[t], y''[t]} /. sol4], {t, 0, 70},
 PlotRange -> All]

Below plot is correct:

Plot[Evaluate[{y[t], y'[t], y''[t]} /. sol4], {t, 50, 70},
 PlotRange -> All]

Is there a way to avoid this?


[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web