mdse.md.resultMD

Classes

ResultMD(data)

Class representing the result of a molecular dynamics (MD) simulation.

class mdse.md.resultMD.ResultMD(data)

Bases: object

Class representing the result of a molecular dynamics (MD) simulation.

This class stores frames from a simulation and provides methods to calculate and visualize the mean squared displacement (MSD).

calc_isobaric_enthalpy()

Calculates isobaric enthalpy after a NPT ensemble.

Returns:

Enthalpy with unit Joule.

Return type:

enthalpy_J (float)

calc_isobaric_specific_heat()

Caluclates isobaric specific heat or c_p after a NPT ensemble.

Returns:

Specific heat in units J / (kg * K).

Return type:

specific heat (float)

calc_isochoric_heat_capacity_per_atom()

Calculates the heat capacity per atom after a NVT ensemble.

Returns:

Heat capacity per atom in units J / (n * K)

Return type:

Heat capacity per atom (float)

calc_lindemann(a=None)

Compute the global Lindemann parameter. :param a: Average nearest-neighbor distance. :type a: float

Returns:

Lindemann parameter δ_L.

Return type:

float

calc_msd()

Compute the overall mean squared displacement (MSD).

Returns:

The average MSD value across all directions.

Return type:

float

calc_self_diff()

Calculates self diffusion coefficient using MSD. Requires a linear-fit, so filters out noisy tau values. (Might need fine-tuning)

Returns:

Self diffusion coefficent, w.r.t all directions.

Return type:

D_total (float)

estimate_average_a()

Estimate the average nearest-neighbor distance over all frames. :returns: The average nearest-neighbor distance across all frames. :rtype: float

estimate_nearest_neighbor_distance(positions)

Estimate average nearest-neighbor distance for one frame. :param positions: shape (N, 3) array of atomic positions. :type positions: ndarray

Returns:

average nearest-neighbor distance for one frame.

Return type:

float

classmethod from_file(filepath)

Create a ResultMD object from a trajectory file.

Parameters:

filepath (str) – Path to the trajectory file.

Returns:

An instance of the class containing trajectory frames.

Return type:

ResultMD

visualize_msd()

Visualize the mean squared displacement (MSD) as a function of time lag.