Math 221 -- Spring 1998 Plotting a phase portrait and direction field with Maple (an example) 0. Load packages: with (DEtools): with (plots): 1. Define the differential equations, which for future reference we call de1 and de2: de1 := diff( x(t), t ) = -0.1 * x(t) - y(t)^2; de2 := diff( y(t), t ) = x(t); 2. Define the initial conditions: inits := { [0,2,2], [0,-2,2], [0,-1.7, 0], [0,2,0], [0,-2,0], [0,1.7,0], [0,0,-1] }; For example, [0,-2,2] will correspond to the initial conditions x(0) = -2, y(0) = 2. 3. Plot the direction field and the phase portrait, comprised of the solution curves corresponding to the six given initial conditions: For Maple V Release 3 do: DEplot2( [-0.1*x - y^2, x], [x,y], -10..10, inits, stepsize=0.05, scene=[x,y], x=-3..3, y=-3..3 ); For Maple V Release 4 do: DEplot( {de1, de2}, [x(t), y(t)], -10..10, inits, x=-3..3, y=-3..3, stepsize=0.05 ); In both cases the "-10..10" refers to the range of t values to be used. 4. Plot x(t) and y(t) for a particular solution: sys := {de1, de2, x(0) = 1.7, y(0) = 0}; soln := dsolve( sys, {x(t), y(t)}, type=numeric ): odeplot( soln, [[t,x(t)], [t,y(t)]], -1..1 ); Here "-1..1" means that t varies from -1 to 1.