BuildDE - Maple Help

Online Help

All Products    Maple    MapleSim


BlockImporter

  

BuildDE

  

creates differential equations from the model

 

Calling Sequence

Parameters

Options

Description

Examples

Calling Sequence

BuildDE( sys, opts )

Parameters

sys

-

record; system data

opts

-

(optional) equation(s) of the form option = value; specify options for the BuildDE command

Options

• 

makesets = truefalse

  

Specifies whether the equations and initialeqs fields are assigned lists or sets. The default is false.

Description

• 

The BuildDE command converts the equations in a BlockImporter data structure to a form that can be solved by dsolve.

• 

The sys parameter is a Maple record. See BlockImporter[datastructure] for details.

• 

The output is a record with fields equations, initialeqs, known, outputvars, parameters, and sourceeqs. With a small amount of further processing, the fields of this record can be passed to dsolve. See the Examples section, below.

– 

equations = (list,set)(equation) -- contains the differential equations that describe the system. Differentials of state-variables in the input equations expressed in terms of D are converted to unevaluated functions of diff with t as the independent variable. For example, D(x) is converted to diff(x(t),t). If the keyword-option makesets is true, then the field is a set, otherwise it is a list.

– 

initialeqs = (list,set)(function = anything) -- defines the initial values of the state variables of the system. If the keyword-option makesets is true, then the field is a set, otherwise it is a list.

– 

known = set(name) -- the names of known functions that must be passed to dsolve/numeric using the known option.

– 

outputvars = list(function) -- the names of the output of the system or subsystem. These are connected to the inputs of sink blocks and Outport blocks of subsystems. These are unevaluated functions of t.

– 

parameters = list(indexed = anything) -- specifies the values of subsystem mask and MATLAB® global parameters used in equations. The left side of each equation consists of an indexed name K[num,str], where num is the block identifier of the subsystem in which parameter was defined (0 if the parameter is a MATLAB® global), and str is a string corresponding to the parameter name. The right side of the equation is the value of the name. It may be expressed in terms of other block parameters.

– 

sourceeqs = list(function = algebraic) -- equations that define the time-behavior of sources. The left side is an unevaluated function of t. The right side is the definition of the source.

Examples

withBlockImporter:

Create an example of an imported data structure.

sysBlockImporter:-Example

sysrecordequations,initialeqs,inputvars,notes,outputvars,parameters,procs,sourceeqs,statevars

(1)

Convert the imported data structure into a record with differential equations that are compatible with dsolve,numeric.

deqBuildDEsys,makesets

deqrecordequations,initialeqs,known,outputvars,parameters,sourceeqs

(2)

Substitute the values of the source equations and parameters into the equations. Substitute the differential equations into the output variables.

usedeqindeqssubssourceeqs,parameters,equations∪initialeqs;outssubsdeqs,outputvars;insmaprhs,sourceeqsend use:

Solve the differential equations.

dsoldsolvedeqs,numeric,interr=false

dsolprocx_rkf45_dae...end proc

(3)

Plot the results.

plotsodeplotdsol,t,outs1,t,ins1,0..10,gridlines=true

See Also

BlockImporter

BlockImporter[datastructure]

dsolve