forked from mtiller/ModelicaBook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
outline.yml
485 lines (484 loc) · 11.9 KB
/
outline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
Part 1 - Mathematical Behavior:
Introduction:
What is Modelica?:
Why Modelica?:
What Modelica allows me to do:
Basic Equations:
Introduction:
Examples:
Simplest possible model:
- der
- Real
- model
- Comment Strings
- initial equations
Newtons Law of Cooling:
- parameter
# Default values
- Numbers
# Equation, not assignment
- Comments
- Identifiers
- type
- unit
- displayUnit
LotkaVolterra:
# Multiple variables
- extends
- start
- min_attr
# start for initial conditions
# start for non-linear iteration
RLC:
Rotational Spring-Mass-Damper:
# Allows us to use it later for speed measurement?
Review:
Lexical Conventions:
- model
- type
- end
- Comment Strings
Built-in Types:
- Real
- Integer
- Boolean
- String
- min_attr
- max_attr
- nominal
- quantity
Variables:
- constant
- parameter
Equations:
- der
- Equality equations
- Arithmetic Operators
Builtin Functions:
- Mathematical Functions
- min
- max
States:
# Discuss states and state selection?
Initialization:
- initial equations
- fixed # Explanation: Allows you to flip special initial equations on and off?
# Number of variables
Inheritance:
- extends
- class_modifications
Conclusion:
Discrete Behavior:
Introduction:
Examples:
Newton Cooling:
- if equation
- if expression
# Variable convection?
# Time events
Bouncing Ball:
- when equation
- reinit
- pre
# State events
Decay:
# event semantics
# chattering
RLC with Switch:
# Better than the Newton Cooling example?
Pulse Generator:
- sample
- Logical Operators
# Discuss discrete states
# Multiple pulses at different frequencies
# and then signals to or and and them?
Counter:
- sample
- pre
Backlash:
# Fits the rotational example
Speed Measurement:
- when statement
- discrete
# equations with same right hand side.
# second order ODEs
Hysteresis:
Review:
Logical expression:
- Relational Operators
- Logical Operators
- edge
- change
If vs. When:
Events:
Functions and Events:
- Event Generating Functions
- abs
- sqrt
- sign
- initial
- terminal
- noEvent
- smooth
- smoothOrder
- delay # Good example?!?
- terminate
Discrete Variables:
- discrete
Equations:
Algorithms:
- initial algorithms
Control Structures:
- if statement
- if equation
- when statement
- when equation
Vector and Array Equations:
Examples:
ABCD Form: # With analytical solution to demo trig functions?
# Use ABCD form of Lotka-Volterra, RLC, SMD, etc.
# Time invariant, Time variant and Non-linear, etc
# ABCD as parameters OR variables
# Perhaps a sidebar on default values for parameters?
# Inheritance
- Array Construction
- Array Concatenation
One-dimensional Heat Conduction:
- for equations
- Array Comprehensions
# vector notation
- end index
Chemical equations:
- enumeration
- Enumeration Indexing
Review:
Array Declarations:
Array Construction:
# Matrix literal notation
- Array Concatenation
# Vector literal notation
# Ways of building higher dimension arrays
- Array Construction
# Array comprehensions
Arrays Functions:
- Array Constructor Functions
- fill
- zeros
- ones
- linspace
- Array Conversion Functions
- Array Algebraic Functions
- ndims
- size
- sum
- product
# Vectorization of functions
Enumerations:
- enumeration
Indexing:
- Array indexing
- Enumeration Indexing
- slicing
- end index
Looping:
- for equations
- for statement
Functions:
Introduction:
Examples:
Basic Function:
# Polynomial
- function
- derivative
- protected
# Harmonic series?
Interpolation:
# Interpolation
# Smoothness + derivative annotation
# Foreign function
- external
- derivative
- ExternalObject
- Include
- IncludeDirectory
Controller:
- pure
- impure
Chemical Reaction:
# Where reaction coefficient (array) is replaced by function
# call
Non-Linear Equations:
# ?
#- homotopy ? (not at present)
- inverse
Review:
Modelica Functions:
- function
- algorithm
- protected
Control flow and return values:
- break
- return
- if statement
- for statement
- while statement
External Functions:
- external
- ExternalObject
Pure vs. Impure:
- pure
- impure
Annotations:
- derivative
- Include
- IncludeDirectory
- Library
- LibraryDirectory
- inverse
- Inline
- LateInline
- GenerateEvents #?
# Event Generation
Part 2 - Components:
Packages:
Introduction:
# Introduce Modelica Standard Library
Examples:
Nested packages:
# Introduce the idea of packages with a really simple example
RLC:
# Show use of fully qualified type names in declarations
Newton Cooling:
# Show imports of names (including renaming)
SecondOrderSystem:
# Wildcard imports
Review:
# Lookup rules!
- package
- import
- within
# Directory storage
Connectors:
Introduction:
Through and Across Variables:
Examples:
Electrical:
Thermal:
Rotational:
Translational:
MSL:
# Show MSL connectors
Hydraulic:
# Mass
ThermoFluid:
# Mass and energy
Chemical:
# multiple species?
# TOO DIFFICULT (should use enum, which means medium model)
Block Connectors:
# Integer
# Real
# Last because they are a last resort
Review:
Connector Definitions:
- connector
Variables:
- parameter
- flow
- input
- output
Annotations:
- Icon
- Documentation
# modelica:// links
Components:
Introduction:
# Erector set/Building blocks
Reuse:
Conservation equations:
Balancing:
Multi-Domain:
Multi-Paradigm:
Examples:
Newtons Law of Cooling:
# Fundamental components
RLC:
# Revisit switch
Rotational Spring-Mass-Damper:
# Revisit backlash
# Dialog(group, showStartAttribute)
Rotational Gear:
# Cover supports/reaction torques
# Optional components!
# State selection/consistent initialization
LotkaVolterra:
# Need to define connectors and types here
# Blog examples
- AssertionLevel
- assert
Block Diagram Components:
- block
# Warning: not the way to do physical modeling (lecturer blackboard problem)
# Basic blocks
# Vector connectors (sum)
# Add control
# Thermal model
# Sensors and actuators
Speed measurement:
# Sensor measurement
Chemistry example:
# Revisit but show how we can ensure conservation
# Not expandable connectors yet, save that for
# architectures.
Review:
Blocks vs. Models vs. Records:
# Review connection rules regarding inputs and outputs
- input
- output
- record
- model
- block
Systems:
# structural type system
- connect
- element_modifications
- final
Model Boundaries:
- AssertionLevel
- assert
Conditional Components:
- conditional
Annotations:
- Icon
- Documentation
- Dialog
# Include "showStartAttribute" in Dialog discussion
- Documentation
- DynamicSelect
- defaultComponentName
- defaultComponentPrefixes
- Evaluate
- HideResult
- experiment
- preferredView
- unassignedMessage
# Subsystems, Inheritance and Architectures are all related at some level.
# Need to think about how to "fuse" these topics nicely.
# Use MSL? (or maybe both, examples and MSL?)
# Subsystems - Start with just systems of components (no redeclare or replaceable)
Subsystems:
Introduction:
Examples:
Gear with inertias:
# Propagate
- final
Lotka-Volterra:
# Region subsystems
# Unconnected semantics (or perhaps earlier?)
# Migration
Switched Power Supply:
# Model diode failure using a switch/short?
# Demonstrate parameter expressions (to short diode)
Transmission:
# ???
1D heat transfer:
# Use arrays (of components)
Pendula:
# Arrays of subsystems, 3D and animation
Review:
# Parameter propagation
- final
- protected
Protection:
- protected
- public
# Arrays of components
# Diagram annotations
Architecture:
Introduction:
Examples:
Speed Sensing System:
# Introduce feedback control
- replaceable
Thermal Control Example (MultiDomainControl):
# Implement sensor with time constant or sampling
# Create block for controller and plant
# Make sensor and controller replaceable
# Heat demand and on/off actuators
# Could be used to demonstrate how to do inverse control later
- replaceable
- expandable
# Another example???
Review:
Reuse:
- partial
- redeclare
Interfaces:
Architecture:
- replaceable
- constrainedby
# Mention vehicle interfaces
Implementation:
- redeclare
Buses:
- expandable
Annotations:
- choices
Part 3 - Advanced Topics:
Building Libraries:
Review:
Packages:
- package
- encapsulated
Annotation:
- version
- uses
Creating Template Models:
# Riff off of the SMD model presented in the section on propagation
Handling Data:
Testing:
Symbolic manipulation:
Examples:
Coupled Rotational SMD System:
- stateSelect
- StateSelect
I/O:
Introduction:
# I/O as a last result
Examples:
Review:
Printing:
- Conversion Functions
- getInstanceName
Dynamic Scoping:
Introduction:
Examples:
Review:
Annotations:
- missingInnerMessage
Operator Overloading:
Examples:
# Revist external object interpolation but with
# multiple constructors?
Review:
- operator
- operator function
- operator record
Discrete Systems:
# State machines
Parametric Modeling:
# semiLinear?
Fluid Systems:
Review:
- actualStream
- inStream
- spatialDistribution
- semiLinear
- stream
- homotopy # Good example?!?
# If I can find an example that used semi-linear,
# I could introduce it somewhere else
Variable Structure:
Backward Models:
# Build existing architecture model that's invertible?
Model-Based System Engineering: