diff --git a/pylj/forcefields.py b/pylj/forcefields.py index e54fa41..d6329d2 100644 --- a/pylj/forcefields.py +++ b/pylj/forcefields.py @@ -27,7 +27,7 @@ def energy(self, dr): .. math:: E = \frac{4e*a^{12}}{dr^{12}} - \frac{4e*a^{6}}{dr^6} - Attributes: + Parameters ---------- dr (float): The distance between particles. @@ -47,7 +47,7 @@ def force(self, dr): .. math:: f = \frac{48e*a^{12}}{dr^{13}} - \frac{24e*a^{6}}{dr^7} - Attributes: + Parameters ---------- dr (float): The distance between particles. @@ -110,7 +110,7 @@ def mixing(self, constants_2): a = 4*\epsilon*(\sigma^12) b = 4*\epsilon*(\sigma^6) - Parameters: + Parameters ---------- constants_2: float, array_like The second set of constantss @@ -150,7 +150,7 @@ def energy(self, dr): .. math:: E = Ae^{(-Bdr)} - \frac{C}{dr^6} - Attributes: + Parameters ---------- dr (float): The distance between particles. @@ -175,7 +175,7 @@ def force(self, dr): .. math:: f = ABe^{(-Bdr)} - \frac{6C}{dr^7} - Attributes: + Parameters ---------- dr (float): The distance between particles. @@ -201,7 +201,7 @@ def mixing(self, constants2): b_{12} = \sqrt{b_1 * b_2} c_{12} = \sqrt{c_1 * c_2} - Attributes: + Parameters ---------- constants_2: float, array_like The second set of constantss @@ -247,7 +247,7 @@ def energy(self, dr): E = 0 } - Attributes: + Parameters ---------- dr (float): The distance between particles. diff --git a/pylj/md.py b/pylj/md.py index f640f2d..978fb8a 100644 --- a/pylj/md.py +++ b/pylj/md.py @@ -84,6 +84,7 @@ def velocity_verlet( Updates the particles positions and velocities in terms of the Velocity Verlet algorithm. Also calculates the instanteous temperature, pressure, and force and appends these to the appropriate system array. + Parameters ---------- particles: util.particle_dt, array_like @@ -92,6 +93,7 @@ def velocity_verlet( Length for each Velocity-Verlet integration step, in seconds. box_length: float Length of a single dimension of the simulation square, in Angstrom. + Returns ------- util.particle_dt, array_like: @@ -127,6 +129,7 @@ def velocity_verlet( def sample(particles, box_length, initial_particles, system): """Sample parameters of interest in the simulation. + Parameters ---------- particles: util.particle_dt, array_like @@ -137,6 +140,7 @@ def sample(particles, box_length, initial_particles, system): Information about the initial particle conformation. system: System Details about the whole system + Returns ------- System: @@ -165,6 +169,7 @@ def sample(particles, box_length, initial_particles, system): def calculate_msd(particles, initial_particles, box_length): """Determines the mean squared displacement of the particles in the system. + Parameters ---------- particles: util.particle_dt, array_like @@ -173,6 +178,7 @@ def calculate_msd(particles, initial_particles, box_length): Information about the initial state of the particles. box_length: float Size of the cell vector. + Returns ------- float: @@ -205,6 +211,7 @@ def update_positions( positions, old_positions, velocities, accelerations, timestep_length, box_length ): """Update the particle positions using the Velocity-Verlet integrator. + Parameters ---------- positions: (2, N) array_like @@ -224,6 +231,7 @@ def update_positions( Length for each Velocity-Verlet integration step, in seconds. box_length: float Length of a single dimension of the simulation square, in Angstrom. + Returns ------- (2, N) array_like: @@ -246,6 +254,7 @@ def update_velocities( velocities, accelerations_old, accelerations_new, timestep_length ): """Update the particle velocities using the Velocity-Verlet algoritm. + Parameters ---------- velocities: (2, N) array_like @@ -257,6 +266,7 @@ def update_velocities( accelerations. timestep_length: float Length for each Velocity-Verlet integration step, in seconds. + Returns ------- (2, N) array_like: @@ -273,10 +283,12 @@ def update_velocities( def calculate_temperature(particles, mass): """Determine the instantaneous temperature of the system. + Parameters ---------- particles: util.particle_dt, array_like Information about the particles. + Returns ------- float: @@ -297,6 +309,7 @@ def calculate_temperature(particles, mass): def compute_force(particles, box_length, cut_off, constants, forcefield, mass): r"""Calculates the forces and therefore the accelerations on each of the particles in the simulation. + Parameters ---------- particles: util.particle_dt, array_like @@ -313,6 +326,7 @@ def compute_force(particles, box_length, cut_off, constants, forcefield, mass): The particular forcefield to be used to find the energy and forces. mass: float (optional) The mass of the particle being simulated (units of atomic mass units). + Returns ------- util.particle_dt, array_like @@ -337,6 +351,7 @@ def heat_bath(particles, temperature_sample, bath_temperature): .. math:: v_{\text{new}} = v_{\text{old}} \times \sqrt{\frac{T_{\text{desired}}}{\bar{T}}} + Parameters ---------- particles: util.particle_dt, array_like @@ -345,6 +360,7 @@ def heat_bath(particles, temperature_sample, bath_temperature): The temperature at each timestep in the simulation. bath_temp: float The desired temperature of the simulation. + Returns ------- util.particle_dt, array_like diff --git a/pylj/pairwise.py b/pylj/pairwise.py index 06b885c..39784dd 100644 --- a/pylj/pairwise.py +++ b/pylj/pairwise.py @@ -6,6 +6,7 @@ def compute_force(particles, box_length, cut_off, constants, forcefield, mass): r"""Calculates the forces and therefore the accelerations on each of the particles in the simulation. + Parameters ---------- particles: util.particle_dt, array_like @@ -22,6 +23,7 @@ def compute_force(particles, box_length, cut_off, constants, forcefield, mass): The particular forcefield to be used to find the energy and forces. mass: float (optional) The mass of the particle being simulated (units of atomic mass units). + Returns ------- util.particle_dt, array_like @@ -73,6 +75,7 @@ def compute_force(particles, box_length, cut_off, constants, forcefield, mass): #Jit tag here had to be removed def separation(dx, dy): """Calculate the distance in 2D space. + Parameters ---------- dx: float @@ -88,6 +91,7 @@ def separation(dx, dy): def update_accelerations(particles, f, m, dx, dy, dr): """Update the acceleration arrays of particles. + Parameters ---------- particles: util.particle_dt, array_like @@ -124,6 +128,7 @@ def update_accelerations(particles, f, m, dx, dy, dr): def second_law(f, m, d1, d2): """Newton's second law of motion to get the acceleration of the particle in a given dimension. + Parameters ---------- f: float @@ -204,6 +209,7 @@ def calculate_pressure( .. math:: p = \langle \rho k_b T \rangle + \bigg\langle \frac{1}{3V}\sum_{i} \sum_{j