(*********************************************************************** 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[ 6787, 205]*) (*NotebookOutlinePosition[ 7425, 228]*) (* CellTagsIndexPosition[ 7381, 224]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Direction Fields.\n\n", StyleBox[ "We will use the command PlotVectorField to plot direction fields. The \ equation y' = f(t,y) tells us that at the point (t,y) we want 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)), (or i + f(t,y)j), but we add an option \ ScaleFunction->(1&) to make all the arrows the same length. (1&) is a pure \ function in ", "Text"], StyleBox["Mathematica", "Text", FontSlant->"Italic"], StyleBox[ " standing for the constant function with value 1. We need a Graphics \ package, or Add-On, to plot a vector field.. You should expect plotting of \ vector fields to be slow.", "Text"], "\n" }], "Subsection", Evaluatable->False, AspectRatioFixed->False], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell[CellGroupData[{ Cell["Example 1. y' = t - y", "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(PlotVectorField[{1, t - y}, {t, \(-3\), 5}, {y, \(-3\), 3}, Axes \[Rule] True, ScaleFunction \[Rule] \((1&)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1]; \)\)], "Input"], Cell["\<\ It appears that all solutions are asymptotic to the line \ y=t-1.Indeed, using an integrating factor to solve the differential equation, one finds that the general solution is \ y = (t-1) + C exp(-t). We plot this solution for C = {-3,-2, -1, 0, 1, 2, 3}:\ \>", "Text"], Cell[BoxData[ \(Plot[ Evaluate[Table\ [\ \((t - 1)\)\ + \ C\ \ Exp[\(-t\)]\ , {C, \(-3\), 3, 1}]], \n \t\t{t, \(-3\), 5}, \ AspectRatio -> 1, \ PlotRange\ -> \ {\(-3\), 3}] \)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Caution: If you execute a PlotVectorField command before you do \ the Needs command, either restart or execute the following commands.\ \>", "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{ \(Remove[PlotVectorField, ScaleFunction]\), \(Needs["\"]\)}], "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell["\<\ A palette for direction fields. This button was made by choosing \"Create Table/Matrix/Palette...\" from the \ Input menu, and then filling in the command we want. The squares are given \ by pressing the key marked \"esc\" followed by the letters spl followed by \ the esc key again.. Next select the cell and then \"Generate Palette from \ Selection\" from the File menu. Palettes like this are especially useful \ when there a re many options to type into a command.\ \>", "Subsubsection"], Cell[BoxData[GridBox[{ { ButtonBox[ \(PlotVectorField[{1, \[SelectionPlaceholder]}, {t, \[SelectionPlaceholder], \[SelectionPlaceholder]}, {y, \[SelectionPlaceholder], \[SelectionPlaceholder]}\n\t, PlotPoints \[Rule] 15, Axes \[Rule] True\n\t, ScaleFunction \[Rule] \((1&)\), Ticks \[Rule] None\n\t, Frame \[Rule] True, AspectRatio \[Rule] 1]; \)]}, { ButtonBox["\[Placeholder]"]} }, RowSpacings->0, ColumnSpacings->0, GridFrame->True, GridDefaultElement:>ButtonBox[ "\\[Placeholder]"]]], "Input", Editable->True, CellMargins->{{Inherited, Inherited}, {8, Inherited}}, Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, PageBreakAbove->True, PageBreakWithin->False, GroupPageBreakWithin->False, CellLabelMargins->{{11, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultInputFormatType, LineSpacing->{1.25, 0}, AutoItalicWords->{}, FormatType->InputForm, ScriptMinSize->12, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", StyleMenuListing->None, FontFamily->"Courier", FontSize->16, FontWeight->"Bold"] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Example 2. y' = y + 2 Click on the palette button and fill in the blanks. If you want more \ vectors, raise the PlotPoints option.\ \>", "Subsubsection", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(PlotVectorField[{1, t\ E\^\(\(-2\) t\) - 2\ y}, {t, \(-2\), 3}, {y, \(-6\), 6}, PlotPoints \[Rule] 15, Axes \[Rule] True, ScaleFunction \[Rule] \((1&)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1]; \)\)], "Input", AspectRatioFixed->True], Cell["\<\ My guess is that all solutions tend to 0 as t tends to \ infinity.\ \>", "Text"], Cell[BoxData[ \(\(PlotVectorField[{1, t\/y}, {t, \(-4\), 4}, {y, \(-3\), 3}, PlotPoints \[Rule] 20, Axes \[Rule] True, ScaleFunction \[Rule] \((1&)\), Ticks \[Rule] None, Frame \[Rule] True, AspectRatio \[Rule] 1]; \)\)], "Input", AspectRatioFixed->True], Cell["\<\ Some solutions approach the negative y-axis. Others approach the \ line y = t or the line y = - t.\ \>", "Text"] }, Open ]] }, Open ]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowSize->{520, 600}, WindowMargins->{{177, Automatic}, {Automatic, 102}} ] (*********************************************************************** 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, 805, 18, 231, "Subsection", Evaluatable->False], Cell[2539, 71, 65, 1, 27, "Input"], Cell[CellGroupData[{ Cell[2629, 76, 96, 2, 42, "Subsubsection", Evaluatable->False], Cell[2728, 80, 226, 3, 59, "Input"], Cell[2957, 85, 281, 6, 86, "Text"], Cell[3241, 93, 221, 5, 43, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3499, 103, 219, 6, 58, "Subsubsection", Evaluatable->False], Cell[3721, 111, 142, 3, 43, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3900, 119, 507, 8, 138, "Subsubsection"], Cell[4410, 129, 1288, 37, 160, "Input", Evaluatable->True, CellGroupingRules->"InputGrouping", PageBreakAbove->True, PageBreakWithin->False, CounterIncrements->"Input"] }, Open ]], Cell[CellGroupData[{ Cell[5735, 171, 214, 6, 74, "Subsubsection", Evaluatable->False], Cell[5952, 179, 304, 5, 67, "Input"], Cell[6259, 186, 90, 3, 32, "Text"], Cell[6352, 191, 281, 5, 83, "Input"], Cell[6636, 198, 123, 3, 50, "Text"] }, Open ]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)