# Molecular Simulation/Rotational Averaging
## Rotational Averaging

Rotational averaging describes the contribution to the potential energy from the rotational orientation of a charge-dipole interaction. Expectation values are utilized to give a single optimal value for the system's potential energy due to rotation.
For example, take a charged particle and a molecule with a permanent dipole. When they interact, the potential energy of this interaction can easily be calculated. For a dipole of length $l$, with a radius of $r$ between the dipole centre and the charged particle, the energy of interaction can be described by:
    Potential Energy of a Charge Dipole Interaction ${\mathcal {V}}(r,\theta )=-{\frac {q_{ion}\mu \cos {\theta }}{4\pi \epsilon _{0}\ r^{2}}}$
where $q$ is the charge of the particle, $\mu$ is the dipole moment, $\theta$ is the angle between $r$ and the dipole vector, $\epsilon _{0}$ is the vacuum permittivity constant, and $r$ is the radius between the particle and dipole.
Geometrically, this interaction is dependant on the radius and the length of dipole, as well as the orientation angle. If the radius $r$ between the ion and dipole is taken to be a fixed value, the angle $\theta$ still has the ability to change. This varied orientation of $\theta$ results in rotation of the dipole about its center, relative to the interacting charged particle. The weights of various orientations are described by a Boltzmann distribution expectation value, described generally by:
    Expectation value (discrete states) $\langle M\rangle ={\frac {\sum _{i}M_{i}\exp \left({\frac {-{\mathcal {V}}_{i}}{k_{B}{\text{T}}}}\right)}{\sum _{i}\exp \left({\frac {-{\mathcal {V}}_{i}}{k_{B}{\text{T}}}}\right)}}$
    Expectation value (continuous states) $\langle M\rangle ={\frac {\int M(r)\exp \left({\frac {-{\mathcal {V}}(r)}{k_{B}T}}\right){\textrm {d}}r}{\int \exp \left({\frac {-{\mathcal {V}}(r)}{k_{B}T}}\right){\textrm {d}}r}}$
where $\langle M\rangle$ is the expectation value, ${\mathcal {V}}$ is the energy value for a particular configuration, $k_{B}$ is Boltzmann's constant, and T is temperature. This Boltzmann-described weighting is the sum over the quantum mechanical energy levels of the system. Therefore, the probability $P$ is directly proportional to $\exp \left({\frac {-{\mathcal {V}}}{k_{B}{\text{T}}}}\right)$, indicating that at a specific temperature lower energy configurations are more probable. An equation can then be derived from this general expression, in order to relate it to the geometry and energy of a charge-dipole interaction.

## Derivation of Rotationally-Averaged Charge-Dipole Interaction Potential

The orientationally averaged potential energy is the expectation value of the charge-dipole potential energy averaged over $\theta$
Starting with the potential energy of a charge-dipole interaction
    ${\mathcal {V}}(r,\theta )=-{\frac {q_{ion}\mu \cos \theta }{4\pi \epsilon _{0}r^{2}}}$
We let $C=-{\frac {q_{ion}\mu }{4\pi \epsilon _{0}r^{2}}}$
This makes ${\mathcal {V}}(r,\theta )=-{\frac {q_{ion}\mu \cos \theta }{4\pi \epsilon _{0}r^{2}}}=C\cos \theta$
The average over the dipole orientation using the expectation value in classical statistical mechanics is:
    $\langle {\mathcal {V}}\left(r\right)\rangle ={\frac {\int _{0}^{\pi }C\cos \theta \exp \left({\frac {-C\cos \theta }{k_{B}T}}\right)\sin \theta {\textrm {d}}\theta }{\int _{0}^{\pi }\exp \left({\frac {-C\cos \theta }{k_{B}T}}\right)\sin \theta {\textrm {d}}\theta }}$
Note: When integrating over an angle, the variable of integration becomes $\sin \theta {\textrm {d}}\theta$
To solve this integral we must first use first order Taylor's series approximation because integrals of exponential of $\cos \theta$ do not have analytical solutions.
    $\int \exp \left({\frac {-C\cos \theta }{k_{B}T}}\right){\textrm {d}}\theta$
The first order Taylor's series approximations is as follows:
    $f(x)\approx f(0)+x\cdot f'(0)$
    $\exp(-x)\approx \exp(-0)-x\cdot \exp(-0)$
    $\exp(-x)\approx 1-x$
Using the Taylor series with $\int \exp \left({\frac {-C\cos \theta }{k_{B}T}}\right){\textrm {d}}\theta$ gives: $\exp \left({\frac {C\cos \theta }{k_{B}T}}\right)\approx 1-{\frac {C\cos \theta }{k_{B}T}}$
The integral now becomes:
    $\langle {\mathcal {V}}\left(r\right)\rangle ={\frac {\int _{0}^{\pi }C\cos \theta \left[1-{\frac {C\cos \theta }{k_{B}T}}\right]\sin \theta {\textrm {d}}\theta }{\int _{0}^{\pi }\left[1-{\frac {C\cos \theta }{k_{B}T}}\right]\sin \theta {\textrm {d}}\theta }}$
Multiplying into the brackets will give:
    $\langle {\mathcal {V}}\rangle ={\frac {\int _{0}^{\pi }C\cos \theta \sin \theta -C\cos \theta \sin \theta {\frac {C\cos \theta }{k_{B}T}}{\textrm {d}}\theta }{\int _{0}^{\pi }\sin \theta -\sin \theta {\frac {C\cos \theta }{k_{B}T}}{\textrm {d}}\theta }}$
All terms that do not depend on ${\textrm {d}}\theta$ are constants and can be factored out of the integral. The terms can be expressed as 4 integrals:
    $\langle {\mathcal {V}}\left(r\right)\rangle ={\frac {C\int _{0}^{\pi }\cos \theta \sin \theta {\textrm {d}}\theta -{\frac {C^{2}}{k_{B}T}}\int _{0}^{\pi }\cos ^{2}\theta \sin \theta {\textrm {d}}\theta }{\int _{0}^{\pi }\sin \theta {\textrm {d}}\theta -{\frac {C}{k_{B}T}}\int _{0}^{\pi }\sin \theta \cos \theta {\textrm {d}}\theta }}$
We must use trigonometric integrals to solve each of these for integrals:
First:
    $C\int _{0}^{\pi }\cos \theta \sin \theta {\textrm {d}}\theta \longrightarrow C\int _{0}^{\pi }\cos \theta \sin \theta {\textrm {d}}\theta =C\cdot \int _{0}^{\pi }\sin \theta d(\sin \theta )=C\cdot \left[{\frac {1}{2}}\sin ^{2}\theta \right]{\Big |}_{0}^{\pi }=C\cdot 0=0$
Second:
    ${\frac {C^{2}}{k_{B}T}}\int _{0}^{\pi }\cos ^{2}\theta \sin \theta {\textrm {d}}\theta \longrightarrow {\frac {C^{2}}{k_{B}T}}\int _{0}^{\pi }\cos ^{2}\theta \sin \theta {\textrm {d}}\theta ={\frac {C^{2}}{k_{B}T}}\cdot -\int _{0}^{\pi }\cos ^{2}\theta d(\cos \theta )={\frac {C^{2}}{k_{B}T}}\left[-{\frac {1}{3}}\cos ^{3}\theta \right]{\Big |}_{0}^{\pi }={\frac {C^{2}}{k_{B}T}}\cdot {\frac {2}{3}}$
Third:
    $\int _{0}^{\pi }\sin \theta {\textrm {d}}\theta \longrightarrow \int _{0}^{\pi }\sin \theta {\textrm {d}}\theta =-\cos \theta {\Big |}_{0}^{\pi }=2$
Fourth:
    ${\frac {C}{k_{B}T}}\int _{0}^{\pi }\sin \theta \cos \theta {\textrm {d}}\theta \longrightarrow {\frac {C}{k_{B}T}}\int _{0}^{\pi }\sin \theta \cos \theta {\textrm {d}}\theta ={\frac {C}{k_{B}T}}\int _{0}^{\pi }\sin \theta d(\sin \theta )={\frac {C}{k_{B}T}}\cdot \left[{\frac {1}{2}}\sin \theta \right]{\Big |}_{0}^{\pi }={\frac {C}{k_{B}T}}\cdot 0=0$
Plugging each trigonometric solved integral back into the equation gives:
    $\langle {\mathcal {V}}\left(r\right)\rangle ={\frac {C\int _{0}^{\pi }\cos \theta \sin \theta {\textrm {d}}\theta -{\frac {C^{2}}{k_{B}T}}\int _{0}^{\pi }\cos ^{2}\theta \sin \theta {\textrm {d}}\theta }{\int _{0}^{\pi }\sin \theta {\textrm {d}}\theta -{\frac {C}{k_{B}T}}\int _{0}^{\pi }\sin \theta \cos \theta {\textrm {d}}\theta }}={\frac {0-{\frac {2C^{2}}{3k_{B}T}}}{2-0}}=-{\frac {C^{2}}{3k_{B}T}}$
Finally replace $C$ with $C=-{\frac {q_{ion}\mu }{4\pi \epsilon _{0}r^{2}}}$ to give:
    The Orientational Average of the Charge-Dipole Interaction Energy $\langle {\mathcal {V}}\left(r\right)\rangle =-{\frac {1}{3k_{B}T}}\left({\frac {q_{ion}\mu }{4\pi \epsilon _{0}}}\right)^{2}{\frac {1}{r^{4}}}$