Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Re: Plot artifact of NDSolve result

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116142] Re: Plot artifact of NDSolve result
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Thu, 3 Feb 2011 05:30:46 -0500 (EST)

This works:

Clear[y]
sol4 = NDSolve[{eqn4, y[0] == 0, y'[0] == 1}, y, {t, 0, 70},
    WorkingPrecision -> 20, MaxStepSize -> 0.01];
y = y /. First@sol4;
Plot[{y[t], y'[t], y''[t]}, {t, 0, 70}, PlotRange -> All,
  PlotPoints -> 100]

PlotPoints had to be increased. Eliminating Evaluate and /.soln4 in the  
plot was mostly for style.

Bobby

On Wed, 02 Feb 2011 05:07:13 -0600, Bert RAM Aerts  
<bert.ram.aerts at 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?
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: ascii quotes in Program cell
  • Next by Date: Re: Read last expression in a file?
  • Previous by thread: Re: Plot artifact of NDSolve result
  • Next by thread: Counting Matching Patterns in a Large File