29
Open System Simulation and Test with SysML, Modelica and Eclipse Parham Vasaiely 16. December 2010

Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

  • Upload
    lamdieu

  • View
    234

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Open System Simulation and Test with SysML, Modelica and Eclipse

Parham Vasaiely 16. December 2010

Page 2: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Introduction and Motivation◦ Project Description

◦ Project Goals

Work Description◦ Technologies

◦ Methods

Risks

Conclusion and Outlook

17.12.2010 2Open System Simulation and Test with SysML, Modelica and Eclipse

Page 3: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Introduction and Motivation◦ Project Description

◦ Project Goals

Work Description◦ Technologies

◦ Methods

Risks

Conclusion and Outlook

17.12.2010 3Open System Simulation and Test with SysML, Modelica and Eclipse

Page 4: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Problem: Increasing complexity of technical systems

◦ Increased degree of automation

◦ Increased number of involved technologies

◦ SW and HW development is strongly coupled

◦ Component suppliers are increasingly involved into the design process

◦ Validation of the functionality long before the first prototype is built

Motivation:

◦ Simplify and Speed systems development

◦ Cut time to market

◦ Improve Quality

Solutions:

◦ Model- Based Systems Engineering

◦ Simulation and Test

17.12.2010 4Open System Simulation and Test with SysML, Modelica and Eclipse

Page 5: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

BranchA

CompanyA

SystemModel

ComponentSupplier

BranchB

BranchA

BranchB

Customer

17.12.2010 5Open System Simulation and Test with SysML, Modelica and Eclipse

Page 6: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Technical Systems◦ Aerospace, Automotive, ...

Dynamic◦ Time depended, Behaviour

Reactive Systems◦ It continuously interacts with its environment

17.12.2010Open System Simulation and Test with SysML, Modelica and Eclipse 6

Page 7: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Open Technologies◦ Open Reusable Solutions

Standardized Model Representation◦ SysML and Modelica

Simulation◦ Experiment◦ Support Understanding

◦ Communication

Test◦ Searching for a failure caused by fails◦ Improve Quality

◦ Verification and Validation

17.12.2010 7Open System Simulation and Test with SysML, Modelica and Eclipse

Page 8: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Mathematical Model◦ System behaviour expressed in mathematical form

Model in the Loop (MiL)

17.12.2010 8Open System Simulation and Test with SysML, Modelica and Eclipse

EnvironmentModel

Mathematical Model

Variables (Input & Output)

Page 9: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Introduction and Motivation◦ Project Description

◦ Project Goals

Work Description◦ Technologies

◦ Methods

Risks

Conclusion and Outlook

17.12.2010 9Open System Simulation and Test with SysML, Modelica and Eclipse

Page 10: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

OMG UML2 Profil for Systems Engineering

SysML Version 1.2 (using UML 2.3) (June 16, 2010)

Diagrams◦ Structure

◦ Behaviour

◦ Requirements

17.12.2010 10Open System Simulation and Test with SysML, Modelica and Eclipse

UML2

SysML

Page 11: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Next Generation Modeling- and Simulation Language

Equation based instead of assignment statements◦ Acausal Physical Modeling

◦ Deklarative

Object Oriented◦ Class Model (+handle complexity)

◦ Component based (+reuse)

17.12.2010 11Open System Simulation and Test with SysML, Modelica and Eclipse

Page 12: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Open Source Modelica Tool◦ Compiler for Modelica Code

◦ Solver for Simulation

DASSL, Euler, Rungekutter

Non-Interactive Simulation

Interactive Simulation

17.12.2010 12Open System Simulation and Test with SysML, Modelica and Eclipse

MODELICASource Code

Translator

Analyzer

Optimizer

Code Gen.

C-Compiler

Simulation

sortierte Gln.

C-Code

*.exe

Page 13: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Eclipse Plug-In Papyrus◦ Papyrus UML as Modeling Environment

17.12.2010 13Open System Simulation and Test with SysML, Modelica and Eclipse

Papyrus UMLSysML Profil

Page 14: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Mathematical Model◦ Behaviour

Model in the Loop◦ Communication with its Environment using its

Inputs and Outputs

Deterministic Model◦ Same Behaviour (Outputs) using same Inputs

17.12.2010 14Open System Simulation and Test with SysML, Modelica and Eclipse

Page 15: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010 15Open System Simulation and Test with SysML, Modelica and Eclipse

Requirements

EnvironmentModel

Mathematical Model

Using Structure Diagrams

Block Definition Diagram

Internal Block- Diagram

Parametric Diagrams

Page 16: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010 16Open System Simulation and Test with SysML, Modelica and Eclipse

See Bachelor Thesis:Interactive Simulation of SysML Models using Modelica

Tank

«block»

Attributes

«variable» area:double=0.5

«variable» flowGain:double=0.05

«variable» minV:double=0

«variable» maxV:double=10

«variable» h:double=0.0

qOut:LiquidFlowqIn:LiquidFlow

tSensor:ReadSignal tActuator:ActSignal

<<block>>Tank Tank.mo (Modelica)

within TwoTanks;

block Tank

ReadSignal tSensor;

ActSignal tActuator;

LiquidFlow qIn;

LiquidFlow qOut;

parameter Real area (unit = "m2") = 0.5;

parameter Real flowGain (unit = "m2/s") = 0.05;

Real h (start = 0.0, unit = "m");

end Tank;

Page 17: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Interactive◦ Real-time, User Interaction

Non-Interactive◦ As fast as computer power allows, event, condition

Dangers of Simulation◦ Falling in love with a Model

◦ Forcing Reality into the Constraints of a Model

◦ Forgetting the model’s level of accuracy

17.12.2010 17Open System Simulation and Test with SysML, Modelica and Eclipse

Page 18: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010 18Open System Simulation and Test with SysML, Modelica and Eclipse

EnvironmentModel

Mathematical Model

Two Tank System 3DTwo Tank System 3D

Status: Simulation is running...

Tank 1 Tank 2

Liquid

Source

MaxLevel

Level h

Level h

OpenModelica

Interactive

Simulation CenterSimulation Center

0.02

Source.flowLevel

1.0

tank1.area

1.3

Source.flowLevel

Start Pause Stop

Status: Simulation is running...

Simulation Time: 00:01:56:220

Interactive & Non-Interactive Simulation◦ Support Understanding, Experiment & Communication

See Bachelor Thesis:Interactive Simulation of SysML Models using Modelica

Page 19: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Functional Specification◦ Formal Requirements

Dynamic Testing◦ Model Execution (Simulation)

Black-Box Testing◦ Input & Output Behaviour

Model-Based Testing◦ Test Cases Derived from a Model

◦ Automatic Test Generation

17.12.2010 19Open System Simulation and Test with SysML, Modelica and Eclipse

Page 20: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010 20Open System Simulation and Test with SysML, Modelica and Eclipse

Requirements

Each tank has a continuous proportional–integral (PI) controller connected to it,

which regulates the level of liquid contained in the tanks to a reference level. While

the liquid source fills the first tank with liquid the PI continuous controller

regulates the outflow from the tank depending on its actual level…

Max_level_Tank_A

Id: 001

Description: The levelof a tank should not rise over 10m, toavoid a Overflow ofliquid.

Using SysML Requirements

Diagram

Non-FormalSpecification

Non-FormalSpecification

FormalSpecification

Using SysML Behaviour Diagrams

State Diagram

Activity Diagram

Specification Language with Formal Semantics◦ Papyrus UML as Modeling Environment

Page 21: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010 21Open System Simulation and Test with SysML, Modelica and Eclipse

EnvironmentModel

Mathematical Model

Using Behaviour Diagrams

State Diagram

Activity Diagram

Sequence Diagram

Formal Specification

Test CasesTest Data

Algorithm for Test

Derivation

Page 22: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010 22Open System Simulation and Test with SysML, Modelica and Eclipse

EnvironmentModel

Mathematical Model

Variables (Input & Output)

Point of Control

Input

Point of Observation

Output

Page 23: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010 23Open System Simulation and Test with SysML, Modelica and Eclipse

Automatically◦ Test Tool forces the Tests

◦ Test Script

◦ Unit Tests

Interactive System Test◦ User controls the system interactively

◦ Undefined Usage

◦ In Real-time

EnvironmentModel

Mathematical Model

EnvironmentModel

Mathematical Model

Page 24: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Introduction and Motivation◦ Project Description

◦ Project Goals

Work Description◦ Technologies

◦ Methods

Risks

Conclusion and Outlook

17.12.2010 24Open System Simulation and Test with SysML, Modelica and Eclipse

Page 25: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010 25Open System Simulation and Test with SysML, Modelica and Eclipse

SysML◦ Modelica Profile for UML

◦ Test Representation in SysML

OpenModelica◦ Interactive Simulation Performance

Automatic Generation of Tests from SysML◦ Generation from UML is still an research topic

Page 26: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Introduction and Motivation◦ Project Description

◦ Project Goals

Work Description◦ Technologies

◦ Methods

Risks

Conclusion and Outlook

17.12.2010 26Open System Simulation and Test with SysML, Modelica and Eclipse

Page 27: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010 27Open System Simulation and Test with SysML, Modelica and Eclipse

Simulation and Test◦ Support Model-based Systems Engineering

◦ Improve System Quality

◦ Cut time to market

Open Reusable Solutions◦ SysML, Modelica, Eclipse

Next Step: Automatic Test Generation

Page 28: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

Sanford Friedenthal, Alan Moore and Rick Steiner, Practical Guide to SysML, 2008

Fritzson Peter. Principles of Object-Oriented Modeling and Simulation with Modelica 2.1, 2004

Modelica Association. Modelica: A Unified Object-Oriented Language for Physical Systems Modeling: Language Specification Version 3.0, Sept 2007. www.modelica.org

OMG. OMG Systems Modeling Language (OMG SysML™), Version 1.1, November 2008.

Acceleo, Eclipse Plug-In. www.acceleo.org/pages/home/en Papyrus UML, www.papyrusuml.org Baker, P., Dai, Z.R., Grabowski, J., Schieferdecker, I., Williams, C,

Model-Driven Testing, 2008 Christof Enert, Systematically Requirements Engineering and

Management, 2008 Johannes Link, Software Tests with JUnit, 2008 Harel D. and Politi M., Modeling Reactive Systems with Statecharts,

1998

17.12.2010Open System Simulation and Test with SysML, Modelica and Eclipse 28

Page 29: Open System Simulation and Test with SysML, Modelica …ubicomp/projekte/master10... · 17.12.2010 16 Open System Simulation and Test with SysML, Modelica and Eclipse See Bachelor

17.12.2010Open System Simulation and Test with SysML, Modelica and Eclipse 29

Parham [email protected]