[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

71. plotdf

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

71.1 Introduction to plotdf

The function plotdf creates a plot of the direction field (also called slope field) for a first-order Ordinary Differential Equation (ODE) or a system of two autonomous first-order ODE's.

Plotdf requires Xmaxima. It can be used from the console or any other interface to Maxima, but the resulting file will be sent to Xmaxima for plotting. Please make sure you have installed Xmaxima before trying to use plotdf.

To plot the direction field of a single ODE, the ODE must be written in the form:

       -- = F(x,y)

and the function F should be given as the argument for plotdf. If the independent and dependent variables are not x, and y, as in the equation above, then those two variables should be named explicitly in a list given as an argument to the plotdf command (see the examples).

To plot the direction field of a set of two autonomous ODE's, they must be written in the form

       dx             dy
       -- = G(x,y)    -- = F(x,y) 
       dt             dt

and the argument for plotdf should be a list with the two functions G and F, in that order; namely, the first expression in the list will be taken to be the time derivative of the variable represented on the horizontal axis, and the second expression will be the time derivative of the variable represented on the vertical axis. Those two variables do not have to be x and y, but if they are not, then the second argument given to plotdf must be another list naming the two variables, first the one on the horizontal axis and then the one on the vertical axis.

If only one ODE is given, plotdf will implicitly admit x=t, and G(x,y)=1, transforming the non-autonomous equation into a system of two autonomous equations.

Categories:  Differential equations · Share packages · Package plotdf

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

71.2 Functions and Variables for plotdf

Function: plotdf (dydx, ...options...)
Function: plotdf (dvdu, [u,v], ...options...)
Function: plotdf ([dxdt,dydt], ...options...)
Function: plotdf ([dudt,dvdt], [u,v], ...options...)

Displays a direction field in two dimensions x and y.

dydx, dxdt and dydt are expressions that depend on x and y. dvdu, dudt and dvdt are expressions that depend on u and v. In addition to those two variables, the expressions can also depend on a set of parameters, with numerical values given with the parameters option (the option syntax is given below), or with a range of allowed values specified by a sliders option.

Several other options can be given within the command, or selected in the menu. Integral curves can be obtained by clicking on the plot, or with the option trajectory_at. The direction of the integration can be controlled with the direction option, which can have values of forward, backward or both. The number of integration steps is given by nsteps and the time interval between them is set up with the tstep option. The Adams Moulton method is used for the integration; it is also possible to switch to an adaptive Runge-Kutta 4th order method.

Plot window menu:

The menu in the plot window has the following options: Zoom, will change the behavior of the mouse so that it will allow you to zoom in on a region of the plot by clicking with the left button. Each click near a point magnifies the plot, keeping the center at the point where you clicked. Holding the Shift key while clicking, zooms out to the previous magnification. To resume computing trajectories when you click on a point, select Integrate from the menu.

The option Config in the menu can be used to change the ODE(s) in use and various other settings. After configuration changes are made, the menu option Replot should be selected, to activate the new settings. If a pair of coordinates are entered in the field Trajectory at in the Config dialog menu, and the enter key is pressed, a new integral curve will be shown, in addition to the ones already shown. When Replot is selected, only the last integral curve entered will be shown.

Holding the right mouse button down while the cursor is moved, can be used to drag the plot sideways or up and down. Additional parameters such as the number of steps, the initial value of t and the x and y centers and radii, may be set in the Config menu.

A copy of the plot can be saved as a postscript file, using the menu option Save.

Plot options:

The plotdf command may include several commands, each command is a list of two or more items. The first item is the name of the option, and the remainder comprises the value or values assigned to the option.

The options which are recognized by plotdf are the following:


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by Oliver Kullmann on May, 18 2013 using texi2html 1.76.