(*********************************************************************** 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[ 7715, 247]*) (*NotebookOutlinePosition[ 8814, 282]*) (* CellTagsIndexPosition[ 8770, 278]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Demo 1.1", FontSize->21, FontWeight->"Bold", FontSlant->"Plain", FontTracking->"Extended", FontVariations->{"Underline"->True}]], "Subsubtitle"], Cell[CellGroupData[{ Cell["Plotting Direction Fields", "Section"], Cell[TextData[{ "We will use the command PlotVectorfield to plot direction fields. The \ equation y'(t)=f(t,y) tells us that at the point (t,y) we have to plot a \ short line with slope f(t,y). The vector (1,f(t,y)) has slope f(t,y), so we \ simply plot the vector field (1,f(t,y)), but we add an option \ ScaleFunction->(1&) to make all the arrows the same length. (1&) is a pure \ function in ", StyleBox["Mathematica", FontSlant->"Italic"], " standing for the constant function 1. We need a graphics package to plot \ a vector field." }], "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell[CellGroupData[{ Cell["Example 1. y'=t-y", "Subsection"], Cell[BoxData[ \(PlotVectorField[{1, t - y}, \ {t, \(-3\), 5}, {y, \(-3\), 3}, \n\t\ PlotPoints\ -> \ 15, \ Axes\ -> \ True, \ ScaleFunction\ -> \ \((1&)\), \ Ticks\ -> \ None, \ Frame\ -> \ True, \ AspectRatio\ -> \ 1]\)], "Input"], Cell["\<\ It appears that all solutions are asymptotic to the line \ y=t-1.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell["Caution:", "Subsection"], Cell[TextData[StyleBox[ "If you execute a PlotVectorField command before you do the Needs command, \ the best thing to do is to restart!", FontSize->12, FontWeight->"Plain"]], "Text"] }, Open ]], Cell[CellGroupData[{ Cell["A Palette for Direction Fields", "Subsection"], Cell[TextData[{ "Here is a Palette for the command above. This button was made by choosing \ \"Create Table/Matrix/Palette...\" from the Input menu, and then filling in \ the commands we want. The squares are given by pressing the key marked \ \"esc\" followed by the letters ", StyleBox["spl", FontFamily->"Courier"], " followed by the \"esc\" key again. Next select the cell and then \ \"Generate Palette from Selection\" from the File menu." }], "Text"], Cell[BoxData[GridBox[{ { ButtonBox[ \(PlotVectorField[{1, \[SelectionPlaceholder]}, \ {t, \[SelectionPlaceholder], \[SelectionPlaceholder]}, \ {y, \[SelectionPlaceholder], \[SelectionPlaceholder]}, \n\t\ PlotPoints\ -> \ 15, \ Axes\ -> \ True, \ \n\t ScaleFunction\ -> \ \((1&)\), \ Ticks\ -> \ None, \n\t\ Frame\ -> \ True, \ AspectRatio\ -> \ 1]\)]} }, RowSpacings->0, ColumnSpacings->0, GridFrame->True, RowLines->True, GridDefaultElement:>ButtonBox[ "\\[Placeholder]"]]], "Input"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Example 2. ", StyleBox["y' = y+2", FontFamily->"Courier"] }], "Subsection"], Cell["\<\ Click on the palette and fill in the blanks. If you want more \ vectors, raise the PlotPoints option, but remember that vector fields are \ slow to plot.\ \>", "Text"], Cell[BoxData[ \(PlotVectorField[{1, y + 2}, \ {t, \(-5\), 5}, \ {y, \(-5\), 5}, \n\t\ PlotPoints\ -> \ 15, \ Axes\ -> \ True, \ \n\t ScaleFunction\ -> \ \((1&)\), \ Ticks\ -> \ None, \n\t\ Frame\ -> \ True, \ AspectRatio\ -> \ 1]\)], "Input"], Cell["\<\ Here it seems that solutions which start with y > -2 tend to \ infinity, those which start with y = -2 remain -2 constantly and those which start with y < -2 tend to \ negative infinity.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Example 3. ", StyleBox["y' =", FontFamily->"Courier"], Cell[BoxData[ \(TraditionalForm\`\(\ E\^\(-t\)\)\)]], StyleBox["+y", FontFamily->"Courier"] }], "Subsection"], Cell[BoxData[ \(PlotVectorField[{1, E^\((\(-t\))\) + y}, \ {t, 0, 10}, \ {y, \(-3\), 3}, \n\t\ PlotPoints\ -> \ 15, \ Axes\ -> \ True, \ \n\t ScaleFunction\ -> \ \((1&)\), \ Ticks\ -> \ None, \n\t\ Frame\ -> \ True, \ AspectRatio\ -> \ 1]\)], "Input"], Cell["\<\ Here it seems likely that solutions which start with y > 0 tend to \ infinity, while those which start with y < -1 tend to negative infinity. \ There seem to be at least one solution with y(0) between -1 and 0, which \ tends to zero. \ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Example 4. ", StyleBox[" y' = -y(3-y)", FontFamily->"Courier"] }], "Subsection"], Cell["\<\ Sometimes it is useful to plot more lines. The default option is \ PlotPoints -> 15.\ \>", "Text"], Cell[BoxData[ \(PlotVectorField[{1, \(-y\) \((3 - y)\)}, \ {t, \(-5\), 5}, \ {y, \(-2\), 6}, \n\t\ PlotPoints\ -> \ 20, \ Axes\ -> \ True, \ \n\t ScaleFunction\ -> \ \((1&)\), \ Ticks\ -> \ None, \n\t\ Frame\ -> \ True, \ AspectRatio\ -> \ 1]\)], "Input"], Cell["\<\ Solutions starting with y(0) = 0 or y(0) = 3 remain constant. If \ the initial y(0) > 3, the solution goes to infinity. If y(0) < 3 the \ solution tends to (or remains constant) 0.\ \>", "Text"] }, Open ]], Cell[CellGroupData[{ Cell[TextData[{ "Example 5. ", StyleBox["y' = t ", FontFamily->"Courier"], Cell[BoxData[ \(TraditionalForm\`E\^\(\(-2\) t\)\)]], Cell[BoxData[ \(TraditionalForm\`\(\^\ \)\)], FontFamily->"Courier"], StyleBox["-2y", FontFamily->"Courier"] }], "Subsection"], Cell[BoxData[ \(PlotVectorField[{1, t\ E^\((\(-2\) t)\) - 2 y}, \ {t, \(-2\), 3}, \ {y, \(-4\), 4}, \n\t\ PlotPoints\ -> \ 15, \ Axes\ -> \ True, \ \n\t ScaleFunction\ -> \ \((1&)\), \ Ticks\ -> \ None, \n\t\ Frame\ -> \ True, \ AspectRatio\ -> \ 1]\)], "Input"], Cell["\<\ My guess is that all solutions tend to 0 as t tends to \ infinity.\ \>", "Text"] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"Macintosh 3.0", ScreenRectangle->{{0, 832}, {0, 604}}, WindowToolbars->"EditBar", WindowSize->{500, 583}, WindowMargins->{{72, Automatic}, {Automatic, -6}}, PrintingCopies->1, PrintingPageRange->{1, Automatic}, PrintingOptions->{"PrintingMargins"->{{54, 54}, {72, 72}}, "PrintCellBrackets"->False, "PrintRegistrationMarks"->False, "PrintMultipleHorizontalPages"->False}, Magnification->1, MacintoshSystemPageSetup->"\<\ 00<0004/0B`000002n88o?mooh<" ] (*********************************************************************** 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, 178, 5, 58, "Subsubtitle"], Cell[CellGroupData[{ Cell[1934, 60, 44, 0, 50, "Section"], Cell[1981, 62, 559, 11, 114, "Text"], Cell[2543, 75, 65, 1, 27, "Input"], Cell[CellGroupData[{ Cell[2633, 80, 57, 0, 46, "Subsection"], Cell[2693, 82, 262, 4, 75, "Input"], Cell[2958, 88, 89, 3, 30, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[3084, 96, 30, 0, 46, "Subsection"], Cell[3117, 98, 187, 4, 46, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[3341, 107, 52, 0, 46, "Subsection"], Cell[3396, 109, 468, 9, 95, "Text"], Cell[3867, 120, 643, 15, 90, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[4547, 140, 127, 4, 46, "Subsection"], Cell[4677, 146, 178, 4, 46, "Text"], Cell[4858, 152, 272, 4, 75, "Input"], Cell[5133, 158, 212, 5, 46, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[5382, 168, 230, 8, 46, "Subsection"], Cell[5615, 178, 281, 4, 91, "Input"], Cell[5899, 184, 258, 5, 62, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6194, 194, 132, 4, 46, "Subsection"], Cell[6329, 200, 108, 3, 30, "Text"], Cell[6440, 205, 285, 4, 91, "Input"], Cell[6728, 211, 205, 4, 46, "Text"] }, Open ]], Cell[CellGroupData[{ Cell[6970, 220, 316, 11, 46, "Subsection"], Cell[7289, 233, 293, 4, 91, "Input"], Cell[7585, 239, 90, 3, 30, "Text"] }, Open ]] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)