Deriving the gravity gradient
The gravity gradient appears in a few different places throughout science & engineering, but the place I’ve run across it the most is always related to covariance analysis for inertial navigation systems. As the name suggests, it helps define how gravity is changing; in the context of work on covariance analysis, it helps us define how gravity is changing between the modeled state and the true state. When studying inertial navigation systems we’re really trying to figure out how far the trajectory the system thinks it’s flying it is from reality. Put another way, we’re trying to quantify how far the trajectory can deviate from the “nominal” trajectory and this tool – the so-called ``gravity gradient’’ – is a means to help us determine how much gravity is changing between the nominal position and the potential, realized position.
Gravity is an incredibly complicated phenomenon. The study of how to model gravity to the highest accuracy possible is far beyond the scope of a quick post like this. As we’re focused on forming a linear covariance model, we can take a simplified view of gravity that is only first-order accurate.
The simplified gravity equation that we’ll use models gravity as spherical distance to a point-mass.
\[\begin{equation}\tag{1}
\label{eq:gravity-equation}
g(r) = - \frac{\mu}{\Vert r \Vert^3}r
\end{equation}\]
where \(g(r)\) is the gravitational acceleration vector, expressed in inertial coordinates, and defined by the two-body gravity (or point-mass) model, \(r = (x, y, z)\) represents a standard Cartesian 3-dimensional coordinate position vector, and \(\mu\) represents the gravitational constant of the planetary body (or any significantly larger mass). Please note that lower case letters represent vector values, upper case letters represent matrix values, and greek letters represent scalar values.
We’re trying to find the gradient of gravity with respect to position; i.e. finding a closed form expression for how the spherical gravity function changes with respect to position. Common expressions for this include \(\frac{\partial a_g(r)}{\partial r}\) and \(\nabla_r g(r)\). An explanation of why spherical is commonly used in inertial navigation systems is given in and .
One form of the gradient of gravity with respect to position is
\[\begin{equation}\tag{2} \label{eq:gravity-gradient-3} \nabla_r g(r) = \frac{\mu}{\Vert r \Vert^5}\left( {\begin{array}{ccc} 2x^2 - y^2 - z^2 & 3xy & 3xz \\ 3xy & 2y^2 - x^2 - z^2 & 3y z \\ 3xz & 3yz & 2z^2 - y^2 - x^2 \end{array} }\right) \end{equation}\]
which is equivalent to Eq. (4.64) in :
\[\begin{equation}\tag{3} \label{eq:gravity-gradient-1} \nabla_r g(r) = \frac{-\mu}{\Vert r \Vert^3}\left( I_{3\times 3} - 3 uu^T\right) \end{equation}\]
where \(u\) is the unit vector, \(u = r/\Vert r \Vert\). A third equivalent expression is:
\[\begin{equation}\tag{4} \label{eq:gravity-gradient-2} \nabla_r g(r) = -\mu\left( \frac{I_{3\times 3}}{\Vert r \Vert^3} - \frac{3 rr^T}{\Vert r \Vert^5}\right) \end{equation}\]
We will show how to derive the first gradient expression and how the three gradient expressions are derived as well. This will be accomplished by first deriving Eq. (2), then showing the derivation from Eq. (2) to Eq. (4) and then finally showing the derivation from Eq. (4) to Eq. (3).
Observe that we are taking the gradient of a three component vector with respect to a three component vector. Thus yielding a 3x3 matrix in the form of
\[\begin{equation}\tag{5} \nabla_r g(r) = \left( {\begin{array}{ccc} \frac{\partial g_x(r)}{\partial x} & \frac{\partial g_x(r)}{\partial y} & \frac{\partial g_x(r)}{\partial z} \\ \frac{\partial g_y(r)}{\partial x} & \frac{\partial g_y(r)}{\partial y} & \frac{\partial g_y(r)}{\partial z} \\ \frac{\partial g_z(r)}{\partial x} & \frac{\partial g_z(r)}{\partial y} & \frac{\partial g_z(r)}{\partial z} \end{array} }\right) \end{equation}\]
Where each row is dictated by the three equations: \[\begin{align*} g_x(r) = \frac{-\mu}{\Vert r \Vert^3}x = \frac{-\mu}{(\sqrt{x^2 + y^2 + z^2})^3}x && g_y(r) = \frac{-\mu}{\Vert r \Vert^3}y = \frac{-\mu}{(\sqrt{x^2 + y^2 + z^2})^3}y \end{align*}\] \[\begin{equation*} g_z(r) = \frac{-\mu}{\Vert r \Vert^3}z = \frac{-\mu}{(\sqrt{x^2 + y^2 + z^2})^3}z \end{equation*}\]
For taking the partial derivative of each equation, notice we need the product rule and chain rule:
\[\begin{equation*} \begin{split} \frac{\partial g_x(r)}{\partial x}&=\frac{-\mu}{(\sqrt{x^2 + y^2 + z^2})^3} + \frac{-\mu x (-\frac{3}{2}) (2x)}{(\sqrt{x^2 + y^2 + z^2})^5} \\ &=\frac{-\mu(\sqrt{x^2 + y^2 + z^2})^2}{(\sqrt{x^2 + y^2 + z^2})^5} + \frac{3\mu x^2}{(\sqrt{x^2 + y^2 + z^2})^5}\\ &=\frac{\mu (2x^2 - y^2 - z^2)}{(\sqrt{x^2 + y^2 + z^2})^5} = \frac{\mu}{\Vert r \Vert^5}(2x^2 - y^2 - z^2) \end{split} \end{equation*}\] Similarly \[\begin{align*} \frac{\partial g_y(r)}{\partial y} = \frac{\mu}{\Vert r \Vert^5}(2y^2 - x^2 - z^2) && \frac{\partial g_z(r)}{\partial z} = \frac{\mu}{\Vert r \Vert^5}(2z^2 - y^2 - x^2) \end{align*}\] The remaining partial derivatives are much simpler. Observe: \[\begin{equation*} \begin{split} \frac{\partial g_x(r)}{\partial y} &= \frac{-\mu x (-\frac{3}{2}) (2y)}{(\sqrt{x^2 + y^2 + z^2})^5} \\ &=\frac{\mu}{\Vert r \Vert^5}(3xy) \end{split} \end{equation*}\] Thus similarly \[\begin{align*} \frac{\partial g_x(r)}{\partial z} &=\frac{\mu}{\Vert r \Vert^5}(3xz) & \frac{\partial g_y(r)}{\partial x} &=\frac{\mu}{\Vert r \Vert^5}(3xy) & \frac{\partial g_y(r)}{\partial z} =\frac{\mu}{\Vert r \Vert^5}(3yz)\\ \frac{\partial g_z(r)}{\partial x} &=\frac{\mu}{\Vert r \Vert^5}(3xz) & \frac{\partial g_z(r)}{\partial y} &=\frac{\mu}{\Vert r \Vert^5}(3yz)\\ \end{align*}\] Now we fill in each entry of Eq. (5) to get Eq. (2) \[\begin{equation*} \nabla_r g(r) = \frac{\mu}{\Vert r \Vert^5}\left( {\begin{array}{ccc} 2x^2 - y^2 - z^2 & 3xy & 3xz \\ 3xy & 2y^2 - x^2 - z^2 & 3y z \\ 3xz & 3yz & 2z^2 - y^2 - x^2 \end{array} }\right) \end{equation*}\] From here we can factor out a negative and distribute \(1/\Vert r \Vert^5\) into each entry to get: \[\begin{equation} \begin{split} \nabla_r g(r) &= -\mu\left( {\begin{array}{ccc} \frac{-2x^2 + y^2 + z^2}{{\Vert r \Vert^5}} & \frac{-3xy}{{\Vert r \Vert^5}} & \frac{-3xz}{{\Vert r \Vert^5}} \\ \frac{-3xy}{{\Vert r \Vert^5}} & \frac{-2y^2 + x^2 + z^2}{{\Vert r \Vert^5}} & \frac{-3y z}{{\Vert r \Vert^5}} \\ \frac{-3xz}{{\Vert r \Vert^5}} & \frac{-3yz}{{\Vert r \Vert^5}} & \frac{-2z^2 + y^2 + x^2}{{\Vert r \Vert^5}} \end{array} }\right)\\ &= -\mu\left( {\begin{array}{ccc} \frac{-2x^2 + y^2 + z^2}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{-3xy}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{-3xz}{(\sqrt{x^2 + y^2 + z^2})^5} \\ \frac{-3xy}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{-2y^2 + x^2 + z^2}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{-3y z}{(\sqrt{x^2 + y^2 + z^2})^5} \\ \frac{-3xz}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{-3yz}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{-2z^2 + y^2 + x^2}{(\sqrt{x^2 + y^2 + z^2})^5} \end{array} }\right)\\ &= -\mu\left( {\begin{array}{ccc} \frac{(\sqrt{x^2 + y^2 + z^2})^2 - 3x^2}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{0-3xy}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{0-3xz}{(\sqrt{x^2 + y^2 + z^2})^5} \\ \frac{0-3xy}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{(\sqrt{x^2 + y^2 + z^2})^2 - 3y^2}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{0-3yz}{(\sqrt{x^2 + y^2 + z^2})^5} \\ \frac{0-3xz}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{0-3yz}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{(\sqrt{x^2 + y^2 + z^2})^2 - 3z^2}{(\sqrt{x^2 + y^2 + z^2})^5} \end{array} }\right)\\ &= -\mu\left( {\begin{array}{ccc} \frac{1}{(\sqrt{x^2 + y^2 + z^2})^3} - \frac{3x^2}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{0}{(\sqrt{x^2 + y^2 + z^2})^3} - \frac{3xy}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{0}{(\sqrt{x^2 + y^2 + z^2})^3} - \frac{3xz}{(\sqrt{x^2 + y^2 + z^2})^5} \\ \frac{0}{(\sqrt{x^2 + y^2 + z^2})^3} - \frac{3xy}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{1}{(\sqrt{x^2 + y^2 + z^2})^3} - \frac{3y^2}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{0}{(\sqrt{x^2 + y^2 + z^2})^3} - \frac{3yz}{(\sqrt{x^2 + y^2 + z^2})^5} \\ \frac{0}{(\sqrt{x^2 + y^2 + z^2})^3} - \frac{3xz}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{0}{(\sqrt{x^2 + y^2 + z^2})^3} - \frac{3yz}{(\sqrt{x^2 + y^2 + z^2})^5} & \frac{1}{(\sqrt{x^2 + y^2 + z^2})^3} - \frac{3z^2}{(\sqrt{x^2 + y^2 + z^2})^5} \end{array} }\right)\\ &= -\mu\left( {\begin{array}{ccc} \frac{1}{\Vert r \Vert^3} - \frac{3x^2}{\Vert r \Vert^5} & \frac{0}{\Vert r \Vert^3} - \frac{3xy}{\Vert r \Vert^5} & \frac{0}{\Vert r \Vert^3} - \frac{3xz}{\Vert r \Vert^5} \\ \frac{0}{\Vert r \Vert^3} - \frac{3xy}{\Vert r \Vert^5} & \frac{1}{\Vert r \Vert^3} - \frac{3y^2}{\Vert r \Vert^5} & \frac{0}{\Vert r \Vert^3} - \frac{3yz}{\Vert r \Vert^5} \\ \frac{0}{\Vert r \Vert^3} - \frac{3xz}{\Vert r \Vert^5} & \frac{0}{\Vert r \Vert^3} - \frac{3yz}{\Vert r \Vert^5} & \frac{1}{\Vert r \Vert^3} - \frac{3z^2}{\Vert r \Vert^5} \end{array} }\right)\\ &= -\mu \left[ \frac{1}{\Vert r \Vert^3} \left( {\begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array}}\right) - \frac{3}{\Vert r \Vert^5} \left( {\begin{array}{ccc} x^2 & xy & xz \\ yx & y^2 & yz \\ zx & zy & z^2 \end{array}}\right)\right]\\ &= -\mu\left( \frac{I_{3\times 3}}{\Vert r \Vert^3} - \frac{3 rr^T}{\Vert r \Vert^5}\right) \end{split} \end{equation}\] This is exactly Eq. (4) \[\begin{equation} \nabla_r g(r) = -\mu\left( \frac{I_{3\times 3}}{\Vert r \Vert^3} - \frac{3 rr^T}{\Vert r \Vert^5}\right) \end{equation}\] Now finally we can factor out \(1/\Vert r \Vert^3\) to get \[\begin{equation} \begin{split} \nabla_r g(r) &= \frac{-\mu}{\Vert r \Vert^3}\left( I_{3\times 3} - 3 \frac{rr^T}{(\Vert r \Vert)(\Vert r \Vert)}\right)\\ &= \frac{-\mu}{\Vert r \Vert^3}\left( I_{3\times 3} - 3 uu^T\right) \end{split} \end{equation}\] So thus we reach the desired goal of Eq. (3) \[\begin{equation} \nabla_r g(r) = \frac{-\mu}{\Vert r \Vert^3}\left( I_{3\times 3} - 3 uu^T\right) \end{equation}\]