ModelicaSpec34modelica规范3.4.pdf
《ModelicaSpec34modelica规范3.4.pdf》由会员分享,可在线阅读,更多相关《ModelicaSpec34modelica规范3.4.pdf(308页珍藏版)》请在文库网上搜索。
1、 Modelica - A Unified Object-Oriented Language for Systems Modeling Language Specification Version 3.4 April 10, 2017 Abstract This document defines the Modelica1 language, version 3.4, which is developed by the Modelica Association, a non-profit organization with seat in Linkping, Sweden. Modelica
2、is a freely available, object-oriented language for modeling of large, complex, and heterogeneous systems. It is suited for multi-domain modeling, for example, mechatronic models in robotics, automotive and aerospace applications involving mechanical, electrical, hydraulic control and state machine
3、subsystems, process oriented applications and generation and distribution of electric power. Models in Modelica are mathematically described by differential, algebraic and discrete equations. No particular variable needs to be solved for manually. A Modelica tool will have enough information to deci
4、de that automatically. Modelica is designed such that available, specialized algorithms can be utilized to enable efficient handling of large models having more than one hundred thousand equations. Modelica is suited and used for hardware-in-the-loop simulations and for embedded control systems. Mor
5、e information is available at http:/www.Modelica.org/ 1 Modelica is a registered trademark of the Modelica Association Copyright 1998-2017, Modelica Association (https:/www.modelica.org) All rights reserved. Reproduction or use of editorial or pictorial content is permitted, i.e., this document can
6、be freely distributed especially electronically, provided the copyright notice and these conditions are retained. No patent liability is assumed with respect to the use of information contained herein. While every precaution has been taken in the preparation of this document no responsibility for er
7、rors or omissions is assumed. The contributors to this and to previous versions of this document are listed in Appendix E. All contributors worked voluntarily and without compensation. Table of Contents Preface . 7 Chapter 1 Introduction . 9 1.1 Overview of Modelica. 9 1.2 Scope of the Specification
8、 . 9 1.3 Some Definitions . 10 1.4 Notation and Grammar . 10 Chapter 2 Lexical Structure . 11 2.1 Character Set . 11 2.2 Comments . 11 2.3 Identifiers, Names, and Keywords . 12 2.4 Literal Constants . 13 2.5 Operator Symbols . 14 Chapter 3 Operators and Expressions . 15 3.1 Expressions . 15 3.2 Oper
9、ator Precedence and Associativity. 15 3.3 Evaluation Order . 16 3.4 Arithmetic Operators . 17 3.5 Equality, Relational, and Logical Operators . 17 3.6 Miscellaneous Operators and Variables . 18 3.7 Built-in Intrinsic Operators with Function Syntax . 19 3.8 Variability of Expressions . 31 Chapter 4 C
10、lasses, Predefined Types, and Declarations . 35 4.1 Access Control Public and Protected Elements . 35 4.2 Double Declaration not Allowed . 36 4.3 Declaration Order and Usage before Declaration . 36 4.4 Component Declarations . 36 4.5 Class Declarations . 41 4.6 Specialized Classes . 44 4.7 Balanced
11、Models . 46 4.8 Predefined Types and Classes . 52 Chapter 5 Scoping, Name Lookup, and Flattening . 57 5.1 Flattening Context . 57 5.2 Enclosing Classes . 57 5.3 Static Name Lookup . 57 5.4 Instance Hierarchy Name Lookup of Inner Declarations . 59 5.5 Simultaneous Inner/Outer Declarations . 61 5.6 Fl
12、attening Process . 61 Chapter 6 Interface or Type Relationships. 67 6.1 The Concepts of Type, Interface and Subtype . 68 6.2 Interface or Type . 69 6.3 Interface Compatibility or Subtyping . 70 6.4 Plug-Compatibility or Restricted Subtyping . 72 6.5 Function-Compatibility or Function-Subtyping for F
13、unctions . 73 6.6 Type Compatible Expressions . 74 Chapter 7 Inheritance, Modification, and Redeclaration . 77 7.1 InheritanceExtends Clause . 77 7.2 Modifications . 80 7.3 Redeclaration . 84 Chapter 8 Equations . 91 8.1 Equation Categories . 91 8.2 Flattening and Lookup in Equations . 91 8.3 Equati
14、ons in Equation Sections . 91 8.4 Synchronous Data-flow Principle and Single Assignment Rule . 98 8.5 Events and Synchronization . 98 8.6 Initialization, initial equation, and initial algorithm . 100 Chapter 9 Connectors and Connections. 105 9.1 Connect-Equations and Connectors . 105 9.2 Generation
15、of Connection Equations . 110 9.3 Restrictions of Connections and Connectors . 113 9.4 Equation Operators for Overconstrained Connection-Based Equation Systems . 115 Chapter 10 Arrays . 121 10.1 Array Declarations . 121 10.2 Flexible Array Sizes . 123 10.3 Built-in Array Functions . 123 10.4 Vector,
16、 Matrix and Array Constructors. 127 10.5 Array Indexing . 130 10.6 Scalar, Vector, Matrix, and Array Operator Functions . 131 10.7 Empty Arrays . 136 Chapter 11 Statements and Algorithm Sections. 137 11.1 Algorithm Sections . 137 11.2 Statements . 138 Chapter 12 Functions . 145 12.1 Function Declara
17、tion . 145 12.2 Function as a Specialized Class . 146 12.3 Pure Modelica Functions. 147 12.4 Function Call . 149 12.5 Built-in Functions . 156 12.6 Record Constructor Functions . 156 12.7 Declaring Derivatives of Functions . 160 12.8 Declaring Inverses of Functions . 164 12.9 External Function Inter
18、face . 165 Chapter 13 Packages . 177 13.1 Package as Specialized Class . 177 13.2 Motivation and Usage of Packages . 177 Chapter 14 Overloaded Operators . 183 14.1 Matching Function . 184 14.2 Overloaded Constructors . 184 14.3 Overloaded String Conversions . 185 14.4 Overloaded Binary Operations .
19、185 14.5 Overloaded Unary Operations . 186 14.6 Example of Overloading for Complex Numbers . 186 Chapter 15 Stream Connectors . 191 15.1 Definition of Stream Connectors . 191 15.2 Stream Operator inStream and Connection Equations . 192 15.3 Stream Operator actualStream . 196 Chapter 16 Synchronous L
20、anguage Elements . 197 16.1 Introduction . 197 16.2 Definitions . 199 16.3 Clock Constructors . 202 16.4 Discrete States . 204 16.5 Partitioning Operators . 204 16.6 Clocked When Clause . 207 16.7 Clock Partitioning . 208 16.8 Continuous-Time Equations in Clocked Partitions . 211 16.9 Initialization
21、 of Clocked Partitions . 215 16.10 Other Operators . 215 16.11 Semantics . 216 Chapter 17 State Machines. 219 17.1 Transitions . 219 17.2 State Machine Graphics . 220 17.3 State Machine Semantics . 222 Chapter 18 Annotations . 231 18.1 Vendor-Specific Annotations . 231 18.2 Annotations for Documenta
22、tion . 231 18.3 Annotations for Code Generation . 232 18.4 Annotations for Simulation Experiments . 234 18.5 Annotation for single use of class . 234 18.6 Annotations for Graphical Objects . 235 18.7 Annotations for the Graphical User Interface . 244 18.8 Annotations for Version Handling . 248 18.9
23、Annotations for Access Control to Protect Intellectual Property . 252 18.10 Annotations for Functions . 256 18.11 Annotation Choices for Modifications and Redeclarations . 256 18.12 Annotation for External Libraries and Include Files . 256 Chapter 19 Unit Expressions . 257 19.1 The Syntax of Unit Ex
24、pressions . 257 19.2 Examples . 258 Chapter 20 The Modelica Standard Library . 259 Appendix A Glossary. 261 Appendix B Modelica Concrete Syntax . 265 Appendix C Modelica DAE Representation . 272 Appendix D Derivation of Stream Equations . 274 Appendix E Modelica Revision History . 279 Appendix F Lit
25、erature . 305 Index . 306 7 Preface Modelica is a freely available, object-oriented language for modeling of large, complex, and heterogeneous physical systems. From a users point of view, models are described by schematics, also called object diagrams. Examples are shown in the next figure: A schem
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
50 文币 0人已下载
下载 | 加入VIP,免费下载 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ModelicaSpec34modelica 规范 3.4