{VERSION 2 3 "APPLE_PPC_MAC" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "" -1 256 "Courier" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "Courier" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "Courier" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 1 12 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 1 12 0 0 0 0 0 2 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 } {CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 274 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 276 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 278 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 279 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 280 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 281 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 282 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 283 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 284 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 285 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 286 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 287 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 288 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 289 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 290 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 291 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 292 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 293 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 4 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 3 " 4 5 1 {CSTYLE "" -1 -1 "" 1 12 0 0 0 0 1 0 0 0 0 0 0 0 0 }0 0 0 -1 0 0 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 4" 5 20 1 {CSTYLE "" -1 -1 "" 1 10 0 0 0 0 1 0 0 0 0 0 0 0 0 }0 0 0 -1 0 0 0 0 0 0 0 0 -1 0 } {PSTYLE "" 3 256 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "" 0 258 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 259 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "" 0 260 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } 0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 261 1 {CSTYLE "" -1 -1 " " 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "" 0 262 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } 0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {SECT 0 {PARA 3 "" 0 "" {TEXT -1 4 "ODE2" }}{PARA 0 "" 0 "" {TEXT -1 88 "ODE2 file must be located where Maple can find it with a \+ read statement. Usually in the" }}{PARA 0 "" 0 "" {TEXT -1 30 "folder which contains Maple. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 69 "ODE2 WEB page located at http://www.math.macaleste r.edu/ODE/ODE.html." }}{PARA 0 "" 0 "" {TEXT -1 104 "Complete document ation is chapter 5 of the Maple Flight Manual available from Brooks/Co le Publishing Co." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 25 "Author: Daniel Schwalbe." }}{PARA 0 "" 0 "" {TEXT -1 70 " Dept. of Math/CS, Macalester College, St. Paul, MN 5510 5" }}{PARA 0 "" 0 "" {TEXT -1 37 " schwalbe@macalester.ed u" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "read ODE2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 7 "History" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 151 "The user routines in this package are\n\n directionfield : create a direction field with integral curves\n \+ for a first order ODE\n " }}{PARA 0 "" 0 "" {TEXT -1 103 " phasep lot: create a phase plot with flow lines for two first\n \+ order ODE's" }}{PARA 0 "" 0 "" {TEXT -1 2 " " }} {PARA 0 "" 0 "" {TEXT -1 69 " phaseline: create a phase line for first order autonomous DE\n " }}{PARA 0 "" 0 "" {TEXT -1 64 "firstuel er: solves a first order ODE using Euler's method" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 79 "impeuler:\011 \+ solves a first order ODE using the \"improved Euler method\"\n " } }{PARA 0 "" 0 "" {TEXT -1 136 "rungekutta:\011 numerical solution \+ to a system of first order \n ODEs using a 4'th order Runge-Kutta method. \n " }}{PARA 0 "" 0 "" {TEXT -1 197 "besi rk: solve DAE : Based on -BESIRK - A DAE Solver-\n \+ by Hendrik A. Kooijman and Ross Taylor (1993) and \n \+ Fortran code by Hendrik A. Kooijman." }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 86 "orbitplot: s ketch solution to differential equation using rungekutta or besirk\n" }}{PARA 0 "" 0 "" {TEXT -1 11 "March 1996." }}{PARA 0 "" 0 "" {TEXT -1 64 "Rewrote package and renamed ODE to work with Maple V, Release 4 ." }}{PARA 0 "" 0 "" {TEXT -1 84 "Added phaseline, besirk, and orbitpl ot. Added options for background and options to" }}{PARA 0 "" 0 "" {TEXT -1 56 "use \"fish shapes\" for vector fields and parametricplots ." }}{PARA 0 "" 0 "" {TEXT -1 1733 "\n October 1994.\n Fixed bug in ru ngekutta which caused errors when\n iterations option was used.\n\n Ap ril 1993.\n Renamed fieldplot routine to directionfield. \n\n January \+ 1993.\n Fixed a bug which caused display to break when grid =[0,0] was used as\n an option. Thanks to Robert Lopez for pointing this out an d \n helping me track it down. Fixed rungekuttahf to handle more\n ty pes of functions. In particular rungekuttahf now handles\n functions w ith if statements.\n\n June 1992.\n Fixed arrow routines which would n ot scale arrows in extreme cases.\n Changed (improved?) the shape of t he arrows.\n Added type checking to improve the error messages the use r would\n see when the parameters were incorrectly input, thanks to Mi chael\n Monagan for his help on this.\n\n November 1991.\n Added help \+ files for rungekutta, rungekuttahf, firsteuler, impeuler.\n Fixed a bu g in rungekuttahf which was restricting accuracy to current\n Digits s etting, rather than the accuracy of evalhf.\n\n April 1991.\n This fil e contains Maple procedures which work with Maple V. They are\n used t o analyze systems of first order differential equations.\n\n Hard copy documentation for the procedures is available as chapter 5\n of a boo k published by Brooks/Cole Publishing Company called Maple V\n Flight \+ Manual.\n\n Thanks to George Labahn of the Waterloo group for sharing \+ his code,\n parts of which helped to speed the following code. Also, t he technique\n of putting arrows on vectors is his. Michael Monagan ha s been very\n helpful testing the routines and making suggestions for \+ general\n improvements. Others in the Waterloo group have also been he lpful for\n testing and suggestions.\n\n Daniel Schwalbe\n 6635 County Road 101\n Corcoran, MN 55340\n\n e-mail schwalbe@macalester.edu" }}} {SECT 1 {PARA 256 "" 0 "" {TEXT -1 7 "OPTIONS" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 15 "general options" }}{PARA 4 "" 0 "" {TEXT 257 6 "ranges " }{TEXT -1 1 " " }{TEXT 261 74 " - should be given as equation with \+ the appropriate variable appearing on" }{TEXT -1 1 " " }}{PARA 257 "" 0 "" {TEXT -1 38 " left side, for example; t = 1 .. 5 \n\n" }{TEXT 256 14 "initial values" }{TEXT -1 151 " - given as a list or a list of lists, first element in each list is assumed to be independent variab le, for example; inits = [[0, 0, 1], [0, 1, 2]]\n\n" }{TEXT 258 9 "va riables" }{TEXT -1 137 " = [t, x, y, ... ] list of variables in equat ions, generally only needed for besirk method when solving differentia l-algebraic equation." }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 14 "numeric solver" }}{PARA 4 "" 0 "" {TEXT 259 9 "intmethod" }{TEXT 260 19 " = b esirk or dsolve" }}{PARA 0 "" 0 "" {TEXT -1 80 "Used to choose which n umeric solver will be used. Default is standard 4th order" }}{PARA 0 "" 0 "" {TEXT -1 92 "Runge-Kutta method. intmethod = dsolve uses one \+ of the methods built-in to dsolve, numeric." }}{SECT 1 {PARA 5 "" 0 " " {TEXT -1 18 "Rungekutta options" }}{PARA 0 "" 0 "" {TEXT 262 8 "step size" }{TEXT -1 58 "\nUsed to control step size of 4th order Runge-Kut ta method" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 138 "orbitplot((t, \+ x, y) -> [y, -x], t = 0 .. 2 * Pi,\n x = -2 .. 2, y = -2 .. 2,\n i nits = [0, 1, 1],\n view = [x, y],\n stepsize = Pi/4);" }}}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 263 10 "iterations" }}{PARA 0 "" 0 " " {TEXT -1 88 "Reduces the step size used by rungekutta without storin g more points. So it is possible" }}{PARA 0 "" 0 "" {TEXT -1 94 "to g et a highly accurate solution without returning a list with all of the intermediate steps." }}{PARA 0 "" 0 "" {TEXT -1 61 "Especially useful for graphics with very sensitive equations." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 108 "rungekutta((t, x, y) -> [y, -x], t = 0 .. 2 * Pi, \n init = [0, 1, 1],\n stepsize = 2*Pi, iterations = 50);" }}} {PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 264 8 "numsteps" }{TEXT -1 95 " \nAn alternate way to control the stepsize. The range of the independ ent variable is divided by" }}{PARA 0 "" 0 "" {TEXT -1 29 "numsteps to get the stepsize." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 135 "orbit plot((t, x, y) -> [y, -x], t = 0 .. 2 * Pi,\n x = -2 .. 2, y = -2 .. 2,\n inits = [0, 1, 1],\n view = [x, y],\n numsteps = 5);" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 293 5 "bound" }} {PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 265 6 "method" }{TEXT -1 33 " \+ = rkf45 gear mgear dverk78" }}}{PARA 258 "" 0 "" {TEXT -1 0 "" }} {SECT 1 {PARA 5 "" 0 "" {TEXT -1 14 "besirk options" }}{PARA 0 "" 0 " " {TEXT 266 8 "numsteps" }{TEXT -1 2 "\n\n" }{TEXT 267 4 "hmin" } {TEXT -1 2 "\n\n" }{TEXT 268 4 "hmax" }{TEXT -1 2 "\n\n" }{TEXT 269 8 "stepsize" }{TEXT -1 2 "\n\n" }{TEXT 270 8 "maxsteps" }{TEXT -1 2 "\n \n" }{TEXT 271 12 "AbsTolerance" }{TEXT -1 2 "\n\n" }{TEXT 272 12 "Rel Tolerance" }{TEXT -1 2 "\n\n" }{TEXT 273 6 "polord" }{TEXT -1 2 "\n\n " }{TEXT 274 5 "bound" }{TEXT -1 2 "\n\n" }{TEXT 275 13 "startstepsize " }{TEXT -1 2 "\n\n" }{TEXT 276 6 "method" }{TEXT -1 13 " = rk4 rk2 \+ " }}}{PARA 259 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 16 "graphics options" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 277 4 "view" }{TEXT -1 64 " = [x, y]\n Controls which var iables are shown in final plot. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 124 "orbitplot((t, x, y) -> [y, -x - 0.1 * y], t = 0 .. 1 0,\n x = -2 .. 2, y = -2 .. 2,\n inits = [0, 1, 1],\n view = [x, y]);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 278 11 "projections" }}{PARA 0 "" 0 "" {TEXT -1 64 " Adds projections ont o gray planes for three dimensional views." }}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 166 "orbitplot((t, x, y) -> [y, -x], t = 0 .. 10,\n x = -2 .. 2, y = -2 .. 2,\n inits = [0, 1, 1],\n view = [t, x, y], \n projections = [t = -0.2, x = -2.2, y = -2.2]);" }}}{PARA 0 "" 0 " " {TEXT -1 1 "\n" }{TEXT 289 10 "background" }{TEXT -1 37 "\n Control s background color of plot." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 155 "orbitplot((t, x, y) -> [y, -x - 0. 1 * y], t = 0 .. 10,\n x = -2 .. 2, y = -2 .. 2, inits = [0, 1, 1], \n view = [t, y], background = COLOR(RGB, 0, 0, 1));" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 290 10 "orbitcolor" }{TEXT -1 83 "\n Controls coloring of orbits. HUE and GRAY are special opti ons to vary the color" }}{PARA 0 "" 0 "" {TEXT -1 22 " along the \+ orbit." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 176 "orbitplot((t, x, \+ y) -> [y, -x - 0.1 * y], t = 0 .. 10,\n x = -2 .. 2, y = -2 .. 2, in its = [0, 1, 1],\n view = [x, y], background = COLOR(RGB, 0, 0, 0), \n orbitcolor = HUE);" }}}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 291 14 "orbitthickness" }{TEXT -1 46 "\n Controls thickness of orbits . 1 is default." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 197 "orbitplo t((t, x, y) -> [y, -x - 0.1 * y], t = 0 .. 10,\n x = -2 .. 2, y = -2 .. 2, inits = [0, 1, 1],\n view = [x, y], background = COLOR(RGB, 1 , 1, 0),\n orbitcolor = GRAY, orbitthickness = 4);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 18 "flowparametri cplot" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 279 15 "parametricplot " }{TEXT -1 93 " = flowparametricplot \n Draws orbits increasing the line thickness in the direction of flow." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 158 "orbitplot((t, x, y) -> [y, -x], t \+ = 0 .. 2 * Pi,\n x = -2 .. 2, y = -2 .. 2,\n inits = [0, 1, 1],\n \+ view = [x, y],\n parametricplot = flowparametricplot);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 292 8 "segments" }} {PARA 0 "" 0 "" {TEXT -1 83 "Used along with numsteps options to contr ol how many \"fish shapes\" are used to draw" }}{PARA 0 "" 0 "" {TEXT -1 44 "orbit -- number of fish = numsteps/segments." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 191 "orbitplot((t, x, y) -> [y, -x], t = 0 .. 2 * Pi,\n x = -2 .. 2, y = -2 .. 2,\n inits = [0, 1, 1],\n view = [x, y],\n parametricplot = flowparametricplot,\n numsteps = 75, s egments = 15);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 280 9 "flowcolor" }{TEXT -1 94 "\nUsed to color the \"fish shape s\". Can either be a solid color or a function on unit interval." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 276 "orbitplot((t, x, y) -> [y, \+ -x], t = 0 .. 2 * Pi,\n x = -2 .. 2, y = -2 .. 2,\n inits = [0, 1, 1],\n view = [x, y],\n parametricplot = flowparametricplot,\n n umsteps = 75, segments = 15,\n flowcolor = (tt -> COLOR(RGB, tt, 1-t t, 0)),\n background = COLOR(RGB, 0, 0, 0));" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 281 13 "flowthickness" }{TEXT -1 49 "\n Used to control the thickness of \"fish shapes\"." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 270 "orbitplot((t, x, y) -> [y, -x], t \+ = 0 .. 2 * Pi,\n x = -2 .. 2, y = -2 .. 2,\n inits = [0, 1, 1],\n \+ view = [x, y],\n parametricplot = flowparametricplot,\n numsteps = 75, segments = 15,\n flowcolor = HUE,\n background = COLOR(RGB, 0, 0, 0),\n flowthickness = 5);" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 20 "vector field options" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 260 "" 0 "" {TEXT -1 12 "flowlogscale " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 282 14 "dire ctionfield" }{TEXT -1 2 "\n\n" }{TEXT 283 11 "vectorfield" }{TEXT -1 2 "\n\n" }{TEXT 284 9 "flowfield" }{TEXT -1 2 "\n\n" }{TEXT 285 10 "nu llclines" }{TEXT -1 2 "\n\n" }{TEXT 286 9 "isoclines" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 287 4 "grid" }{TEXT -1 1 "\n" }}{PARA 261 "" 0 "" {TEXT -1 10 "fieldcolor" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 288 14 "fieldthickness" }{TEXT -1 1 " \n" }}{PARA 262 "" 0 "" {TEXT -1 10 "flowlength" }}}}{SECT 1 {PARA 3 " " 0 "" {TEXT -1 10 "firsteuler" }}{PARA 0 "" 0 "" {TEXT -1 150 "firste uler - approximate a solution to a first order\nordinary differential \+ equations using Euler's method.\nSolution is returned as an array of l ists. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 16 "Calling Sequence" }}{PARA 0 "" 0 "" {TEXT -1 19 "firsteul er(f,i,h,n)" }}{SECT 0 {PARA 5 "" 0 "" {TEXT -1 10 "Parameters" }} {PARA 0 "" 0 "" {TEXT -1 217 "f - function of 2 real variables. The d ifferential equation to be \n solved is dy/dt = f(t,y) \n i - lis t of 2 numbers. \n h - step size used by the numerical method.\n n - n umber of steps taken by numerical method." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Synopsis" }}{PARA 0 "" 0 "" {TEXT -1 605 "A typical call to the firsteuler function is\nfirsteu ler(f,i,h,n) where f is a real valued functions of 2 variables,\nh is \+ the step size used by the numerical method, and n specifies the\nnumbe r of steps to be taken by the numerical method. An array of (n+1)\nlis ts of 2 numbers is returned, where each list represents a point\ncalcu lated by the numerical method.\n \n- makelist is a procedure in the \+ ODE file to extract a list of values\nfrom an array of lists. This is \+ useful for making a plot of the\napproximate solution calculated by fi rsteuler. makelist(A) will make a\nlist of values from the entries of \+ A." }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Examples" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "eulerpts:= firsteuler((t,y)->t-y,[0,1],.1,10);\nplot(makelist(eulerpts));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 198 "eq:=(t,y)->y;\npts1:=firste uler(eq,[0,1],.5,2);\npts2:=firsteuler(eq,[0,1],.25,4);\npts3:=firsteu ler(eq,[0,1],.1,10);\nplot(\{makelist(pts1),makelist(pts2),makelist(pt s3),\n exp(t)\},0..1,style=LINE);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "eq2:=(t,y)->-t/y;\neq2pts:=firsteuler(eq2,[0,4],.2,25 ):\nplot(makelist(eq2pts));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 159 "eq3:=(t,y)->5*y-6*exp(-t);\neq3pts:=firsteuler(eq3,[0,1],.1,10); \neq3sol:=dsolve(\{diff(y(t),t)=eq3(t,y),y(0)=1\},y(t));\nplot(\{makel ist(eq3pts),rhs(eq3sol)\},0..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 86 "eq4:=(t,y)->25*y*(1-y);\neq4pts:=firsteuler(eq4,[0,1. 3],.1,10):\nplot(makelist(eq4pts));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 207 "eq4:=(t,y)->25*y*(1-y);\neq4pts:=firsteuler(eq4,[0,1 .3],.1,10):\neq4pts2:=firsteuler(eq4,[0,1.3],.05,20):\neq4pts3:=firste uler(eq4,[0,1.3],.025,40):\nplot(\{makelist(eq4pts),makelist(eq4pts2), makelist(eq4pts3)\});" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 8 "impeuler" }}{PARA 0 "" 0 "" {TEXT -1 147 " approximate a solution to a first order ordinary\ndifferential equatio ns using the improved Euler method. Solution is\nreturned as an array \+ of lists." }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 16 "Calling Sequence" }} {PARA 0 "" 0 "" {TEXT -1 17 "impeuler(f,i,h,n)" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "Parameters" }}{PARA 0 "" 0 "" {TEXT -1 217 "f - func tion of 2 real variables. The differential equation to be \n solv ed is dy/dt = f(t,y) \n i - list of 2 numbers. \n h - step size used \+ by the numerical method.\n n - number of steps taken by numerical meth od." }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Synopsis" }}{PARA 0 "" 0 "" {TEXT -1 600 "A typical call t o the impeuler function is\nimpeuler(f,i,h,n) where f is a real valued functions of 2 variables,\nh is the step size used by the numerical m ethod, and n specifies the\nnumber of steps to be taken by the numeric al method. An array of (n+1)\nlists of 2 numbers is returned, where ea ch list represents a point\ncalculated by the numerical method.\n \n - makelist is a procedure in the ODE file to extract a list of values \nfrom an array of lists. This is useful for making a plot of the\napp roximate solution calculated by impeuler. makelist(A) will make a\nlis t of values from the entries of A. " }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Examples" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "impts:=impeuler((t,y)->t-y,[0,1],.1,10);\nplot(m akelist(impts));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 204 "eq:=(t ,y)->y;\nimpts1:=impeuler(eq,[0,1],.5,2);\nimpts2:=impeuler(eq,[0,1],. 25,4);\nimpts3:=impeuler(eq,[0,1],.1,10);\nplot(\{makelist(impts1),mak elist(impts2),makelist(impts3),\n exp(t)\},0..1,style=LINE);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "eq2:=(t,y)->-t/y;\neq2impts: =impeuler(eq2,[0,4],.2,25):\nplot(makelist(eq2impts));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 161 "eq3:=(t,y)->5*y-6*exp(-t);\neq3imp ts:=impeuler(eq3,[0,1],.1,10);\neq3sol:=dsolve(\{diff(y(t),t)=eq3(t,y) ,y(0)=1\},y(t));\nplot(\{makelist(eq3impts),rhs(eq3sol)\},0..1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "eq4:=(t,y)->25*y*(1-y);\neq4 impts:=impeuler(eq4,[0,1.3],.1,10):\nplot(makelist(eq4impts));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 328 "eq4:=(t,y)->25*y*(1-y);\neq 4impts:=impeuler(eq4,[0,1.3],.1,10):\neq4impts2:=impeuler(eq4,[0,1.3], .05,20):\neq4impts3:=impeuler(eq4,[0,1.3],.025,40):\neq4implot:=plot( \{makelist(eq4impts),makelist(eq4impts2),\n makelist(eq4i mpts3)\}):\neq4field:=directionfield(eq4,0..1,0.8..1.5):\nwith(plots): \ndisplay(\{eq4implot,eq4field\});" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 10 "rungekutta" }}{PARA 0 "" 0 "" {TEXT -1 175 "approximate a solution to a system of first\norder ordin ary differential equations using a fourth order Runge/Kutta\nnumerical method. Solution is returned as an array of lists." }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 16 "Calling Sequence" }}{PARA 0 "" 0 "" {TEXT -1 107 "rungekutta(fcnlist,initvalue,stepsize,numsteps)\n rungekutta(fcnl ist,initvalue,stepsize,numsteps,iterations)" }}{SECT 1 {PARA 20 "" 0 " " {TEXT -1 10 "Parameters" }}{PARA 0 "" 0 "" {TEXT -1 697 "fcnlist - l ist of functions, [f1,f2,...,fn], of n+1 real variables. \n \+ The differential equation to be solved is of the form:\n\011\011\011 \011dx1/dt = f1(t,x1,x2,...,xn)\n\011\011\011\011dx2/dt = f2(t,x1,x2,. ..,xn)\n\011\011\011\011 . . .\n\011\011\011\011 . . \+ .\n\011\011\011\011 . . .\n\011\011\011\011dxn/d t = fn(t,x1,x2,...,xn)\n initvalue - list of n+1 numbers, [i0,i1,i2,.. .,in], which represents \n the initial value of the diffe rential equation. \n stepsize - step size used by the numerical method .\n numsteps - number of steps taken by numerical method.\n iterations - optional value which decreases the step size without \n \+ storing more points. New step size will be \n\011\011\011 stepsize /iterations." }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Synopsis" }} {PARA 0 "" 0 "" {TEXT -1 1061 " A typical call to the rungekutta funct ion is\nrungekutta([f1,f2,...,fn],[i0,i1,i2,...,in],stepsize,numsteps) , where\nf1,f2,...,fn are real valued functions of n+1 variables, step size is\nthe step size used by the numerical method, and numsteps spec ifies the\nnumber of steps to be taken by the numerical method. An arr ay of (n+1)\nlists of (numsteps+1) numbers is returned, where each lis t represents\na point calculated by the numerical method.\n \n- An o ptional fifth argument is used to reduce the step size without \nstori ng more points. This is especially useful when graphing \nsolutions w hich require a small step size and a large plot structure \nis undesir able. Also useful when only the final value is wanted.\n \n- makeli st is a procedure in the ODE file to extract a list of values\nfrom an array of lists. This is useful for making two dimensional\nplots of s olutions calculated by rungekutta. makelist(A,m,n) will \nmake a list of values from the mth and nth components from each \nentry of A. m d efaults to 1 and n defaults to 2 if no values are \nentered." }}} {SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Examples" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 67 "rkpts1:=rungekutta((t,y)->t-y,[0,1],.1,10);\nplot( makelist(rkpts1));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 108 "eq1: =(t,x,y)-> y;\neq2:=(t,x,y)->-x;\nrkpts2:=rungekutta([eq1,eq2],[0,1,1] ,.1,60);\nplot(makelist(rkpts2,2,3));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 378 "dp1:=(t,x,xp,y,yp)->xp;\ndp2:=(t,x,xp,y,yp)->-2*sin( x)+sin(y);\ndp3:=(t,x,xp,y,yp)->yp;\ndp4:=(t,x,xp,y,yp)->-2*sin(y)+2*s in(x);\ndpinit:=[0,0,0,0,2];\ndppts:=rungekutta([dp1,dp2,dp3,dp4],dpin it,1,10,1):\ndppts2:=rungekutta([dp1,dp2,dp3,dp4],dpinit,1,10,2):\ndpp ts3:=rungekutta([dp1,dp2,dp3,dp4],dpinit,1,10,4):\nplot(\{makelist(dpp ts,2,4),makelist(dppts2,2,4),\n makelist(dppts3,2,4)\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 150 "dp:=(t,x,xp,y,yp)->[xp,-2*sin(x)+s in(y),yp,-2*sin(y)+2*sin(x)];\ndpinit:=[0,0,0,0,2];\ndppts:=rungekutta (dp,dpinit,.1,100):\nplot(\{makelist(dppts,2,4)\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 360 "eq3:=(t,x,y)->x*sin(t)+5*y;\neq4:=(t,x,y )->-10*x+y*sin(t);\nrkpts3:=rungekutta([eq3,eq4],[0,2,0],.05,200,5):\n plot(makelist(rkpts3,2,3));\nplot(\{makelist(rkpts3,1,2),makelist(rkpt s3,1,3)\});\n#for the Maple expert and the brave alike, construct a PL OT3D structure\nplot1:=PLOT3D(CURVELIST([seq([rkpts3[i][1],rkpts3[i][2 ],rkpts3[i][3]],\n i=0..100)]),AXES(BOXED)):\";" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 192 "pulse:=proc(t) if not type(t,numeric) then 'pulse'(t)\n elif trunc(trunc(t)/2)=trunc(t)/2 then 1 else 0 fi end ;\npulsepts:=rungekutta((t,x)->pulse(t)*x,[0,1],.1,100):\nplot(makelis t(pulsepts));" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 " " 0 "" {TEXT -1 6 "besirk" }}{PARA 0 "" 0 "" {TEXT -1 451 "Procedure f or the numerical solution of ODE and DAE systems. \n besirk uses a th ird order semi-implicit Runge-Kutta (SIRK) method of\n M. Michelsen ( 1976) combined with a Bulirsch-Stoer extrapolation method to\n contro l step-size to obtain numerical solutions to systems of ODEs and\n di fferential algebraic systems. The method is especially useful for solv ing\n stiff systems of ODEs where explicit Runge-Kutta methods fail o r are very\n inefficient." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 147 "Based on besirk - A DAE Solver by Harry Kooijman and Ross Taylor (1993)\n and Fortran code by Harry Kooijman, transla ted into Maple by Dan Schwalbe" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {SECT 1 {PARA 4 "" 0 "" {TEXT -1 16 "Calling Sequence" }}{PARA 0 "" 0 "" {TEXT -1 57 " besirk (eqnlist, initvalue, IntegrationRange, options );\n" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "Parameters" }}{PARA 0 "" 0 "" {TEXT -1 892 " eqnlist - list of n differential equations, [de1 ,de2,...,den], or a list of\n differential and algebraic e quations, [de1,..,dem,aem+1,..aen].\n Differential equatio ns must be written using the Diff operator,\n or using the functional notation used in dsolve/numeric.\n Differentia l equations must precede algebraic ones in DAE systems.\n \n initvalue - list of n+1 equations each of the form x = \n w here x represents the name of a variable and the number is it's\n \+ initial value. For example, [t=0, x=0, y=1]\n\n IntegrationRan ge \n - range to integrate over. For exmaple, 0..100.,\n \+ This range need not start at the initial value of the indepen dent,\n variable in which case besirk integrates back from the initial,\n value to the start of the range and forwar d to it's end.\n" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Synopsis" }} {PARA 0 "" 0 "" {TEXT -1 1478 "besirk accepts a number of optional arg uments of the form option=something.\n In most cases the something is \+ a number.\n\n The accuracy of the results is controlled by two optiona l arguments:\n - AbsTolerance = (the default is 10^(7-precisi on)\n - RelTolerance = (the default is zero).\n\n - polord = \+ , The extrapolation order is the order of a polynomial\n \+ used to fit results of successive integrations in order to esti mate\n the results at some point in the \"future\". The hig her the order,\n the fewer steps are likely to be needed. T he default value 3.\n In some cases it is advisable to set \+ the order of extrapolation to\n 2 or even 1 for increased a ccuracy. \n\n The number and size of the integration steps can be cont rolled with four\n optional arguments:\n - startstepsize = \n \+ - hmax = , maximum allowable step size\n - hmin = , mi nimum allowable step size\n - maxsteps = \n besirk can be so \+ efficient that there may be too few points to render an\n accurate plo t. Limiting the maximum step size can help in such cases. To\n obtain \+ equally spaced points set hmax and hmin equal.\n\n besirk uses Michels on's SIRK method for each step of the integration unless\n an alternat ive method is specified via the method= optional argument.\n P ossible values of string include:\n rk4, 4th order Runge/Kutta used \+ for each small step\n rk2, Improved Euler used for each small step. " }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Examples" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "eq1:= (t, y) -> y:\ninit1:=[0, 1]:\nbesirk(eq1,init1,-1..1,AbsTolerance=1e-10);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 97 "eq2:= (t, x, y) -> [y, -x] ;\ninit2:=[0, 1, 0];\neq2pts:=besirk(eq2,init2,0..2*Pi,startstepsize=. 3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 249 "p := 0.01;\neq5:=[D iff(u,t) = p - (p+u+v)*(1+(u+1000)*(u+1)),\n Diff(v,t) = p-(p+u+v )*(1+v^2)];\ninit5:=[0, 0, 0];\neq5pts:=besirk(eq5,init5,0..100,AbsTol erance=10^(-10));\n#plot t vs y1 and t vs y2\nplot(\{makelist(eq5pts,1 ,2),makelist(eq5pts,1,3)\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 477 "rho:=3; Fballoon:=9800; g:=980;\nFgravity:= -rho*g*x(t);\nFgrou nd:= Heaviside(-v(t))*rho*v(t)^2;\nNewtball:= diff(rho*x(t)*diff(x(t) ,t),t) = \n Fgravity + Fground + Fballoon;\nropedx := diff(x( t),t) = v(t);\nropedv := diff(v(t),t) =subs(ropedx,solve(Newtball,diff (x(t),t,t)));\nropepts:=besirk([ropedv,ropedx],[0, 0, 0.5],0..2,method =rk4,\n startstepsize=0.001,hmax=.01):\nropeptsplot:=plot(\{ma kelist(ropepts,2,3)\},\n velocity =-50..50,position = 0..5,color=r ed):\";" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 566 "Belousov :=\n \+ [Diff(y[1],t)=77.27*(y[2]-y[1]*y[2]+y[1]-8.375e-6*y[1]^2),\n \+ Diff(y[2],t)=(-y[2]-y[1]*y[2]+y[3])/77.27,\n Diff(y[3],t)=0.161 *(y[1]-y[3])];\ninitialB := [0, 4, 1.1, 4];\nbpoints:=besirk(Belousov, initialB,0..5,\n AbsTolerance=1e-6,RelTolerance=1e-4,hmax=0.025):\np lots[logplot](\{makelist(bpoints,1,2),makelist(bpoints,1,3),\n makeli st(bpoints,1,4)\});\nbpoints420:=besirk(Belousov,initialB,0..420,\n \+ AbsTolerance=1e-6,RelTolerance=1e-4,hmax=0.4):\nplots[logplot](\{makel ist(bpoints420,1,2),makelist(bpoints420,1,3),\n makelist(bpoints420,1 ,4)\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 389 "# A DAE problem : pendulum with torsion\ng:=1:L:=1:\nindex1 := [Diff(z[1],t) = z[3],\n Diff(z[2],t) = z[4],\n Diff(z[3],t) = -z[1] * lam bda,\n Diff(z[4],t) = -z[2] * lambda - g,\n 0 = z[ 3]^2 - lambda*L^2 + z[4]^2-z[2]*g];\ninit3:=[0, 1, 0, 0, 1, 1]:\nindex 1pts:=besirk(index1,init3,0..10,hmax=0.2,hmin=0.2,\n variables = [t, \+ z[1], z[2], z[3], z[4], lambda]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 157 "#animate pendulum\nplots[display]([seq(\n plot([[0 ,0],[index1pts[i][2],index1pts[i][3]]],\n -1..1,-1..1,scaling=constr ained),\n i=0..42)],insequence=true);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 86 "eq1a:=diff(y(t),t)=y(t);\ninit1a:=[0, 1];\nbesirk(eq1 a,init1a,-1..1,AbsTolerance=1e-10);" }}}}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 14 "directionfield" }}{PARA 0 " " 0 "" {TEXT -1 80 " create a direction field with flow lines \nfor fi rst order differential equation" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 16 "Calling Sequence" }}{PARA 0 "" 0 "" {TEXT -1 61 " directionfield(f , h, v)\n directionfield(f, h, v,\{inits\},...)" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "Parameters" }}{PARA 0 "" 0 "" {TEXT -1 144 " f - fun ction of two variables where D(y)(t)=f(t,y).\n h - horizontal range\n \+ v - vertical range\n \{inits\} - set of initial values for flow lines. \n" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Synopsis" }}{PARA 0 "" 0 "" {TEXT -1 1294 "A typical call to the directionfield function is\ndirectionfield(f,a..b,c..d), where f is a real function of two\nvariables and a..b,c..d specifies the horizonta l and vertical real\nrange. For each point, (tp,yp), of a grid a short line segment is\ndrawn with slope f(tp,yp).\n \n- Each initial poin t is specified as a list, [t0,y0]. A fourth\norder Runge/Kutta scheme \+ is used to calculate the solution to\nD(y)(t)=f(t,y) through the point (t0,y0) over the entire\nhorizontal range. The routine will adjust th e step size\ndown for very steep solutions.\n \n- Remaining argument s are interpreted as options which are\nspecified as equations of the \+ form option = value. There are\ncurrently 3 options -- grid, stepsize, iterations\nThe value for grid is a list, [m,n], where the current de fault is\n[16,12]. The value for stepsize controls the step size in th e\nRunge/Kutta numerical scheme and determines how many points will\nb e plotted, the current default is (b-a)/20 and 20 points are\nplotted. It is possible to decrease the stepsize without\nincreasing the numbe r of points plotted (which slows down the\nroutine and leads to unreas onably large plot structures) by\nsetting the value for iterations. it erations = 10 decreases the\nstepsize by a factor of 10, and every 10t h point will be stored and\nplotted. " }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Examples" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "dire ctionfield((t, y) -> t - y, t = -4..4, y = -3..3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "directionfield((t, y) -> y, t = 0..1, y = 0 ..3, inits = \{[0, 1]\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 84 "directionfield((t, y) -> -t/y, -4..4, -4..4, \n \{[0, 1], [0, \+ 2], [0, 3],[0, 4]\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "di rectionfield((t,y)->-t/y,-4..4,-4..4,\{[0,1],[0,2],[0,3],[0,4]\},\n i ntmethod = besirk);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "dire ctionfield((t,y)->sin(t+y),-4..4,-4..4,grid=[16,14]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 188 "directionfield((t, y) -> -t + y, - 4..4, -4..4,\n \{seq(seq([3*j, 3*i], i = -1..1), j = -1..1)\},\n \+ orbitcolor = RAINBOW, orbitthickness = 3,\n background = COLOR(RG B, 0.5, 0.5, 0.5));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 138 "eq \+ := (t, y) -> sin(t + y):\ninits := \{seq(seq([2*i, 2*j], i = -2..2), j = -2..2)\}:\ndirectionfield(eq, -4..4, -4..4, inits, grid = [0, 0]); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "directionfield((t, y) - > -y^2 + t, 0..20, 0..10, [0,1], \n iterations = 10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 247 "eq4 := (x, y) -> (1 - x^2 - y^2)/( y - x + 2):\ninit4 := seq(seq([2*j, i], i = -1.9..1.1), j = -1..1):\nd irectionfield(eq4, -2..2, -2..2, \{init4\}, intmethod = besirk,\n orb itcolor = RAINBOW, orbitthickness = 2,\n background = COLOR(RGB, .5, \+ .5, .5));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 245 "eq5 := (t, y) -> y*tan(t);\ninit5:=seq(seq([3*i, 2*j + 1], i = -1..1), j = -2..1): \ndirectionfield(eq5, -6..6, -6..6, grid = [0,0], \{init5\},\n iterati ons = 5, hmax = 0.1, intmethod = besirk,\n orbitcolor = RAINBOW, backg round = COLOR(RGB,.5,.5,.5));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 243 "eq6 := (t, y) -> -y*tan(t);\ninit6 := seq(seq([2*i, 2*j], i = - 2..2), j = -2..2):\ndirectionfield(eq6, -6..6 ,-6..6, grid = [0, 0],\{ init6\},\n iterations = 5, hmax =.1, intmethod = besirk, \n orbitcolor = RAINBOW, background = COLOR(RGB,.5,.5,.5));" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 205 "directionfield((t, x) -> sin(t*x), 0..6, 0..6 ,\n \{seq([0, i], i = 0..6)\}, stepsize=0.1, grid=[25, 25],\n isocli nes = true, background = COLOR(RGB, .5, .5, .5),\n orbitcolor = RAINB OW, orbitthickness = 3); " }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 "phaseline" }}{PARA 0 "" 0 "" {TEXT -1 72 "Draw phase line for single first order autonomous differential equ ation." }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 16 "Calling Sequence" }} {PARA 0 "" 0 "" {TEXT -1 24 "phaseline(f, x = xrange)" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "Parameters" }}{PARA 0 "" 0 "" {TEXT -1 133 "f- function of two variables where D(x)(t)=f(t,x) where f does no t depend on t. t=0 is substituted to draw the phase line\notherwise. \+ " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Synopsis" }}{PARA 0 "" 0 "" {TEXT -1 2 ".\n" }}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 8 "Examples" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 118 "phaseline((t,x) -> sin(x/2), x = -10..10, \n numsteps = 30, segm ents = 5,\n orbitthickness = 2, flowthickness = 0.75);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 158 "phaseline((t,x) -> sin(x/2), x = - 10..10, flowcolor = redscale, \n numsteps = 10, segments = 5,\n orbi tthickness = 2, flowthickness = 0.75, flowfield = true);" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 "phaseplot " }}{PARA 0 "" 0 "" {TEXT -1 85 " draw phase space with flow lines for second\n order autonomous differential equation." }}{SECT 1 {PARA 4 " " 0 "" {TEXT -1 16 "Calling Sequence" }}{PARA 0 "" 0 "" {TEXT -1 62 "p haseplot([f1,f2], h, v)\n phaseplot([f1,f2], h, v,\{inits\},...)" }} {SECT 1 {PARA 4 "" 0 "" {TEXT -1 10 "Parameters" }}{PARA 0 "" 0 "" {TEXT -1 401 "f1,f2 - two functions of three variables where\nD(x)(t)= f1(t,x,y) and D(y)(t)=f2(t,x,y) where normally f1 and f2\ndo not depen d on t. t=0 is substituted to draw the phase space\notherwise. Note it will still be interesting to draw flow\nlines in the non-autonomous c ase, i.e. where f1 and f2 depend\nexplicity on time. h - horizontal ra nge v - vertical range \{inits\}\n- set of initial values for flow lin es." }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Synopsis" }}{PARA 0 "" 0 "" {TEXT -1 1456 "A typical call \+ to the phaseplot function is\nphaseplot([f1,f2],a..b,c..d), where f1 a nd f2 are real functions of\nthree variables and a..b,c..d specifies t he horizontal and\nvertical real range. For each point, (xp,yp), of a \+ grid, a scaled\nvector with basepoint (xp,yp) and endpoint\n(f1(0,xp,y p),f2(0,xp,yp)) is drawn.\n \n- Each initial point is specified as a list, [t0,x0,y0]. A\nfourth order Runge/Kutta scheme is used to calcu late the solution\nto the system of equations, D(x)(t)=f1(t,x,y),\nD(y )(t)=f2(t,x,y),x(t0)=x0,y(t0)=y0. The default is to use a step\nsize o f 0.1 and do 50 iterations.\n \n- Remaining arguments are interprete d as options which are\nspecified as equations of the form option = va lue. There are\ncurrently 4 options -- grid, stepsize, numsteps, and i terations.\nThe value for grid is a list, [m,n], where the current def ault is\n[16,14]. The value for stepsize controls the step size in the \nRunge/Kutta numerical scheme, the current default is 0.1. The\nvalue for numsteps specifies how many steps forward and backward\n will be \+ calculated and stored by the Runge/Kutta routine. The\ncurrent default is 50 forward and back. It is possible to\ndecrease the stepsize with out increasing the number of points\nplotted (which slows down the rou tine and leads to unreasonably\nlarge plot structures) by setting the \+ value for iterations.\niterations = 10, would decrease the stepsize by a factor of 10\nand every 10th point would be stored and plotted.\n" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "Examples" }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 48 "phaseplot([(t,x,y)->-x,(t,x,y)->y],-4..4,-4..4 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 170 "eq1:=(t,x,y)-> 5*x-x ^2-x*y: \neq2:=(t,x,y)->x*y-2*y:\ninits:=\{seq([0,5,i],i=1..9),seq([0, i,0.1],i=1..9)\}:\nphaseplot([eq1,eq2],0..10,0..10,inits,grid=[15,15], \nbound = true);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 101 "readli b(Heaviside): \neq3:=(t,y,v)->v: \neq4:=(t,y,v)->-Heaviside(y):\nphase plot([eq3,eq4],-4..4,-4..4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 181 "readlib(Heaviside): \neq5:=(t,y,v)->v:\neq6:=(t,y,v)->-Heavisid e(y-5)*v/2-(1-Heaviside(y-5))*v/10+1:\nphaseplot([eq5,eq6],0..10,0..5, [0,0,0],iterations=10,\n numsteps=200,grid=[15,15]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 170 "eq7:=(t,x,y)-> -x+x*y: \neq8:=(t,x,y)->- y+2*x*y:\ninits2:=\{seq(seq([0,i/2,j/2],i=0..2),j=0..2)\}:\nphaseplot( [eq7,eq8],-.5..1.5,-.5..1.5,inits2,grid=[15,15],\n bound = true);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 182 "pend3:=(t,y,v) -> v;\npend 4:=(t,y,v) -> -sin(y) -0.2*v;\npendinits:=seq([0,j/2],j=2..8):\nphasep lot([pend3,pend4],\n t = -10..10, y = -10..10, v = -4..4,\n \{pend inits\}, numsteps=200);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 507 "ropedv := proc(t,v,y) if type(v,numeric) then \n if v>0 then (9800 \+ -3*980*y - 3*v^2)/(3*y)\n elif v <= 0 then (9800 -3*980*y)/(3*y) fi \n else 'ropedv(t,v,y)' fi end;\nropedy := (t,v,y) -> v;\nphaseplo t([ropedv,ropedy],-59..59,0.1..5, \n background = COLOR(RGB,0.5,0.5,0 .5),\n init = [0,0,0.25], t = 0 .. 2,\n flowlogscale = 5, \n intmet hod = besirk, \n method = rk4, hmax = 0.002,\n hmin = 0.002, \n pa rametricplot = flowparametricplot, \n segments = 35, \n flowcolor = \+ (xx -> COLOR(RGB,1,1-xx,1-xx)));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 166 "eq11:=(t,y,v) -> v^2-y^2;\neq12:=(t,y,v) -> y-2*v;\n eq1init:=seq(seq([i,j],j=-2..2),i=-2..2):\nphaseplot([eq11,eq12],-5..5 ,-5..5,grid=[12,12],\{eq1init\},\n bound = true);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 97 "eq21:=(t,x,y)->cos(x+y);\neq22:=(t,x,y)->-s in(y);\nphaseplot([eq21,eq22],-6..6,-6..6,grid=[25,25]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 272 "pend := (t,y,v) -> [v, -sin(y) - 0 .2*v];\npendinits := [0, 2], [0, 2.5], [0, 3], [0, 3.5]:\nphaseplot(pe nd, y = -3..10, v = -6..6,\n t = -2 .. 15, \{pendinits\}, \n \+ orbitthickness = 2, orbitcolor = red,\n numsteps=200, flowfiel d = true,\n nullclines = true);" }}}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 "orbitplot" }}{PARA 0 "" 0 "" {TEXT -1 42 " sketch solution to di fferential equation." }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 16 "Calling S equence" }}{PARA 0 "" 0 "" {TEXT -1 50 "orbitplot(eqn, t = trange, ini ts = initialvalues);" }}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 10 "Parameter s" }}{PARA 0 "" 0 "" {TEXT -1 169 "eqn = (t, x_1, x_2, ... , x_n) -> [ exp_1, exp_2, ... , exp_n] - function of an arbritrary number of va riables where diff(x_i, t) = exp_i is the differential equation." }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 8 "S ynopsis" }}{PARA 0 "" 0 "" {TEXT -1 1408 "A typical call to the orbitp lot function is\norbitplot(eqn, t = t_0 .. t_1, init = initialvalues), where eqn is a real function of\nn variables and t_0 .. t_1 is the ra nge over which to solve the differential equation. initialvalues is a \+ list of list of initial values.\n \n- Each initial point is specifie d as a list, [t0,x0,y0]. A\nfourth order Runge/Kutta scheme is used to calculate the solution\nto the system of equations, D(x)(t)=f1(t,x,y) ,\nD(y)(t)=f2(t,x,y),x(t0)=x0,y(t0)=y0. The default is to use a step\n size of 0.1 and do 50 iterations.\n \n- Remaining arguments are inte rpreted as options which are\nspecified as equations of the form optio n = value. There are\ncurrently 4 options -- grid, stepsize, numsteps, and iterations.\nThe value for grid is a list, [m,n], where the curre nt default is\n[16,14]. The value for stepsize controls the step size \+ in the\nRunge/Kutta numerical scheme, the current default is 0.1. The \nvalue for numsteps specifies how many steps forward and backward\n w ill be calculated and stored by the Runge/Kutta routine. The\ncurrent \+ default is 50 forward and back. It is possible to\ndecrease the stepsi ze without increasing the number of points\nplotted (which slows down \+ the routine and leads to unreasonably\nlarge plot structures) by setti ng the value for iterations.\niterations = 10, would decrease the step size by a factor of 10\nand every 10th point would be stored and plott ed.\n" }}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 8 "Examples" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 211 "f := (a,w,b) -> -a*w + (a+b)/2*(ab s(w+1) - abs(w-1));\norbitplot( \n unapply([-f(7/100,y-x,1/10)/10,-f( 7/100,y-x,1/10)-z,y], t,x,y,z),\n [0,1,1,1], t = 0..350, view = [x,y, z], \n stepsize = 0.3, flowcolor = HUE);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 239 "orbitplot((t,x,y) -> [10*(y - x^3/3 + x), -0.1*x], \n t = 0..100, x = -3..3, y = -2..2,\n init = [0,1.7,0.7], \n i ntmethod = besirk, flowcolor = red,\n orbitthickness = 2, \n view \+ = [x,t,y],\n projections = [x = -4, t = 105,y = -3]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 317 "orbitplot(\n (t,x,y) -> [2*y, 2* x-3*x^2 - 5*y*(x^3-x^2+y^2)], \n t = -3..3, x = -2..2, y = -2..2,\n \+ inits = [seq([0, i/4, 0], i = -7..7)],\n numsteps = 200, segments \+ = 25, bound = true,\n flowcolor = (xx -> COLOR(RGB,1,1-xx,1-xx)),\n \+ parametricplot = flowparametricplot, \n background = gray,\n vie w = [x,y]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{MARK "0 \+ 21" 0 }{VIEWOPTS 1 1 0 1 1 1803 }