Class CompositeSwitch

java.lang.Object
ffx.numerics.switching.CompositeSwitch
All Implemented Interfaces:
UnivariateDiffFunction, UnivariateSwitchingFunction

public class CompositeSwitch extends Object implements UnivariateSwitchingFunction
The CompositeSwitch uses a primary switch in the middle, and then two secondary switches at the ends of the path to smoothly switch to the primary switch. For example, one can smoothly interpolate from 0/0/0 value/derivative/second derivative to a linear switch by multiplying the linear switch by a MultiplicativeSwitch in the range 0-0.1.

At present, there is an assumption that x gets linearly scaled when passed to the switch; at the ends, s(x) = f(g(x))*h(x), where h(x) is the primary switch, g(x) = x / (switching range), and f(g(x)) is the secondary switch.

Author:
Jacob M. Litman, Michael J. Schnieders
  • Constructor Details

    • CompositeSwitch

      public CompositeSwitch()
      Builds a switch that uses MultiplicativeSwitches at the ends (0-0.1, 0.9-1.0) to smoothly interpolate a linear switch between 0 and 1 with smooth 2'nd and 3'rd derivatives. Will not be quite linear from 0-0.1 and 0.9-1.0.
    • CompositeSwitch

      public CompositeSwitch(UnivariateSwitchingFunction primary)
      Builds a switch that uses MultiplicativeSwitches at the ends (0-0.1, 0.9-1.0) to smoothly interpolate a provided switch between 0 and 1 with smooth 2'nd and 3'rd derivatives.
      Parameters:
      primary - Primary switch to obey exactly from 0.1-0.9.
    • CompositeSwitch

      public CompositeSwitch(UnivariateSwitchingFunction primary, UnivariateSwitchingFunction start, UnivariateSwitchingFunction end, double lbPrimary, double ubPrimary)
      Builds a composite switch in .
      Parameters:
      primary - Primary switch to obey exactly from lbPrimary to ubPrimary.
      start - Switch to interpolate from 0 to primary between 0 and lbPrimary; assumed to internally function from 0-1.
      end - Switch to interpolate from primary to 1.0 between ubPrimary and 1; assumed to internally function from 0-1.
      lbPrimary - Value at which primary should begin to be obeyed exactly.
      ubPrimary - Value at which primary should stop being obeyed exactly.
    • CompositeSwitch

      public CompositeSwitch(UnivariateSwitchingFunction primary, UnivariateSwitchingFunction start, UnivariateSwitchingFunction end, double lbPrimary, double ubPrimary, double lb, double ub)
      Builds a composite switch in .
      Parameters:
      primary - Primary switch to obey exactly from lbPrimary to ubPrimary.
      start - Switch to interpolate from 0 to primary between 0 and lbPrimary; assumed to internally function from 0-1.
      end - Switch to interpolate from primary to 1.0 between ubPrimary and 1; assumed to internally function from 0-1.
      lbPrimary - Value at which primary should begin to be obeyed exactly.
      ubPrimary - Value at which primary should stop being obeyed exactly.
      lb - Overall lower bound of the CompositeSwitch.
      ub - Overall upper bound of the CompositeSwitch.
  • Method Details