Luís Marques
Luís Marques

Reputation: 1001

In Mathematica, how to see the full messages output?

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.

Upvotes: 1

Views: 1279

Answers (2)

acl
acl

Reputation: 6520

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}]

Upvotes: 3

mef
mef

Reputation: 161

Try this:

Off[General::stop]

--Mark

Upvotes: 3

Related Questions