MathGroup Archive 2006

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

Search the Archive

Re: NDSolve::ndsz question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63634] Re: [mg63599] NDSolve::ndsz question
  • From: Pratik Desai <pdesai1 at umbc.edu>
  • Date: Sun, 8 Jan 2006 03:32:56 -0500 (EST)
  • References: <200601070729.CAA06883@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Flip wrote:

>Greetings, I'm trying to solve a differential equation  but I'm getting
>the following error:
>
>NDSolve::ndsz: At x == 18.84025621252942`, step size is effectively
>zero; \
>singularity or stiff system suspected
>
>I'm not sure how to deal with this--is there a way to allow smaller
>step sizes? Here is my complete code:
>
>k := 400000000;
>b  := 0.0023;
>epsR := 0.024;
>solution := NDSolve[
>{y'[x] == -k x^(-0.5) \[ExponentialE]^(-epsR x) (y[x]^2 - (b x^2
>BesselK[2,x])^2),
>y[0.1] == b*BesselK[2,0.1]/(0.1)}, y, {x,0.1,5000}]
>Evaluate[y[5000] /. solution]
>
>Any thoughts would be appreciated! Thanks,
>Flip
>
>  
>
I replaced all of your := with = and it seems to work fine,

In[222]:=
$Version
k=400000000;
b=0.0023;
epsR=0.024;
solution=NDSolve[{y'[x]\[Equal]-
    k* x^(-0.5)* \[ExponentialE]^(-epsR x) (y[x]^2-(b
    x^2 
BesselK[2,x])2),y[0.1]\[Equal]b*BesselK[2,0.1]/(0.1)},y,{x,0.1,5000}]
Evaluate[y[5000]/.solution]//InputForm

Out[222]=
5.1 for Microsoft Windows (January 27, 2005)

Out[226]=
{{y\[Rule]InterpolatingFunction[{{0.1,5000.}},<>]}}

Out[227]//InputForm=
{1.887473651751147*^-9}


  • Prev by Date: Questionable solution from DSolve
  • Next by Date: Re: Odd answer from Mathematica
  • Previous by thread: NDSolve::ndsz question
  • Next by thread: Re: NDSolve::ndsz question