modeling multi-domain systems using simscape - · pdf filemodeling multi-domain systems using...

34
1 © 2013 The MathWorks, Inc. Modeling Multi-domain Systems Using Simscape A Battery Modeling Example By Prasanna Deshpande Application Engineering Control Design and Automation

Upload: haque

Post on 01-Feb-2018

264 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

1 © 2013 The MathWorks, Inc.

Modeling Multi-domain Systems Using

Simscape – A Battery Modeling

Example

By

Prasanna Deshpande

Application Engineering

Control Design and Automation

Page 2: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

2

Challenges of Developing Battery Models

Page 3: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

3

Challenges of Developing Battery Models

Hard to model exact electrochemical behaviour.

Multidomain, nonlinear effects are challenging to model.

Model must simulate quickly to enable extensive testing

(drive cycles, temperatures, etc.)

Model must provide results that compare well to test

data

Page 4: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

4

0 1000 2000 3000-32

-31.5

-31

-30.5

-30

t (sec)

I (A

mp)

0 1000 2000 30003.2

3.4

3.6

3.8

4

t (sec)

V (

Vo

lts)

0 1000 2000 30000

0.2

0.4

0.6

0.8

1

t (sec)

SoC

(-)

0 1000 2000 300020

25

30

35

40

t (sec)

T (

ºC)

The Goal

Discharge current (A)

DT = +16ºC

Output Voltage (V)

Battery Temperature (ºC)

State of Charge

Page 5: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

5

Today’s Example: Battery

Page 6: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

6

Modeling Multi-domain Systems

Page 7: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

7

DESIGN

Control Electrical Mechanical

REQUIREMENTS

Traditional Design Process

INTEGRATION AND TEST

Embedded

Software

IMPLEMENTATION

Designs are hard to validate

against system requirements

Not possible to optimize

system performance or detect

integration issues in “Design”

Manual coding is slow,

introduces defects, and is

difficult to compare to design

Errors are found late

in the development process

using expensive prototypes

Page 8: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

8

INTEGRATION AND TEST INTEGRATION AND TEST

IMPLEMENTATION

Embedded

Software

IMPLEMENTATION

HIL System

DESIGN SYSTEM LEVEL SIMULATION

Control Electrical Mechanical

REQUIREMENTS

Model-Based Design Process

Designs are hard to validate

against system requirements

Not possible to optimize

system performance or detect

integration issues in “Design

Manual coding is slow,

introduces defects, and is

difficult to compare to design

Errors are found late

in the development process

using expensive prototypes

Optimize system performance

by developing in a single

simulation environment

Save time by automatically

generating embedded code

Create physical prototypes only

after thorough real time testing

TE

ST

& V

ER

IFIC

AT

ION

Produce better designs by

continuously comparing design

and specification

Page 9: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

9

INTEGRATION AND TEST INTEGRATION AND TEST

IMPLEMENTATION

Embedded

Software HIL System

DESIGN SYSTEM LEVEL SIMULATION

Control Electrical Mechanical

REQUIREMENTS

Model-Based Design Process

Optimize system performance

by developing in a single

simulation environment

Save time by automatically

generating embedded code

Create physical prototypes only

after thorough real time testing

TE

ST

& V

ER

IFIC

AT

ION

Produce better designs by

continuously comparing design

and specification

Page 10: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

10

DESIGN SYSTEM LEVEL SIMULATION

Control Electrical Mechanical

Model-Based Design Process

Key Message

System Level Simulation Helps in Addressing

Challenges Involved in System Design &

Optimization.

Page 11: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

11

Agenda

Different Approaches for Modeling Dynamic Systems

Creating Custom Components Using Simscape

Language

Modeling Multi-domain systems Using Simscape

Enhancing Models with Simscape Add-on Libraries

Automatically Estimating Model Parameters Based on

Test Data

Page 12: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

12

Agenda

Different Approaches for Modeling Dynamic

Systems

Creating Custom Components Using Simscape

Language

Modeling Multi-domain systems Using Simscape

Enhancing Models with Simscape Add-on Libraries

Automatically Estimating Model Parameters Based on

Test Data

Page 13: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

13

Data-Driven Modeling First Principles Modeling

Neural Networks

Physical Networks System

Identification

Parameter Tuning

Programming

Block Diagram

Modeling Language

Symbolic Methods

Modeling Approaches

Modeling Physical Systems

With MathWorks Products

Statistical Methods

(MATLAB, C)

(Simulink)

(Simscape language)

(Symbolic Math Toolbox)

(Simscape and other

Physical Modeling

products)

(Neural Network

Toolbox)

(Model Based

Calibration Toolbox)

(Simulink Design Optimization)

(System Identification Toolbox)

Page 14: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

14

Modeling RC Circuit in Simulink Requires the

Equation

Page 15: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

15

Modeling RC Circuit in Simscape Requires

Knowledge of Physical Topology

Page 16: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

16

What if the resistance value changes with

temperature?

Page 17: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

17

Agenda

Different Approaches for Modeling Dynamic Systems

Creating Custom Components Using Simscape

Language

Modeling Multi-domain systems Using Simscape

Enhancing Models with Simscape Add-on Libraries

Automatically Estimating Model Parameters Based on

Test Data

Page 18: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

18

Model Custom Physical Components

in Simscape

Problem: Add custom equation

to model thermal effect on resistor

Solution: Use the Simscape

language to model the component.

Model:

Temperature

250K – 350K

MATLAB based Object-oriented

Define implicit equations

(DAEs and ODEs)

Page 19: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

19

Data-Driven Modeling First Principles Modeling

Neural Networks (Neural Network

Toolbox)

Physical Networks (Simscape and other

Physical Modeling products)

System Identification

(System Identification Toolbox)

Parameter Optimization (Simulink Design Optimization)

Code (MATLAB)

Modeling Language (Simscape language)

Symbolic Methods

(Symbolic Math Toolbox)

Modeling Approaches

Modeling Physical Systems in the Simulink

Environment

Statistical Methods (Model Based

Calibration Toolbox)

Block Diagram (Simulink)

Page 20: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

20

Simscape Enables Bidirectional Flow of Power

Between Components

R1

C1 v1

i +

_

R1

C1

i2

+

_ i3

i1 R2

C2 v2

Simulink: Input/Output

Simscape: Physical Networks

Page 21: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

21

Agenda

Different Approaches for Modeling Dynamic Systems

Creating Custom Components Using Simscape

Language

Modeling Multi-domain systems Using Simscape

Enhancing Models with Simscape Add-on Libraries

Automatically Estimating Model Parameters Based on

Test Data

Page 22: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

22

Modeling Battery Using Equivalent Circuit:

Simscape

Model:

Using Simscape Foundation Library Components:

+ -

+ -

Page 23: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

23

Customization Is Required For Modeling the

Dependency of Components

Use Physical Modeling

methods to build electrical

and thermal network

Battery cell equivalent discharge circuit Resistors, capacitor, and voltage source

are dependent upon SOC, DOC,

and temperature

+ -

+ -

Page 24: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

24

Agenda

Different Approaches for Modeling Dynamic Systems

Creating Custom Components Using Simscape

Language

Modeling Multi-domain systems Using Simscape

Enhancing Models with Simscape Add-on Libraries

Automatically Estimating Model Parameters Based on

Test Data

Page 25: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

25

Battery Models

Generic, Pre-Defined

Generic

– Charge dependent voltage source

– Parameters found on data sheets

Pre-Defined

– Several pre-defined models

– Full parameterization

– Documentation provides

extensive detail

Page 26: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

26

Physical Systems in Simulink

Multibody mechanics (3-D) Mechanical systems (1-D)

Fluid power and control Multidomain physical systems

Electrical power systems

Electromechanical and

electronic systems

Sim

Me

ch

an

ics

Sim

Dri

ve

lin

e

Sim

Hyd

rau

lic

s

Sim

Ele

ctr

on

ics

Sim

Po

we

rSys

tem

s

Simscape

MATLAB, Simulink

Sim

Me

ch

an

ics

Sim

Dri

ve

lin

e

Sim

Hyd

rau

lic

s

Sim

Ele

ctr

on

ics

Sim

Po

we

rSys

tem

s

Simscape Mechanical Hydraulic Electrical

Thermal

Custom Domains via

Simscape Language

Pneumatic Magnetic

N S

Page 27: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

27

Data-Driven Modeling First Principles Modeling

Neural Networks (Neural Network

Toolbox)

Physical Networks (Simscape and other

Physical Modeling products)

System Identification

(System Identification Toolbox)

Parameter Optimization (Simulink Design Optimization)

Code (MATLAB)

Modeling Language (Simscape language)

Symbolic Methods

(Symbolic Math Toolbox)

Modeling Approaches

Modeling Physical Systems in the Simulink

Environment

Statistical Methods (Model Based

Calibration Toolbox)

Block Diagram (Simulink)

Page 28: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

28

Agenda

Different Approaches for Modeling Dynamic Systems

Creating Custom Components Using Simscape

Language

Modeling Multi-domain systems Using Simscape

Enhancing Models with Simscape Add-on Libraries

Automatically Estimating Model Parameters Based

on Test Data

Page 29: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

29

Problem: Simulation data does not

match measured data because the

parameters are incorrect

Solution: Use Simulink Design

Optimization to automatically tune

model parameters

Model:

A22 Ao Emo Qe_init

-4 -1 2 1.0e4

A22 = Constant

Ao = Constant

Emo = Open Cir. Voltage

Qe_init = Initial Extr. Chg.

A22 Ao Emo Qe_init

-9.99 0.402 2.20 3.84e4

Estimating Parameters Using

Measured Data

Battery

Cell

Discharge

Cycle

Voltage

Ambient

Temperature

Page 30: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

30

Estimating Parameters Using

Measured Data

Steps to Estimate Parameters

1. Import measurement data and

select estimation data

2. Identify parameters

and their ranges

3. Perform parameter estimation

4. Validate estimation

A22 Ao Emo Qe_init

-4 -1 2 1.0e4

Page 31: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

31

Summary

System Level Simulation helps in addressing

challenges involved in system design and optimization.

SYSTEM LEVEL SIMULATION

Control Electrical Mechanical

Simscape helps you in building multi-domain system

models.

It enables you to simulate plant and controller in single

environment.

Page 32: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

32

MathWorks Certification Program- for the first

time in India!

MathWorks Certified MATLAB Associate Exam

Why certification?

Validates proficiency with MATLAB

Can help accelerate professional growth

Can help increase productivity and project success and thereby

prove to be a strategic investment

Certification exam administered in English at MathWorks facilities

in Bangalore on Nov 27,2013

Email: [email protected] URL: http://www.mathworks.in/services/training Phone: 080-6632-6000

Page 33: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

33

Scheduled Public Training for Sep–Dec 2013

Course Name Location Training dates

Statistical Methods in MATLAB Bangalore 02- 03 Sep 2013

MATLAB based Optimization Techniques Bangalore 04 Sep 2013

Physical Modeling of Multi-Domain Systems using

Simscape Bangalore

05 Sep 2013

MATLAB Fundamentals

Delhi 23-25 Sep 2013

Pune 07-09 Oct 2013

Bangalore 21-23 Oct 2013

Web based 05- 07 Nov 2013

Chennai 09-11 Dec 2013

Simulink for System and Algorithm Modeling

Delhi 26-27 Sep 2013

Pune 10-11 Oct 2013

Bangalore 24-25 Oct 2013

Web based 12-13 Nov 2013

Chennai 12-13 Dec 2013

MATLAB for Data Processing and Visualization Bangalore 20 Nov 2013

MATLAB for Building Graphical User Interface Bangalore 21 Nov 2013

Generating HDL Code from Simulink Bangalore 28-29 Nov 2013 Email: [email protected] URL: http://www.mathworks.in/services/training Phone: 080-6632-6000

Page 34: Modeling Multi-domain Systems Using Simscape - · PDF fileModeling Multi-domain Systems Using Simscape – A Battery Modeling Example By Prasanna Deshpande ... Modeling Multi-domain

34

Q & A

Thank You For Attending The Session