Skip to content

Commit

Permalink
Rename derivative
Browse files Browse the repository at this point in the history
  • Loading branch information
HansOlsson committed Feb 22, 2021
1 parent fc0ce17 commit 3ce6e0f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1451,27 +1451,27 @@ \subsection{Using the Derivative Annotation}\label{using-the-derivative-annotati
output Real z;
algorithm
$\ldots$
annotation(derivative(noDerivative = y) = f_der);
annotation(derivative(noDerivative = y) = h);
end f;

function f_der
function h
input Real x;
input Real y;
input Real x_der;
output Real z_der;
algorithm
$\ldots$
end f_der;
end h;
\end{lstlisting}
This is useful if \lstinline!g! represents the major computational
effort of \lstinline!fg!.

Therefore \lstinline!f_der! indirectly includes the derivative with respect to \lstinline!y! as follows:
Therefore \lstinline!h! indirectly includes the derivative with respect to \lstinline!y! as follows:
\begin{eqnarray*}
\frac{d}{dt}fg(x(t))&=&\frac{d}{dt}f(x(t),g(x(t)))\\
&=&\frac{\partial f}{\partial x}\frac{dx}{dt}+\frac{\partial f}{\partial y}\frac{\partial g}{\partial x}\frac{dx}{dt}\\
&=&\left(\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{\partial g}{\partial x}\right)\frac{dx}{dt}\\
&=&\textrm{f\_der}(x,y)\frac{dx}{dt}
&=&h(x,y)\frac{dx}{dt}
\end{eqnarray*}
\end{nonnormative}

Expand Down

0 comments on commit 3ce6e0f

Please sign in to comment.