Skip to content

Derivative in left-hand-side#3838

Open
HansOlsson wants to merge 3 commits intomodelica:masterfrom
HansOlsson:DerLhs
Open

Derivative in left-hand-side#3838
HansOlsson wants to merge 3 commits intomodelica:masterfrom
HansOlsson:DerLhs

Conversation

@HansOlsson
Copy link
Copy Markdown
Collaborator

As previously discussed.
Closes #3764

@HansOlsson HansOlsson added this to the 2026-March milestone Mar 4, 2026
@HansOlsson HansOlsson requested a review from henrikt-ma March 12, 2026 13:11
@HansOlsson HansOlsson modified the milestones: 2026-March, 2026-April Mar 26, 2026
Comment on lines +94 to +97
The right-hand side of the \lstinline!:=! is evaluated, and the resulting value is stored into the left-hand side variable or derivative.

The \lstinline[language=grammar]!expression! is evaluated.
The resulting value is stored into the variable denoted by \lstinline[language=grammar]!component-reference!.
The resulting value is stored into the variable denoted by \lstinline[language=grammar]!component-reference! (or as its derivative).
An assignment to a derivative may only occur in a model or block.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are repeating ourselves too much regarding the storage of the result. Also, the paragraph break in the middle is strange. This is avoided with this good old suggestion:

Suggested change
The right-hand side of the \lstinline!:=! is evaluated, and the resulting value is stored into the left-hand side variable or derivative.
The \lstinline[language=grammar]!expression! is evaluated.
The resulting value is stored into the variable denoted by \lstinline[language=grammar]!component-reference!.
The resulting value is stored into the variable denoted by \lstinline[language=grammar]!component-reference! (or as its derivative).
An assignment to a derivative may only occur in a model or block.
(The restriction that \lstinline!der! is not allowed inside \lstinline!function! classes also applies to assignments.)
The right-hand side of the \lstinline!:=! is evaluated, and the resulting value is stored into the left-hand side variable or derivative.

Copy link
Copy Markdown
Collaborator

@henrikt-ma henrikt-ma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to address repeated explanation and strange paragraph break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect definition of statement within the Modelica grammar

2 participants