Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /trunk/math/derivs.tex
ViewVC logotype

View of /trunk/math/derivs.tex

Parent Directory Parent Directory | Revision Log Revision Log

Revision 10 - (download) (as text) (annotate)
Sun Jan 10 19:42:44 2010 UTC (10 years, 9 months ago) by glk
File size: 3298 byte(s)
some initial thoughts on math


\newcommand{\ie}{{\em i.e.}}


\title{Math for Diderot}

In the following, 
\item $\bx$ is a vector (an element of some vector space $W$)
\item $\alpha$ is a constant scalar
\item $f$ and $g$ are scalar functions of $W$
\item $\mathbf{u} \otimes \mathbf{v}$ is tensor product of two vectors,
computed as the outer product of their vectors of coefficients in
some basis.
\item $\nabla f$ is a the gradient (first derivative) of $f$,
computed in 3-D as:
\nabla f = \begin{bmatrix}
\frac{\partial}{\partial x} \\
\frac{\partial}{\partial y} \\
\frac{\partial}{\partial z}
\end{bmatrix} f
= \begin{bmatrix}
\frac{\partial f}{\partial x} \\
\frac{\partial f}{\partial y} \\
\frac{\partial f}{\partial z}
where $x$, $y$, $z$ are the coordinates in $W$ (\ie{} some basis
is assumed).  The formulae below don't assume a particular dimension.
Note that $\nabla$ can also be used to define divergence and curl
of vector fields, but for the time being these are not Diderot's concern.
\item $\bH f = \nabla \otimes \nabla f$ is the Hessian (second derivative)
of $f$, computed in 3-D as:
\bH f = \begin{bmatrix}
\frac{\partial}{\partial x} \\
\frac{\partial}{\partial y} \\
\frac{\partial}{\partial z}
\end{bmatrix} \begin{bmatrix}
\frac{\partial}{\partial x} &
\frac{\partial}{\partial y} &
\frac{\partial}{\partial z}
\end{bmatrix} f
= \begin{bmatrix}
\frac{\partial^2 f}{\partial x_1^2} & \frac{\partial^2 f}{\partial x_1 \partial x_2} & \frac{\partial^2 f}{\partial x_1 \partial x_3} \\
\frac{\partial^2 f}{\partial x_1 \partial x_2} & \frac{\partial^2 f}{\partial x_2^2} & \frac{\partial^2 f}{\partial x_2 \partial x_3} \\
\frac{\partial^2 f}{\partial x_1 \partial x_3} & \frac{\partial^2 f}{\partial x_2 \partial x_3} & \frac{\partial^2 f}{\partial x_3^2} 

Basic rules for the gradient:
\nabla (f +  g) &= \nabla f + \nabla g \\
\nabla (f g) &= f \nabla g + g \nabla f \label{eq:grad-prod} \\
\nabla (\alpha f) &= \alpha \nabla f \label{eq:grad-scale} \\
\nabla (f^n) &= n f^{n-1} \nabla f \label{eq:grad-pow} \\
\nabla \left(\frac{f}{g}\right) 
          &= \frac{\nabla f}{g} - \frac{f \nabla g}{g^2} \label{eq:grad-frac} \\

(\ref{eq:grad-scale}) follows from (\ref{eq:grad-prod}) with $\nabla
\alpha = 0$. (\ref{eq:grad-frac}) follows from (\ref{eq:grad-pow}).

Basic rules for the Hessian:
\bH (f +  g) &= \bH f + \bH g \\
\bH (\alpha f) &= \alpha \bH f \\
\bH (f g) &= f \bH g + \nabla f \otimes \nabla g + \nabla g \otimes \nabla f + g \bH f \\
\bH \left(\frac{f}{g}\right) &=
   \frac{\bH f}{g} 
 - \frac{\nabla f \otimes \nabla g + \nabla g \otimes \nabla f + f \bH g}{g^2} 
 + \frac{2 f \nabla g \otimes \nabla g}{g^3} \label{eq:hess-quot} \\
\bH (f^n) &= n f^{n-2} \left( (n-1) \nabla f \otimes \nabla f + f \bH f \right) \label{eq:hess-pow}

All of these can actually be derived with $\bH f = \nabla \otimes \nabla f$
and the rules above.  Someone may want to doublecheck (\ref{eq:hess-quot}).


ViewVC Help
Powered by ViewVC 1.0.0