This module serves as a conainer for several clases representing the functions.
Instance of the class stores all the parameters, only the most important variable
is provided when the value is calculated.
module Func
class Gaussian
Gaussian function a * exp((x-b)^2 / (2 *c^2))
initialize(a,b,c)
Creates new instance of Gaussian
calc(x)
Calculates the value at point x using the stored a, b and c values
deriv(x)
Calculates first derivative at point x using the stored a, b and c values
deriv2(x)
Calculates second derivative at point x using the stored a, b and c values
class Sawtooth
Triangle with the same parameters as a gaussian
initialize(a,b,c)
Creates new instance of Gaussian
calc(x)
Calculates the value at point x using the stored a, b and c values
class DampingFunction
Smooth damping function. Type selects the form:
- :df_1_to_0 => ^^^\___ (default)
- :df_0_to_1 => ___/^^^
initialize(r0,exponent,type = :df_1_to_0)
Creates new instance of DampingFunction
calc(r)
Calculates value of the damping function at point r
class LennardJones
Lennard-Jones potential function
initialize(sigma, epsilon)