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$
1
  • $\begingroup$ Try using SetDelayed (expr := (* stuff *)) instead of Set (expr = (* stuff *)). $\endgroup$ Commented Jan 20, 2012 at 8:47

2 Answers 2

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$
1
  • $\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$ Commented Jan 20, 2012 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$
2
  • 1
    $\begingroup$ +1: Although, to clear the cached simplify results you should use ClearSystemCache[] or ClearSystemCache["Symbolic"]. $\endgroup$ Commented Jan 20, 2012 at 11:29
  • $\begingroup$ @Simon Thanks. I knew there was a different command to do this, but I couldn't find it. $\endgroup$ Commented Jan 20, 2012 at 11:42

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.