Package maths_fns :: Module potential
[hide private]
[frames] | no frames]

Module potential

source code

Functions for calculating various optimisation potentials.

Functions [hide private]
 
quad_pot(values, pot, lower, upper)
Calculate the flat-bottom quadratic energy potential.
source code
Variables [hide private]
  __package__ = None
hash(x)
Function Details [hide private]

quad_pot(values, pot, lower, upper)

source code 

Calculate the flat-bottom quadratic energy potential.

The formula used is:

                       / (x - x+)^2    if x > x+,
                       |                         
   V_pQuad(x;x+,x-) = <  (x - x-)^2    if x < x-,
                       |                         
                       \ 0             otherwise.

Where x+ and x- are the absolute bounds.

Parameters:
  • values (numpy float array) - An array of values of x.
  • pot (numpy float array) - The array to place the potential values (V_pQuad) into. This should have the same dimensions as the values array.
  • lower (numpy float array) - The array of lower bounds. This should have the same dimensions as the values array.
  • upper (numpy float array) - The array of upper bounds. This should have the same dimensions as the values array.