Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 1. Getting Started > Aborting a Calculation

1.11. Aborting a Calculation

Sometimes we might want to interrupt a calculation. For example, if we unknowingly start a calculation that might take days to finish, we’ll just be waiting and waiting wondering how long it is going to take! Or, after we learn how to program in Mathematica, we might accidentally write a program that has a mistake in it that will cause the computer to run forever without ever completing what we wanted it to do. Rather than just quitting Mathematica and losing all of our work, we can usually abort the calculation by choosing Evaluation Abort Evaluation from the menu bar.

When Mathematica is doing a calculation it will say “Running . . .” in the title bar of the window. If the calculation is really fast you won’t even notice, but if the calculation lasts for several seconds you will see it. Try computing 510000000. This calculation should last long enough for you to see the title of your window change to include “Running . . . .” This would be a great place to use a semicolon to suppress output! It is also a great place to use the Timing function so that we can see how long the calculation takes. The Timing function can be wrapped around any other calculation. Here is an example.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint