       Re: NDSolve solution does not fulfill boundary condition ??

• To: mathgroup at smc.vnet.net
• Subject: [mg121123] Re: NDSolve solution does not fulfill boundary condition ??
• From: "Kevin J. McCann" <kjm at KevinMcCann.com>
• Date: Mon, 29 Aug 2011 20:00:49 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <j3fg96\$fb4\$1@smc.vnet.net>

```My guess is that this is due to the extreme nonlinearity of the DE. The
exponential is essentially zero except for x = 0; so, you have something
like a delta function at the origin. Plot the RHS, which should be zero,
for the two cases, and you will see a problem at x = 0. I think the
question is why it *does* work when the parameter is 1500. The whole
thing falls apart even for a value of 1490.

Kevin

On 8/29/2011 3:48 AM, Alex wrote:
> Hello everybody,
>
> I use Mathematica 7 and try to solve and plot a 2nd order ODE like this:
>
> sol = NDSolve[{0 == 4800*O2''[x] + 1500*Exp[-(100*x)^2] - 2000*O2[x],
> O2'[-0.5] == 0, O2'[0.5] == 0}, O2, {x, -1, 1}]
> Plot[O2[x] /. sol, {x, -1, 1}, PlotRange ->  All]
>
> The solution looks ok, i.e. the slope of the solution is 0 at 0.5 and
> -0.5, as required by the boundary conditions. But if I slightly change
> the parameter values from 1500 to 1000 like this:
>
> sol = NDSolve[{0 == 4800*O2''[x] + 1000*Exp[-(100*x)^2] - 2000*O2[x],
> O2'[-0.5] == 0, O2'[0.5] == 0}, O2, {x, -1, 1}]
>
> I get a solution with slope=0 at -0.5, but with a positive slope at
> 0.5 !!??
>
> How can this be ?  What am I doing wrong ?
>
> Many thanks,
>
> axel
>

```

• Prev by Date: Re: With Nearest
• Next by Date: Importing FITS files into Mathematica
• Previous by thread: Re: NDSolve solution does not fulfill boundary condition ??
• Next by thread: Defective Mesh lines in ContourPlot3D