DynamicSystems in Maple
Go to Maple Portal Maple Portal for Engineers
The DynamicSystems package in Maple contains a collection of commands which allows you to extract analytical information from your system models.
To being, load the package into the workspace by using the with command. This enables the use of the short form of the command names. For more information, see with.
| (1) |
It is important to note that the DynamicSystems package only applies to causal systems (systems that have well-defined input and output variables.)
This document uses the system equations of a DC motor model to illustrate how the commands in the DynamicSystems package can be used.
|
Extracting DC Motor Parameter Values
|
|
The parameters and variables that define the DC motor model are shown in the tables below:
Parameter Names
|
Value
|
Units
|
Parameters
|
Moment of inertia of the motor ()
|
|
|
Damping of the mechanical system ()
|
|
|
Electromotive force constant ()
|
|
|
Motor coil resistance ()
|
|
|
Motor coil inductance ()
|
|
|
|
|
Variable Names
|
Description
|
Input Variables
|
|
Applied Voltage
|
Output Variables
|
|
Motor Shaft Angular Position
|
|
Motor Current
|
|
|
The parameter values are contained in TextArea embedded components. Each parameter value can be extracted from the Text Area using Maple's DocumentTools package. The commands in the DocumentTools package can be accessed by loading the package into the Maple environment. To see the names for each Text Area embedded component, right-click on the Text Area and select Component Properties from the context-sensitive menu.
| (2) |
To obtain the parameter values, execute the following commands:
| (3) |
| (4) |
| (5) |
| (6) |
| (7) |
Now that the parameter values are extracted, combine the values into a list for use in the subsequent sections.
| (8) |
For more information on DocumentTools and the Text Area embedded component, see DocumentTools and TextAreaComponent.
|
|
System Creation and Conversion
|
|
|
Creating a DynamicSystems Object
|
|
The DynamicSystems package allows for the creation of six different types of System Objects.
1.
|
Algebraic Equation System Objects
|
2.
|
Coefficient System Objects
|
3.
|
Differential Equation System Objects
|
4.
|
State Space System Objects
|
5.
|
Transfer Function System Objects
|
6.
|
Zero Pole Gain System Objects.
|
A DynamicSystems object is a data container structure that encapsulates all of the information about a system.
For this example we will create a Differential Equation System Object. The differential equation describing the DC motor's electrical system is defined by .
| (9) |
Note: Maple provides two distinct methods to write derivatives with respect to . The first method produces and can be obtained using the operator from the Expressions palette, while the second method makes use of Maple's dot notation for derivatives. The dot notation is obtained by pressing [Ctrl][Shift]["] followed by [.] after the variable name. For example, typing the following command in 2-D math: y + [Ctrl][Shift]["] + [.] will result in =
. For more details and shortcuts for using 2-D Math notation to enter derivatives, see 2-D Math Shortcut Keys and How Do I Enter an ODE?.
Now that the equation is defined, we can use the DiffEquation command to create a DynamicSystems System Object which can then be accessed by other commands in the DynamicSystems package.
| (10) |
The System Object created in (10) provides us with information about the system. For instance, has 1 input and 1 output. This information becomes very useful when dealing with large scale systems.
Once a System Object is created we can use the PrintSystem command to print the contents of the System Object.
| (11) |
An alternative method for creating a DynamicSystems Object is through the context-sensitive menu. We will illustrate the use of the context menu to create a System Object of the DC motor's mechanical system.
The differential equation describing the DC motor's mechanical system is defined by .. To create a Differential System Object from this equation, right-click on the equation and select Differential Equation from the DynamicSystems>System Creation menu. A dialog appears asking you to define a name for the System Object. For this example, use the name sysMechanical. Then, you are asked to specify the input and outputs of the system. In this case the input of the system is and the output is .
| (12) |
| (13) |
By combining equations in (9) and (12) we can create a Differential Equation System Object describing the entire DC motor model in terms of the voltage, , and angular position, .
| (14) |
Note: The syntax equation[ ] is used to extract the equations from the list. For instance, = . The two equations are then combined in a new list.
| (15) |
|
|
Converting between different DynamicSystems System Object Representations
|
|
A Transfer Function System Object can be obtained directly from the Differential Equation System Object by applying the TransferFunction command to the System Object.
| (16) |
The equation for the Transfer Function Model can be extracted from the Transfer Function System Object by accessing the exports of the Transfer Function System Object. This is done by appending to the end of the System Object variable.
| (17) |
| (18) |
Information about the exports of each System Object type can be found in the help page SystemObject. For general information about accessing exports using ':-', see colondash.
Similarly, a Zero Pole Gain System Object can be obtained by applying the ZeroPoleGain command to .
| (19) |
The zero, pole and gain matrices are exports of the System Object that can be extracted from the Zero Pole Gain model by appending and to the end of the System Object variable.
| (20) |
| (21) |
| (22) |
|
|
Converting between different DynamicSystems Representations
|
|
In the last section, we saw how easy it is to covert between different DynamicSystems System Object Representations. The DynamicSystems package, through the DynamicSystems context menus, allows you to convert between different DynamicSystems representations without first having to create a System Object.
For instance, the differential equation defined in can be quickly converted into a Transfer Function or to a sequence of State Space or Zero Pole Gain Matrices. This is done by right-clicking on the differential equation defined in and selecting from the choices found in the DynamicSystems>Conversions menu.
| (23) |
| (24) |
| (25) |
|
|
|
Plotting in DynamicSystems
|
|
The DynamicSystems package also provides the user with a multitude of commands for generating plots, such as Bode Plots, Magnitude Plots, Phase Plots, Root Locus Plots, Zero Pole Plots, Impulse Response Plots, and Response Plots. The user can generate these plots by applying a DynamicSystems plotting command to their System Object definition, or by accessing the DynamicSystems context menu for the desired expression. Both these methods will be illustrated in the following section.
Assuming that the user has already created a DynamicSystems Object such as the one defined by then creating a Bode Plot is simply a matter of applying the BodePlot command to the System Object.
The sine response plot for the System Object can be obtained in a similar manner.
Alternatively, one can use the DynamicSystems context menu to access the plotting features in the DynamicSystems package. To access the context menu simply right click on a Differential Equation, Transfer Function, State Space Matrices or Zero Pole Gain Matrices and choose any of the plots available from the DynamicSystems>Plots menu.
For example, the Impulse Response plot can be generated by right-clicking on the sequence of three Zero Pole Gain Matrices. From the context menu, select DynamicSystems>Plots>Continuous>ImpulseResponsePlot. In the Parameter Editor, specify the parameters .
| (26) |
|
|
System Manipulation and Analysis
|
|
The DynamicSystems package also provides the user with many commands to allow them to extract meaningful analytical information from their system models. As we saw in the previous section, the commands that are available for system manipulation and analysis can be applied to both a DynamicSystems System Object or to set of Differential Equations, Transfer Functions, State Space Matrices, or Zero Pole Gain Matrices.
For example, the gain and phase margin for the System Object defined by can be easily obtained using the following commands.
| (27) |
| (28) |
This information could have also been obtained by right-clicking on the differential equation defined in (14), the transfer function defined in (18), or the zero pole gain matrices defined in (25) and selecting the GainMargin and PhaseMargin options found in the DynamicSystems>Manipulation menu.
|
Go to Maple Portal Maple Portal for Engineers
|