Teaching Modelica for Engineers at Technische Universität Braunschweig€¦ · Teaching Modelica...

Preview:

Citation preview

1 University of Braunschweig – Institute of Technology

Teaching Modelica for Engineers at Technische Universität Braunschweig

W. Tegethoff, M. Gräber, R. Kossel, C. Richter

2

1. Classroom and Exam

2. Thinking in Objects

3. Course Example: Refrigeration Cycle

4. Course Example: Tire Service Garage

5. Course Example: Lumped Capacitors

6. Conclusion

Contents

Technische Universität Braunschweig

Classroom

3 Technische Universität Braunschweig

WilliWilli

ManuelManuel

24 Course Hours24 Course Hours

4

Final Exam

Learning targets:

•Modeling language Modelica

•Numeric for solving DAE-Systems (heuristic)

•Object-oriented analysis

Technische Universität Braunschweig

Final Exam

5 Technische Universität Braunschweig

What is What is Polymorphism?Polymorphism?

Exam Time:Exam Time:

30 Minutes30 Minutes

6

1. Classroom and Exam

2. Thinking in Objects

3. Course Example: Refrigeration Cycle

4. Course Example: Tire Service Garage

5. Course Example: Lumped Capacitors

6. Conclusion

Contents

Technische Universität Braunschweig

7

Thinking in Objects

Class: Construction Plan /Blueprint

Object: The house

What is a class? What is an object?

Instantiation: Building

More objects of the same class

Technische Universität Braunschweig

Modifier

AnimalAnimal

Object-oriented Analysis

8 Technische Universität Braunschweig

““is ais a””

““is part ofis part of””

AnimalAnimal

Object-oriented Analysis

9 Technische Universität Braunschweig

““is ais a””

66

111144

44

““is part ofis part of””

Object-oriented Analysis

10 Technische Universität Braunschweig

11

Overview of Course Examples

Refrigeration Cycle

Tire Service Garage

Lumped Capacitors

Technische Universität Braunschweig

12

1. Classroom and Exam

2. Thinking in Objects

3. Course Example: Refrigeration Cycle

4. Course Example: Tire Service Garage

5. Course Example: Lumped Capacitors

6. Conclusion

Contents

Technische Universität Braunschweig

Refrigeration Cycle

13 Technische Universität Braunschweig

14

Solving Non-linear Algebraic Equations

gascooler.idealOutletRefrigerant.p = 1E+007receiver.refrigerant.p = 0Residual:{ -0.0654391, 92922.9 }

gascooler.idealOutletRefrigerant.p = -1E+009receiver.refrigerant.p = -1.41559Residual:{ -0.101224, -9024.99 }

gascooler.idealOutletRefrigerant.p = -9.17831E+008receiver.refrigerant.p = -1.28344Residual:{ -0.0970766, -9024.99 }

Technische Universität Braunschweig

15

Solving Non-linear Algebraic Equations

NewtonNewton’’s Methods Method

Technische Universität Braunschweig

Solving Non-linear Algebraic Equations

16 Technische Universität Braunschweig

Pitfalls:

17

1. Classroom and Exam

2. Thinking in Objects

3. Course Example: Refrigeration Cycle

4. Course Example: Tire Service Garage

5. Course Example: Lumped Capacitors

6. Conclusion

Contents

Technische Universität Braunschweig

Tire Service Garage

18 Technische Universität Braunschweig

Tire Service GarageTire Service Garage

Tire Service Garage

19 Technische Universität Braunschweig

Tire Service Garage

Car

<<partial>>

Tire

Firestone Michelin

Object DiagramObject Diagram

Tire Service Garage

20 Technische Universität Braunschweig

IconIcon

CarCar

Object DiagramObject Diagram

Tire Service Garage

21 Technische Universität Braunschweig

CarCar

model Car

Firestone spareTire;

Michelin frontRightTire;

Michelin frontLeftTire;

Michelin backRightTire;

Michelin backLeftTire;

end Car;

Object DiagramObject Diagram

Tire Service Garage

22 Technische Universität Braunschweig

CarCar

model Car

replaceable Firestone spareTire extends Tireannotation (choicesAllMatching=true);

replaceable model TireModel = Michelin extends Tireannotation (choicesAllMatching=true);

TireModel frontRightTire;

TireModel frontLeftTire;

TireModel backRightTire;

TireModel backLeftTire;

end Car;

Tire Service Garage

23 Technische Universität Braunschweig

Tire Service GarageTire Service Garage

redeclare model TireModel =

Michelin;

M M

24

1. Classroom and Exam

2. Thinking in Objects

3. Course Example: Refrigeration Cycle

4. Course Example: Tire Service Garage

5. Course Example: Lumped Capacitors

6. Conclusion

Contents

Technische Universität Braunschweig

25

Lumped Capacitors

TTss

RR11 RR22

22

2

211

1

Qdt

dTC

QQdt

dTC

=⋅

−=⋅

1Q 2Q

1C 2C

TT11 TT22

2

212

1

11

RTTQ

RTTQ s

−=

−=

22

212

21

21

11

11

RCTT

dtdT

RCTT

RCTT

dtdT s

−=

−−

−=

Technische Universität Braunschweig

Euler’s Method

26 Technische Universität Braunschweig

00 2020 3030 4040Time [s]Time [s]300300

380380

320320

340340

360360

Tem

pera

ture

[K

]Te

mpe

ratu

re [

K]

50501010

DasslDassl’’ss SolutionSolutionEulerEuler’’s Solutions Solution

Lumped Capacitors - Stiffness

27 Technische Universität Braunschweig

00 400400 600600 800800

Time [s]Time [s]

10001000200200

6.0 e86.0 e8Te

mpe

ratu

reTe

mpe

ratu

re[K

][K

]

--6.0 e86.0 e8

00

Lumped Capacitors - Stiffness

28 Technische Universität Braunschweig

TTss

RR11

1C 2C

TT11 TT22RR22

21 RR >>

Lumped Capacitors - Stiffness

29 Technische Universität Braunschweig

00 44 66 88

Time [s]Time [s]

101022

Tem

pera

ture

Tem

pera

ture

[K]

[K]

400400

300300

350350

EulerEuler’’s Methods Method

ΔΔt = 1et = 1e--4 sec4 sec

Lumped Capacitors – Index Reduction

30 Technische Universität Braunschweig

TTss

RR11

1C 2C

TT11 TT22

2

212

1

11

RTTQ

RTTQ s

−=

−=dt

d

dtd

Lumped Capacitors – State Selection

31 Technische Universität Braunschweig

TTss

RR11

1C 2C

TT11 TT22

32

1. Classroom and Exam

2. Thinking in Objects

3. Course Example: Refrigeration Cycle

4. Course Example: Tire Service Garage

5. Course Example: Lumped Capacitors

6. Conclusion

Contents

Technische Universität Braunschweig

33

Conclusion

Students typically have to learn thinking in objects

Students learn modelling in Modelica by

• Carefully selected didactical concepts

• Well assisted assignments

• Final projects

In thermo-fluid systems, good knowledge about numerical solving of DAE-Systems is necessary

Technische Universität Braunschweig

Recommended