Mathematica Basics - The Environment

Introduction

The Interface

As you are probably already aware,ÌýMathematicaÌýis one of a class of applications calledÌýcomputer algebra systems. With the right input it is capable of doing almost all of the mathematics you have learned in college so far, and much of what you have yet to learn! Its abilities come at a price, both financial, and in the effort you have to put into learning its interface. It is less forgiving than most software when it comes to minor differences in your input. A missing comma or brace can lead to serious, hard to track down errors, so it is essential that you pay careful attention to detail when you enter commands into the program.

When you interact withÌý²Ñ²¹³Ù³ó±ð³¾²¹³Ù¾±³¦²¹, you do so by typing text commands into itsÌýfront-end, which then sends these commands off to the core of the program, called theÌýkernel. The kernel then executes the code you have entered, and returns the result to you through the front end-again. As you carry on this conversation withÌýMathematica'sÌýkernel, you will create a document, called aÌýnotebook, (file extension .nb) consisting ofÌýcells. These cells have two primary types,Ìýinput cells, andÌýoutput cells, (though many other cell types, such asÌýtext cellsÌý²¹²Ô»åÌýgraphic cellsÌýalso exist.)

Input and output cells are numbered sequentially, usually in pairs, as you carry out your conversation with the kernel. These inputs and outputs areÌýnotÌýtied in any way to the specific notebook you have open in front of you. TheyÌýareÌýtied to the session you have been having with the kernel. You could close a notebook and open a new one, and the numbering would pick up where the old notebook left off, provided the kernel was not terminated in the transition.

Getting Command Help

There are two main ways of obtaining help fromÌýMathematicaÌýif you run into any questions about it's built in commands, etc.

  • °Õ³ó±ðÌý?command: The simplest way to get help assumes that you already know the name of the command that you wish to use, and simply wish to check on itsÌýsyntax. This can be found by typing a question mark, followed by the command's name, followed by hitting the ENTER key. This same command can be used to check on the current values of the variables that you are using, and the definitions of user defined functions, etc.

  • °Õ³ó±ðÌýHelpÌýmenu: If you have no idea what the command you are seeking is even called,ÌýMathematica'sÌýhelp menu is extraordinarily rich in information. The entireÌýMathematicaÌýmanual is available through this menu, as are examples of using the command you seek. The main information you are looking for can almost certainly be tracked down in the first four choices in the menu, as shown below.

    Ìý
    Help Image

Typing Shortcuts

While usingÌýMathematicaÌýit is handy to be aware of a few typing shortcuts.Ìý(Note that on the Macintosh the COMMAND key would replace the CONTROL key in the discussion below.)

  • CONTROL-K: This keystroke will attempt to complete the command that you are currently typing. If the there is more than one possible ending to what you have typed so far,ÌýMathematicaÌýwill generate a little pop-up menu containing the the full list of possible endings. You may select one of the items on this list by either using the mouse, and clicking, or the arrow keys on the keyboard, and hitting RETURN.

  • CONTROL-L: This keystroke retypes in the current cell theÌýfull command from the cell immediately above it. The newly produced cell may then be edited to give a new command. This comes in useful when you are doing a sequence of problems where very little changes between consecutive commands.

  • °Õ³ó±ðÌý%-key: The percent key,Ìý%, can be used as a direct reference within a new command to theÌýprevious answer. This comes in useful when doing a sequence of commands where a new command depends on the result of the previous command. Furthermore,Ìý%%Ìýrefers to the result from two commands earlier,Ìý%%%Ìýto three commands earlier, etc.Ìý%nÌýrefers to the result fromÌýOut[n]ÌýinÌýMathematica's sequentially numbered cells.

You're now finishing learning the Basics of theÌýMathematicaÌýInterface. You may now go to theÌý, theÌýTable of Contents for theÌýMathematicaÌýBasics Labs, or theÌýTable of Contents for all of the Differential Equations Labs, or simply quit.