Re: How to NDSolve the differential equation
- To: mathgroup at smc.vnet.net
- Subject: [mg19640] Re: How to NDSolve the differential equation
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Tue, 7 Sep 1999 00:28:36 -0400
- Organization: Universitaet Leipzig
- References: <7qulo3$2r5@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Chee, your equation is singular at the origin. How ever a convergent power series exist and a numerical solution is possible. The problem ov NDSolve[] ist that it divedes the equation by x and get Sin[x]/x but it does not calculate a Limit[] at x->0 it just find a (not existing) singulaity. You cando the following: Define the Sin[x]/x function deqn = x y''[x] + Sin[x] y'[x] + 2 x y[x] == 0 sinc[0.] := 1 sinc[0] := 1 sinc[x_?NumericQ] := Sin[x]/x deqn2 = (Simplify[#/x & /@ deqn]) /. Sin[x]/x -> sinc[x] and NDSolve[{deqn2, y[0] == 0, y'[0] == 1}, y[x], {x, 0, 2}] works as expected. Hope that helps Jens Chee Lim Cheung wrote: > > Dear Mathematica gurus & users, > > I encountered error messages with the tag Power::infy when I tried to do > the following: > > NDSolve[{x y''[x] + Sin[x] y'[x] + 2 x y[x] == 0,y[0]==0, y'[0]==1}, y, > {x,0,2}] > > Can anyone help me in getting Mathematica to produce an answer? I am using > Mathematica 4.0 & Mathematica 3.0. > > Thanks > Chee