![]() |
Bsoft 2.1.4
Bernard's software package
|
Functions to do molecular mechanics. More...
Functions | |
double | model_mechanics (Bmodel *model, Bmodparam &md, int mm_type, int max_iter, double max_shift, double velocitylimit) |
Minimizes the energy of a model. More... | |
int | model_minimize (Bmodel *model, double max_shift) |
Move components random distances down the energy gradient. More... | |
double | model_verlet (Bmodel *model, double timestep, double Kfriction, double velocitylimit) |
Model dynamics using the velocity verlet integrator. More... | |
double | model_electrostatic_energy (Bmodel *model, Bmodparam &md) |
Calculates the electrostatic potentials between components. More... | |
double | model_distance_energy (Bmodel *model, Bmodparam &md) |
Calculates the distance-related potentials between components. More... | |
double | model_grid_distance_energy (Bmodel *model, Bmodparam &md) |
Calculates the non-bonded forces and energy. More... | |
double | model_neighbor_distance_energy (Bmodel *model, Bmodparam &md) |
Calculates the distance-related potentials between components and their neighbors. More... | |
double | model_soft_sphere_energy (Bmodel *model, double Kdistance, double dist_ref) |
Calculates the soft sphere potential between components. More... | |
double | model_lennard_jones_energy (Bmodel *model, double Kdistance, double distance) |
Calculates the Lennard-Jones potential between components. More... | |
double | model_morse_energy (Bmodel *model, double Kdistance, double distance) |
Calculates the Morse potential between components. More... | |
double | model_link_energy (Bmodel *model, Bmodparam &md) |
Calculates the model link energy. More... | |
double | model_link_energy (Bmodel *model, double Klink) |
Calculates the model link energy. More... | |
double | model_angle_energy (Bmodel *model, Bmodparam &md) |
Calculates the model angular energy. More... | |
double | model_polygon_angle_energy (Bmodel *model, double Kangle) |
Calculates the link angular forces and energy. More... | |
double | model_polygon_energy (Bmodel *model, double Kpoly) |
Calculates the polygon regularity energy and forces. More... | |
double | model_polygon_plane_energy (Bmodel *model, double Kpolyplane) |
Calculates the polygon planarity energy and forces. More... | |
double | model_neighbor_plane_energy (Bmodel *model, double Kplane) |
Calculates the planarity energy and forces with respect to neighbors. More... | |
double | model_point_force (Bmodel *model, Vector3< double > point, double Kpoint, double decay) |
Calculates the forces and energy resulting from a single point force. More... | |
double | model_radial_energy (Bmodel *model, Vector3< double > point, double d0, double Kd) |
Calculates the potential between a components and a point. More... | |
double | model_guide_energy (Bmodel *model, Bmodparam &md) |
Calculates the potential with respect to a guide model. More... | |
double | model_polyhedron_guide_energy (Bmodel *model, Bmodel *gmod, double Kguide) |
Calculates the potential with respect to a guide polyhedron. More... | |
double | model_map_energy (Bmodel *model, Bimage *map, double Kmap) |
Energy calculation of a model into a map. More... | |
double | model_map_energy (Bmodel *model, Bimage *map, double Kmap, double sigma) |
int | model_zero_forces (Bmodel *model) |
Zeroes the component forces. More... | |
int | model_calculate_deviations (Bmodel *model) |
Calculates the deviations from regularity in a polyhedral model. More... | |
int | model_calculate_deviations (Bmodel *model, Bmodparam &md) |
int | model_regularize (Bmodel *model, int reg_iter, double distance, double Kdistance, double Klink, double Kangle, double Kpoly, double Kpolyplane, double Kpoint, double decay) |
Regularizes a model. More... | |
Functions to do molecular mechanics.
Calculates the model angular energy.
*model | model structure. |
&md | model parameters with reference angle specifications. |
The angular potential is a harmonic function: E = Ka*(a - a0)^2 The force is zero when a = reference angle (a0). Only the first model in the linked list is used.
int model_calculate_deviations | ( | Bmodel * | model | ) |
Calculates the deviations from regularity in a polyhedral model.
*model | model structure. |
Link deviation: d = sqrt(sum((l - l0)^2)/n) where l is the length and l0 is the reference length. Angle deviation: d = sqrt(sum((a - a0)^2)/n) where a is the angle between two links and a0 is the reference angle: a0 = PI*(1 - 2/v) where v is the number of vertices in the associated polygon. Only the first model in the linked list is used.
Calculates the distance-related potentials between components.
*model | model structure. |
&md | model parameters with distance interactions specifications. |
Distance potential types: 0 none 1 harmonic - only for explicit links 2 soft 3 Lennard-Jones 4 Morse Only the first model in the linked list is used.
Calculates the electrostatic potentials between components.
*model | model structure. |
&md | model parameters with distance interactions specifications. |
Electrostaic potential: E = Ke*q1*q2/d Only the first model in the linked list is used.
Calculates the non-bonded forces and energy.
*model | model structure. |
&md | model parameters with distance interactions specifications. |
Distance potential types: 0 none 1 harmonic - only for explicit links 2 soft 3 Lennard-Jones 4 Morse
Calculates the potential with respect to a guide model.
*model | model structure. |
&md | model aparameters. |
Only the first model in the linked list is used.
double model_lennard_jones_energy | ( | Bmodel * | model, |
double | Kd, | ||
double | d0 | ||
) |
Calculates the Lennard-Jones potential between components.
*model | model structure. |
Kd | distance force constant (Kd). |
d0 | reference distance between components (d0). |
The Lennard-Jones potential is given by: E = Kd*((d0/d)^12 - 2*(d0/d)^6) The force is zero when d = d0. The potential is set to zero for d > 3*d0; Only the first model in the linked list is used.
Calculates the model link energy.
*model | model structure. |
&md | model parameters with distance interactions specifications. |
The link potential is a harmonic function: E = Kl*(d - l0)^2 The force is zero when d = reference link length (l0). Only the first model in the linked list is used.
double model_link_energy | ( | Bmodel * | model, |
double | Klink | ||
) |
Calculates the model link energy.
*model | model structure. |
Klink | link force constant (Kl). |
The link potential is a harmonic function: E = Kl*(d - l0)^2 The force is zero when d = reference link length (l0). Only the first model in the linked list is used.
Energy calculation of a model into a map.
*model | model structure. |
*map | map. |
Kmap | map force constant. |
The map must be possitive density. Only the first model in the linked list is used.
double model_mechanics | ( | Bmodel * | model, |
Bmodparam & | md, | ||
int | mm_type, | ||
int | max_iter, | ||
double | max_shift, | ||
double | velocitylimit | ||
) |
Minimizes the energy of a model.
*model | model structure. |
&md | model parameters. |
mm_type | type of mechanics: 0=minimization, 1=dynamics |
max_iter | number of minimization iterations. |
max_shift | maximum shift per iteration. |
velocitylimit | limit on velocity per time step. |
The inclusion of energy terms is based on positive K-constants in the model parameter structure. Only the first model in the linked list is used.
int model_minimize | ( | Bmodel * | model, |
double | max_shift | ||
) |
Move components random distances down the energy gradient.
*model | model structure. |
max_shift | maximum shift for each component. |
The distance of movement is limited to the maximum shift. Only the first model in the linked list is used.
double model_morse_energy | ( | Bmodel * | model, |
double | Kd, | ||
double | d0 | ||
) |
Calculates the Morse potential between components.
*model | model structure. |
Kd | distance force constant (Kd). |
d0 | reference distance between components (d0). |
The Morse potential is given by: E = Kd*((1-exp((a/d0)*(d0-d)))^2 - 1) The width of the energy well is given by a, set here to 6. The force is zero when d = d0. The potential is set to zero for d > 3*d0; Only the first model in the linked list is used.
Calculates the distance-related potentials between components and their neighbors.
*model | model structure. |
&md | model parameters with distance interactions specifications. |
Distance potential types: 0 none 1 harmonic - only for explicit links 2 soft 3 Lennard-Jones 4 Morse Only the first model in the linked list is used.
double model_neighbor_plane_energy | ( | Bmodel * | model, |
double | Kplane | ||
) |
Calculates the planarity energy and forces with respect to neighbors.
*model | model structure. |
Kplane | neighbor planarity constant. |
A plane is fit through the neigbor locations and the normal calculated from: n•p = d where n is the normal vector, p is a point in the plane, and d is the offset. The deviation of a component location from the neighbor plane is calculated and converted to a harmonic energy and force. Only the first model in the linked list is used.
Calculates the forces and energy resulting from a single point force.
*model | model structure. |
point | center of point force. |
Kpoint | point force constant. |
decay | energy decay with distance. |
The energy is defined as an exponential decay over distance from the center of the point force: Ep = Kp * exp(-decay*dist) The force is the derivative of the energy: Fp = Kp * decay * dir * exp(-decay*dist) where Kp is the point force constant, dist is the distance of the component from the center of the point force, decay is the energy decay with distance from the point force center, and dir is the normalized direction vector pointing from the point force center to the component, indicating the direction of force. Only the first model in the linked list is used.
double model_polygon_angle_energy | ( | Bmodel * | model, |
double | Kpolyangle | ||
) |
Calculates the link angular forces and energy.
*model | model structure. |
Kpolyangle | angle force constant (Ka). |
The energy is defined as a harmonic function around the reference link angle, a0: Ea = Ka*(cos(a0)-r1*r2/(|r1|*|r2|))^2 Ea = Ka*(a0 - a)^2 The force is the derivative of the energy on the first and last atoms: Fa1 = 2*Ka*(cos(a0)-r1*r2/(|r1|*|r2|))/(|r1|*|r2|) * ((r1*r2/|r1|)*r1-r2) Fa3 = 2*Ka*(cos(a0)-r1*r2/(|r1|*|r2|))/(|r1|*|r2|) * ((r1*r2/|r2|)*r2-r1) where r1 is the vector from atom 2 to atom 1, r2 is the vector from atom 2 to atom 3, and Ka is the link angle force constant. Only the first model in the linked list is used.
double model_polygon_energy | ( | Bmodel * | model, |
double | Kpoly | ||
) |
Calculates the polygon regularity energy and forces.
*model | model structure. |
Kpoly | polygon regularity constant (Kp). |
Given the distances of all the vertices from the polygon center, the polygon regularity is defined as the deviation of these distances from the average distance: E = Kp*(d - d0) Only the first model in the linked list is used.
double model_polygon_plane_energy | ( | Bmodel * | model, |
double | Kpolyplane | ||
) |
Calculates the polygon planarity energy and forces.
*model | model structure. |
Kpolyplane | polygon planarity constant. |
A plane is fit through the polygon vertices and the normal calculated from: n•p = d where n is the normal vector, p is a point in the plane, and d is the offset. The polygon plane energy is calculated as a harmonic deviation from the fitted plane. Only the first model in the linked list is used.
Calculates the potential with respect to a guide polyhedron.
*model | model structure. |
*gmod | guide polyhedron model. |
Kguide | guide polyhedron force constant. |
Only the first model in the linked list is used.
Calculates the potential between a components and a point.
*model | model structure. |
point | reference point = radial center. |
d0 | reference distance between component and point. |
Kradial | radial force constant. |
The radial potential is given by: E = Kd*(d - d0)^2 The force is zero when d = d0. Only the first model in the linked list is used.
int model_regularize | ( | Bmodel * | model, |
int | max_iter, | ||
double | distance, | ||
double | Kdistance, | ||
double | Klink, | ||
double | Kpolyangle, | ||
double | Kpolygon, | ||
double | Kpolyplane, | ||
double | Kpoint, | ||
double | decay | ||
) |
Regularizes a model.
*model | model structure. |
max_iter | maximum number of iterations. |
distance | reference distance. |
Kdistance | distance strength constant. |
Klink | link strength constant. |
Kpolyangle | angle strength constant. |
Kpolygon | polygon regularity constant. |
Kpolyplane | polygon planarity constant. |
Kpoint | force away from the center-of-mass. |
decay | point force decay constant. |
Only the first model in the linked list is used.
double model_soft_sphere_energy | ( | Bmodel * | model, |
double | Kd, | ||
double | d0 | ||
) |
Calculates the soft sphere potential between components.
*model | model structure. |
Kd | distance force constant. |
d0 | reference distance between components. |
The soft sphere potential is given by: E = Kd*(d0/d)^12 The potential is set to zero for d > 3*d0; Only the first model in the linked list is used.
double model_verlet | ( | Bmodel * | model, |
double | timestep, | ||
double | Kfriction, | ||
double | velocitylimit | ||
) |
Model dynamics using the velocity verlet integrator.
*model | model structure. |
timestep | dynamics time step. |
Kfriction | friction coefficient. |
velocitylimit | limit on velocity per time step. |
Leapfrog integration for any coordinate x, velocity vx and force Fx: x(t+1) = x(t) + vx(t+1) * dt vx(t+1) = (Fx(t) * dt/m + vx(t)) * kf where kf: friction constant (1=no friction) dt: time step m: atomic mass The velocity is limited each time step to damp chaotic oscillations. Only the first model in the linked list is used.
int model_zero_forces | ( | Bmodel * | model | ) |
Zeroes the component forces.
*model | model. |
Only the first model in the linked list is used.