DynamicSystems
DiffEquation
create a differential or difference equation system object
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
DiffEquation(opts)
DiffEquation(sys, opts)
DiffEquation(tf, opts)
DiffEquation(z, p, k, opts)
DiffEquation(num, den, opts)
DiffEquation(a, b, c, d, opts)
DiffEquation(de, invars, outvars, opts)
sys
-
System; system object
tf
algebraic or Matrix(algebraic); transfer function
z
list(algebraic) or Matrix(list(algebraic)); zeros
p
list(algebraic) or Matrix(list(algebraic)); poles
k
algebraic or Matrix(algebraic); gain(s)
num
list(algebraic) or Matrix (list(algebraic)); numerator coefficients
den
list(algebraic) or Matrix (list(algebraic)); denominator coefficients
a
Matrix; state-space matrix A
b
Matrix; state-space matrix B
c
Matrix; state-space matrix C
d
Matrix; state-space matrix D
de
equation or list(equation); diff-equations
invars
name, anyfunc(name) or list of same; input variables
outvars
name, anyfunc(name) or list of same; output variables
opts
(optional) equation(s) of the form option = value; specify options for the DiffEquation command
The opts arguments are optional arguments of the form option = value, where option is one of the names listed below. These arguments correspond to keyword parameters; the left side of an equation is the keyword and the right side is the value. Each keyword parameter has a default value that is assigned if the parameter is not passed.
The following paragraphs describe each of the keyword parameters. The first line of each paragraph specifies the format of the argument: the left side is the keyword and the right side specifies the type of the value. If the type is truefalse, then passing just the keyword is equivalent to passing keyword = true.
discrete = truefalse
Specifies whether the system is discrete (true) or continuous (false). The default value is assigned by DynamicSystems[SystemOptions].
conjugate = truefalse
If true and the z and p (and k) parameters are used, then the conjugate of any complex zero or pole is added to the respective list. For example, if conjugate = true then z=1,1+I is equivalent to z=1,1+I,1−I. The default value is assigned by DynamicSystems[SystemOptions].
sampletime = realcons
The sampling time of the system. The default value is assigned by DynamicSystems[SystemOptions].
systemname = string
The name of the system. The default is the empty string.
inputvariable = list of name or function(name)
The names of the inputs to the system. A name, say u, is converted to a function u(t), where t is the independent variable of the system, See DynamicSystems/SystemObject. The default value is assigned by DynamicSystems[SystemOptions].
outputvariable = list of name or function(name)
The names of the outputs of the system. A name, say y, is converted to a function y(t), where t is the independent variable of the system, see DynamicSystems[SystemObject]. The default value is assigned by DynamicSystems[SystemOptions].
statevariable = list of name or function(name)
The names of the states of the system. A name, say x, is converted to a function x(t), where t is the independent variable of the system, see DynamicSystems[SystemObject]. The default value is assigned by DynamicSystems[SystemOptions].
parameters = list or set of name=complexcons
Specifies values for symbolic parameters. These are used in operations that require numeric evaluation, such as plotting.
The DiffEquation command creates a diff-equation (DE) system object. The time-domain behavior of the object is modeled by differential or difference equations, depending whether the system is continuous or discrete, respectively.
The input can be specified as one of several representations: transfer function (TF), zero-pole-gain (ZPK), coefficients (Coeff), state-space (SS), or diff-equations (DE).
If no input is provided, a unity-gain DE system is created.
The optional parameter sys is a system object; it is converted to the DE representation. All options are ignored.
The optional parameter tf is the transfer function of a TF system. For a single-input/single-output system, tf is a rational function (ratpoly). For a multi-input/multi-output system, tf is a Matrix of rational functions. The indeterminate of the polynomials depends on whether the system is continuous or discrete; a continuous system typically uses s while a discrete system typically uses z as the indeterminate. The actual names are assigned by DynamicSystems[SystemOptions].
The optional parameters z, p, and k are the zeros, poles, and gain, respectively, of a ZPK system. For a single-input/single-output system, z and p are lists and k is an algebraic expression. For a multi-input/multi-output system, z and p are Matrices of lists and k is a Matrix of algebraic expressions.
The optional parameters num and den are the coefficients of the numerator and denominator, respectively, of a Coeff system. For a single-input/single-output system, num and den are lists, the first element being the coefficient of the highest order term. For a multi-input/multi-output system, num and den are Matrices of lists.
The optional parameters a, b, c, and d are the four state-space matrices, A, B, C, and D, respectively, of an SS system.
The optional parameter de is the difference/differential equation(s) of a DE system. A list is used to specify more than one equation.
The parameters invars and outvars specify the input and output variables of difference/differential equations. They are not required, but if either is not specified then the corresponding keyword parameter inputvariable or outputvariable must be assigned. If both positional and keyword parameters are specified, the keyword parameter take precedence.
with⁡DynamicSystems:
sys1≔DiffEquation⁡:
PrintSystem⁡sys1
Diff. Equationcontinuous1 output(s); 1 input(s)inputvariable=u1⁡toutputvariable=y1⁡tde=y1⁡t=u1⁡t
sys2≔DiffEquation⁡ss3+5⁢s2+7⁢s+6:
PrintSystem⁡sys2
Diff. Equationcontinuous1 output(s); 1 input(s)inputvariable=u1⁡toutputvariable=y1⁡tde={[ⅆⅆtx1⁡t=x2⁡t, ⅆⅆtx2⁡t=−x3⁡t5, ⅆⅆtx3⁡t=30⁢x1⁡t+35⁢x2⁡t−5⁢x3⁡t−5⁢u1⁡t, y1⁡t=x2⁡t]
sys3≔DiffEquation⁡1,2,1,2,3:
PrintSystem⁡sys3
Diff. Equationcontinuous1 output(s); 1 input(s)inputvariable=u1⁡toutputvariable=y1⁡tde={[ⅆⅆtx1⁡t=−x2⁡t2, ⅆⅆtx2⁡t=6⁢x1⁡t−2⁢x2⁡t−2⁢u1⁡t, y1⁡t=2⁢x1⁡t−x2⁡t2]
sys4≔DiffEquation⁡,−5+1⁢I,−5−1⁢I,1:
PrintSystem⁡sys4
Diff. Equationcontinuous1 output(s); 1 input(s)inputvariable=u1⁡toutputvariable=y1⁡tde={[ⅆⅆtx1⁡t=−x2⁡t10, ⅆⅆtx2⁡t=260⁢x1⁡t−10⁢x2⁡t−10⁢u1⁡t, y1⁡t=x1⁡t]
ss_a≔Matrix⁡1,2,0,4
ss_a≔1204
ss_b≔Matrix⁡3,7,9,6
ss_b≔3796
ss_c≔Matrix⁡5,6,5,2
ss_c≔5652
ss_d≔Matrix⁡0,0,0,0
ss_d≔0000
sys5≔DiffEquation⁡ss_a,ss_b,ss_c,ss_d,discrete,sampletime=0.001,systemname=Example discrete MIMO system:
PrintSystem⁡sys5
Diff. Equationdiscrete; sampletime = .1e-2systemname=Example discrete MIMO system2 output(s); 2 input(s)inputvariable=u1⁡q,u2⁡qoutputvariable=y1⁡q,y2⁡qde={[x1⁡q+1=x1⁡q+2⁢x2⁡q+3⁢u1⁡q+7⁢u2⁡q, x2⁡q+1=4⁢x2⁡q+9⁢u1⁡q+6⁢u2⁡q, y1⁡q=5⁢x1⁡q+6⁢x2⁡q, y2⁡q=5⁢x1⁡q+2⁢x2⁡q]
diff_eq≔L⁢diff⁡i⁡t,t+R⁢i⁡t=v⁡t−K⁢diff⁡θ⁡t,t,J⁢diff⁡θ⁡t,t,t+b⁢diff⁡θ⁡t,t=K⁢i⁡t
diff_eq≔L⁢ⅆⅆti⁡t+R⁢i⁡t=v⁡t−K⁢ⅆⅆtθ⁡t,J⁢ⅆ2ⅆt2θ⁡t+b⁢ⅆⅆtθ⁡t=K⁢i⁡t
params≔J=0.1,b=0.1,K=0.01,R=1,L=0.5
sys6≔DiffEquation⁡diff_eq,v⁡t,θ⁡t,i⁡t
sys6≔Diff. Equationcontinuous2 output(s); 1 input(s)inputvariable=v⁡toutputvariable=θ⁡t,i⁡t
ResponsePlot⁡sys6,Step⁡,parameters=params
The DynamicSystems[DiffEquation] command was updated in Maple 18.
The parameters option was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
DynamicSystems[Coefficients]
DynamicSystems[StateSpace]
DynamicSystems[SystemObject]
DynamicSystems[SystemOptions]
DynamicSystems[TransferFunction]
DynamicSystems[ZeroPoleGain]
Download Help Document