(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. 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[ 4764, 157]*) (*NotebookOutlinePosition[ 5431, 180]*) (* CellTagsIndexPosition[ 5387, 176]*) (*WindowFrame->Normal*) Notebook[{ Cell["2D/3D ODE Systems", "Subtitle"], Cell[TextData[{ "This notebook provides examples of how to solve 2D and 3D ODE systems and \ plot their solution trajectories in the phase plane/space using Mathematica. \ \n\nTO SEE WHAT THIS NOTEBOOK PROVIDES:\n- Select \ Kernel|Evaluation|Evaluate_Notebook to execute all the cell and produce the \ graphics. (Note: Some potential spelling error messages may result \ depending upon how ", StyleBox["Mathematica", FontSlant->"Italic"], " is set on your system).\n\nThe material in this notebook was developed by \ Major Matt Bohn of the USAF Academy, Dept of Mathematical Sciences.\t\n\ Filename: 3dsystems.nb" }], "Text"], Cell[BoxData[ \(ClearAll[x, y]\)], "Input"], Cell[BoxData[ \(sol = DSolve[{D[x[t], t] == 5*y[t], D[y[t], t] == \(-x[t]\) - 2*y[t], x[0] == 3, y[0] == 7}, {x[t], y[t]}, t]\)], "Input"], Cell[BoxData[{ \(xsol[t_] = First[x[t] /. sol]\), "\n", \(ysol[t_] = First[y[t] /. sol]\)}], "Input"], Cell[BoxData[ \(Plot[xsol[t], {t, 0, 6}]\)], "Input"], Cell[BoxData[ \(Plot[ysol[t], {t, 0, 6}]\)], "Input"], Cell[BoxData[ \(para1 = ParametricPlot[{xsol[t], ysol[t]}, {t, 0, 6}]\)], "Input"], Cell[BoxData[ \(<< Graphics`PlotField`\)], "Input"], Cell[BoxData[ \(vectorplt = PlotVectorField[{5 y, \(-x\) - 2*y}, {x, \(-3\), 11}, {y, \(-3\), 6}]\)], "Input"], Cell[BoxData[ \(<< Graphics`ImplicitPlot`\)], "Input"], Cell[BoxData[ \(ycline := \ ImplicitPlot[ 5\ y\ \[Equal] \ 0\ x, \ {x, \(-3\), 11}, {y, \(-3\), 6}]\)], "Input"], Cell[BoxData[ \(xcline := ImplicitPlot[\(-x\)\ - \ 2\ y\ \[Equal] \ 0, {x, \(-3\), 11}, {y, \(-3\), 6}]\)], "Input"], Cell[BoxData[ \(Show[vectorplt, para1]\)], "Input"], Cell[BoxData[ \(Show[vectorplt, xcline, ycline, \ para1]\)], "Input"], Cell[BoxData[ \(soln = Simplify[DSolve[{D[x[t], t] == \(-x[t]\) + y[t] + 6*t, D[y[t], t] == x[t] + 2*y[t] + z[t] + 1, D[z[t], t] == 3*y[t] - z[t], x[0] == 15, y[0] == 5, z[0] == 3}, {x[t], y[t], z[t]}, t]]\)], "Input"], Cell[BoxData[{ \(xsol[t_] = First[x[t] /. soln]\), "\n", \(ysol[t_] = First[y[t] /. soln]\), "\n", \(zsol[t_] = First[z[t] /. soln]\)}], "Input"], Cell[BoxData[ \(Plot[xsol[t], {t, \(-1\), 1}]\)], "Input"], Cell[BoxData[ \(Plot[ysol[t], {t, \(-1\), 1}]\)], "Input"], Cell[BoxData[ \(Plot[zsol[t], {t, \(-1\), 1}]\)], "Input"], Cell[BoxData[ \(plot3d = ParametricPlot3D[{xsol[t], ysol[t], zsol[t]}, {t, \(-1\), 1}]\)], "Input"], Cell[BoxData[""], "Input"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell[BoxData[ \(\(\(\n\)\(t = 0\)\)\)], "Input"], Cell[BoxData[ \(vplt3d = PlotVectorField3D[{\(-x\) + y + 6*t, x + 2*y + z + 1, 3*y - z}, {x, 20, 50}, {y, 0, 150}, {z, 0, 100}]\)], "Input"], Cell[BoxData[ \(Show[plot3d, vplt3d]\)], "Input"] }, FrontEndVersion->"5.0 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowSize->{834, 755}, WindowMargins->{{Automatic, 154}, {Automatic, 105}}, StyleDefinitions -> "DemoText.nb" ] (******************************************************************* 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[1754, 51, 37, 0, 41, "Subtitle"], Cell[1794, 53, 637, 12, 246, "Text"], Cell[2434, 67, 47, 1, 37, "Input"], Cell[2484, 70, 160, 3, 37, "Input"], Cell[2647, 75, 110, 2, 53, "Input"], Cell[2760, 79, 57, 1, 37, "Input"], Cell[2820, 82, 57, 1, 37, "Input"], Cell[2880, 85, 86, 1, 37, "Input"], Cell[2969, 88, 55, 1, 37, "Input"], Cell[3027, 91, 133, 3, 37, "Input"], Cell[3163, 96, 58, 1, 37, "Input"], Cell[3224, 99, 132, 3, 37, "Input"], Cell[3359, 104, 140, 3, 37, "Input"], Cell[3502, 109, 55, 1, 37, "Input"], Cell[3560, 112, 73, 1, 37, "Input"], Cell[3636, 115, 268, 5, 69, "Input"], Cell[3907, 122, 159, 3, 69, "Input"], Cell[4069, 127, 62, 1, 37, "Input"], Cell[4134, 130, 62, 1, 37, "Input"], Cell[4199, 133, 62, 1, 37, "Input"], Cell[4264, 136, 121, 3, 37, "Input"], Cell[4388, 141, 26, 0, 37, "Input"], Cell[4417, 143, 67, 1, 37, "Input"], Cell[4487, 146, 52, 1, 53, "Input"], Cell[4542, 149, 162, 3, 37, "Input"], Cell[4707, 154, 53, 1, 37, "Input"] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)