DiffEqs`DEGraphics`
This package provides the following functions for plotting solutions of differential equations.
DEPlot[f[t, y], {t, tmin, tmax}, {y, ymin, ymax}] creates a plot showing the direction field and solution curves for the differential equation y' = f[t, y]. PhasePlot[{f[x, y], g[x, y]}, {t, tmin, tmax}, {x, xmin, xmax}, {y, ymin, ymax}] creates a plot showing the direction field and solution curves for the autonomous system x' = f[x, y], y' = g[x, y]. PhasePlot[{f[t, x, y], g[t, x, y]}, {t, tmin, tmax}, {x, xmin, xmax}, {y, ymin, ymax}] creates a plot showing solution curves for the system x' = f[t, x, y], y' = g[t, x, y]. NDPlot[eqns, fns, {t, tmin, tmax}] uses NDSolve to compute a numerical solution of a system of (up to 3) first-order differential equations and plots the solution. Returns {solution, -Graphics-}. PoincareTimeSection[{f[t, x, y], g[t, x, y]}, {t, t0, tmax, dt}, {x, x0 }, {y, y0 }] creates a Poincaré time section plot of the solution of x' = f[t, x, y], x[t0] = x0, y' = g[t, x, y], y[t0] = y0. ViewProjections[{f[t], g[t], h[t]}, {t, t0, tmax}, {x, y, z}] creates a GraphicsArray of projections of the curve (f[t], g[t], h[t]) onto the xy, xz, and yz coordinate planes. PlotImplicit[F[t, y], {t, tmin, tmax}, {y, ymin, ymax}] creates a contour plot of the function F. TimeStatePlot[{x[t], y[t]}, {t, tmin, tmax}, {y, ymin, ymax}] creates a 3D plot of the ``time-state trajectory" (t, x[t], y[t]) with projections onto the t x, t y, and x y planes.
Plotting solutions of differential equations.
This loads the package.
<<DiffEqs`DEGraphics`
DEPlot
Here are a few examples of the use of DEPlot. Each of these uses the differential equation
.
![[Graphics:Images/index_gr_26.gif]](Images/index_gr_26.gif)
![[Graphics:Images/index_gr_29.gif]](Images/index_gr_29.gif)
![[Graphics:Images/index_gr_32.gif]](Images/index_gr_32.gif)
![[Graphics:Images/index_gr_35.gif]](Images/index_gr_35.gif)
DEPlot accepts any of the options of ListPlot, as well as the following:
![[Graphics:Images/index_gr_38.gif]](Images/index_gr_38.gif)
Curve options for DEPlot.
With InitialPoints -> Automatic, DEPlot uses four uniformly spaced initial points to draw four curves. With InitialPoints -> None or MaxCurves -> 0, no curves are drawn. If MaxCurves -> n, where n > 0, then, for each initial point, DEPlot attempts to generate
additional starting points if n is odd and n additional starting points if n is even. This is done by taking steps orthogonal to the direction field.
![[Graphics:Images/index_gr_42.gif]](Images/index_gr_42.gif)
Arrow style options for DEPlot.
![[Graphics:Images/index_gr_43.gif]](Images/index_gr_43.gif)
Display options for DEPlot.
![[Graphics:Images/index_gr_44.gif]](Images/index_gr_44.gif)
Numerical options for DEPlot.
Standard (nonadaptive) fourth-order Runge-Kutta is the default numerical method. Heun is the second-order method that is often called the improved, or modified, Euler method. With Method -> DormandPrince, the eighth-order (nonadaptive) Dormand-Prince method is used. Method -> Automatic causes DEPlot to use NDSolve successively over intervals [t, t+h], where h = StepSize. Thus StepSize does not affect the accuracy in this case--only the smoothness of the curve drawn. Method -> Automatic is generally much slower at a given stepsize, but for difficult (i.e., stiff) equations, may give much better results. When Method -> Automatic, any of the options of NDSolve can be used.
This illustrates the ShowEquilibriumPoints option.
![[Graphics:Images/index_gr_47.gif]](Images/index_gr_47.gif)