MathGroup Archive 2011

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

Search the Archive

Defining a variable from an error message (NDSolve::ndsz)

  • To: mathgroup at
  • Subject: [mg122265] Defining a variable from an error message (NDSolve::ndsz)
  • From: Jonathan Frazer <J.Frazer at>
  • Date: Sat, 22 Oct 2011 06:10:31 -0400 (EDT)
  • Delivered-to:

Hi Everyone,

Using the example from the NDSolve::ndsz section in the documentation centre, evaluating

NDSolve[{(2 - f[x]) f'[x] == f[x], f[0] == 1}, f, {x, 0, 5}]

gives the error message

"NDSolve:ndsz : At x == 0.38629402687577696`, step size is effectively zero; singularity or stiff system suspected".

What I would like to do is be able to automatically define a variable xdanger = 0.38629402687577696 so that I can use it in a subsequent part of the code.

Does anyone have a suggestion for how I might do this?

Many thanks,


P.S. In similar problems I usually can make use of Check one way or another but in this case I want to be able to use the variable xdanger to make an inequality. For this reason, I don't think Check is applicable.

  • Prev by Date: Re: Problem with "Which"
  • Next by Date: Re: count the number of sub-list in a list
  • Previous by thread: Re: strange error
  • Next by thread: Re: Defining a variable from an error message (NDSolve::ndsz)