principles of modeling for cyber-physical systems · •~4 worksheets (posted on uvacollab/website)...

96
Madhur Behl Computer Science Systems and Information Engineering Principles of Modeling for Cyber-Physical Systems Fall 2018 CS 6501-003 / SYS 6581-004/600 Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 1

Upload: others

Post on 09-Mar-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Madhur Behl

Computer Science

Systems and Information Engineering

Principles of Modeling for Cyber-Physical SystemsFall 2018

CS 6501-003 / SYS 6581-004/600

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 1

Page 2: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Meet your instructor

Madhur Behl

Assistant ProfessorComputer Science, Systems and Information Engineering.

Physicist at

Cyber-Physicist by profession

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 2

PhD, University of Pennsylvania (2015)Co-Founder @ Flexergy AI

Page 3: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

What do I do..Modeling, simulation, control, optimization, and implementation of Cyber-Physical System

Cyber-Physical Energy Systems

Internet of things Critical Infrastructures & Smart Cities

Safety of Autonomous Vehicles

Data Predictive Control: Interfacing machine learning suitable for predictive control.

DeepExplainations:Answering open-ended queries using procedural generation and interpretable models.

DeepRacing AI:Algorithms for operating autonomous cars at the limits of their control

Madhur Behl - [email protected]

Page 4: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Course logistics (5-7 mins)• Course introduction ( the interesting stuff !)

This lecture

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 4

Page 5: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Timings: Tue & Thu 2:00pm – 3:15pm,

• Location: Olsson Hall 018

• Course website: https://linklab-uva.github.io/modeling_cps/

• All lectures notes/slides/assignments/videos will be posted on this website.

• Piazza: https://piazza.com/virginia/fall2019/modelingcpsfall2019/home

• Prerequisites (must have):

• Some familiarity with Matlab / Simulink.

• Some programming experience, Python is a plus.

• Mathematical maturity (differential equations, matrix operations, some calculus, probability

distributions)

•Prerequisites (good to have):

• Machine learning

• Temporal logic

• Model predictive control

Course Logistics

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 5

Page 6: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 6

Teaching Assistants

Siavash Yousefi Jordehi Jiechao Gao

[email protected] [email protected]

Systems Engineering, PhD Computer Science, PhD

Office Hours: TBA

Page 7: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• No midterm, No final exam.

• The course has three modules (more on this later). Each module is equally weighted. • Energy CPS, Medical CPS, and Automotive CPS

• ~4 worksheets (posted on UVACollab/Website) in each module, comprising of:• Problem sets• Coding/implementation assignments

• 2 late homework submissions permitted – No questions asked.• Should not be more than 1 day late. 25% grade lost for each additional late day.

• Abide by the UVA honor system. Absolutely no code/solution sharing !

Grading

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 7

Page 8: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Timings: Monday 2-3pm, or by appointment.

• Location: Link Lab Room 265 [Olsson Hall 2nd floor]

• Available by appointment outside of the listed hours:• To discuss course assignments or lectures.• Research opportunities.

• Live streamed office hours will be held for online CGEP students.

Office Hours

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 8

Page 9: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Attend the lectures (in-person for on-grounds students)

• Check Piazza and the Course website for announcements, and assignments.

• Ask questions !• Ask, disagree, debate..

Your responsibilities.

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 9

Page 10: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

what is this course about ?

Principles of Modeling for Cyber-Physical Systems

Lets break it down..

1. What are Cyber-Physical Systems ?2. What do you really mean by modeling ?3. What principles am I going to learn about ?

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 10

Page 11: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Cyber-Physical Systems

Deeply integrating computation, communication, and control

into physical systems

� Physical = some tangible, physical device or system + environment� Cyber = computational + communicational

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 11

Page 12: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Application domains: Transportation

Faster, safer, more energy-efficient air

travel

Improved use of airspace

Autonomous unmanned drones

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 12

Page 13: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 13

Page 14: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 14

Page 15: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Application domains: Transportation

Safety, security, and control of autonomous cars

• Connected vehicles.• Autonomous

fleets/ride sharing.• Traffic management

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 15

Page 16: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 16

Page 17: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Application domains: Energy

• Smart buildings.• Energy-efficient

operation.

• Smart homes.• EV charging/solar

rooftops

• Reliable and resilient electricity grid.

• Micro grids.

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 17

Page 18: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Application domains: Healthcare + Biomedical

• Electronic patient record management.

• In home healthcare delivery.

Health and well being monitoring devices.

Safety, and security of medical devices and heath management systems.

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 18

Page 19: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Application domains: Critical Infrastructure

• Water & waste management.• Storm-water/flood control.

Structural health monitoring

Utility infrastructure- Gas, Electricity, Steam.

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 19

Page 20: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Application domains: … and many more

Agriculture Manufacturing Industrial Control

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 20

Page 21: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Characteristics of CPS

• Pervasive computation, sensing and control• Networked at multi- and extreme scales• Dynamically reorganizing/ reconfiguring• High degrees of automation

• Dependable operation with potential requirements for high assurance of reliability, safety, security and usability

•With / without human in-the-loop• Conventional and unconventional substrates / platforms

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 21

Page 22: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Closing the loop

Plant/System

Controller

ActuationSensingCyber

Physical

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 22

Page 23: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Human in the loop

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 23

Page 24: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Cyber-Physical Systems

Deeply integrating computation, communication, control, and humans

into physical systems

� Physical = some tangible, physical device or system + environment� Cyber = computational + communicational

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 24

Page 25: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Cyber-Physical Systems - Goals

Transform how we interact with the physical world

Fusion of physical and computational sciences

Produce significant impact on society

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 25

Page 26: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Why is CPS hard ?

package org.apache.tomcat.session;

import org.apache.tomcat.core.*;import org.apache.tomcat.util.StringManager;

import java.io.*;import java.net.*;import java.util.*;

import javax.servlet.*;import javax.servlet.http.*;

/*** Core implementation of a server session

** @author James Duncan Davidson [[email protected]]

* @author James Todd [[email protected]]*/

public class ServerSession {

private StringManager sm =StringManager.getManager("org.apache.tomcat.session");

private Hashtable values = new Hashtable();private Hashtable appSessions = new Hashtable();

private String id;

private long creationTime = System.currentTimeMillis();;private long thisAccessTime = creationTime;private long lastAccessed = creationTime;

private int inactiveInterval = -1;

ServerSession(String id) {this.id = id;

}

public String getId() {

return id;}

public long getCreationTime() {return creationTime;

}

public long getLastAccessedTime() {return lastAccessed;

}

public ApplicationSession getApplicationSession(Context context,boolean create) {

ApplicationSession appSession =(ApplicationSession)appSessions.get(context);

if (appSession == null && create) {

// XXX// sync to ensure valid?

appSession = new ApplicationSession(id, this, context);appSessions.put(context, appSession);

}

// XXX// make sure that we haven't gone over the end of our// inactive interval -- if so, invalidate and create

// a new appSession

return appSession;}

void removeApplicationSession(Context context) {appSessions.remove(context);

}

/*** Called by context when request comes in so that accesses and

* inactivities can be dealt with accordingly.

*/

void accessed() {// set last accessed to thisAccessTime as it will be left over

// from the previous access

lastAccessed = thisAccessTime;thisAccessTime = System.currentTimeMillis();

}

void validate()

Computing Control Systems

Crosses Interdisciplinary Boundaries

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 26

Page 27: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Why is CPS hard ?

• Disciplinary boundaries need to be realigned• New fundamentals need to be created• New technologies and tools need to be developed• Education need to be restructured

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 27

Page 28: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Why is CPS hard ?

• Disciplinary boundaries need to be realigned• New fundamentals need to be created• New technologies and tools need to be developed• Education needs to be restructured

Hmmm, I wonder if there is a course which is trying to achieve this?

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 28

Page 29: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

what is this course about ?

Principles of Modeling for Cyber-Physical Systems

Lets break it down..

1. What are Cyber-Physical Systems ?2. What do you really mean by modeling ?3. What principles am I going to learn about ?

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 29

Page 30: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Modeling types: Physical modeling

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 30

Page 31: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Modeling types: Functional/compositional modeling

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 31

Do you know of any tools for functional modeling ?

Page 32: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Modeling types: Mathematical modeling

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 32

Page 33: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Modeling types: Computational modeling

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 33

Page 34: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Verification

Validation

A word about mathematical models

Physical

System

Reality

ObservationsMathematical

models

Observational

errorsModeling

errors

Computational/

Simulation

models

Discretization

errors

Control &

implementation

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 34

Page 35: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

“Essentially all models are wrong, but some are useful”

- George E.P. Box (statistician)

….this course is about building useful models.

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 35

Page 36: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

This course: Three CPS domains

Energy CPS Medical CPS Automotive CPS

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 36

Page 37: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Energy CPS Medical CPS Automotive CPS

1/Ugw

1/Ugi

1/Ugo

Cgo

Cgi

Tgo

Tg

Tgi

Tz

Q.rad,e

1/Uei1/Uew1/Ueo

Ceo Cei

Ta

Teo Tei

Q.sol,e

Q.solt/2

1/Uci

1/Ucw

1/UcoCci

Cci

Ta

Q.sol,c

Q.rad,c

Ta

Q.conv + Q.

sens

1/Uii 1/Uiw 1/Uio

Cii Cio

Tci

Tco

1/Uwin Tii Tio

Q.solt/2

Q.rad,g

[ExternalWalls]

Ti

[Ceiling]

[Floor]

[InternalWalls]

[Windows] White-boxState-space

TimedAutomata Data-driven

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 37

Page 38: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Energy CPS Medical CPS Automotive CPS

EnergyPlus

Matlab

UPPAAL

Simulink

TensorFlow

PythonPrinciples of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 38

Page 39: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Energy CPS ModulePrinciples of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 39

Page 40: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

40Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected]

Page 41: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 41

Page 42: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Price Volatility: Summer peak

20th, July 2015

Nominal price: $25/MWh Peak Price: $800/MWh

32x!

42Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected]

Page 43: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

43

“All kilowatts are not created equally”

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected]

Page 44: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 44

Page 45: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Price Volatility: Winter peak

24th, January 2014

Nominal price: $31.21/MWh Peak Price: $2,680.21/MWh

86x!

45Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected]

Page 46: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Price volatility is the new normalPJM (ISO) Locational Marginal Prices (LMPs) example

46Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected]

Page 47: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

At large scales: University Campus

72 MWPeak (UCAP)

187 Buildings

300,000SCADA Tags

4 MillionGallons of chilled water (@42F)

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 47

Page 48: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

~$28MAnnual Electricity Bill

In 2011

Peak > UCAP

30 min

$720,000Penalty for 30 minutes

Economic incentives for model based control

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 48

Page 49: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Why focus on Buildings ?

Portion of global energy use

Portion of electricity consumption in the United States

Portion of global total CO2 emissions

40%70%1/3

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 49

Page 50: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Model-Based control for buildings

Traditional rule-based building control

• Sequence of operations or planned steps.

• Pre-defined rules set by building

engineers.

• Purely reactive.

• Equipment-level controllers (PID) ensure

reference tracking.

Start Chiller #3 at 4:00

am

Start Chiller #1

Chiller #3

at 90%

load

Took 23 min yesterday

Took 42 min today

(but price increased !)

Model-based building control

• Model how the building will response to

disturbances (weather, occupants etc.)

• Predictive

• Control design:

• Energy-efficiency

• Demand flexibility

• Fault handling

• Okay to use equipment level PID control

Model Predictive Control (MPC)50Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected]

Page 51: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

The control problem in buildings

51

Integrated control of:

• Heating• Cooling• Ventilation• Lighting• Blinds

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected]

Page 52: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

State-space ‘RC’ thermal modeling

1/Ugw

1/Ugi

1/Ugo

Cgo

Cgi

Tgo

Tg

Tgi

Tz

Q.rad,e

1/Uei1/Uew1/Ueo

Ceo Cei

Ta

Teo Tei

Q.sol,e

Q.solt/2

1/Uci

1/Ucw

1/UcoCci

Cci

Ta

Q.sol,c

Q.rad,c

Ta

Q.conv + Q.

sens

1/Uii 1/Uiw 1/Uio

Cii Cio

Tci

Tco

1/Uwin Tii Tio

Q.solt/2

Q.rad,g

[ExternalWalls]

Ti

[Ceiling]

[Floor]

[InternalWalls]

[Windows]

Wall Dynamics

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 52

Page 53: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Whole building energy simulation

Using EnergyPlus.

Generating input-output data

Modeling a building in MATLAB

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 53

Page 54: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Non-linear parameter estimation and model validation

Model Accuracy for Training data

RMSE: 0.062 °CR2: 0.983

Model Accuracy for Test Data

RMSE: 0.091 °CR2: 0.948

Baseline

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 54

Page 55: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Predictive control

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 55

Page 56: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Medical CPS ModulePrinciples of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 56

Page 57: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Software related vehicle recalls

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 57

Page 58: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Over 600,000 cardiac medical devices recalled from 1990-2000 – 40% of which were due to software issues

• 2008-12: 15% of all the medical device recalls due to software

Implantable Pacemaker Implantable Cardioverter-Defibrillator (ICD)58

Page 59: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Muscle contraction triggered by electrical signals

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 59

Page 60: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Slow generation and conduction of electrical signals

• Slow heart rate

• Symptom: fainting, dizziness

• Could lead to heart attack

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 60

Page 61: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Two leads in heart chambers

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 61

Page 62: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Two leads in heart chambers

• Deliver electrical signals when heart rate is low

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 62

Page 63: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

• Two leads in heart chambers

• Deliver electrical signals when heart rate is low

• Device malfunction may result in injury or death

• Flawed devices are recalled

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 63

Page 64: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Pacemaker Autonomous device with minimum human interactionLimited diagnostic/therapy capabilityIts safety must be evaluated within its environment

The physical plant:Complex dynamics of the heartInteraction between the heart and the bodyDomain knowledge

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 64

Page 65: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Pacemaker

Scenario 1

Scenario 2

Scenario 3

65Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected]

Page 66: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 66

Page 67: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Refractory

Time

V out

Rest ERP RRP Rest

Refractory

TimeV out

Rest ERP RRP Rest

node

pathnode

Principles of modeling for CPS – Fall 2019 67Madhur Behl - [email protected]

Page 68: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

68Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected]

Page 69: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

69

Cellular Level

Node Automaton• Divide refractory period into time periods

• Model refractory properties as timers using timed automata.

• These time periods can be measured during EP study

Madhur Behl - [email protected]

Page 70: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

70

Cellular Level

Node Automaton

Madhur Behl - [email protected]

Page 71: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

71

The UPPAAL model of the closed-loop system

Page 72: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

72

Model checking – Counter example guided.

Safety property

Ventricular rate should not be equal or above the upper rate limit for more than 30 beats

![]$%& '%$(&%). +))

Heart Pacemaker

Aget!

Vget!

AP!

VP!

monitorMadhur Behl - [email protected]

Page 73: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Automotive CPS ModulePrinciples of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 73

Page 74: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Localization and Mapping

Scene Understanding

Trajectory Planning and Control

Human Interaction

Where am I ?

Where/who/what/why of

everyone/everything else ?

Where should I go next ?

How do I steer and accelerate ?

How do I convey my intent to the

passenger and everyone else ?Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 74

Page 75: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Localization and Mapping

Scene Understanding

Trajectory Planning and Control

Human Interaction

Where am I ?

Where/who/what/why of everyone/everything else ?

Where should I go next ? How do I steer and accelerate ?

How do I convey my intent to the passenger and everyone else ?

Deep

Lea

rnin

g

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 75

Page 76: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Localization and Mapping

Scene Understanding

Trajectory Planning and Control

Human Interaction

Where am I ?

Where/who/what/why of everyone/everything else ?

Where should I go next ? How do I steer and accelerate ?

How do I convey my intent to the passenger and everyone else ?

End-

to-e

nd le

arna

ble

Deep

Neu

ral N

etw

orks

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 76

Page 77: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Center camera CNN

Steeringcommand

Drive-by-wire interface

End-to-End Deep Learning for Self Driving Cars - NVIDIA

Video credit:DeepTesla

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 77

Page 78: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Machine intelligence is largely about training data.

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 78

Page 79: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Image courtesy: Cognata

When’s a pedestrian not a pedestrian? When it’s a decal.

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 79

Page 80: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

One car ? or Multiple cars ?

Page 81: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments
Page 82: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments
Page 83: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments
Page 84: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments
Page 85: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

There is a bus right next to you!!

Page 86: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Autonomous Driving: End-to-End

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 86

Page 87: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Autonomous Driving: End-to-End

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 87

Page 88: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Autonomous Driving: End-to-End

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 88

Page 89: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 89

Page 90: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 90

Page 91: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

what is this course about ?

Principles of Modeling for Cyber-Physical Systems

Lets break it down..

1. What are Cyber-Physical Systems ?2. What do you really mean by modeling ?3. What principles am I going to learn about ?

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 91

Page 92: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

•Modeling for predictive control.• Parameter estimation. • Linear and non-linear

•Model checking•Model validation•Model selection• Model abstraction/reduced order modeling

• End-to-end learning

This course: Modeling principles

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 92

Page 93: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

This course: Learning objectives

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 93

DomainExpert

(Physical System)

Modelingprinciples

Tools &implementation

Page 94: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

This course: Learning objectives

Principles of modeling for CPS – Fall 2019 94

The future belongs to those who learn more skills and combine them in creative ways.

Madhur Behl - [email protected]

Page 95: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

This course: Becoming a Cyber-Physicist

Parameter estimation

Med CPS

Automotive CPS

First principles modeling

Model checking

Timed automataData-driven modeling

State-SpaceModeling

Energy CPS

EnergyPlusUPPAAL

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 95

Cyber-Physicist

Page 96: Principles of Modeling for Cyber-Physical Systems · •~4 worksheets (posted on UVACollab/Website) in each module, comprising of: •Problem sets •Coding/implementation assignments

Next lecture:

• How to predict the future..

• State-space modeling using first principles.• Mechanical, electrical, thermal systems• ODEs and elements of white box modeling

Principles of modeling for CPS – Fall 2019 Madhur Behl - [email protected] 96