Skip to content

Conversation

henrikt-ma
Copy link
Collaborator

Fixes #3751.

@henrikt-ma henrikt-ma requested a review from HansOlsson October 15, 2025 07:49
@henrikt-ma
Copy link
Collaborator Author

Since this PR is probably getting more attention than the issue, I'll repeat the question in the issue here:

What is or when the controller is switched on supposed to mean?

As this is also related to the specification of the first clock tick, perhaps we could also address it in this PR?

@HansOlsson
Copy link
Collaborator

Since this PR is probably getting more attention than the issue, I'll repeat the question in the issue here:

What is or when the controller is switched on supposed to mean?

I don't know.

Just thinking in general it could either be that one for some reason consider generating a controller from the model, so it is similar but using different words to indicate that it isn't "a simulation" but an actual system, or it could a controller inside a state machine.

  • I don't see a reason to have some special text for the first case, and to it seems to be incompletely done.
  • I haven't figured out if the second case is actually meaningful, as state machines are (currently) clocked so I don't see how the controller Clock would be decoupled from the other clocks.

The incomplete part is that it says:

"The clock starts at the start of the simulation tstart or when the controller is switched on. At the start of the simulation, previous(intervalCounter) = intervalCounter.start and the clocks ticks the first time."

but it doesn't say what "previous(intervalCounter)" is when the controller is switched on. If we assume "controller is switched on" is the same as "start of the simulation" it's just a bit confusing, but otherwise it is just unclear.

So, my conclusion is that it likely is just a special case "start of the simulation" and it is best to remove it.

\item For an event clock the additional \lstinline!startInterval! argument to the event clock constructor is returned.
\end{enumerate}
\begin{itemize}
\item For a rational interval clock (\cref{modelica:clock-rational}): \lstinline!previous($\mathit{intervalCounter}$)!
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
\item For a rational interval clock (\cref{modelica:clock-rational}): \lstinline!previous($\mathit{intervalCounter}$)!
\item For a rational interval clock (\cref{modelica:clock-rational}): \lstinline!previous($\mathit{intervalCounter}$)/resolution!

It was missing before, but when we add it, then it must be correct.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, but with proper formatting. OK?

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.

Why talk about previous(intervalCounter) when defining rational interval clock?

2 participants