BlockImporter[BuildDE] - creates differential equations from the model
|
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
|
|
|
|
|
Description
|
|
•
|
The BuildDE command converts the equations in a BlockImporter data structure to a form that can be solved by dsolve.
|
•
|
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.
|
|
|
Options
|
|
|
Specifies whether the equations and initialeqs fields are assigned lists or sets. The default is false.
|
|
|
Examples
|
|
>
|
|
Create an example of an imported data structure.
>
|
|
| (1) |
Convert the imported data structure into a record with differential equations that are compatible with dsolve,numeric.
>
|
|
| (2) |
Substitute the values of the source equations and parameters into the equations. Substitute the differential equations into the output variables.
>
|
|
Solve the differential equations.
>
|
|
| (3) |
Plot the results.
>
|
|
|
|
Download Help Document
Was this information helpful?