Package ffx.numerics.switching
Class MultiplicativeSwitch
java.lang.Object
ffx.numerics.switching.MultiplicativeSwitch
- All Implemented Interfaces:
- UnivariateDiffFunction,- UnivariateSwitchingFunction
The 6 coefficients of the multiplicative polynomial switch are unique given the distances "a" and
 "b". They are found by solving a system of 6 equations, which define the boundary conditions of
 the switch. 
f(a) = 1
f'(a) = f"(a) = 0
f(b) = f'(b) = f"(b) = 0
f(a) = 1
f'(a) = f"(a) = 0
f(b) = f'(b) = f"(b) = 0
- Author:
- Michael J. Schnieders
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a MultiplicativeSwitch that starts at f(0)=1 and ends at f(1)=0.MultiplicativeSwitch(double a, double b) Constructs a MultiplicativeSwitch that starts at f(a)=1 and ends at f(b)=0.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanRemains 0 below the lower bound, and 1 above the upper bound (i.e. a multiplicative switch).doubledtaper(double r) First derivative of the switching function at r.doubledtaper(double r, double r2, double r3, double r4) First derivative of the switching function at r.doublefirstDerivative(double x) First derivative at a point.intThe highest-order derivative that is zero at the bounds.doubleGets the one bound, where f(x) becomes one.doubleGet the value where the switch starts.doubleGet the value where the switch starts.doubleGets the zero bound, where f(x) becomes zero.doublenthDerivative(double x, int order) N'th order derivative at a point.doublesecondDerivative(double x) Second derivative at a point.booleanTrue if f(lb + delta) + f(ub - delta) = 1 for all delta between 0 and (ub - lb).doubletaper(double r) Value of the switching function at r.doubletaper(double r, double r2, double r3, double r4, double r5) Value of the switching function at r.toString()booleanRemains in the range 0-1 outside the bounds.doublevalueAt(double x) Value at a pointMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ffx.numerics.switching.UnivariateSwitchingFunctionhighestOrderZeroDerivativeAtZeroBound
- 
Constructor Details- 
MultiplicativeSwitchpublic MultiplicativeSwitch()Constructs a MultiplicativeSwitch that starts at f(0)=1 and ends at f(1)=0. The switch smoothly interpolates from 1 to 0 across that range, with zero first and second derivatives at off and cut.
- 
MultiplicativeSwitchpublic MultiplicativeSwitch(double a, double b) Constructs a MultiplicativeSwitch that starts at f(a)=1 and ends at f(b)=0. The switch smoothly interpolates from 1 to 0 across that range, with zero first and second derivatives at off and cut.- Parameters:
- a- f(a)=1
- b- f(b)=0
 
 
- 
- 
Method Details- 
constantOutsideBoundspublic boolean constantOutsideBounds()Remains 0 below the lower bound, and 1 above the upper bound (i.e. a multiplicative switch).- Specified by:
- constantOutsideBoundsin interface- UnivariateSwitchingFunction
- Returns:
- df(x)/dx is zero outside range lb-ub.
 
- 
dtaperpublic double dtaper(double r, double r2, double r3, double r4) First derivative of the switching function at r.- Parameters:
- r- r
- r2- r^2
- r3- r^3
- r4- r^4
- Returns:
- First derivative of switch at r
 
- 
dtaperpublic double dtaper(double r) First derivative of the switching function at r.- Parameters:
- r- r
- Returns:
- First derivative of switch at r
 
- 
firstDerivativepublic double firstDerivative(double x) First derivative at a point.- Specified by:
- firstDerivativein interface- UnivariateDiffFunction
- Parameters:
- x- a double.
- Returns:
- f'(x)
 
- 
getHighestOrderZeroDerivativepublic int getHighestOrderZeroDerivative()The highest-order derivative that is zero at the bounds.- Specified by:
- getHighestOrderZeroDerivativein interface- UnivariateSwitchingFunction
- Returns:
- Maximum order zero derivative at bounds.
 
- 
getOneBoundpublic double getOneBound()Gets the one bound, where f(x) becomes one.- Specified by:
- getOneBoundin interface- UnivariateSwitchingFunction
- Returns:
- One bound
 
- 
getSwitchEndpublic double getSwitchEnd()Get the value where the switch starts.- Returns:
- Switch start.
 
- 
getSwitchStartpublic double getSwitchStart()Get the value where the switch starts.- Returns:
- Switch start.
 
- 
getZeroBoundpublic double getZeroBound()Gets the zero bound, where f(x) becomes zero.- Specified by:
- getZeroBoundin interface- UnivariateSwitchingFunction
- Returns:
- Zero bound
 
- 
nthDerivativeN'th order derivative at a point. Should be relatively optional for any order above 2.- Specified by:
- nthDerivativein interface- UnivariateDiffFunction
- Parameters:
- x- a double.
- order- Derivative order (>= 1)
- Returns:
- d^nf(x)/dx^n
- Throws:
- IllegalArgumentException- If derivative undefined at x.
 
- 
secondDerivativepublic double secondDerivative(double x) Second derivative at a point.- Specified by:
- secondDerivativein interface- UnivariateDiffFunction
- Parameters:
- x- a double.
- Returns:
- f''(x)
 
- 
symmetricToUnitypublic boolean symmetricToUnity()True if f(lb + delta) + f(ub - delta) = 1 for all delta between 0 and (ub - lb). For example, a power switch with beta 1 is symmetric to unity, as f(l) + f(1-l) = 1, but beta 2 produces a non-unity result, where f(0.5) + f(0.5) = 0.5.- Specified by:
- symmetricToUnityin interface- UnivariateSwitchingFunction
- Returns:
- If symmetry produces unity result.
 
- 
taperpublic double taper(double r, double r2, double r3, double r4, double r5) Value of the switching function at r.- Parameters:
- r- r
- r2- r^2
- r3- r^3
- r4- r^4
- r5- r^5
- Returns:
- Value of switch at r
 
- 
taperpublic double taper(double r) Value of the switching function at r.- Parameters:
- r- r
- Returns:
- Value of switch at r
 
- 
toString
- 
validOutsideBoundspublic boolean validOutsideBounds()Remains in the range 0-1 outside the bounds. Implied to be true if constantOutsideBounds is true.- Specified by:
- validOutsideBoundsin interface- UnivariateSwitchingFunction
- Returns:
- min(f ( x)) = 0 and max(f(x)) = 1.
 
- 
valueAtValue at a point- Specified by:
- valueAtin interface- UnivariateDiffFunction
- Parameters:
- x- a double.
- Returns:
- f(x)
- Throws:
- IllegalArgumentException- If f(x) is undefined at x.
 
 
-