Skip to content
Open

Clarify #3786

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ \subsection{Partial Derivatives of Functions}\label{partial-derivatives-of-funct
is the partial derivative of a function, and may only be used as declarations of functions.

The semantics is that a function (and only a function) can be specified in this form, defining that it is the partial derivative of the function to the right of the equal sign (looked up in the same way as a short class definition, and the looked up name must be a function), and partially differentiated with respect to each {\lstinline!IDENT!} in order (starting from the first one).
Each {\lstinline!IDENT!} must be a scalar {\lstinline!Real!} input to the function.
Each {\lstinline!IDENT!} must be a scalar {\lstinline!Real!} input to the function, and mathematically correspond to prepending $\frac{\partial}{\partial\text{\lstinline!IDENT!}}$ to the function call.

The comment allows a user to comment the function (in the info-layer and as one-line description, and as icon).

Expand All @@ -1502,6 +1502,8 @@ \subsection{Partial Derivatives of Functions}\label{partial-derivatives-of-funct
h := Gibbs(p, T) - T * Gibbs_T(p, T);
end specificEnthalpy;
\end{lstlisting}
Thus \lstinline!der(Gibbs, T)! corresponds to $\frac{\partial \text{\lstinline!Gibbs!}}{\partial \text{\lstinline!T!}}=\frac{\partial}{\partial \text{\lstinline!T!}}\text{\lstinline!Gibbs!}$.
For multiple arguments \lstinline!der(Gibbs, T, T, p)! corresponds to $\frac{\partial}{\partial \text{\lstinline!p!}}\frac{\partial}{\partial \text{\lstinline!T!}}\frac{\partial}{\partial \text{\lstinline!T!}}\text{\lstinline!Gibbs!}$.
\end{example}


Expand Down