1

While performing an optimization using Minimize[] in Mathematica, I'm getting what appear to be some NaNs:

NMinimize::nnum: The function value Indeterminate is not a number at {q} = {0.}. >> NMinimize::nnum: The function value Indeterminate is not a number at {q} = {0.}. >> NMinimize::nnum: The function value Indeterminate is not a number at {q} = {0.}. >> General::stop: Further output of NMinimize::nnum will be suppressed during this calculation. >>

The NaNs are OK, because they don't seem to be affecting the optimization result. But because further messages are being suppressed, I'm not sure if I'm getting messages relating (for instance) the maximum number of iterations being exceeded without reaching the requested precision.

So, is there a way to see the full list of messages? Does such option, if it exists, have to be activated prior to the evaluation, or is there a full message buffer that I can consult afterwards? The optimization takes a very long time, so I would wish to avoid having to recompute it.

I only found the Off and On functions, which didn't seem to do what I wanted.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
Luís Marques
  • 991
  • 1
  • 10
  • 20
  • 1
    Beware of not get involved in solving cascading errors when debugging. As Timo said [`here`](http://stackoverflow.com/questions/4176612/setting-up-diagnostic-error-messages-in-large-mathematica-projects) **Mathematica's error message are opaque, archaic, and legion.** – Dr. belisarius Feb 05 '11 at 17:59
  • 1
    Possibly relevant -- http://stackoverflow.com/questions/4264734/seeing-truncated-messages-in-mathematica . By overriding Message you can get all messages, even the ones that are being suppressed to start with. For Maximize this can produce messages with Hessian at each step so can be quite large – Yaroslav Bulatov Feb 05 '11 at 18:10
  • Thanks Yaroslav, that was helpful too. – Luís Marques Feb 05 '11 at 18:14

2 Answers2

3

Try this:

Off[General::stop]

--Mark

mef
  • 161
  • 4
3

Two comments. First, Off[General::stop] should do exactly what you want, ie, turn off suppression of messages. Second, only messages of the given kind have been suppressed, eg NMinimize::nnum in your case. Other messages are not, so if, for instance, $IterationLimit is exceeded, you'll get that message.

EDIT: Example:

On[General::stop]
Do[
NIntegrate[Sin[a*x], {x, 0, 10}];
If[i == 20, 1/0],
{i, 1, 100}]
acl
  • 6,490
  • 1
  • 27
  • 33