3
$\begingroup$

sorry for a basic question, but does any one know what is the trick to make the front end beep at me each time I issue the same command (which contain an error)?

It now only beeps the first time, but when I SHIFT+ENTER the same command again, it stops beeping. I want it to beep each time.

here is an example:

expr = 0.09 - (0.00043739999999999995*
     Sin[x])/(Sqrt[1 - 0.36*Sin[x]^2]*(0.0225 - 0.0081*Sin[x]^2))
FullSimplify[expr]

now it beeped and gave message to the notebook

Indeterminate

and the following messages to the console:

 Mathematica beeped to let you know that a warning or error 
 message was generated by the kernel. You can disable this beep by resetting 
 MessageOptions in the Option Inspector.

But when I typed the above again:

FullSimplify[expr]

I see no more messages to the console and no more beeps but only the Indeterminate message comes out to the notebook. Only way to see the error again and hear the beeps is to do Remove["Global*"]` and run everything again.

Strange thing, is that this behaviour does not happen for everything. For example, if I type

Simplify[1/0]

I will see a new error a hear a new beep EACH time I execute the command. I have a feeling that the kernel is remembering things. But I do not want to clear everything each time.

I am using 8.04, and this is a picture of my setup:

enter image description here

and here is the messageOptions in the advanced setup

enter image description here

I tried to change the MaxMessageCount to 100 but no change. same for the MessageCountRestTime.

thanks

$\endgroup$
  • $\begingroup$ Try using SetDelayed (expr := (* stuff *)) instead of Set (expr = (* stuff *)). $\endgroup$ – J. M. is away Jan 20 '12 at 8:47
3
$\begingroup$

Heike figured out what was going on. However, if you want a command that will make your Simplify[expr] beep everytime, you need to turn of the symbolic part of the cache using

SetSystemOptions["CacheOptions" -> {"Symbolic" -> False}]
$\endgroup$
  • $\begingroup$ @Nasser: Of course, this will slow down some calculations. It will also make some of the weird behaviour go away, like trying the same integral twice in a row and getting two different results! $\endgroup$ – Simon Jan 20 '12 at 11:41
4
$\begingroup$

I think you only get the warning once because Simplify somehow remembers which expressions it has simplified before. For example, in a new session this only gives me a warning for the first evaluation of FullSimplify:

FullSimplify[1/x, x == 0]
FullSimplify[1/x, x == 0]

output:

Mathematica graphics

Now if I clear Simplify and run FullSimplify again the warning show up again

Unprotect[Simplify]
Clear[Simplify]
Protect[Simplify]
FullSimplify[1/x, x == 0]

output:

Mathematica graphics

$\endgroup$
  • 1
    $\begingroup$ +1: Although, to clear the cached simplify results you should use ClearSystemCache[] or ClearSystemCache["Symbolic"]. $\endgroup$ – Simon Jan 20 '12 at 11:29
  • $\begingroup$ @Simon Thanks. I knew there was a different command to do this, but I couldn't find it. $\endgroup$ – Heike Jan 20 '12 at 11:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.