Re: NDSolve::ndsz question
- To: mathgroup at smc.vnet.net
- Subject: [mg63660] Re: NDSolve::ndsz question
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Mon, 9 Jan 2006 04:48:43 -0500 (EST)
- Organization: The Open University, Milton Keynes, UK
- References: <200601070729.CAA06883@smc.vnet.net> <dpqk4s$2j6$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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.
- References:
- NDSolve::ndsz question
- From: "Flip" <fliptomato@gmail.com>
- NDSolve::ndsz question