Skip to content

Commit

Permalink
Change so that we don't say that there are always discontinuities, an…
Browse files Browse the repository at this point in the history
…d explain for example.
  • Loading branch information
HansOlsson committed Aug 30, 2022
1 parent 2abb214 commit ab15ebf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion chapters/operatorsandexpressions.tex
Expand Up @@ -434,12 +434,13 @@ \subsection{Numeric Functions and Conversion Functions}\label{numeric-functions-
Argument $v$ needs to be an \lstinline!Integer! or \lstinline!Real! expression.
\end{semantics}
\begin{nonnormative}
By not generating events the property \lstinline!abs($x$)! $\geq 0$ for all $x$ is ensured at the cost of having a derivative that changes discontinuously between events.
By not generating events the property \lstinline!abs($x$)! $\geq 0$ for all $x$ is ensured at the cost of sometimes having a derivative that changes discontinuously between events.

A typical case requiring the event-free semantics is a flow equation of the form \lstinline!abs(x) * x = y!.
With event generation, the equation would switch between the two forms \lstinline!x^2 = y! and \lstinline!-x^2 = y! at the events, where the events would not be coinciding exactly with the sign changes of \lstinline!y!.
When \lstinline!y! passes through zero, neither form of the equation would have a solution in an open neighborhood of \lstinline!y! $= 0$, and hence solving the equation would have to fail at some point sufficiently close to \lstinline!y! $= 0$.
Without event generation, on the other hand, the equation can be solved easily for \lstinline!x!, also as \lstlinline!y! passes through zero.
Note that without event generation the derivative of \lstinline!abs(x) * x! never changes discontinuously, despite \lstinline!abs(x)! having a discontinuous derivative.

In inverted form this equation is \lstinline!x = sign(y) * sqrt(abs(y))!.
With event generation, the call to \lstinline!sqrt! would fail when applied to a negative number during root finding of the zero crossing for \lstinline!abs(y)!, compare \cref{events-and-synchronization}.
Expand Down

0 comments on commit ab15ebf

Please sign in to comment.