acumen a cyber-physical (cps) modeling language rigorous … · 2015-01-26 · rigorous simulation...

44
Walid Taha Halmstad University and Rice University Rigorous Simulation

Upload: others

Post on 13-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

AcumenA Cyber-Physical (CPS)

Modeling LanguageWalid Taha

Halmstad University and Rice University

Rigorous Simulation

Page 2: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Aaron Ames, Kevin Atkinson, Jerker Bengtsson, Raktim Bhattacharya, Paul Brauner, Robert Cartwright, Alexandre Chapoutot, Adam Duracz, Jan Duracz, Henrik Eriksson,

Veronica Gaspes, Christian Grante, Jun Inoue, Michal Konecny, Marcie O’Malley, Travis Martin,Jawad Masood, Marisa Peralta, Cherif Salama, Walid Taha, Edwin

Westbrook, Fei Xu, Yingfu Zeng, Yun ZhuHalmstad University, Rice University and Texas A&M, SP, Volvo Trucks

Rigorous Simulation

Page 3: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Robot Design

Page 4: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

NG-Test Project

Page 5: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Simulation in innovation

Idea

Product

Prototype

Model

Page 6: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Simulation in innovation

Idea

Product

Prototype

ModelBug

Flaw

Disaster

Page 7: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Rigorous Simulation

Idea

Product

Prototype

ModelBug

Flaw

Disaster

Late “debugging” can be extremely expensive

Debugging models (simulation) is a productivity bottleneck

SimulateTest

CPS models must combine C & P!

Page 8: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

This talk• The CPS simulation domain

• Available tools

• Rigorous simulation

• The staging connection

• The E-L equation (previous work)

• Binding time analysis (ongoing)

Page 9: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

ModelingSimulation

Page 10: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Why simulation is hard• Solving continuous equations:

• ODEs, DAEs, PDEs, IDEs, ...

• IVP vs. BVP

• Hybrid aspects pervasive (both C & Ph)

• Dealing with precision in models

• Uncertainty (intervals)

Page 11: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Hybrid systems basics

Derivatives

ComputabilityDiscontinuities

Interaction

Page 12: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Specific problems• Equality & zero crossing (if x=0 then ...)

• Zeno-behavior (bouncing ball)

• Static verification (e.g. solvable, stable)

• Numerical precision and validity

• Pole detection (e.g. x’=x*x, x(0)=1(?))

• Semantic treatment desperately needed

Page 13: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Current tools

• Simulink

• Mathematica, Maple

• ML, Haskell

• HA, e.g. CHARON

• Modelica, Verilog-AMS, ...

Page 14: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Strengths

• Simulink: Lots of models (IP)

• Mathematica, Maple: Symbolics

• ML, Haskell: Expressivity, concurrency

• HA, e.g. CHARON: Formal proof

• Modelica, Verilog-AMS: Equations

Page 15: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Weaknesses

• Simulink: Numeric semantics...

• Mathematica: Executability

• ML, Haskell: “Indeterminism”

• HA, e.g. CHARON: Scalability

• Modelica, Verilog-AMS: Semantics...

Page 16: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Acumen• Acumen ’09: continuous language

• “Math as a programming language”

• Acumen ’10 (- now): hybrid language

• Hierarchical hybrid systems

• IDE (automatic plotting & 3D view)

• Rigorous semantics

Page 17: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Basic Look and Feel

Page 18: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Hybrid Dynamics Example

Page 19: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Example for CPS course

Page 20: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Rigorous Semantics

x

xx

E

t

t

t

x’

Page 21: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Rigorous Semantics

Page 22: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely
Page 23: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

The Staging Connection

A passive robot walks naturally down inclines

Can this be generalized?

Page 24: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

The Staging Connection

• Effort by one of our three domain experts

• Robot model uses 8x8 Lagrangian

• Must convert to “executable” math

• Mathematica gave a 13MB derivative!

• It’s very hard for robotics experts to find the right tools for simulation

Page 25: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Equational models

Page 26: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Equational models

Page 27: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Equational models

Page 28: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Equational models

Page 29: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Equational models

Page 30: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Equational models

Page 31: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Equational models

Page 32: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

From Acumen to DAEs

Page 33: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

From Acumen to DAEs

Page 34: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Effect on Performance

Acumen ’09[ICCPS’10]

Page 35: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

BTA: Syntax

Page 36: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

BTA: Collecting constraints

Page 37: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

BTA: Solving constraints

Page 38: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Example: Pendulum

Page 39: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Example: Pendulum

Page 40: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Example: Pendulum

Page 41: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

BTA: Next Steps

• Formalizing correctness criteria

• “Well-annotated programs don’t go wrong”

• Establishing sufficiency for an interesting class of models

• Example: Rigid body dynamics

Page 42: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Conclusions (1/2)

• Rigorous simulation is a powerful tool

• Being based on simulation makes intuitive

• Being rigorous makes it a verification tool

• Semantics makes the tool rigorous

• Staging implements the semantics efficiently

Page 43: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Conclusions (2/2)

• Rigorous simulation naturally accommodates parametric uncertainty

• Modeling uncertainty makes simulations much more informative

• Using rigorous simulation during early-stage design has a distinctive flavor that promotes robust design

Page 44: Acumen A Cyber-Physical (CPS) Modeling Language Rigorous … · 2015-01-26 · Rigorous Simulation Idea Product Prototype Bug Model Flaw Disaster Late “debugging” can be extremely

Thank you!• To download our papers:

• http://effective-modeling.org

• To download Acumen

• http://acumen-language.org

• For CPS Lecture Notes

• http://bit.ly/LNCPS-2014