MathGroup Archive 2010

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

Search the Archive

Re: NDSolve: ..numerically ill-conditioned...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109481] Re: NDSolve: ..numerically ill-conditioned...
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 29 Apr 2010 02:53:04 -0400 (EDT)

Use exact numbers and DSolve or use higher precision with NDSolve

eqns = {u''[x] - 1*^7 u[x] == 36*^6,
   u'[0] == 0, u'[2*^-3] == 0};

soln = DSolve[eqns, u[x], x][[1]]

{u[x] -> -(18/5)}

eqns2 = {u''[x] - 1*^7 u[x] == 3.6`35*^7,
   u'[0] == 0, u'[2*^-3] == 0};

soln2 = NDSolve[eqns2, u, {x, 0, 5}, WorkingPrecision -> 35][[1]];

Table[u[x] /. soln2, {x, 0, 5, .5}]

{-3.6,-3.6,-3.6,-3.6,-3.6,-3.6,-3.6,-3.6,-3.6,-3.6,-3.6}

Plot[Evaluate[u[x] /. soln2], {x, 0, 5}]


Bob Hanlon

---- Alessio Giberti <giberti at fe.infn.it> wrote: 

=============
I have to solve numerically equations like

u''[x] - 1*^7 u[x] ==  3.6*^7,
u'[0]==0, u'[2*^-3]==0,

but I get the message:

"The equations derived from the boundary conditions are numerically 
ill-conditioned. The boundary conditions may not be sufficient to 
uniquely define a solution. The computed solution may match the boundary 
conditions poorly."

No problem with less extreme coefficients, the solutions are good, but 
more extreme coefficients lead to non-reliable results. What can I do to 
overcome the problem?




  • Prev by Date: Re: Why Return[] does not work?
  • Next by Date: Re: Why Return[] does not work?
  • Previous by thread: NDSolve: ..numerically ill-conditioned...
  • Next by thread: Odd phenomenon