Maple
Text Commands for Chapter 18 - SIMULATION
Simulation
using MapleSim® and Simulink®.
The MapleSim Connectivity Toolbox - Please note that you must have MATLAB® 2007b or later and Simulink® 7.0 or later to run the following commands in Maple. Several Simulink models are displayed in Chapter 18 of the book.
You can download working Simulink model files here:
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=2374&objectType=file
Example 1. Build a Simulink block for the ode,
where u(t) represents the input of the block and i(t)
is the output. In this case i(t) is the current in a series
resistor-inductor electrical circuit.
|
> |
restart:with(DynamicSystems):with(Connectivity):
|
|
|
|
|
|
|
|
|
The following commands create an S-function, called “MyTransferFunction”, and makes it available in the Simulink library.
|
> |
(CSFcn,MBlock):=Simulink(sys2,sys2:-inputvariable,sys2:-outputvariable,"MyTransferFunction",parameters=params): SaveCode(“MyTransferFunction”,cSFcn,extension=”c”,interactive=true): SaveCode(“MyTransferFunction”,MBlock,extension=”m”,interactive=true): |
Example 2. Build a Simulink block for the ode,
where u(t) represents the input of the block and y(t)
is the output.
|
> |
with(Connectivity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Please see the Connectivity Toolbox Help pages for more detailed information.
Example 3. Build a Simulink block for the two ode's:
where
(t),
represent two inputs of the block and
(t) and
are the two outputs.
|
> |
par:=[m=5,b=2,k=3]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Please see the Connectivity Toolbox Help pages for more detailed information.
MapleSim
Please note that you must have Maple 12.0.2 or later to run MapleSim models.
Example 13. An acausal representation of an electrical RL circuit:

Example 13. A causal representation of an electrical RL circuit:

Example 14. Causal and acausal representations of a mass-spring damper (from the MapleSim Help pages):

Example 15. The Rössler system:

End of Chapter 18 Commands