ibm rhapsody and matlab/simulink
TRANSCRIPT
© 2013 IBM Corporation
Rhapsody and MATLAB/Simulink
Giulio Santoli, Client Technical ProfessionalIBM Software, Rational26/11/2013
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Rhapsody and MATLAB/Simulink Integration Points
- MATLAB/SimulinkGenerate and simulate a Simulink model from a structured SysML block/UML class that consists of SysML/UML parts connected to parts implemented in Simulink
Plant Model Integration
- MATLAB/SimulinkIntegrate Simulink models in Rhapsody Design Manager for either model change configuration and traceability
Design Manager
- MATLAB,
- MATLAB Symbolic Math Toolbox
1. Solve SysML parametric diagrams using MATLAB Symbolic Math Toolbox
2. Include MATLAB expressions for computations
Parametric Constraint Evaluation
- MATLAB/SimulinkGenerate an S-Function block to be used in Simulink models from a UML class / SysML block
S-Function Generation
- MATLAB/Simulink,
- Real-time workshop with Embedded Coder
1. Generate executable code from a Rhapsody model with parts implemented in Simulink
1. The Simulink code may represent either:
� Algorithms implemented in the system
� The behavior of the environment (plant)
2. Models can be animated if code is instrumented
3. Rhapsody references code generated from Simulink by Embedded Coder
Hosted Simulation
The Mathworks ProductsShort descriptionIntegration point
© 2013 IBM Corporation
Software and Systems Engineering | Rational
� PCE carry out analytics of system parameters as expressed in SysML parametric diagrams
– A tool for engineers to perform trade studies
� PCE Analytics includes
– Calculating values of system properties given a set of constraints
– Simulating (plotting) dependencies between a set of properties & in time
– Optimizing values for system properties
� PCE workflow also supports
– Producing html reports
– Exporting to a solver specific script
– Importing and exporting from .csv files
� PCE integrates with mathematical solvers
– Currently supports MAXIMA and MATLAB Symbolic Math Toolbox
� Free PCE Tutorial on developerWorks:
https://www-304.ibm.com/support/docview.wss?uid=swg2701872
Parametric Constraint Evaluator (PCE)Evaluation of parametric diagrams using a Computer Algebra System
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Parametric Constraint Evaluator (PCE)Parametric Evaluation for Trade-Studies and System Optimization
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Parametric Constraint Evaluator (PCE)Plotting Non-Linear Differential Equations
© 2013 IBM Corporation
Software and Systems Engineering | Rational
� The integration of Simulink blocks into Rational Rhapsody uses a black box approach
� In Rhaposdy, a <<SimulinkBlock>> represents a Simulink model and its generated code
� When code is generated for a Rational Rhapsody model containing Simulink blocks, the code
generated by Simulink is wrapped into the Rational Rhapsody-generated code
� Input/Output ports of the Simulink blocks are exposed as flowports
� Simulink Real-Time Workshop Embedded Coder is required, and only Fixed Step Solver
is supported
Hosted SimulationImport the Simulink model and its corresponding code in Rhapsody
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Hosted SimulationImporting and Executing a Simulink Model in Rhapsody
© 2013 IBM Corporation
Software and Systems Engineering | Rational
� MATLAB/Simulink S-Function is a user defined block implemented in C/C++ or other
programming language
� Rhapsody can generate C/C++ code corresponding to blocks stereotyped «S-FunctionBlock»
along with a MEX option file to generate an S-Function simulink block
� The generated code conforms to the S-Function standard and transforms the ports
accordingly
� The S-Function generation capability is used by the Plant Model integration too
S-Function GenerationUsing Rhapsody to create S-functions that can then be plugged into Simulink models.
© 2013 IBM Corporation
Software and Systems Engineering | Rational
S-Function GenerationInclude Simple or Complex Rhapsody-generated Code in Simulink Models
© 2013 IBM Corporation
Software and Systems Engineering | Rational
� Bring the best of both Rhapsody and Simulink to run and simulate a Plant System
� Build a Rhapsody model with «StructuredSimulinkBlock», containing parts typed by
«SimulinkBlock» in their hierarchy and other SysML/UML parts
� «StructuredSimulinkBlock» blocks are transformed to a Simulink model that consists of an S-
Function block for the SysML/UML parts and usages of the Simulink models represented by
the «SimulinkBlock» parts or other «StructuredSimulinkBlock» parts
� The simulation runs on Simulink: no Step Solvers limiatations, nor Real-Time Workshop
Embedded Coder is needed
Plant Model IntegrationGenerate and Simulate a System with both Rhapsody and Simulink contribution
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Plant Model IntegrationGenerating Simulink Models from Rhapsody
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Plant Model IntegrationEnables the Simulation of Control Blocks within the overall UML/SysML Model
1. Behaviors in Simulink 2. Architecture in Rhapsody(control and plant blocks)
4. Simulation (both tools)3. Simulink model for co-simulation
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Plant Model IntegrationCo-Simulation Example with Rhapsody and Simulink
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Integration Points Comparison TableComparison among different Integration point from the Execution point of view
Host SimulationS-Functions Generation
Plant Model Integration
Can Use Variable Step Solvers
No Yes Yes
Animation 1 Rhapsody Only Both Both
Execution Performed In 2
Rhapsody Simulink Simulink
Real-Time Workshop
Embedded Coder License
Required Not Required Not Required
1 The capability to receive feedback from the model as it executes, i.e. diagram animation in Rhapsody, Scopes in Simulink2 The tool performing the execution also controls the timing
© 2013 IBM Corporation
Software and Systems Engineering | Rational
� Publish and Collaborate on Simulink models using the Jazz platform
� Breakthrough combination of domain-specific design solutions enabling:
– Look at the system as a whole and not individual parts across the architecture, algorithms and environment
– View Simulink design information with a web browser or Rational Rhapsody desk top client providing easy access for project stakeholders
– Search and navigate across projects and lifecycle artifacts to help find key information from multiple sources quickly
� Trace, via Open Services for Lifecycle Collaboration (OSLC), from designs to other
lifecycle artifacts such as requirements, test cases, work items or other aspects of the
engineering process
� Create design reviews involving different model stakeholders
� Manage changes in a Simulink model and perform lock and unlock operations directly in
Simulink
Rhapsody Design Manager Integration Integrating MATLAB/Simulink models in the Collaboration Lifecycle
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Rhapsody Design Manager Integration Navigating a Simulink Model in Design Manager
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Rhapsody Design Manager Integration Versioning a Simuilnk model in Design Manager from Simulink context-menu
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Helping customers improve the value and performance of their investments in software as strategic business assets
SummaryRhaposdy and MATLAB/Simulink, a perfect match
� Several integration points are available between Rhapsody and MATLAB/Simulink
� The integration allows design and simulationof cyber-physical systems
� Bringing Simulink into Design Managerenables Traceability and Collaboration
© 2013 IBM Corporation
Software and Systems Engineering | Rational
Additional RerefencesArticles and Views about Rhaposdy and Simulink Integrations
� IBM Rational Rhapsody 8 Infocenter
– http://pic.dhe.ibm.com/infocenter/rhaphlp/v8/index.jsp?topic=%2Fcom.ibm.rhp.integ.designtools.doc%2Ftopics%2Ft_integratingrationmathworkssimulink.html
� “Model Based Control System Design Using SysML, Simulink, and Computer Algebra System” by Takashi Sakairi, Eldad Palachi, et al.
– http://www.hindawi.com/journals/jcse/2013/485380/
� Rhapsody Community @ developerWorks
– https://www.ibm.com/developerworks/community/groups/service/html/communityview?communityUuid=969f1342-9137-406d-81f5-7f082a7c646d
� Tutorial for Parametric Constraints Evaluator
– http://www-01.ibm.com/support/docview.wss?uid=swg27018723
© 2013 IBM Corporation
Software and Systems Engineering | Rational
© Copyright IBM Corporation 2013. All rights reserved. The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. IBM, the IBM logo, Rational, the Rational logo, Telelogic, the Telelogic logo, and other IBM products and services are trademarks of the International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.
www.ibm.com/software/rational