NVE ensemble
============

Two integration schemes can be used to sample the NVE ensemble. 

* [Born Oppenheimer-type MD for the electrode atom charges or the electrolyte ion dipoles](#BO)
* [MaZe algorithm for the electrode atom charges or the electrolyte ion dipoles](#MaZe)

The former is also used when no electrodes or dipoles are present. The latter cannot be used for the calculation of the ion radii in the DAIM force field.<br>
Note that the sections thermostat & barostat should not be present in the *runtime.inpt* file.

<a name="BO">

Born-Oppenheimer 
==========

</a>

(NVE-BO1) Update of the positions and of the velocities due to $`\mathbf{F}(0)`$
```math
\mathbf{r}_{i}(\Delta t) \leftarrow \mathbf{r}_{i}(0)+\mathbf{v}_{i}(0)\Delta t + \mathbf{F}_{i}(0)\frac{\Delta t^2}{2 m_{i}}\\
\mathbf{v}'_{i}(\Delta t) \leftarrow \mathbf{v}_{i}(0)+\mathbf{F}_{i}(0)\frac{\Delta t}{2 m_{i}}
```
(NVE-BO2) Enforce the constraints on the new positions and velocities with the first part of RATTLE

(NVE-BO3) Compute the new electrolyte atom dipoles (polarizable force field), electrode atom charges (in constant potential simulations) and electrolyte atom radii (for the DAIM force field)

(NVE-BO4) Compute the new forces at $`\Delta t`$

(NVE-BO5) Update of the velocities due to $`\mathbf{F}(\Delta t)`$
```math
\mathbf{v}_{i}(\Delta t) \leftarrow \mathbf{v}'_{i}(\Delta t)+\mathbf{F}_{i}(\Delta t)\frac{\Delta t}{2 m_{i}}
```
(NVE-BO6) Enforce the constraints on the new velocities with the second part of RATTLE

<a name="MaZe">

MaZe 
==========

</a>

(NVE-Maze1) Update of the positions and of the velocities due to $`\mathbf{F}(0)`$
```math
\mathbf{r}_{i}(\Delta t) \leftarrow \mathbf{r}_{i}(0)+\mathbf{v}_{i}(0)\Delta t + \mathbf{F}_{i}(0)\frac{\Delta t^2}{2 m_{i}}\\
\mathbf{v}'_{i}(\Delta t) \leftarrow \mathbf{v}_{i}(0)+\mathbf{F}_{i}(0)\frac{\Delta t}{2 m_{i}}
```
(NVE-MaZe2) Enforce the constraints on the new positions and velocities with the first part of RATTLE

(NVE-MaZe3) The Verlet algorithm is used to provide an expression of the additional variables $`s`$ (electrode charges for constant potential simulations or electrolyte dipoles for polarizable force fields) at $`\Delta t`$ as a function of the Lagrange multipliers $`\gamma`$:
```math
s_i(\Delta t) \leftarrow 2s_i(0) - s_i(-\Delta t) + \Delta t^2\sum_k\gamma_k\frac{\partial^2 U}{\partial s_i\partial s_k}
```
Initialization details for the variables $`s`$ are provided [here](maze-initialization).

(NVE-MaZe4) The Lagrange multipliers $`\gamma`$ are found solving the equation of the adiabatic constraints $`\sigma(\mathbf{r}(\Delta t), s(\Delta t)) = 0`$ where $`\sigma = \frac{\partial U}{\partial s}`$.

(NVE-MaZe5) Compute the new forces at $`\Delta t`$

(NVE-MaZe6) Update of the velocities due to $`\mathbf{F}(\Delta t)`$
```math
\mathbf{v}_{i}(\Delta t) \leftarrow \mathbf{v}'_{i}(\Delta t)+\mathbf{F}_{i}(\Delta t)\frac{\Delta t}{2 m_{i}}
```
(NVE-MaZe7) Enforce the constraints on the new velocities with the second part of RATTLE
