Skip to content

Commit

Permalink
Specify noDerivative and zeroDerivative.
Browse files Browse the repository at this point in the history
Closes #2840
(And using those formulas, but reworked based on the examples.)
  • Loading branch information
HansOlsson committed Feb 19, 2021
1 parent c668500 commit 4ee257b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,12 @@ \subsection{Using the Derivative Annotation}\label{using-the-derivative-annotati
//annotation(derivative(order=2) = f_general_der2);
end f_general_der;
\end{lstlisting}
In the example above \lstinline!zeroDerivative=y! imply that
\begin{eqnarray*}
\frac{d}{dt}f(x(t),y(t))&=&\frac{\partial f}{\partial x}\frac{dx}{dt}+\frac{\partial f}{\partial y}\frac{dy}{dt}\\
&=&\frac{\partial f}{\partial x}\frac{dx}{dt}+\frac{\partial f}{\partial y}\cdot 0\\
&=&\frac{\partial f}{\partial x}\frac{dx}{dt}
\end{eqnarray*}
\end{nonnormative}

\begin{itemize}
Expand Down Expand Up @@ -1459,6 +1465,13 @@ \subsection{Using the Derivative Annotation}\label{using-the-derivative-annotati
\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:
\begin{eqnarray*}
\frac{d}{dt}fg(x(t))&=&\frac{\partial f}{\partial x}\frac{dx}{dt}+\frac{\partial f}{\partial y}\frac{\partial g}{\partial x}\frac{dx}{dt}\\
&=&(\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{\partial g}{\partial x})\frac{dx}{dt}\\
&=&\textrm{f\_der}(x,y)\frac{dx}{dt}
\end{eqnarray*}
\end{nonnormative}

\subsection{Partial Derivatives of Functions}\label{partial-derivatives-of-functions}
Expand Down

0 comments on commit 4ee257b

Please sign in to comment.