(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of 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[ 31866, 933]*) (*NotebookOutlinePosition[ 32994, 968]*) (* CellTagsIndexPosition[ 32950, 964]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["L3 Packages and Palettes", "Subtitle", FontSize->16, FontWeight->"Bold"], Cell[TextData[{ "In this ", StyleBox["Mathematica", FontSlant->"Italic"], " lesson you will learn how to access and use the palettes and packages \ that were specially designed for this course, as well as how to avoid \ frustrating mistakes. \n\nFor each part of the course, there are special \ functions which are not part of the standard ", StyleBox["Mathematica", FontSlant->"Italic"], " functions. These functions are grouped in packages, and each such package \ has a palette and a help file associated with it. (A listing of the palettes \ is given at the end of this lesson, on page M-18.) As an example we will use \ the palette ", StyleBox["DataFitP", FontWeight->"Bold"], " and its associated package ", StyleBox["DataFit", FontWeight->"Bold"], ". To follow along, launch ", StyleBox["Mathematica", FontSlant->"Italic"], " and open a new notebook." }], "Text"], Cell[CellGroupData[{ Cell["Accessing and Using Palettes", "Subsection"], Cell[TextData[{ "All of the special palettes can be opened from within any notebook by \ selecting ", StyleBox["File \[Rule] Palettes", FontWeight->"Bold"], ", just like the built-in palettes you have seen in the previous ", StyleBox["Mathematica", FontSlant->"Italic"], " lesson. All the palettes whose names end in P are associated with the \ course specific packages. For example, the palette ", StyleBox["DataFitP", FontWeight->"Bold"], " is related to the package that fits functions to data. ", StyleBox["Select this palette now to open it.\n\n", FontWeight->"Bold"], "Each palette consists of buttons. Clicking on any of the buttons will \ paste the content of the button into the active notebook. Move the palette \ to one side of the screen so that it does not overlap with your notebook \ window. This will ensure that your notebook remains the active window (the \ top bar of the window is highlighted under Windows 95, striped under Mac OS) \ when you press a button in the palette. If your sceen is too small to do \ this, either make your notebook window smaller or remember that you have to \ click on your notebook window to make it the active window after you clicked \ on a palette button." }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Loading the Package"]], "Subsection"], Cell[TextData[{ "Each of the palettes with names ending in P has a topmost button that \ looks slightly different from the others. This button is used to load the \ associated package, in this case the DataFit package, into the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel, so that ", StyleBox["Mathematica", FontSlant->"Italic"], " knows about the palette functions." }], "Text"], Cell[TextData[{ StyleBox["This is a very important step - if the package is not loaded, ", CellFrame->True, Background->GrayLevel[0.849989]], StyleBox["Mathematica", CellFrame->True, FontSlant->"Italic", Background->GrayLevel[0.849989]], StyleBox[ " will not know about the functions within the package. Thus, whenever you \ use a palette, make sure to click on the uppermost button first. ", CellFrame->True, Background->GrayLevel[0.849989]] }], "Text", CellFrame->True, Background->GrayLevel[0.849989]], Cell[" This button will always look like", "Text"], Cell[TextData[StyleBox["\t\t<"Bold"]], "Text"], Cell[TextData[StyleBox[ "where packagename is replaced by the specific package name."]], "Text"], Cell[TextData[{ "Click on the topmost button. This will paste ", StyleBox["<"Bold"], " into the open notebook. Depending on whether the palette and notebook \ overlap on the screen, the notebook may not be the active window. If this is \ the case, click on the notebook to make it active. Now you need to place the \ cursor (if it is not already there) into the cell containing the ", StyleBox["<"Bold"], "command, and then evaluate the cell. You should see an ", StyleBox["In[#]", FontWeight->"Bold"], " tag in front of <"Bold"], " tag, check whether the notebook is the active window and repeat the \ procedure." }], "Text"], Cell["\<\ Before using any palette function, you need to load the package. Otherwise, \ strange things will happen (see section on what can go wrong) !!!! Make sure \ that you see an In[#] tag before you continue.\ \>", "Text", CellFrame->True, FontWeight->"Bold", Background->GrayLevel[0.849989]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Using the Help File"]], "Subsection"], Cell[TextData[{ "For each palette, there is a help file. It can be found in a location \ specified by your instructor. Open it by double-clicking on the notebook, or \ by using the ", StyleBox["File \[Rule] Open", FontWeight->"Bold"], " menu. The name of the help file indicates the palette and package with \ which it is associated; for example, the help file for the DataFit package is \ called ", StyleBox["DataFitHelp.nb", FontWeight->"Bold"], ". \n\nThe help file describes each function in detail, and has an example \ of how to use the function. The first time you evaluate a cell in a help \ file, a window with this question will open (except for the name of the help \ file):\n\n\t", StyleBox[ "Do you want to automatically evaluate all the initialization cells in \n\t\ \t\tthe notebook 'DataFitHelp.nb?", FontWeight->"Bold", FontColor->RGBColor[0, 0, 1]] }], "Text"], Cell[TextData[{ "You should click on the ", StyleBox["Yes", FontWeight->"Bold"], " button to ensure that the package containing the functions is loaded for \ proper functioning of the help file. To go to the description of a particular \ function, just press the button with the function name. It is linked to the \ description, and will move you to the appropriate cell within the notebook. \ The data tables are evaluated automatically, as you can verify by checking on \ the In[#] tag in those cells.\n" }], "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Graphing Data"]], "Subsection"], Cell[TextData[{ "The function ", StyleBox["PlotData", FontWeight->"Bold"], " is designed to plot given data. Let's see how this function works. Just \ like for built-in functions we can type ? followed by the function name to \ find out about how to use the palette function. To avoid typos, we can type \ ?, press the button for ", StyleBox["PlotData[ ]", FontWeight->"Bold"], " and erase the square brackets." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(?PlotData\)\)], "Input"], Cell[BoxData[ \("PlotData[list] plots the data given in list as pairs of input/output \ values (the first entry in list may consist of the names for the variables)."\ \)], "Print"] }, Open ]], Cell[TextData[{ "This tells us that we need to give the list of data as input to the \ function PlotData. We will use as an example the data about the median age of \ marriage from the beginning of Chapter 3. Select ", StyleBox["Input", FontWeight->"Bold"], " \[Rule] ", StyleBox["Create Table/Matrix/Palette ", FontWeight->"Bold"], "from the menu. A dialog box opens. Click the radio button for table. As we \ want to create a table with 8 input-output pairs and also would like to \ indicate the meaning of the variables, we should create a table with 9 rows \ and 2 columns. Enter these values into the appropriate boxes, then click on \ OK. A 9 -by -2 grid of placeholders is pasted into your notebook." }], "Text"], Cell[BoxData[GridBox[{ {"\[Placeholder]", "\[Placeholder]"}, {"\[Placeholder]", "\[Placeholder]"}, {"\[Placeholder]", "\[Placeholder]"}, {"\[Placeholder]", "\[Placeholder]"}, {"\[Placeholder]", "\[Placeholder]"}, {"\[Placeholder]", "\[Placeholder]"}, {"\[Placeholder]", "\[Placeholder]"}, {"\[Placeholder]", "\[Placeholder]"}, {"\[Placeholder]", "\[Placeholder]"} }]], "Input"], Cell[TextData[ "Click on the top left placeholder and enter \"year\". (Make sure to include \ the quotation marks to identify year as a text string, as opposed to a \ variable name). Use the \[TabKey] key to move to the next empty space (the \ \[TabKey] key moves to the right, then down) and enter \"age\" (again with \ quotation marks). Continue to move through the table with either the \ \[TabKey] key or the arrow keys until you have entered all the data. Your \ table should look like this:"], "Text"], Cell[BoxData[GridBox[{ {\("\"\), \("\"\)}, {"1960", "20.3"}, {"1965", "20.6"}, {"1970", "20.8"}, {"1975", "21.1"}, {"1980", "22"}, {"1985", "23.3"}, {"1990", "23.9"}, {"1995", "24.5"} }]], "Input"], Cell[TextData[{ "Move the cursor to the left of the table and click the mouse button to \ place the cursor at this position. You should see a vertical bar the length \ of the table. Now type A=. This will assign the name A to this table of \ data, and we can use A whenever we want to refer to the data. You may also \ want to put a ", StyleBox[";", FontWeight->"Bold"], " to the right of the table (to supress the output), then evaluate the \ cell." }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"A", "=", GridBox[{ {\("\"\), \("\"\)}, {"1960", "20.3"}, {"1965", "20.6"}, {"1970", "20.8"}, {"1975", "21.1"}, {"1980", "22"}, {"1985", "23.3"}, {"1990", "23.9"}, {"1995", "24.5"} }]}], ";"}]], "Input"], Cell[TextData[{ "Now we can use the function PlotData. Click on the relevant function \ button in the palette to paste ", StyleBox["PlotData[ ]", FontWeight->"Bold"], " into the notebook. The palceholder inside the square brackets is \ highlighted, indicating that what is typed on the keyboard will be entered \ there. Type", StyleBox[" A ", FontWeight->"Bold"], "(the name of the data list), then evaluate the cell." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(PlotData[A]\)], "Input"], Cell[GraphicsData["PostScript", "\<\ %! %%Creator: Mathematica %%AspectRatio: .61803 MathPictureStart /Mabs { Mgmatrix idtransform Mtmatrix dtransform } bind def /Mabsadd { Mabs 3 -1 roll add 3 1 roll add exch } bind def %% Graphics /Courier findfont 10 scalefont setfont % Scaling calculations -48.3745 0.0247372 -2.51806 0.127403 [ [.11039 .00222 -12 -9 ] [.11039 .00222 12 0 ] [.35776 .00222 -12 -9 ] [.35776 .00222 12 0 ] [.60513 .00222 -12 -9 ] [.60513 .00222 12 0 ] [.8525 .00222 -12 -9 ] [.8525 .00222 12 0 ] [1.025 .01472 0 -7.5 ] [1.025 .01472 28 7.5 ] [.01131 .03 -12 -4.5 ] [.01131 .03 0 4.5 ] [.01131 .15741 -12 -4.5 ] [.01131 .15741 0 4.5 ] [.01131 .28481 -12 -4.5 ] [.01131 .28481 0 4.5 ] [.01131 .41221 -12 -4.5 ] [.01131 .41221 0 4.5 ] [.01131 .53962 -12 -4.5 ] [.01131 .53962 0 4.5 ] [.02381 .64303 -11 0 ] [.02381 .64303 11 15 ] [ 0 0 0 0 ] [ 1 .61803 0 0 ] ] MathScale % Start of Graphics 1 setlinecap 1 setlinejoin newpath 0 g .25 Mabswid .11039 .01472 m .11039 .02097 L s [(1960)] .11039 .00222 0 1 Mshowa .35776 .01472 m .35776 .02097 L s [(1970)] .35776 .00222 0 1 Mshowa .60513 .01472 m .60513 .02097 L s [(1980)] .60513 .00222 0 1 Mshowa .8525 .01472 m .8525 .02097 L s [(1990)] .8525 .00222 0 1 Mshowa .125 Mabswid .15986 .01472 m .15986 .01847 L s .20934 .01472 m .20934 .01847 L s .25881 .01472 m .25881 .01847 L s .30829 .01472 m .30829 .01847 L s .40724 .01472 m .40724 .01847 L s .45671 .01472 m .45671 .01847 L s .50618 .01472 m .50618 .01847 L s .55566 .01472 m .55566 .01847 L s .65461 .01472 m .65461 .01847 L s .70408 .01472 m .70408 .01847 L s .75356 .01472 m .75356 .01847 L s .80303 .01472 m .80303 .01847 L s .06092 .01472 m .06092 .01847 L s .01144 .01472 m .01144 .01847 L s .90198 .01472 m .90198 .01847 L s .95145 .01472 m .95145 .01847 L s .25 Mabswid 0 .01472 m 1 .01472 L s gsave 1.025 .01472 -61 -11.5 Mabsadd m 1 1 Mabs scale currentpoint translate 0 23 translate 1 -1 scale 63.000000 14.437500 moveto %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10.000000 scalefont [1 0 0 -1 0 0 ] makefont setfont 0.000000 0.000000 0.000000 setrgbcolor 0.000000 0.000000 rmoveto 63.000000 14.437500 moveto %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10.000000 scalefont [1 0 0 -1 0 0 ] makefont setfont 0.000000 0.000000 0.000000 setrgbcolor (year) show 87.000000 14.437500 moveto %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10.000000 scalefont [1 0 0 -1 0 0 ] makefont setfont 0.000000 0.000000 0.000000 setrgbcolor 0.000000 0.000000 rmoveto 1.000000 setlinewidth %%DocumentNeededResources: font Courier %%DocumentSuppliedResources: %%DocumentNeededFonts: Courier %%DocumentSuppliedFonts: %%DocumentFonts: font Courier grestore .02381 .03 m .03006 .03 L s [(20)] .01131 .03 1 0 Mshowa .02381 .15741 m .03006 .15741 L s [(21)] .01131 .15741 1 0 Mshowa .02381 .28481 m .03006 .28481 L s [(22)] .01131 .28481 1 0 Mshowa .02381 .41221 m .03006 .41221 L s [(23)] .01131 .41221 1 0 Mshowa .02381 .53962 m .03006 .53962 L s [(24)] .01131 .53962 1 0 Mshowa .125 Mabswid .02381 .05548 m .02756 .05548 L s .02381 .08096 m .02756 .08096 L s .02381 .10645 m .02756 .10645 L s .02381 .13193 m .02756 .13193 L s .02381 .18289 m .02756 .18289 L s .02381 .20837 m .02756 .20837 L s .02381 .23385 m .02756 .23385 L s .02381 .25933 m .02756 .25933 L s .02381 .31029 m .02756 .31029 L s .02381 .33577 m .02756 .33577 L s .02381 .36125 m .02756 .36125 L s .02381 .38673 m .02756 .38673 L s .02381 .43769 m .02756 .43769 L s .02381 .46318 m .02756 .46318 L s .02381 .48866 m .02756 .48866 L s .02381 .51414 m .02756 .51414 L s .02381 .00452 m .02756 .00452 L s .02381 .5651 m .02756 .5651 L s .02381 .59058 m .02756 .59058 L s .02381 .61606 m .02756 .61606 L s .25 Mabswid .02381 0 m .02381 .61803 L s gsave .02381 .64303 -72 -4 Mabsadd m 1 1 Mabs scale currentpoint translate 0 23 translate 1 -1 scale 63.000000 14.437500 moveto %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10.000000 scalefont [1 0 0 -1 0 0 ] makefont setfont 0.000000 0.000000 0.000000 setrgbcolor 0.000000 0.000000 rmoveto 63.000000 14.437500 moveto %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10.000000 scalefont [1 0 0 -1 0 0 ] makefont setfont 0.000000 0.000000 0.000000 setrgbcolor (age) show 81.000000 14.437500 moveto %%IncludeResource: font Courier %%IncludeFont: Courier /Courier findfont 10.000000 scalefont [1 0 0 -1 0 0 ] makefont setfont 0.000000 0.000000 0.000000 setrgbcolor 0.000000 0.000000 rmoveto 1.000000 setlinewidth %%DocumentNeededResources: font Courier %%DocumentSuppliedResources: %%DocumentNeededFonts: Courier %%DocumentSuppliedFonts: %%DocumentFonts: font Courier grestore 0 0 m 1 0 L 1 .61803 L 0 .61803 L closepath clip newpath 1 0 0 r .02 w .11039 .06822 Mdot .23408 .10645 Mdot .35776 .13193 Mdot .48145 .17015 Mdot .60513 .28481 Mdot .72882 .45043 Mdot .8525 .52688 Mdot .97619 .60332 Mdot 0 g .5 Mabswid .02381 .01472 m .11039 .01472 L s .02381 .01472 m .02381 .06822 L s % End of Graphics MathPictureEnd \ \>"], "Graphics", ImageSize->{286, 176.625}, ImageMargins->{{43, 0}, {0, 0}}, ImageRegion->{{0, 1}, {0, 1}}, ImageCache->GraphicsData["Bitmap", "\<\ CF5dJ6E]HGAYHf4PAg9QL6QYHgooool00`000?ooooooo`0Ioooo000Aoooo00<0003oooooool0k_oo o`030000oooooooo00;oool200000_ooo`@000001?ooo`000000000000_oool0017oool00`000?oo ooooo`3]oooo00<0003oool000000_ooo`030000oooooooo00;oool300000oooo`030000oooooooo 00[oool000_oooo^00002?ooo`030000oooo000000;oool300001?ooo`050000oooooooooooo0000 00coool000Goool300000oooo`040000oooooooo00000_ooo`030000oooooooo00Koool00`000?oo ooooo`09oooo00<0003oooooool02?ooo`030000oooooooo00Woool00`000?ooooooo`09oooo00<0 003oooooool02?ooo`030000oooooooo00Woool00`000?ooooooo`09oooo00<0003oooooool02?oo o`030000oooooooo00Woool00`000?ooooooo`09oooo00<0003oooooool02Oooo`030000oooooooo 00Soool00`000?ooooooo`09oooo00<0003oooooool02Oooo`030000oooooooo00Soool00`000?oo ooooo`09oooo00<0003oooooool02Oooo`030000oooooooo00Woool00`000?ooooooo`0@oooo0P00 0004oooo00000000oooo0`0000?oool200000_ooo`@0000:oooo0005oooo00<0003oooooool00_oo o`030000oooo000000Coool00`000?ooooooo`3ooooo2oooo`001_ooo`070000oooooooooooo0000 oooo000000Coool30000ooooo`_oool000Koool01`000?ooooooooooo`000?ooo`000004oooo00<0 003oooooool0ooooo`_oool000Goool00`000?ooo`000002oooo00<0003oool000001?ooo`030000 oooooooo0?ooool;oooo0006oooo00<0003oooooool00_ooo`030000oooooooo00?oool00`000?oo ooooo`3ooooo2oooo`004Oooo`030000oooooooo0?ooool;oooo000Aoooo00<0003oooooool0oooo o`_oool0017oool20000ooooo`coool0017oool00`000?ooooooo`3ooooo2oooo`004Oooo`030000 oooooooo0?ooool;oooo000Aoooo00<0003oooooool04?ooo`?o003goooo000Aoooo00<0003ooooo ool04?ooo`?o003goooo000Aoooo00<0003oooooool04Oooo`03o`00oooooooo0?Koool0017oool0 0`000?ooooooo`3ooooo2oooo`004Oooo`80003ooooo3?ooo`004Oooo`030000oooooooo0?ooool; oooo000Aoooo00<0003oooooool0ooooo`_oool0017oool00`000?ooooooo`3ooooo2oooo`004Ooo o`030000oooooooo0?ooool;oooo000Aoooo00<0003oooooool0;Oooo`?o003Joooo000Aoooo0P00 02koool3o`00f_ooo`004Oooo`030000oooooooo02koool00ol00?ooooooo`3Ioooo000Aoooo00<0 003oooooool0ooooo`_oool0017oool00`000?ooooooo`3ooooo2oooo`004Oooo`030000oooooooo 0?ooool;oooo000Aoooo00<0003oooooool0B_ooo`?o002moooo000Aoooo0P0004_oool3o`00_Ooo o`004Oooo`030000oooooooo04_oool00ol00?ooooooo`2loooo000Aoooo00<0003oooooool0oooo o`_oool0017oool00`000?ooooooo`3ooooo2oooo`001Oooo`<000000oooo`000000000300000ooo o`030000oooooooo0?ooool;oooo0005oooo00<0003oooooool00oooo`030000oooooooo00?oool0 0`000?ooooooo`3ooooo2oooo`001_ooo`030000oooooooo00;oool00`000?ooooooo`03oooo0`00 0?ooool;oooo0006oooo00<0003oooooool00_ooo`030000oooooooo00?oool00`000?ooooooo`3o oooo2oooo`001Oooo`030000oooo000000?oool00`000?ooooooo`03oooo00<0003oooooool0J?oo o`?o002Ooooo0006oooo00@0003oooooooooool200001Oooo`030000oooooooo06Soool3o`00Wooo o`004Oooo`030000oooooooo06Woool00ol00?ooooooo`2Noooo000Aoooo00<0003oooooool0oooo o`_oool0017oool20000ooooo`coool0017oool00`000?ooooooo`3ooooo2oooo`004Oooo`030000 oooooooo0?ooool;oooo000Aoooo00<0003oooooool0ooooo`_oool0017oool00`000?ooooooo`3o oooo2oooo`004Oooo`030000oooooooo0?ooool;oooo000Aoooo0P000?ooooloooo000Aoooo00<0003oooooool0ooooo`_oool000Woool400000_ooo`<00002oooo0P00 0?ooool9oooo0009oooo0`0000;oool01P000?ooooooo`000?ooo`000?ooool;oooo000;oooo00@0 003oooooool00002oooo00<0003oool000000P000?ooool9oooo000:oooo0P0000?oool3000000Co ool000000000003ooooo2Oooo`00oooooaooool00?oooolOoooo003ooooo7oooo`00oooooaooool0 0?oooolOoooo003ooooo7oooo`00\ \>"], ImageRangeCache->{{{82.875, 367.875}, {249.438, 73.8125}} -> {1939.34, 21.9319, 0.170849, 0.0331729}}], Cell[BoxData[ TagBox[\(\[SkeletonIndicator] Graphics \[SkeletonIndicator]\), False, Editable->False]], "Output"] }, Open ]], Cell["\<\ We will return to this package and explore the other functions in Section \ 4.2. \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["What Can Go Wrong - And How to Fix It", "Subsection"], Cell[TextData[{ "If a function definition from a palette isn't working, chances are that \ you used the function without loading the respective package, or that you \ used the function before loading the package. Let's see what happens if we \ use the function ", StyleBox["PlotData ", FontWeight->"Bold"], "before loading the package ", StyleBox["DataFit", FontWeight->"Bold"], ". To make this work, you need to quit the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel (computational engine) using ", StyleBox["Kernel ", FontWeight->"Bold"], "\[Rule] ", StyleBox["Quit", FontWeight->"Bold"], " ", StyleBox["Kernel ", FontWeight->"Bold"], "\[Rule]", StyleBox[" Local ", FontWeight->"Bold"], "from the menu. Now all that is open is the current notebook (front-end), \ but ", StyleBox["Mathematica", FontSlant->"Italic"], " has forgotten about all the assignments and computations (even though you \ still see all the values). Open a new notebook.\n\nFirst we enter(short) list \ of data to be graphed using ", StyleBox["Input", FontWeight->"Bold"], " \[Rule] ", StyleBox["Create Table/Matrix/Palette", FontWeight->"Bold"], "." }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"A", "=", GridBox[{ {"1", "2"}, {"2", "3"}, {"4", "6"} }]}], ";"}]], "Input"], Cell[TextData[{ "To plot this data we paste the function ", StyleBox["PlotData", FontWeight->"Bold"], " from the palette (without loading the package!)." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(PlotData[A]\)], "Input"], Cell[BoxData[ \(PlotData[{{1, 2}, {2, 3}, {4, 6}}]\)], "Output"] }, Open ]], Cell["\<\ Nothing happens! We just get back the function unevaluated!!! Now we remember \ that we did not load the package. Immediately, we paste the command for \ loading the DataFit package into the notebook and evaluate it. This results \ in the following warning message:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(<< DataFit`\)], "Input"], Cell[BoxData[ \(PlotData::"shdw" \( : \ \) "Symbol \!\(\"PlotData\"\) appears in multiple contexts \!\({\"DataFit`\ \", \"Global`\"}\); definitions in context \!\(\"DataFit`\"\) may shadow or \ be shadowed by other definitions."\)], "Message"] }, Open ]], Cell["\<\ Ignoring the warning message, we try using the function again. Even though \ the package has been loaded, it still won't work:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(PlotData[A]\)], "Input"], Cell[BoxData[ \(PlotData[{{1, 2}, {2, 3}, {4, 6}}]\)], "Output"] }, Open ]], Cell[TextData[{ "What to do about this problem? The easiest way is to quit the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel. This will make ", StyleBox["Mathematica", FontSlant->"Italic"], " forget about ", StyleBox["all", FontWeight->"Bold"], " the computations you have done so far, and allows you to start with a \ clean sheet. To quit the kernel, select ", StyleBox["Kernel ", FontWeight->"Bold"], "\[Rule] ", StyleBox["Quit", FontWeight->"Bold"], " ", StyleBox["Kernel ", FontWeight->"Bold"], "\[Rule]", StyleBox[" Local ", FontWeight->"Bold"], "from the menu. Then cut the cell which loads the package from wherever it \ is located and paste it at the top of the notebook; this will ensure that the \ package is loaded first thing into the notebook, and no problems will occur. \ However, we now have to reevaluate all the cells, which could be a tedious \ task. To perform this task very quickly, select ", StyleBox["Kernel ", FontWeight->"Bold"], "\[Rule] ", StyleBox["Evaluation ", FontWeight->"Bold"], "\[Rule]", StyleBox[" Evaluate Notebook", FontWeight->"Bold"], " from the menu. This will evaluate all the input cells (a main reason why \ text should be in text cells - you will get otherwise lots of funny output \ here) in the notebook, starting from the top. \n\nThese two menu commands are \ also useful in two other instances: 1) ", StyleBox["Mathematica", FontSlant->"Italic"], " freezes or behaves very strangely and 2) to continue a project or \ homework after having quit ", StyleBox["Mathematica", FontSlant->"Italic"], ". In the first case, save your work (if possible), then quit the kernel \ and reevaluate all cells. In the second case, open the notebook and \ reevaluate all cells. This will get you back to exaclty where you were \ before, and you can continue your work." }], "Text"] }, Open ]] }, Open ]] }, FrontEndVersion->"Microsoft Windows 3.0", ScreenRectangle->{{0, 800}, {0, 544}}, CellGrouping->Manual, WindowSize->{583, 435}, WindowMargins->{{34, Automatic}, {Automatic, 7}}, PrintingCopies->1, PrintingStartingPageNumber->13, PrintingPageRange->{Automatic, Automatic}, PageHeaders->{{Cell[ TextData[ "M-", { CounterBox[ "Page"]}], "PageNumber"], Inherited, Cell[ TextData[ "Silvia Heubach"], "Header"]}, {Cell[ TextData[ "Introduction to Modeling"], "Header"], Inherited, Cell[ TextData[ "M-", { CounterBox[ "Page"]}], "PageNumber"]}}, PrintingOptions->{"FacingPages"->True} ] (*********************************************************************** 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[CellGroupData[{ Cell[1731, 51, 84, 2, 44, "Subtitle"], Cell[1818, 55, 912, 23, 114, "Text"], Cell[CellGroupData[{ Cell[2755, 82, 50, 0, 43, "Subsection"], Cell[2808, 84, 1257, 24, 172, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[4102, 113, 61, 0, 43, "Subsection"], Cell[4166, 115, 411, 10, 55, "Text"], Cell[4580, 127, 544, 15, 57, "Text"], Cell[5127, 144, 50, 0, 26, "Text"], Cell[5180, 146, 76, 1, 26, "Text"], Cell[5259, 149, 96, 1, 26, "Text"], Cell[5358, 152, 884, 20, 100, "Text"], Cell[6245, 174, 304, 7, 87, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6586, 186, 61, 0, 47, "Subsection"], Cell[6650, 188, 910, 20, 204, "Text"], Cell[7563, 210, 528, 10, 109, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[8128, 225, 55, 0, 47, "Subsection"], Cell[8186, 227, 443, 11, 56, "Text"], Cell[CellGroupData[{ Cell[8654, 242, 46, 1, 22, "Input"], Cell[8703, 245, 184, 3, 29, "Print"] }, Open ]], Cell[8902, 251, 739, 14, 85, "Text"], Cell[9644, 267, 457, 10, 116, "Input"], Cell[10104, 279, 508, 7, 70, "Text"], Cell[10615, 288, 290, 10, 116, "Input"], Cell[10908, 300, 473, 10, 70, "Text"], Cell[11384, 312, 377, 12, 116, "Input"], Cell[11764, 326, 448, 11, 56, "Text"], Cell[CellGroupData[{ Cell[12237, 341, 44, 1, 22, "Input"], Cell[12284, 344, 14606, 418, 184, 5089, 296, "GraphicsData", "PostScript", "Graphics"], Cell[26893, 764, 130, 3, 22, "Output"] }, Open ]], Cell[27038, 770, 108, 5, 55, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[27183, 780, 59, 0, 43, "Subsection"], Cell[27245, 782, 1231, 38, 129, "Text"], Cell[28479, 822, 166, 6, 44, "Input"], Cell[28648, 830, 175, 5, 26, "Text"], Cell[CellGroupData[{ Cell[28848, 839, 44, 1, 22, "Input"], Cell[28895, 842, 68, 1, 22, "Output"] }, Open ]], Cell[28978, 846, 289, 5, 55, "Text"], Cell[CellGroupData[{ Cell[29292, 855, 44, 1, 22, "Input"], Cell[29339, 858, 254, 4, 29, "Message"] }, Open ]], Cell[29608, 865, 150, 3, 41, "Text"], Cell[CellGroupData[{ Cell[29783, 872, 44, 1, 22, "Input"], Cell[29830, 875, 68, 1, 22, "Output"] }, Open ]], Cell[29913, 879, 1925, 50, 202, "Text"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)