# Derivatives and Internal Coordinates

Brownian Dynamics has the following equations of motion, where we assume that the geometries $x$ is dependent on the forcefield parameters $\theta$

$x_t = x_{t-1} - k(g(x_{t-1}(\theta), \theta) + noise)$

We can differentiate the above w.r.t. $\theta$

$\dfrac{\partial x_t}{\partial \theta} = \dfrac{\partial x_{t-1}}{\partial \theta} - k( \dfrac{\partial g}{\partial x}(x_{t-1})\dfrac{\partial x_{t-1}}{\partial \theta} + \dfrac{\partial g}{\partial \theta})$

For the purposes of stability analysis and without loss of generality we can assume:

$\dfrac{\partial g}{\partial \theta} = 0$

So we can proceed to simplify into:

$\dfrac{\partial x_t}{\partial \theta} = (I-k \dfrac{\partial g}{\partial x}) \dfrac{\partial x_{t-1}}{\partial \theta}$

It can be shown that this converges if and only if the Hessian $\dfrac{\partial g}{\partial x}$ is PSD and $k$ is sufficiently small.

The issue is that the Hessian is not PSD in standard equations of motion due to “contamination” of the translational and rotational degrees of freedom even for the simplest of systems.

What we’d really like is something that looks like:

$\dfrac{\partial x_t}{\partial \theta} = (I-k P^T \dfrac{\partial g}{\partial x} P) \dfrac{\partial x_{t-1}}{\partial \theta}$

We can back compute the following anti-derivative :

$x_t = x_{t-1} - k P^T (g(P x, \theta) + noise)$

But this is invalid since we’d be modifying the positions in two different reference frames, so how would we modify the equations of motion to give us Hessians are that always PSD?

## Pure internal coordinates

We can trivially implement Brownian dynamics in either Cartesian Coordinates or Internal Coordinates, since the kinetic energy is irrelevant. Suppose we have a two particle harmonic oscillator:

$U(r(x), b) = (r(x)-b)^2$

Where $r$ is the distance between the two particles.

We have two equivalent Brownian equations of motion we can use:

$x_t = x_{t-1} - k(g(x_{t-1}(\theta), \theta) + noise_{cart})$

$r_t = r_{t-1} - k(g(r_{t-1}(\theta), \theta) + noise_{int})$

$noise_{int} = r(noise_{cart})$

They have the following derivatives w.r.t. $\theta$ if we again assume the mixed partial is zero.

$x'_t = x'_{t-1} - k(H_x(x_{t-1})x'_{t-1})$

$r'_t = r'_{t-1} - k(H_r(r_{t-1})r'_{t-1})$

Where $H_x$ is the Hessian with respect to the coordinate system $x$

The same same equations of motion are generated, except the former is divergent if we sample geometries where $r < b$. What?