DOC PREVIEW
IIT MATH 149 - Introduction to Mathematica

This preview shows page 1-2-23-24 out of 24 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

An Introduction to MathematicaNavigating the Mathematica UIMathematica's user interface is organized by a single top title and menu bar, with several child windows beneath. Many othermodern editors use this, although Mathematica makes the unusual move of displaying the user's other windows beneath the menubar. This can sometimes confuse people into thinking they are interacting with the wrong program. Each child window is dedi-cated to a single Mathematica notebook, a document that can also contain Mathematica commands.The default size of the characters displayed in a Mathematica notebook is rather small. However, the magnification can easily be adjusted by clicking on Window along top toolbar and selecting a more readable magnification, e.g. 150%.A Mathematica notebook's basic structure is called a "cell." You can see the cell divisions by looking at the right-hand side of thenotebook view: each cell is denoted by a single bracket.You can create a cell by clicking on the border between two cells and typing any letter, symbol, or other input.Each cell can contain a specific type of content. For example, what you are reading now is located in a text cell. Some examplesof different kinds of cells:è Text cells contain text that has no major stylistic forms, and no executable code. è Item cells contain the elements of a bulleted listè Input cells contain Mathematica codeè Section, Subsection, etc cells contain text that is formatted larger and with extra gimmicks so that they are eye-catching.You can view a cell's designation by right-clicking on a cell's bracket and selecting"Style:"2 Introduction to Mathematica.nbAll cells have certain properties associated with them. These properties may be viewed by selecting a cell, going into the Cellmenu, and then going into the Cell Properties submenu:Introduction to Mathematica.nb 3You can also quickly view a cell's properties by the symbols in the upper part of the bracket. A line parallel to the top of thebracket means that the cell cannot be evaluated - that is, the cell cannot be run as though it contains Mathematica code. A trianglemeans that the cell can be evaluated. An "x" means that the cell cannot be edited by the user. If the cell can evaluated, but notedited, the "x" will be located below the triangle. Otherwise, the "x" will be located above the line.These can all be changed by the user at any time through the cell properties submenu, so they are primarily for convenience.Cells can contain other cells. You can see this with multiple layers of brackets. You can collapse a cell down to just one of itssubcells by double-clicking on the subcell that you want to be visible.It is important to distinguish here between the Mathematica program that you are looking at right now, and the Mathematicaprogram that is executing your Mathematica code. What you are looking at right now is just a fancy interface; when you are4 Introduction to Mathematica.nbusing Mathematica to do mathematics, you are not dealing with this interface, but rather you are dealing with another programcalled the Mathematica Kernel. You are merely using this interface as an intermediary. You can see this by looking at the In andOut designations when you enter commands into Input cells. Each Input cell that has been evaluated contains an In designation,which consists of the word "In" followed by a number in brackets. Each response to an input from the Mathematica kernel has anOut designation, which is the word "Out" followed by the same number in brackets as the input that generated it. These In andOut lines are what the Mathematica kernel is seeing.What you see when you are dealing with Mathematica is a document editor, but what you are actually using is not a documenteditor at all; it is more like a chatclient.Introduction to Mathematica.nb 5ArithmeticWe will call any typed string of symbols to be executed by Mathematica' s computational engine (or kernel) an instruction.Instructions are placed inside of input cells. To execute a typed instruction, hit the Ente] key while simultaneously holding downthe Shift key. Instructions entered in Mathematica typically appear in black bold type and in Courier font. You can enter instruc-tions for the Mathematica kernel to execute using the same type of notation that is commonly seen in calculators. Here are someexamples:In[1]:=2 + 5Out[1]=7In[2]:=2 − 5Out[2]=− 3In[3]:=2 ∗ 5Out[3]=10In[4]:=2 ê5Out[4]=25In[5]:=2^5Out[5]=326 Introduction to Mathematica.nbIn[6]:=Sqrt@9DOut[6]=3In[7]:=5!Out[7]=120In[8]:=Abs@2 − 5DOut[8]=3In[9]:=Sin@2DOut[9]=Sin@2DIn[10]:=Csc@2DOut[10]=Csc@2DEntering two numbers separated by a space is assumed to be multiplication:In[11]:=2 × 5Out[11]=10In addition, you can use special shortcuts on your keyboard to obtain similar effects. Pressing one of these key combinations doesnot lead to an ordinary character being entered, but instead typically causes some action to occur or some structure to be created.Ctrl+^ or Ctrl+6 go to the superscript for a power Ctrl+/ go to the denominator for a fractionCtrl+@ or Ctrl+2 go into a square root Please try to see if you can input these mathematical expressions :In[12]:=25Out[12]=25In[13]:=52Out[13]=25In[14]:=9Out[14]=3Using AssistantsSometimes, you will see a bit of Mathematica code, but you won't understand the purpose of it. It is in this situation where youwill have to use Mathematica's built in help feature. If you highlight a command that you do not know the purpose of and thenpress F1, you will be taken to a window that shows what that command does. You can try this now with the Erf function:Introduction to Mathematica.nb 7In[15]:=Erf@2DOut[15]=Erf@2DYou should have gotten something that looks likethis:You can get a more detailed explanation by clicking on the "More Information" button, and there are always several examples.At other times, you will want Mathematica to do something, but you will not know how to tell Mathematica to do what it is you8 Introduction to Mathematica.nbwant it to do. At these times, you have several options available to you. If you press F1 without highlighting anything, you willbe brought to the basic help screen. From there, you can perform a search for the command you wish to enter, and the help willgive you anything that isrelated.Many basic commands are also available in Palettes. If you go to the Palettes menu and select


View Full Document

IIT MATH 149 - Introduction to Mathematica

Documents in this Course
QUIZ

QUIZ

2 pages

QUIZ

QUIZ

3 pages

Quiz

Quiz

2 pages

Exam

Exam

4 pages

Load more
Download Introduction to Mathematica
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Introduction to Mathematica and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Introduction to Mathematica 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?