Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
back to top
Getting Started
Introduction
This document is intended for beginner users of BlockImporter. It gives an overview and through an example explains how to work with BlockImporter. The example illustrates how to import a system, simplify the equations, and simulate them in Maple. For details, see the help page on BlockImporter.
Setting up BlockImporter
BlockImporter requires that the following components be set up correctly.
Maple-MATLAB® link
MATLAB and Simulink
For details, see the BlockImporter,setup help page.
Initialization
Importing a Simple System
We would like to import a simple Simulink model. This model is located in the BlockImporter data directory. The following command will return the location of this data directory.
This directory contains the model file (example.mdl) and an initialization script (example.m). The initialization script contains the definition of two parameters, a1 and a2, that must be defined before the model can be executed.
To import the model, we call the Import function, and give it the name of the model that we want to import. In our case the model is called example. Optionally, we also pass in the name of the initialization script, and the directory where the model is located. The function will return a data structure with the imported equations, and we will assign it to the variable sys.
The import command makes a copy of the model and calls it temp_example, and adds numerical IDs to all the blocks in the model. These IDs correspond to the variable names in the extracted equations.
The variable sys contains the representation of the model, and is represented as a record data structure, which contains the following fields.
blockeqs: list of the equations extracted from the model
initialeqs: list of initial equations
statevars: list of state variables
inputvars: list of input variables
outputvars: list of output variables
sourceeqs: list of source equations for the input sources
parameters: list of constant parameters
notes: list of any notes generated during the import
procs: procedure required to implement some of the blocks (for example lookup). Note that this field is a table, rather than a list.
A convenient procedure, PrintSummary, displays all the fields of this data structure.
Simplifying the Model
The structure that has been imported from the model contains over 20 equations; however, many of these equations are of the trivial form . We can simplify the total number of equations with the SimplifyModel command, and store the result in the sys2 data structure, using the same internal format.
The summary of this model reveals that the simplified model contains significantly fewer equations.
Building Differential Equations and Simulating the Model
The equations that are contained in the data structure imported from Simulink are not differential equations, and therefore are not suitable to simulate the system using the dsolve command. To convert the structure to a suitable form, we use the BuildDE command, and assign the result to the variable deq.
The result is a list of objects.
equations: set of differential equations with the parameters left in the symbolic form
initialeqs: list of initial conditions
sourceeqs: list of the source equations
parameters: list of parameter values
known: set of procedures in the differential equations
To simulate the model, we substitute the source equations into the differential equations, add the initial conditions, and pass the equations to the dsolve procedure, which returns a simulation procedure.
The time domain solution can be plotted.
Available Resources
The following resources are available.
BlockImporter Overview lists all the available commands
BlockImporter Tour highlights the BlockImporter features and showcases a number of examples
Download Help Document