(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 4359, 145]*) (*NotebookOutlinePosition[ 5036, 169]*) (* CellTagsIndexPosition[ 4992, 165]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic", FontColor->RGBColor[0, 0, 1]], StyleBox[" can \"hold\" values in variables, and this works as you might \ expect. Evaluate the Cells below in order. Note that if there is a \ semicolon after a statement, the output is suppressed (but the variable value \ is still assigned). Also note that the variables are \"cleared\" at the end \ so that they are ready to be reassigned later.", FontColor->RGBColor[0, 0, 1]] }], "Section"], Cell[BoxData[ \(\(m\ = \ 5;\)\)], "Input"], Cell[BoxData[ \(n\ = \ 6; \ t\ = \ 9.4; \ s\ = \ \(-3.345677\);\)], "Input"], Cell[BoxData[ \(m\ *\ n\)], "Input"], Cell[BoxData[ \(m\ - \ n\ *\ t\ /\ s\^2\)], "Input"], Cell[BoxData[ \(t\)], "Input"], Cell[BoxData[ \(Clear[m, n, t, s]\)], "Input"], Cell["\<\ The syntax for defining functions is a little less intuitive, and you will \ want to take note of the x_ (that's x with an underscore after it), the \ bracket notation [ ] (not parantheses), and the := (not just an equals sign, \ but colon equals). Evaluate the following expressions, and then try some of \ your own.\ \>", "Section", FontColor->RGBColor[0, 0, 1]], Cell[BoxData[ \(f[x_]\ := \ x\^2 - 5 x + 7\)], "Input"], Cell[BoxData[ \(g[x_] := \ Sin[2 x\ - \ \[Pi]\/3]\)], "Input"], Cell[BoxData[ \(f[1]\)], "Input"], Cell[BoxData[ \(f[5] + g[\[Pi]\/3]\)], "Input"], Cell[BoxData[ \(g[a\^2 - a]\)], "Input"], Cell[BoxData[ \(f[5 - 2 \[ImaginaryI]]\)], "Input"], Cell[BoxData[ \(f[g[\[Pi]\/6]]\)], "Input"], Cell[BoxData[ \(f[g[x]]\)], "Input"], Cell[BoxData[ \(Clear[f, g]\)], "Input"], Cell[TextData[{ "Setting up expressions and then substituting also has its quirks. See the \ expression below, expr /. y \[Rule] 2, which you should read as \"replace y \ in expr with 2\". Be careful, too, with \"implied multiplication\". You \ need to make sure that you place spaces between the variables for ", StyleBox["Mathematica", FontSlant->"Italic"], " to understand this. Evaluate and then try your own." }], "Section", FontColor->RGBColor[0, 0, 1]], Cell[BoxData[ \(expr\ = \ x\ y\ z\ + \ x\^2 + \ 3 y\^2\ + \ 2 y\ z\)], "Input"], Cell[BoxData[ \(expr\ /. y \[Rule] 2\)], "Input"], Cell[BoxData[ \(expr\ /. \ x\ \[Rule] \ \(-3\)\)], "Input"], Cell[BoxData[ \(expr\ /. \ {x\ \[Rule] \ 2, \ z\ \[Rule] \ \(-1\)}\)], "Input"], Cell[BoxData[ \(expr\ /. \ {x\ \[Rule] \ 5, \ y\ \[Rule] \ \(-4\), \ z\ \[Rule] \ 3}\)], "Input"], Cell[BoxData[ \(Clear[expr]\)], "Input"] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, CellGrouping->Manual, WindowSize->{496, 599}, WindowMargins->{{Automatic, 131}, {Automatic, 6}} ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1717, 49, 506, 10, 158, "Section"], Cell[2226, 61, 47, 1, 30, "Input"], Cell[2276, 64, 83, 1, 30, "Input"], Cell[2362, 67, 40, 1, 30, "Input"], Cell[2405, 70, 57, 1, 30, "Input"], Cell[2465, 73, 34, 1, 30, "Input"], Cell[2502, 76, 50, 1, 30, "Input"], Cell[2555, 79, 377, 7, 158, "Section"], Cell[2935, 88, 61, 1, 30, "Input"], Cell[2999, 91, 68, 1, 40, "Input"], Cell[3070, 94, 37, 1, 30, "Input"], Cell[3110, 97, 51, 1, 40, "Input"], Cell[3164, 100, 44, 1, 31, "Input"], Cell[3211, 103, 56, 1, 30, "Input"], Cell[3270, 106, 47, 1, 40, "Input"], Cell[3320, 109, 40, 1, 30, "Input"], Cell[3363, 112, 44, 1, 30, "Input"], Cell[3410, 115, 476, 9, 179, "Section"], Cell[3889, 126, 88, 1, 30, "Input"], Cell[3980, 129, 54, 1, 30, "Input"], Cell[4037, 132, 65, 1, 30, "Input"], Cell[4105, 135, 86, 1, 30, "Input"], Cell[4194, 138, 114, 2, 30, "Input"], Cell[4311, 142, 44, 1, 30, "Input"] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)