Skip to content

Commit

Permalink
Merge pull request modelica#3352 from henrikt-ma/empty-unit-string
Browse files Browse the repository at this point in the history
Clarify that unit/displayUnit-attributes can be empty
  • Loading branch information
HansOlsson committed Mar 17, 2023
2 parents 5974df8 + 6b772cd commit a5efd95
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions chapters/annotations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,9 @@ \subsubsection{Axis Properties}\label{axis-properties}

When an axis bound is not provided, the tool computes one automatically.

An empty \lstinline!unit! means that the axis is unitless, and each expression plotted against it may use its own unit determined by the tool. The tool is responsible for conveying the information
about choice of unit for the different variables, for instance by attaching this information to curve legends.
A non-empty \lstinline!unit! shall match \lstinline[language=grammar]!unit-expression! in \cref{unit-expressions}.
An empty \lstinline!unit! means that the axis is unitless, and each expression plotted against it may use its own unit determined by the tool.
The tool is responsible for conveying the information about choice of unit for the different variables, for instance by attaching this information to curve legends.

The Modelica tool is responsible for showing that values at the axis tick marks are expressed in \lstinline!unit!, so the axis \lstinline!label! shall not contain this information.

Expand Down
5 changes: 5 additions & 0 deletions chapters/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,11 @@ \subsection{Real Type}\label{real-type}
\index{unbounded@\robustinline{unbounded}!attribute of \robustinline{Real}}%
\index{stateSelect@\robustinline{stateSelect}!attribute of \robustinline{Real}}

The \lstinline!unit! and \lstinline!displayUnit! attributes may be either the empty string or a string matching \lstinline[language=grammar]!unit-expression! in \cref{unit-expressions}.
The meaning of the empty string depends on the context.
For the input and output components of a function, the empty string allows different units to be used in different calls to the function.
For a non-function component, the empty string allows the unit (or display unit) to be inferred by the tool.

The \lstinline!nominal! attribute is meant to be used for scaling purposes and to
define tolerances in relative terms, see \cref{attributes-start-fixed-nominal-and-unbounded}.

Expand Down
2 changes: 1 addition & 1 deletion chapters/unitexpressions.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
\chapter{Unit Expressions}\label{unit-expressions}

Unless otherwise stated, the syntax and semantics of unit expressions in Modelica conform with the international standards \emph{International System of Units (SI)} by BIPM superseding parts of ISO 31/0-1992 \emph{General principles concerning quantities, units and symbols} and ISO 1000-1992 \emph{SI units and recommendations for the use of their multiples and of certain other units}.
Unless otherwise stated, the syntax and semantics of unit expressions in Modelica (for example, \cref{real-type} or \cref{axis-properties}) conform with the international standards \emph{International System of Units (SI)} by BIPM superseding parts of ISO 31/0-1992 \emph{General principles concerning quantities, units and symbols} and ISO 1000-1992 \emph{SI units and recommendations for the use of their multiples and of certain other units}.
Unfortunately, these standards do not define a formal syntax for unit expressions.
There are recommendations and Modelica exploits them.

Expand Down

0 comments on commit a5efd95

Please sign in to comment.