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

calc   deriv   deriv2   initialize  

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

calc   initialize  

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

calc   deriv   initialize  

Smooth damping function. Type selects the form:

initialize(r0,exponent,type = :df_1_to_0)

Creates new instance of DampingFunction

calc(r)

Calculates value of the damping function at point r

deriv(r)

class LennardJones

calc   deriv   initialize  

Lennard-Jones potential function

initialize(sigma, epsilon)

calc(r)

deriv(r)