DEtools
convertsys
convert a system of differential equations to a first-order system
Calling Sequence
Parameters
Description
Examples
convertsys(deqns, inits, vars, ivar, yvec, ypvec)
deqns
-
ordinary differential equation, or set or list of equations; can be specified as expressions, which are assumed equal to zero
inits
set or list of initial conditions
vars
function or list or set of functions; dependent variables of the system
ivar
independent variable
yvec
(optional) name to be used for the solution vector in the first-order system
ypvec
(optional) name to be used for the yvec' vector in the first-order system
DEtools[convertsys] converts a system of one or more ordinary differential equations to a system of first-order differential equations. Corresponding initial conditions (if specified) are also converted.
The initial conditions inits must each be of the form function = expression. See examples below. Note: if no initial conditions are available, inits must still be specified as {} or [].
The convertsys command returns a list eqnlist,Ydefs,x0,Y0 where
* eqnlist is the list of equations representing the first-order system Y'⁡x=f⁡x,Y⁡x in which the Y vector is specified by yvec1,...,yvecneqns and the Y' vector by ypvec1,...,ypvecneqns.
* Ydefs is the list of equations defining the yveci names in terms of the original functions.
* x0 is the point at which the initial conditions are specified. It is returned as undefined if inits is the empty set.
* Y0 is a list representing the vector of initial conditions (possibly empty). Only one of the initial conditions needs to be specified for this list to be nonempty. Note that the ordering of Y0 matches that of Ydefs, not that of inits.
This function is part of the DEtools package, and so it can be used in the form convertsys(..) only after executing the command with(DEtools). However, it can always be accessed through the long form of the command by using DEtools[convertsys](..).
with⁡DEtools:
deq1≔diff⁡y⁡t,`$`⁡t,2=y⁡t−x⁡t,diff⁡x⁡t,t=x⁡t:
init1≔y⁡0=1,D⁡y⁡0=2,x⁡0=3:
convertsys⁡deq1,init1,x⁡t,y⁡t,t,y,y_p
y_p1=y1,y_p2=y3,y_p3=y2−y1,y1=x⁡t,y2=y⁡t,y3=ⅆⅆty⁡t,0,3,1,2
deq2≔D3⁡y⁡x=y⁡x⁢x:
init2≔y⁡0=3,D⁡y⁡0=2,D2⁡y⁡0=1:
convertsys⁡deq2,init2,y⁡x,x
YP1=Y2,YP2=Y3,YP3=Y1⁢x,Y1=y⁡x,Y2=ⅆⅆxy⁡x,Y3=ⅆ2ⅆx2y⁡x,0,3,2,1
deq3≔diff⁡y⁡t,`$`⁡t,2=100⁢exp⁡−10⁢t+exp⁡10⁢t:
convertsys⁡deq3,,y⁡t,t,V
YP1=V2,YP2=100⁢ⅇ−10⁢t+100⁢ⅇ10⁢t,V1=y⁡t,V2=ⅆⅆty⁡t,undefined,
convertsys⁡deq3,D⁡y⁡0=1,y⁡t,t,V
YP1=V2,YP2=100⁢ⅇ−10⁢t+100⁢ⅇ10⁢t,V1=y⁡t,V2=ⅆⅆty⁡t,0,y⁡0,1
See Also
Download Help Document