Abstract
While writing equations (i.e., equating two expressions) is sufficient for most modeling, there are cases where a procedural or algorithmic approach, involving explicit assignment, is necessary. To address this need, Modelica includes support for algorithmic functions. While a function in Modelica is like a block because all quantities must be explicitly labeled as either input or output, it is different from a block or model because it is not connected to other components. Instead, it is invoked during the evaluation of expressions. Another difference between a function and a block or model is that a function is not allowed to have any persistent internal state. As a result, there are several restrictions on the statements which can appear within a function (e.g., the der operator cannot appear within a function).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer Science+Business Media New York
About this chapter
Cite this chapter
Tiller, M. (2001). Functions. In: Introduction to Physical Modeling with Modelica. The Springer International Series in Engineering and Computer Science, vol 615. Springer, Boston, MA. https://doi.org/10.1007/978-1-4615-1561-6_5
Download citation
DOI: https://doi.org/10.1007/978-1-4615-1561-6_5
Publisher Name: Springer, Boston, MA
Print ISBN: 978-1-4613-5615-8
Online ISBN: 978-1-4615-1561-6
eBook Packages: Springer Book Archive