Metrics and Derived Quantities

Tissue Forge provides numerous methods to compute a range of derived quantities. Some quantities are top-level metrics that depend on the entire simulation volume, and others are localized to individual or groups of objects.

Pressure and Virial Tensors

For a system of \(N\) particles in a volume \(V\), the surface tension can be computed from the diagonal components of the pressure tensor \(P_{\alpha,\alpha}(\alpha=x,y,z)\). The \(P_{xx}\) components are

\[P_{\alpha,\beta} = \rho k T + \ \frac{1}{V} \ \left( \ \sum^{N-1}_{i=1} \ \sum^{N}_{j>i} \ (\mathbf{r}_{ij})_{\alpha} \ (\mathbf{f}_{ij})_{\beta} \ \right),\]

where \(\rho\) is the particle density, \(k\) is the Boltzmann constant, \(T\) is the temperature, and \(\mathbf{r}_{ij}\) and \(\mathbf{f}_{ij}\) are the relative position of, and force between, the \(i\mathrm{th}\) and \(j\mathrm{th}\) particles, respectively. Here \(\mathbf{f}_{ij}\) is only due to inter-particle interactions and excludes external forces. The pressure tensor is a measure of how much internal force exists in the specified set of particles.

A term in the definition of the pressure tensor is known as the virial tensor, which is defined as

\[V_{\alpha,\beta} = \sum^{N-1}_{i=1} \ \sum^{N}_{j>i} \ (\mathbf{r}_{ij})_{\alpha} \ (\mathbf{f}_{ij})_{\beta}.\]

The virial tensor represents half of the the product of the stress due to the net force between pairs of particles and the distance between them. Since the volume of a group of particles is not well defined, Tissue Forge provides the flexibility of using different volume metrics for computing the virial tensor and corresponding pressure tensor.

The pressure tensor for the entire simulation domain, or for a specific region, can be calculated using the method virial on the universe.

import tissue_forge as tf
...
virial_universe = tf.Universe.virial()
virial_region = tf.Universe.virial(origin=[5.0, 6.0, 7.0], radius=2.0)

The viritual tensor about a particle can also be computed with the particle method virial within a specific distance.

class MyParticleType(tf.ParticleTypeSpec):
    pass
my_particle_type = MyParticleType.get()
my_particle = my_particle_type()
virial = my_particle.virial(radius=3.0)

Centroid

The centroid of a system of \(N\) particles \(\mathbf{C}\), where each \(i\mathrm{th}\) particle has position \(\mathbf{r}_i\), is defined as

\[\mathbf{C} = \frac{1}{N} \sum_{i=1}^N \mathbf{r}_i,\]

The centroid of a cluster is avilable using the property centroid.

Radius of Gyration

The radius of gyration is a measure of the dimensions of a group (Cluster) of particles. The radius of gyration of a group of \(N\) particles is defined as

\[R_\mathrm{g}^2 \ \stackrel{\mathrm{def}}{=}\ \frac{1}{N} \sum_{k=1}^{N} \left( \mathbf{r}_k - \mathbf{C} \right)^2 ,\]

where \(\mathbf{C}\) is the centroid of the particles. The radius of gyration for a cluster is available using the property radius_of_gyration.

Center of Mass

The center of mass of a system of \(N\) particles \(\mathbf{R}\), where each \(i\mathrm{th}\) particle has mass \(m_i\) and position \(\mathbf{r}_i\), satisfies the condition

\[\sum_{i=1}^N m_i(\mathbf{r}_i - \mathbf{R}) = \mathbf{0} .\]

\(\mathbf{R}\) is then defined as

\[\mathbf{R} = \frac{1}{M} \sum_{i=1}^N m_i \mathbf{r}_i,\]

where \(M\) is the sum of the masses of all of the particles. The center of mass of a cluster is available using the property center_of_mass.

Moment of Inertia

For a system of \(N\) particles, the moment of inertia tensor mathbf{I} is a symmetric tensor defined as

\[\begin{split}\mathbf{I} = \begin{bmatrix} I_{11} & I_{12} & I_{13} \\ I_{21} & I_{22} & I_{23} \\ I_{31} & I_{32} & I_{33} \end{bmatrix}\end{split}\]

Its diagonal elements are defined as

\[\begin{split}\begin{align*} I_{xx} &\stackrel{\mathrm{def}}{=} \sum_{k=1}^{N} m_{k} (y_{k}^{2}+z_{k}^{2}), \\ I_{yy} &\stackrel{\mathrm{def}}{=} \sum_{k=1}^{N} m_{k} (x_{k}^{2}+z_{k}^{2}), \\ I_{zz} &\stackrel{\mathrm{def}}{=} \sum_{k=1}^{N} m_{k} (x_{k}^{2}+y_{k}^{2}) \end{align*} ,\end{split}\]

and its off-diagonal elements are defined as

\[\begin{split}\begin{align*} I_{xy} &= I_{yx} \ \stackrel{\mathrm{def}}{=}\ -\sum_{k=1}^{N} m_{k} x_{k} y_{k}, \\ I_{xz} &= I_{zx} \ \stackrel{\mathrm{def}}{=}\ -\sum_{k=1}^{N} m_{k} x_{k} z_{k}, \\ I_{yz} &= I_{zy} \ \stackrel{\mathrm{def}}{=}\ -\sum_{k=1}^{N} m_{k} y_{k} z_{k} \end{align*} .\end{split}\]

Here \(m_{k}\) is the mass of the \(k\mathrm{th}\) particle, and \(x_{k}\), \(y_{k}\) and \(z_{k}\) are its relative coordinates with respect to the centroid of the cluster along the first, second and third dimensions, respectively. The moment of inertia tensor of a cluster is available using the property moment_of_inertia.