This preview shows page 1. Sign up to view the full content.
Unformatted text preview: is the dependent variable • range is the range of the independent variable • iniconds is a list of initial conditions The following is a plot of the function satisfying both the diﬀerential equation ode1 and the initial conditions ic1 above.
> DEplot( ode1, y(t), 0..20, [ [ ic1 ] ] ); 1 0.8 y(t) 0.6 0.4 0.2 0 5 10 t 15 20 You can reﬁne the plot by specifying a smaller stepsize.
> DEplot( ode1, y(t), 0..20, [ [ ic1 ] ], stepsize=0.2 ); 1 0.8 y(t) 0.6 0.4 0.2 0 5 10 t 15 20 If you specify more than one list of initial conditions, DEplot plots a solution for each.
> ic2 := y(0)=0, D(y)(0)=1; 262 • Chapter 7: Solving Calculus Problems ic2 := y(0) = 0, D(y )(0) = 1 > DEplot( ode1, y(t), 0..20, [ [ic1], [ic2] ], stepsize=0.2 );
1.4 1.2 1 y(t) 0.8 0.6 0.4 0.2 5 10 t 15 20 DEplot can also plot solutions to a set of diﬀerential equations.
> eq1 := diff(y(t),t) + y(t) + x(t) = 0; eq1 := ( d y(t)) + y(t) + x(t) = 0 dt > eq2 := y(t) = diff(x(t), t); eq2 := y(t) =
> ini1 := x(0)=0, y(0)=5; d x(t) dt ini1 := x(0) = 0, y(0) = 5
> ini2 := x(0)=0, y(0)=5; ini2 := x(0) = 0, y(0) = −5 The system {eq1, eq2} has two dependent variables, x(t) and y(t), so you must include a list of dependent variables. 7.2 Ordinary Diﬀerential Equations > DEplot( {eq1, eq2}, [x(t), y(t)], 5..5, > [ [ini1], [ini2] ] );
60 40 y 20 –60 –40 –20 0 –20 –40 –60 20 40 x 60 • 263 Note: DEplot also generates a direction ﬁeld, as above, whenever it is meaningful to do so. For more details on how to plot ODEs, refer to the ?DEtools,DEplot help page. DEplot3d is the threedimensional version of DEplot. The basic syntax of DEplot3d is similar to that of DEplot. For details, refer to the ?DEtools,DEplot3d help page. The following is a threedimensional plot of the system plotted in two dimensions above.
> DEplot3d( {eq1, eq2}, [x(t), y(t)], 5..5, > [ [ini1], [ini2] ] ); 40 20 y(t) 0 –20 –40 –60 –40 –20 0 20 x(t) 0 –2 t –4 40 60 4 2 The following is an example of a plot of a system of three diﬀerential equations.
> eq1 := diff(x(t),t) = y(t)+z(t); eq1 := d x(t) = y(t) + z(t) dt 264 • Chapter 7: Solving Calculus Problems > eq2 := diff(y(t),t) = x(t)y(t); eq2 := d y(t) = −y(t) − x(t) dt > eq3 := diff(z(t),t) = x(t)+y(t)z(t); eq3 := d z(t) = x(t) + y(t) − z(t) dt These are two lists of initial conditions.
> ini1 := [x(0)=1, y(0)=0, z(0)=2]; ini1 := [x(0) = 1, y(0) = 0, z(0) = 2]
> ini2 := [x(0)=0, y(0)=2, z(0)=1]; ini2 := [x(0) = 0, y(0) = 2, z(0) = −1] The DEplot3d command plots two solutions to the system of diﬀerential equations {eq1, eq2, eq3}, one solution for each list of initial values.
> DEplot3d( {eq1, eq2, eq3}, [x(t), y(t), z(t)], t=0..10, > [ini1, ini2], stepsize=0.1, orientation=[171, 58] ); 2 z 2 x –1 2 –1 y –1 Discontinuous Forcing Functions
In many practical instances the forcing function to a system is discontinuous. Maple provides many ways to describe a system in terms of ODEs and include descriptions of discontinuous forcing functions. 7.2 Ordina...
View
Full
Document
 Spring '12
 NIL
 Math, Division

Click to edit the document details