Skip to content

Commit

Permalink
Update chapters/operatorsandexpressions.tex
Browse files Browse the repository at this point in the history
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
  • Loading branch information
HansOlsson and henrikt-ma committed Aug 30, 2022
1 parent 3a94659 commit 11567f5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions chapters/operatorsandexpressions.tex
Expand Up @@ -434,9 +434,12 @@ \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}
The reason this does not generate events is that in many cases that would introduce more problems than the event would solve.
A typical case is a flow equation of the form \lstinline!abs(x)*x=y!.
If we have to solve for \lstinline!x! and had events for \lstinline!abs(x)! we would not find a solution if \lstinline!y! passes through zero.
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.

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.

In inverted form this equation is \lstinline!x=sign(y)*sqrt(abs(y))!, with similar issues.
\end{nonnormative}
Expand Down

0 comments on commit 11567f5

Please sign in to comment.