Skip to content

Commit

Permalink
Fix white-space errors in recently introduced example on derivative
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Mar 1, 2021
1 parent 41ecf17 commit 6e38b97
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1188,22 +1188,22 @@ \subsection{Using the Derivative Annotation}\label{using-the-derivative-annotati
The function value, \lstinline!x1!, should up to numerical precision match the integral of the derivative, \lstinline!x2!.
Note that in practice tools may over-optimize this.
\begin{lstlisting}[language=modelica]
function f
input Real x;
output Real y;
annotation(derivative=fder);
external "C";
end f;
model M
input Real u;
Real x1 "Directly from function";
Real x2 "Integrated from derivative";
equation
x1 = f(u);
der(x2) = der(x1);
initial equation
x2=x1;
end M;
function f
input Real x;
output Real y;
annotation(derivative=fder);
external "C";
end f;
model M
input Real u;
Real x1 "Directly from function";
Real x2 "Integrated from derivative";
equation
x1 = f(u);
der(x2) = der(x1);
initial equation
x2 = x1;
end M;
\end{lstlisting}
\end{nonnormative}

Expand Down

0 comments on commit 6e38b97

Please sign in to comment.