use of matlab & simulink tools for model-based system
TRANSCRIPT
![Page 1: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/1.jpg)
1 CONFIDENTIAL | © 2012 The MathWorks, Inc. CONFIDENTIAL
November, 2014
Ariel Rubanenko, Systematics
Application, Consulting & Tool Implementation for
Large-scale simulations, Guidance, Navigation & Control
Use of MATLAB & Simulink tools for
Model-Based System Engineering (MBSE)
![Page 2: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/2.jpg)
2
Today’s Agenda
Introduction to Model-Based System Engineering
Introduction for MathWorks tools
Example for system engineering workflow using
Mathworks tools
![Page 3: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/3.jpg)
3
Why did we miss our deadline?
Reasons for late projects, as reported by Venture Development Corporation.
Source: Embedded Software Strategic Market Intelligence report, Volume 4, December 2007, VDC.
Note: Percentages sum to over 100% due to multiple responses.
![Page 4: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/4.jpg)
4
Early Verification - WHY?
![Page 5: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/5.jpg)
5
Document Centric .vs. MBSE
Document Centric System
Engineering
Focus is specification
Tool of Choice – Requirement
Management Tools
Quality – traceability Reports?
Measure of completeness – Page
count?
Correctness – Specification Structure
is a static functional model
![Page 6: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/6.jpg)
6
Model Based System Engineering
Understanding the system behavior
Relating Requirements to Functions
Quality – traceability Reports?
Complete all Views of the Model
Specification is incidental (By-Product)
Document Centric .vs. MBSE
![Page 7: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/7.jpg)
7
Behavior View
Architecture View Test View
Requirements View
MODEL
![Page 8: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/8.jpg)
8
MODEL
VIEWS Documents
simulation
![Page 9: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/9.jpg)
9
![Page 10: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/10.jpg)
10 CONFIDENTIAL | © 2012 The MathWorks, Inc. CONFIDENTIAL
Overview of MathWorks
![Page 11: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/11.jpg)
11
MathWorks at a Glance Earth’s topography
on a Miller cylindrical
projection, created
with MATLAB and
Mapping Toolbox.
● Headquarters:
Natick, Massachusetts U.S.
● Other U.S. Locations:
California; Michigan;
Texas; Washington, D.C.
● Europe:
France, Germany, Italy,
Netherlands, Spain, Sweden,
Switzerland, United Kingdom
● Asia-Pacific:
Australia, China, India,
Japan, Korea
● Worldwide training
and consulting
● Distributors serving more
than 20 countries
![Page 12: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/12.jpg)
12
Key capabilities drive MathWorks
business
Founded in 1984
1985 1990 1995 2000 2005
Rapid prototyping and HIL
DSP designs State charts Physical modeling
Discrete-event simulation
Video processing
Model checking
Test and measurement
Code verification
Embedded code HDL code
MATLAB
Simulink
Control design
Signal processing
Image processing
Computational finance Computational biology
Application deployment
Parallel computing Student version
Optimization
Statistics
Technical
Computing
Data Analysis
and Algorithm
Development
System
Modeling and
Simulation
Automatic
Code
Generation
Verification,
Validation,
and Test
Instrument and database connectivity
DSP support packages
Communications systems
2010
Certification kits
PLC code
MATLAB Mobile for iPhone/iPad
MATLAB to C/HDL
Computer vision
System objects
![Page 13: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/13.jpg)
13
MathWorks Today
Revenues ~$750M in 2013
More than 60% from outside the U.S.
Privately held
3200 employees worldwide
More than 1 million users in 175+ countries
![Page 14: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/14.jpg)
14
Key Industries
Aerospace and defense
Automotive
Biotech and pharmaceutical
Communications
Education
Electronics and semiconductors
Energy production
Financial services
Industrial automation and
machinery
Medical devices
![Page 15: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/15.jpg)
15
The leading environment for
technical computing
The industry-standard, high-level
programming language
for algorithm development
Numeric computation
Parallel computing, with multicore and
multiprocessor support
Data analysis and visualization
Toolboxes for signal and image
processing, statistics, optimization,
symbolic math, and other areas
Tools for application development
and deployment
Foundation of MathWorks products
![Page 16: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/16.jpg)
16
Design
with
Simulation
Executable
Specifications
Continuous
Test and
Verification
Automatic
Code Generation
Models
Design
with
Simulation
Executable
Specifications
Continuous
Test and
Verification
Automatic
Code Generation
Models
Advantages of Model-Based Design
16
Test with Design
- detects errors earlier
Simulation
-reduces “real” prototypes
-systematic “what-if” analysis
Automatic code generation
-minimizes coding errors
Executable models
-unambiguous
-only “one truth”
![Page 17: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/17.jpg)
17
Design an Embedded Controller
Plant
Controller
+
-
Command
Algorithm Simulation
Code Generation Plant Simulation
![Page 18: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/18.jpg)
18
Simulink environment
System-level modeling Graphical
Interactive
Hierarchical
Simulation Model is an “executable specification”
Analog + Digital Simulation
Easy code generation
Multi - domain simulation
Stateflow – logic modeling
simEvents – event simulation
Physical modeling
Animation capabilities
![Page 19: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/19.jpg)
19
Stateflow
Extend Simulink with a design environment for developing
state machines and flow charts
Design systems containing control, supervisory, and mode
logic
Describe logic in a natural and understandable form with
deterministic execution semantics
![Page 20: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/20.jpg)
20
Introduction to SimMechanics
θ 2
m2g
θ 1
x
y
z
m1g
![Page 21: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/21.jpg)
21
Revolute
Joint1
Revolute
Joint2
Joints Bodies
Fixture
Link1
Link2
+
Simulink Model
![Page 22: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/22.jpg)
22
TIME-DRIVEN
SYSTEM
EVENT-DRIVEN
SYSTEM
STATES
TIME t
x(t)
STATE SPACE:
X
DYNAMICS:
,x f x t
STATES
s1
s2
s3
s4
TIME t t2
e2
x(t)
t3 t4 t5
e3 e4 e5 EVENTS
t1
e1
STATE SPACE:
X s s s s 1 2 3 4, , ,
DYNAMICS:
exfx ,'
Introduction to SimEvents
![Page 23: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/23.jpg)
23
TIME-DRIVEN EVENT-DRIVEN
INTEGER VALUED:
Number of packets,
Number of parts
OR
SYMBOLS: Traffic light: green, red
Machine status: on, off
TYPICAL
STATES
CLOCK
Discontinuously
changing with
each EVENT
REAL VALUED:
Position, Velocity,
Flow, Pressure,
Voltage, Current
Continuously
changing with
each TICK
TYPICAL
STATES
![Page 24: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/24.jpg)
24
Simulink Projects Helps You Get Organized
Compare changes
HDL
![Page 25: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/25.jpg)
25
Merge Simulink Models Based on XML
Comparison Differences
Merge models within the tool by
merging changes from left to
right: Left model is the base
Right model is the one edited
Merge individual parameters,
blocks, or entire subsystems
Merge Simulink models from
within XML comparison
report
New Merge option
Parameter merge option for the
selected node
![Page 26: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/26.jpg)
26
Requirements Traceability - Overview
Bi-directional linking with external documents
– Requirements consistency checks
– Extensibility API
– Report generation
HDL Coder / Embedded Coder integration
– Embeds requirements as comments in source code
IBM Rational DOORS®
Microsoft Word ®
Microsoft Excel ®
Simulink/Stateflow
MATLAB scripts
Supported document formats
Simulink
Stateflow
Embedded Coder
HDL Coder
![Page 27: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/27.jpg)
27
Test Coverage Analysis for Models
Coverage from
first simulation Coverage from second simulation
Total coverage
Decision coverage
Condition coverage
MC/DC
Lookup table coverage
Signal range coverage
Supported coverage types
![Page 28: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/28.jpg)
28
Test Generation for 100% Coverage
Automatically generate
tests to reach coverage
objectives
>>sf_security
(change chart for
fast run)
![Page 29: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/29.jpg)
29
Generation of System Design
Descriptions
Generate different
formats
Select from predefined
stylesheets
Customization on
Simulink Report
Generator
![Page 30: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/30.jpg)
30
C-Code Generation Tools
MATLAB Coder
Simulink Coder
Embedded Coder
Embedded Coder
Simulink Coder
MATLAB Coder
![Page 31: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/31.jpg)
31
Code Correctness:
Absence of Runtime Errors Formal method:
Abstract Interpretation
PolySpaceTM Solution For hand written code
– Read access to non-initialized data
– Out-of-bounds array access
– Dereferencing through null or out-of-bounds pointers
– Illegal type conversion
– Incorrect computation
• Overflow/Underflow
• Division by zero
• Square root of negative value
– And more…
Code Verification
![Page 32: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/32.jpg)
32
Formal method:
Abstract Interpretation
Red
faulty
Green
reliable
Grey
dead
Orange
unproven
PolySpaceTM Solution For hand written code
Results are proven for all possible executions of the code!!
Green
reliable
Green
reliable
Green
reliable
Proven
![Page 33: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/33.jpg)
33 CONFIDENTIAL | © 2012 The MathWorks, Inc. CONFIDENTIAL
Workflow example for Street Parking Meter
(SPM)
![Page 34: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/34.jpg)
34
System in its Environment
SPM Functionality
SPM Architecture
![Page 35: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/35.jpg)
35
Elaborate SPM Functionality Node:
Modes & Capabilities
![Page 36: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/36.jpg)
36
Generate Test Cases and Simulate
![Page 37: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/37.jpg)
37
Simulation & Analysis Step Forward Step Back
Coverage Report
Stateflow Animation
MATLAB Graphs
Test Report
![Page 38: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/38.jpg)
38
Link To Stake-Holders Requirements and
generate System Specification Report
![Page 39: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/39.jpg)
39
Elaborate Capabilities: states & functions
![Page 40: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/40.jpg)
40
Integrating Code with Simulink
M
C++ C
Fortran Ada
![Page 41: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/41.jpg)
41
Simulate functionality
![Page 42: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/42.jpg)
42
Simulate Capability (Parking)
SPM MODES
Parking CTRL
![Page 43: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/43.jpg)
43
Elaborate physical subsystems
![Page 44: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/44.jpg)
44
Allocate functions to subsystems
RMI Linking between Simulink Models
Parking
![Page 45: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/45.jpg)
45
Validate allocation by Simulation(Optional)
Parking
Parking CTRL
SPM MODES
![Page 46: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/46.jpg)
46
Allocate Subsystems Requirements for
Subsystems and Generate SSDD report
SSDD Report
![Page 47: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/47.jpg)
47
Subcontractors design models
![Page 48: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/48.jpg)
48
Models Integration – System level
simulation
Subcontractors Models
![Page 49: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/49.jpg)
49
Behavior View
Architecture View Test View
Requirements View
MODEL
![Page 50: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/50.jpg)
50
Workflow Summary
System in its Environment diagrams (functionality &
architecture)
Elaboration of top functionality diagram - Modes &
Capabilities
Validate by simulation of top functionality Node
Link to SH Requirements and generate System
Specification report
Elaborate Capabilities – Capabilities States & functions
Validate by Capabilities simulation
Elaborate top level Architecture to physical subsystems
Allocate capabilities functions to physical subsystems
![Page 51: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/51.jpg)
51
Workflow Summary - Continue
Validate allocation by simulation (optional)
Assign subsystem requirements and generate SSDD
report
Use subcontractors to design subsystems – receive
models from subcontractors
Integrate subcontractors models to build system level
simulation and validate design
![Page 52: Use of MATLAB & Simulink tools for Model-Based System](https://reader033.vdocument.in/reader033/viewer/2022061503/629e98cb25866172420358c6/html5/thumbnails/52.jpg)
52
Conclusion
Model-Based system Engineering (MBSE) is a proven
methodology for reducing errors during the early
requirements phase and therefore save time & money
Mathworks have a set of tools based on Simulink, to
implement Model-Based Design(MBD) paradigm
The 2 paradigms are similar so it is possible to use the
same Simulink based tools also for MBSE
The big advantage of using Simulink is its strong
simulation capabilities, simulation is a very strong tool for
validating design.