create a differential or difference equation system object - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Science and Engineering : Dynamic Systems : System Object : DynamicSystems/DiffEquation

DynamicSystems[DiffEquation] - create a differential or difference equation system object

Calling Sequence

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)

Parameters

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

Description

• 

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.

Examples

withDynamicSystems:

sys1:=DiffEquation:

PrintSystemsys1

Diff. Equationcontinuous1 output(s); 1 input(s)inputvariable=u1toutputvariable=y1tde=x1.t=u1t,y1t=u1t

(1)

sys2:=DiffEquationss3+5s2+7s+6:

PrintSystemsys2

Diff. Equationcontinuous1 output(s); 1 input(s)inputvariable=u1toutputvariable=y1tde={[x1.t=x2t, x2.t=x3t5, x3.t=30x1t+35x2t5x3t5u1t, y1t=x2t]

(2)

sys3:=DiffEquation1,2,1,2,3:

PrintSystemsys3

Diff. Equationcontinuous1 output(s); 1 input(s)inputvariable=u1toutputvariable=y1tde={[x1.t=x2t2, x2.t=6x1t2x2t2u1t, y1t=2x1tx2t2]

(3)

sys4:=DiffEquation,5+1I,51I,1:

PrintSystemsys4

Diff. Equationcontinuous1 output(s); 1 input(s)inputvariable=u1toutputvariable=y1tde={[x1.t=x2t10, x2.t=260x1t10x2t10u1t, y1t=x1t]

(4)

ss_a:=Matrix1,2,0,4

ss_a:=1204

(5)

ss_b:=Matrix3,7,9,6

ss_b:=3796

(6)

ss_c:=Matrix5,6,5,2

ss_c:=5652

(7)

ss_d:=Matrix0,0,0,0

ss_d:=0000

(8)

sys5:=DiffEquationss_a,ss_b,ss_c,ss_d,discrete,sampletime=0.001,systemname=Example discrete MIMO system:

PrintSystemsys5

Diff. Equationdiscrete; sampletime = .1e-2systemname=Example discrete MIMO system2 output(s); 2 input(s)inputvariable=u1q,u2qoutputvariable=y1q,y2qde={[x1q+1=x1q+2x2q+3u1q+7u2q, x2q+1=4x2q+9u1q+6u2q, y1q=5x1q+6x2q, y2q=5x1q+2x2q]

(9)

diff_eq:=Lⅆⅆtit+Rit=vtKⅆⅆtθt,Jⅆ2ⅆt2θt+bⅆⅆtθt=Kit

diff_eq:=Lⅆⅆtit+Rit=vtKⅆⅆtθt,Jⅆ2ⅆt2θt+bⅆⅆtθt=Kit

(10)

params:=J=0.1,b=0.1,K=0.01,R=1,L=0.5

params:=J=0.1,b=0.1,K=0.01,R=1,L=0.5

(11)

sys6:=DiffEquationdiff_eq,vt,θt,it

sys6:=Diff. Equationcontinuous2 output(s); 1 input(s)inputvariable=vtoutputvariable=θt,it

(12)

ResponsePlotsys6,Step,parameters=params

See Also

DynamicSystems, DynamicSystems[Coefficients], DynamicSystems[StateSpace], DynamicSystems[SystemObject], DynamicSystems[SystemOptions], DynamicSystems[TransferFunction], DynamicSystems[ZeroPoleGain]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam