开发者

In Mathematica, how to see the full messages output?

开发者 https://www.devze.com 2023-02-08 13:16 出处:网络
While performing an optimization using Minimize[] in Mathematica, I\'m getting what appear to be some NaNs:

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 开发者_JS百科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.


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


Try this:

Off[General::stop]

--Mark

0

精彩评论

暂无评论...
验证码 换一张
取 消