MathGroup Archive 2006

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

Search the Archive

Re: NDSolve::ndsz question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63668] Re: NDSolve::ndsz question
  • From: Pratik Desai <pdesai1 at umbc.edu>
  • Date: Mon, 9 Jan 2006 04:49:08 -0500 (EST)
  • References: <200601070729.CAA06883@smc.vnet.net> <dpqk4s$2j6$1@smc.vnet.net> <43C182A6.8080901@gmail.com>
  • Sender: owner-wri-mathgroup at wolfram.com

Jean-Marc Gulliet wrote:

> Pratik Desai wrote:
>
>> 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),
>>
>               ^^^
> Note that the whole expression {b x^2 BesselK[2, x]) is squared.
>
>>> 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,
>>
> I am afraid not
>
>> 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}]
>
>               ^^^
> since the expression is not squared as in the original equation.
>
>> 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}
>>
>
> Best regards,
> /J.M.

Whoop sorry, I thought I had gotten all the powers in the expression 
when I copied from the e-mail. I got the ndsz error too (yeah!!! :-) ). 

Thanks Jean Marc and sorry Flip.


Pratik


  • Prev by Date: Re: Moving an outsider to the closest point on the boundary
  • Next by Date: Fw: Connecting to an existing Notebook from Java
  • Previous by thread: Re: NDSolve::ndsz question
  • Next by thread: Re: NDSolve::ndsz question