-
Notifications
You must be signed in to change notification settings - Fork 43
Add variability change for these functions. #3610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HansOlsson
wants to merge
16
commits into
modelica:master
Choose a base branch
from
HansOlsson:DiscreteGenerateEvents
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5878d52
Add variability change for these functions.
HansOlsson 7b49a58
After some thinking I believe this is how we handle multiple outputs.
HansOlsson b760714
Update chapters/operatorsandexpressions.tex
HansOlsson 3acf849
To handle the other case for GenerateEvents-functions.
HansOlsson b1cb03a
Update chapters/operatorsandexpressions.tex
HansOlsson aa0e9ec
Forgot variability for inputs previously.
HansOlsson fb13f66
State that variables in functions being discrete-time is a bit more c…
HansOlsson cefd7a5
Add examples.
HansOlsson 54a38c3
WS
HansOlsson a99f180
Update chapters/operatorsandexpressions.tex
HansOlsson 5a2917e
Update chapters/functions.tex
HansOlsson 983b4cb
Apply suggestions from code review
HansOlsson a096f0a
Apply suggestions from code review
HansOlsson 8cfb20d
Update chapters/operatorsandexpressions.tex
HansOlsson fb125b7
Update chapters/functions.tex
HansOlsson 3fdc125
Update chapters/functions.tex
HansOlsson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -1582,7 +1582,7 @@ \subsection{Evaluable Expressions}\label{evaluable-expressions} | |||||
\item | ||||||
Evaluable parameter variables, see \cref{component-variability}. | ||||||
\item | ||||||
Input variables in functions behave as though they were evaluable expressions. | ||||||
Input variables in functions not having annotation \lstinline!GenerateEvents = true! (\cref{modelica:GenerateEvents}) behave as though they were evaluable expressions. | ||||||
\item | ||||||
Except for the special built-in operators \lstinline!initial!, \lstinline!terminal!, \lstinline!der!, \lstinline!edge!, \lstinline!change!, \lstinline!sample!, and \lstinline!pre!, a function or operator with evaluable subexpressions is an evaluable expression. | ||||||
\item | ||||||
|
@@ -1593,7 +1593,7 @@ \subsection{Evaluable Expressions}\label{evaluable-expressions} | |||||
\item | ||||||
\lstinline!cardinality(c)!, see restrictions for use in \cref{cardinality-deprecated}. | ||||||
\item | ||||||
\lstinline!size(A)! (including \lstinline!size(A, j)! where \lstinline!j! is an evaluable expression) if \lstinline!A! is variable declared in a non-function class. | ||||||
\lstinline!size(A)! (including \lstinline!size(A, j)! where \lstinline!j! is an evaluable expression) if \lstinline!A! is variable declared in a non-function class, or \lstinline!A! is an input in a function having annotation \lstinline!GenerateEvents = true! (\cref{modelica:GenerateEvents}). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Revert change due to #3610 (comment) This may cause a minor problem if functions generating events have arrays (including declaring non-input arrays), but given how event generation is normally handled by inlining them I don't see how we can support such arrays. |
||||||
\item | ||||||
\lstinline!Connections.isRoot(A.R)! | ||||||
\item | ||||||
|
@@ -1644,10 +1644,13 @@ \subsection{Discrete-Time Expressions}\label{discrete-time-expressions} | |||||
Note that \lstinline!rem! and \lstinline!mod! generate events but are not discrete-time expressions. | ||||||
In other words, relations inside \lstinline!noEvent!, such as \lstinline!noEvent(x>1)!, are not discrete-time expressions. | ||||||
\end{nonnormative} | ||||||
\item | ||||||
Unless inside \lstinline!noEvent!: Function calls where the function has annotation \lstinline!GenerateEvents = true! (\cref{modelica:GenerateEvents}), the output does not contain a subtype of \lstinline!Real!, and any non-\lstinline!Real! inputs have discrete-time variability. | ||||||
For a function call returning multiple return values (see \cref{output-formal-parameters-of-functions}) the variability is decided separately for each output. | ||||||
\item | ||||||
The functions \lstinline!pre!, \lstinline!edge!, and \lstinline!change! result in discrete-time expressions. | ||||||
\item | ||||||
Expressions in functions behave as though they were discrete-time expressions. | ||||||
Expressions in functions not having annotation \lstinline!GenerateEvents = true! (\cref{modelica:GenerateEvents}), behave as though they were discrete-time expressions. | ||||||
\end{itemize} | ||||||
|
||||||
Inside an \lstinline!if!-expression, \lstinline!if!-clause, \lstinline!while!-statement or \lstinline!for!-clause, that is controlled by a non-discrete-time (that is continuous-time, but not discrete-time) switching expression and not in the body of a \lstinline!when!-clause, it is not legal to have assignments to discrete-time variables, equations between discrete-time expressions, or real elementary relations/functions that should generate events. | ||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.