Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Mario Rodriguez Riotorto <riotorto@us...>  20101128 13:06:50

Update of /cvsroot/maxima/maxima/doc/info In directory sfpcvsdas4.v30.ch3.sourceforge.com:/tmp/cvsserv7751/doc/info Modified Files: includemaxima.texi.in Makefile.am Added Files: drawdf.texi Log Message: Adding package drawdf  NEW FILE: drawdf.texi  @menu * Introduction to drawdf:: * Functions and Variables for drawdf:: @end menu @node Introduction to drawdf, Functions and Variables for drawdf, drawdf, drawdf @section Introduction to drawdf The function @code{drawdf} draws the direction field of a firstorder Ordinary Differential Equation (ODE) or a system of two autonomous firstorder ODE's. Since this is an additional package, in order to use it you must first load it with @code{load(drawdf)}. Drawdf is built upon the @code{draw} package, which requires Gnuplot 4.2. To plot the direction field of a single ODE, the ODE must be written in the form: @ifnottex @example dy  = F(x,y) dx @end example @end ifnottex @tex $${{dy}\over{dx}} = F(x,y)$$ @end tex and the function @var{F} should be given as the argument for @code{drawdf}. If the independent and dependent variables are not @var{x}, and @var{y}, as in the equation above, then those two variables should be named explicitly in a list given as an argument to the drawdf command (see the examples). To plot the direction field of a set of two autonomous ODE's, they must be written in the form @ifnottex @example dx dy  = G(x,y)  = F(x,y) dt dt @end example @end ifnottex @tex $${{dx}\over{dt}} = G(x,y) \qquad {{dy}\over{dt}} = F(x,y)$$ @end tex and the argument for @code{drawdf} should be a list with the two functions @var{G} and @var{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 @var{x} and @var{y}, but if they are not, then the second argument given to drawdf 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, @code{drawdf} will implicitly admit @code{x=t}, and @code{G(x,y)=1}, transforming the nonautonomous equation into a system of two autonomous equations. @opencatbox @category{Differential equations} @category{Plotting} @category{Share packages} @category{Package drawdf} @category{Package draw} @closecatbox @node Functions and Variables for drawdf, , Introduction to drawdf, drawdf @section Functions and Variables for drawdf @subsection Functions @deffn {Function} drawdf (@var{dydx}, ...options and objects...) @deffnx {Function} drawdf (@var{dvdu}, @code{[}@var{u},@var{v}@code{]}, ...options and objects...) @deffnx {Function} drawdf (@var{dvdu}, @code{[}@var{u},@var{umin},@var{umax}@code{]}, @code{[}@var{v},@var{vmin},@var{vmax}@code{]}, ...options and objects...) @deffnx {Function} drawdf (@code{[}@var{dxdt},@var{dydt}@code{]}, ...options and objects...) @deffnx {Function} drawdf (@code{[}@var{dudt},@var{dvdt}@code{]}, @code{[}@var{u},@var{v}@code{]}, ...options and objects...) @deffnx {Function} drawdf (@code{[}@var{dudt},@var{dvdt}@code{]}, @code{[}@var{u},@var{umin},@var{umax}@code{]}, @code{[}@var{v},@var{vmin},@var{vmax}@code{]}, ...options and objects...) Function @code{drawdf} draws a 2D direction field with optional solution curves and other graphics using the @code{draw} package. The first argument specifies the derivative(s), and must be either an expression or a list of two expressions. @var{dydx}, @var{dxdt} and @var{dydt} are expressions that depend on @var{x} and @var{y}. @var{dvdu}, @var{dudt} and @var{dvdt} are expressions that depend on @var{u} and @var{v}. If the independent and dependent variables are not @var{x} and @var{y}, then their names must be specified immediately following the derivative(s), either as a list of two names @code{[}@var{u},@var{v}@code{]}, or as two lists of the form @code{[}@var{u},@var{umin},@var{umax}@code{]} and @code{[}@var{v},@var{vmin},@var{vmax}@code{]}. The remaining arguments are @i{graphic options}, @i{graphic objects}, or lists containing graphic options and objects, nested to arbitrary depth. The set of graphic options and objects supported by @code{drawdf} is a superset of those supported by @code{draw2d} and @code{gr2d} from the @code{draw} package. The arguments are interpreted sequentially: @i{graphic options} affect all following @i{graphic objects}. Furthermore, @i{graphic objects} are drawn on the canvas in order specified, and may obscure graphics drawn earlier. Some @i{graphic options} affect the global appearence of the scene. The additional @i{graphic objects} supported by @code{drawdf} include: @code{solns_at}, @code{points_at}, @code{saddles_at}, @code{soln_at}, @code{point_at}, and @code{saddle_at}. The additional @i{graphic options} supported by @code{drawdf} include: @code{field_degree}, @code{soln_arrows}, @code{field_arrows}, @code{field_grid}, @code{field_color}, @code{show_field}, @code{tstep}, @code{nsteps}, @code{duration}, @code{direction}, @code{field_tstep}, @code{field_nsteps}, and @code{field_duration}. Commonly used @i{graphic objects} inherited from the @code{draw} package include: @code{explicit}, @code{implicit}, @code{parametric}, @code{polygon}, @code{points}, @code{vector}, @code{label}, and all others supported by @code{draw2d} and @code{gr2d}. Commonly used @i{graphic options} inherited from the @code{draw} package include: @code{points_joined}, @code{color}, @code{point_type}, @code{point_size}, @code{line_width}, @code{line_type}, @code{key}, @code{title}, @code{xlabel}, @code{ylabel}, @code{user_preamble}, @code{terminal}, @code{eps_width}, @code{eps_height}, @code{file_name}, and all others supported by @code{draw2d} and @code{gr2d}. See also @code{draw2d}. Users of wxMaxima or Imaxima may optionally use @code{wxdrawdf}, which is identical to @code{drawdf} except that the graphics are drawn within the notebook using @code{wxdraw}. To make use of this function, write first @code{load(drawdf)}. Examples: @example (%i1) load(drawdf)$ (%i2) drawdf(exp(x)+y)$ /* default vars: x,y */ (%i3) drawdf(exp(t)+y, [t,y])$ /* default range: [10,10] */ (%i4) drawdf([y,9*sin(x)y/5], [x,1,5], [y,2,2])$ @end example For backward compatibility, @code{drawdf} accepts most of the parameters supported by plotdf. @example (%i5) drawdf(2*cos(t)1+y, [t,y], [t,5,10], [y,4,9], [trajectory_at,0,0])$ @end example @code{soln_at} and @code{solns_at} draw solution curves passing through the specified points, using a slightly enhanced 4thorder Runge Kutta numerical integrator. @example (%i6) drawdf(2*cos(t)1+y, [t,5,10], [y,4,9], solns_at([0,0.1],[0,0.1]), color=blue, soln_at(0,0))$ @end example @code{field_degree=2} causes the field to be composed of quadratic splines, based on the first and second derivatives at each grid point. @code{field_grid=[}@var{COLS},@var{ROWS}@code{]} specifies the number of columns and rows in the grid. @example (%i7) drawdf(2*cos(t)1+y, [t,5,10], [y,4,9], field_degree=2, field_grid=[20,15], solns_at([0,0.1],[0,0.1]), color=blue, soln_at(0,0))$ @end example @code{soln_arrows=true} adds arrows to the solution curves, and (by default) removes them from the direction field. It also changes the default colors to emphasize the solution curves. @example (%i8) drawdf(2*cos(t)1+y, [t,5,10], [y,4,9], soln_arrows=true, solns_at([0,0.1],[0,0.1],[0,0]))$ @end example @code{duration=40} specifies the time duration of numerical integration (default 10). Integration will also stop automatically if the solution moves too far away from the plotted region, or if the derivative becomes complex or infinite. Here we also specify @code{field_degree=2} to plot quadratic splines. The equations below model a predatorprey system. @example (%i9) drawdf([x*(1xy), y*(3/4yx/2)], [x,0,1.1], [y,0,1], field_degree=2, duration=40, soln_arrows=true, point_at(1/2,1/2), solns_at([0.1,0.2], [0.2,0.1], [1,0.8], [0.8,1], [0.1,0.1], [0.6,0.05], [0.05,0.4], [1,0.01], [0.01,0.75]))$ @end example @code{field_degree='solns} causes the field to be composed of many small solution curves computed by 4thorder Runge Kutta, with better results in this case. @example (%i10) drawdf([x*(1xy), y*(3/4yx/2)], [x,0,1.1], [y,0,1], field_degree='solns, duration=40, soln_arrows=true, point_at(1/2,1/2), solns_at([0.1,0.2], [0.2,0.1], [1,0.8], [0.8,1], [0.1,0.1], [0.6,0.05], [0.05,0.4], [1,0.01], [0.01,0.75]))$ @end example @code{saddles_at} attempts to automatically linearize the equation at each saddle, and to plot a numerical solution corresponding to each eigenvector, including the separatrices. @code{tstep=0.05} specifies the maximum time step for the numerical integrator (the default is 0.1). Note that smaller time steps will sometimes be used in order to keep the x and y steps small. The equations below model a damped pendulum. @example (%i11) drawdf([y,9*sin(x)y/5], tstep=0.05, soln_arrows=true, point_size=0.5, points_at([0,0], [2*%pi,0], [2*%pi,0]), field_degree='solns, saddles_at([%pi,0], [%pi,0]))$ @end example @code{show_field=false} suppresses the field entirely. @example (%i12) drawdf([y,9*sin(x)y/5], tstep=0.05, show_field=false, soln_arrows=true, point_size=0.5, points_at([0,0], [2*%pi,0], [2*%pi,0]), saddles_at([3*%pi,0], [3*%pi,0], [%pi,0], [%pi,0]))$ @end example @code{drawdf} passes all unrecognized parameters to @code{draw2d} or @code{gr2d}, allowing you to combine the full power of the @code{draw} package with @code{drawdf}. @example (%i13) drawdf(x^2+y^2, [x,2,2], [y,2,2], field_color=gray, key="soln 1", color=black, soln_at(0,0), key="soln 2", color=red, soln_at(0,1), key="isocline", color=green, line_width=2, nticks=100, parametric(cos(t),sin(t),t,0,2*%pi))$ @end example @code{drawdf} accepts nested lists of graphic options and objects, allowing convenient use of makelist and other function calls to generate graphics. @example (%i14) colors : ['red,'blue,'purple,'orange,'green]$ (%i15) drawdf([xx*y/2, (x*y  3*y)/4], [x,2.5,3.5], [y,1.5,2.5], field_color = gray, makelist([ key = concat("soln",k), color = colors[k], soln_at(3, 2 + k/20) ], k,1,5))$ @end example @opencatbox @category{Package drawdf} @closecatbox @end deffn Index: includemaxima.texi.in =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/includemaxima.texi.in,v retrieving revision 1.11 retrieving revision 1.12 diff u d r1.11 r1.12  includemaxima.texi.in 13 Oct 2010 00:35:46 0000 1.11 +++ includemaxima.texi.in 28 Nov 2010 13:06:41 0000 1.12 @@ 148,6 +148,7 @@ * diag:: Jordan matrices. * distrib:: Probability distributions. * draw:: A MaximaGnuplot interface. +* drawdf:: Direction fields with Gnuplot. * dynamics:: Graphics for dynamical systems and fractals. * ezunits:: Dimensional quantities. * f90:: Maxima to fortran translator. @@ 462,6 +463,11 @@ * Functions and Variables for pictures:: * Functions and Variables for worldmap:: +drawdf + +* Introduction to drawdf:: +* Functions and Variables for drawdf:: + dynamics * Introduction to dynamics:: @@ 821,11 +827,15 @@ @chapter distrib @include distrib.texi @... draw, dynamics, distrib, Top +@node draw, drawdf, distrib, Top @chapter draw @include draw.texi @... dynamics, ezunits, draw, Top +@node drawdf, dynamics, draw, Top +@chapter drawdf +@include drawdf.texi + +@node dynamics, ezunits, drawdf, Top @chapter dynamics @include dynamics.texi Index: Makefile.am =================================================================== RCS file: /cvsroot/maxima/maxima/doc/info/Makefile.am,v retrieving revision 1.76 retrieving revision 1.77 diff u d r1.76 r1.77  Makefile.am 27 Nov 2010 14:49:14 0000 1.76 +++ Makefile.am 28 Nov 2010 13:06:41 0000 1.77 @@ 43,7 +43,7 @@ bode.texi augmented_lagrangian.texi opsubst.texi stats.texi stirling.texi\ implicit_plot.texi interpol.texi lbfgs.texi romberg.texi grobner.texi\ contrib_ode.texi graphs.texi categorymacros.texi lapack.texi \  asympa.texi Deleted.texi minpack.texi cobyla.texi + asympa.texi Deleted.texi minpack.texi cobyla.texi drawdf.texi figurefiles = \ figures/introduction1.gif\ 
Sign up for the SourceForge newsletter:
No, thanks