Klasse FSTFunctions

java.lang.Object
net.simplace.sim.components.util.FSTFunctions

public class FSTFunctions extends Object
Defines some helper functions similar to some FST functions (FortranSimulationTranslator) WIKI_START Defines some of the FST-Functions (sometimes with different signatures than the original FST ones). == References: == (FST) [https://www.wageningenur.nl/en/Publication-details.htm?publicationId=publication-way-333137323735 The Fortran simulation translator], Kraalingen, D.W.G. van; Rappoldt, C.; Laar, H.H. van, European Journal of Agronomy 18 (2003) WIKI_END
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static double
    AFGEN(Double[] xy, double t)
    Computes a linear interpolation for t from a table.
    static double
    AFGEN(Double[] x, Double[] y, double t)
    Computes a linear interpolation for t from a table.
    static double
    AFGEN(TreeMap<Double,Double> xy, double t)
    Computes a linear interpolation for t from a table.
    static double
    AFGEN(InterpolationTable xy, double t)
    Computes a linear interpolation for t from a table.
    static double
    AFGEN(net.simplace.sim.util.FWSimVariable<Double[]> xy, double t)
    Computes a linear interpolation for t from a table.
    static double
    AFGEN(net.simplace.sim.util.FWSimVariable<Double[]> x, net.simplace.sim.util.FWSimVariable<Double[]> y, double t)
    Computes a linear interpolation for t from a table.
    static double
    INSW(boolean testvalue, double X2, double X3)
    Returns one value, if the test value is false and another value, if the test value ist nonnegative
    static double
    INSW(double testvalue, double X2, double X3)
    Returns one value, if the test value is negative and another value, if the test value ist nonnegative
    static void
    INTGRL(net.simplace.sim.util.FWSimVariable<Double> state, double rate)
    Integrates a state by adding a rate
    static void
    INTGRL(net.simplace.sim.util.FWSimVariable<Double> state, double rate, double delta)
    Integrates a state by adding a rate
    static void
    INTGRL(net.simplace.sim.util.FWSimVariable<Double> state, net.simplace.sim.util.FWSimVariable<Double> rate)
    Integrates a state by adding a rate
    static void
    INTGRL(net.simplace.sim.util.FWSimVariable<Double> state, net.simplace.sim.util.FWSimVariable<Double> rate, double delta)
    Integrates a state by adding a rate
    static void
    INTGRLA(net.simplace.sim.util.FWSimVariable<Double[]> state, double[] rate)
    Integrates a state array by adding a rate array
    static void
    INTGRLA(net.simplace.sim.util.FWSimVariable<Double[]> state, double[] rate, double delta)
    Integrates a state array by adding a rate array
    static void
    INTGRLA(net.simplace.sim.util.FWSimVariable<Double[]> state, net.simplace.sim.util.FWSimVariable<Double[]> rate)
    Integrates a state array by adding a rate array
    static void
    INTGRLA(net.simplace.sim.util.FWSimVariable<Double[]> state, net.simplace.sim.util.FWSimVariable<Double[]> rate, double delta)
    Integrates a state array by adding a rate array
    static double
    LIMIT(double XL, double XH, double X)
    Limits a value to a lower and upper bound
    static double
    NOTNUL(double x)
    Returns 1 instead of 0 if the value is 0.
    static int
    REAAND(double x1, double x2)
    Tests whether two values are positive
    static double
    REANOR(double a, double b)
    Returns 1 if two values are both zero or negative, returns 0 otherwise

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • FSTFunctions

      public FSTFunctions()
  • Methodendetails

    • AFGEN

      public static double AFGEN(Double[] xy, double t)
      Computes a linear interpolation for t from a table. The method returns the leftmost or rightmost value if t is out of range. Takes the table as a double array with x-values in the even and y-values in the odd entries
      Parameter:
      xy - interpolation table as double array with x and y values interleaved
      t - point at which the value is computed
      Gibt zurück:
      the interpolated value
    • AFGEN

      public static double AFGEN(Double[] x, Double[] y, double t)
      Computes a linear interpolation for t from a table. The method returns the leftmost or rightmost value if t is out of range. Takes the table as two double array, first one with x-values, second one with y-values.
      Parameter:
      x - array with x values of the table
      y - array with y values of the table
      t - point at which the value is computed
      Gibt zurück:
      the interpolated value
    • AFGEN

      public static double AFGEN(net.simplace.sim.util.FWSimVariable<Double[]> xy, double t)
      Computes a linear interpolation for t from a table. The method returns the leftmost or rightmost value if t is out of range. Takes the table as a SimVariable of type double array with x-values in the even and y-values in the odd entries and calls AFGEN for double array
      Parameter:
      xy - data set
      t - point at which the value is computed
      Gibt zurück:
      the interpolated value
    • AFGEN

      public static double AFGEN(net.simplace.sim.util.FWSimVariable<Double[]> x, net.simplace.sim.util.FWSimVariable<Double[]> y, double t)
      Computes a linear interpolation for t from a table. The method returns the leftmost or rightmost value if t is out of range. Takes the table as two SimVariable of type double array with x-values in the even and y-values in the odd entries and calls AFGEN for two double array
      Parameter:
      x -
      y - data set
      t - point at which the value is computed
      Gibt zurück:
      the interpolated value
    • AFGEN

      public static double AFGEN(TreeMap<Double,Double> xy, double t)
      Computes a linear interpolation for t from a table. The method returns the leftmost or rightmost value if t is out of range. Takes the table as a TreeMap with x-values as keys and y-values as entries and calls AFGEN for two double arrays.
      Parameter:
      xy - data set
      t - point at which the value is computed
      Gibt zurück:
      the interpolated value
    • AFGEN

      public static double AFGEN(InterpolationTable xy, double t)
      Computes a linear interpolation for t from a table. The method returns the leftmost or rightmost value if t is out of range. Takes the table as a TreeMap with x-values as keys and y-values as entries and calls AFGEN for two double arrays.
      Parameter:
      xy - data set
      t - point at which the value is computed
      Gibt zurück:
      the interpolated value
    • INSW

      public static double INSW(double testvalue, double X2, double X3)
      Returns one value, if the test value is negative and another value, if the test value ist nonnegative
      Parameter:
      testvalue -
      X2 - value returned if test value is negative
      X3 - value returned if test value is positive or zero
      Gibt zurück:
      resulting value
    • INSW

      public static double INSW(boolean testvalue, double X2, double X3)
      Returns one value, if the test value is false and another value, if the test value ist nonnegative
      Parameter:
      testvalue -
      X2 - value returned if test value is negative
      X3 - value returned if test value is positive or zero
      Gibt zurück:
      resulting value
    • REAAND

      public static int REAAND(double x1, double x2)
      Tests whether two values are positive
      Parameter:
      x1 - first value
      x2 - second value
      Gibt zurück:
      1 if both are positive, 0 otherwise
    • LIMIT

      public static double LIMIT(double XL, double XH, double X)
      Limits a value to a lower and upper bound
      Parameter:
      XL - lower bound
      XH - upper bound
      X - value
      Gibt zurück:
      the value or it's lower/upper bound if it exceeds the bounds
    • NOTNUL

      public static double NOTNUL(double x)
      Returns 1 instead of 0 if the value is 0. Used to avoid division by 0
      Parameter:
      x - value
      Gibt zurück:
      value or 1
    • REANOR

      public static double REANOR(double a, double b)
      Returns 1 if two values are both zero or negative, returns 0 otherwise
      Parameter:
      a - first value
      b - second value
      Gibt zurück:
      1 or 0
    • INTGRL

      public static void INTGRL(net.simplace.sim.util.FWSimVariable<Double> state, net.simplace.sim.util.FWSimVariable<Double> rate)
      Integrates a state by adding a rate
      Parameter:
      state -
      rate -
    • INTGRL

      public static void INTGRL(net.simplace.sim.util.FWSimVariable<Double> state, net.simplace.sim.util.FWSimVariable<Double> rate, double delta)
      Integrates a state by adding a rate
      Parameter:
      state -
      rate -
      delta -
    • INTGRL

      public static void INTGRL(net.simplace.sim.util.FWSimVariable<Double> state, double rate)
      Integrates a state by adding a rate
      Parameter:
      state -
      rate -
    • INTGRL

      public static void INTGRL(net.simplace.sim.util.FWSimVariable<Double> state, double rate, double delta)
      Integrates a state by adding a rate
      Parameter:
      state -
      rate -
      delta -
    • INTGRLA

      public static void INTGRLA(net.simplace.sim.util.FWSimVariable<Double[]> state, net.simplace.sim.util.FWSimVariable<Double[]> rate)
      Integrates a state array by adding a rate array
      Parameter:
      state -
      rate -
    • INTGRLA

      public static void INTGRLA(net.simplace.sim.util.FWSimVariable<Double[]> state, net.simplace.sim.util.FWSimVariable<Double[]> rate, double delta)
      Integrates a state array by adding a rate array
      Parameter:
      state -
      rate -
      delta -
    • INTGRLA

      public static void INTGRLA(net.simplace.sim.util.FWSimVariable<Double[]> state, double[] rate)
      Integrates a state array by adding a rate array
      Parameter:
      state -
      rate -
    • INTGRLA

      public static void INTGRLA(net.simplace.sim.util.FWSimVariable<Double[]> state, double[] rate, double delta)
      Integrates a state array by adding a rate array
      Parameter:
      state -
      rate -
      delta -