Modulation
Date: 2019-10-22

org.jmol.util

## Class Modulation

- java.lang.Object
- - org.jmol.util.Modulation

-     public class Modulation
      extends java.lang.Object

  A class to allow for more complex vibrations and associated phenomena, such as modulated crystals, including Fourier series, Crenel functions, and sawtooth functions
  Author:
    Bob Hanson hansonr@stolaf.edu 8/8/2013

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private double` | `a1`
    `private double` | `a2`
    `private char` | `axis`
    `private double` | `center`
    `private double` | `delta2`
    `private double` | `left`
    `(package private) static double[][]` | `legendre`
    `private int` | `order`
    `private double[]` | `params`
    `private double[]` | `qCoefs`
    `private double` | `right`
    `private static double` | `TWOPI`
    `private char` | `type`
    `static char` | `TYPE_DISP_FOURIER`
    `static char` | `TYPE_DISP_LEGENDRE`
    `static char` | `TYPE_DISP_SAWTOOTH`
    `static char` | `TYPE_OCC_CRENEL`
    `static char` | `TYPE_OCC_FOURIER`
    `static char` | `TYPE_SPIN_FOURIER`
    `static char` | `TYPE_SPIN_SAWTOOTH`
    `static char` | `TYPE_U_FOURIER`
    `static char` | `TYPE_U_LEGENDRE`
    `private java.lang.String` | `utens`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Modulation(char axis, char type, double[] params, java.lang.String utens, double[] qCoefs)` Each atomic modulation involves a fractional coordinate wave vector q, a Fourier power n, a modulation axis (x, y, or, z), and specified parameters that depend upon the type of function.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `apply(ModulationSet ms, double[][] t)`
    `(package private) void` | `calcLegendre(int m)`
    `java.util.Hashtable<java.lang.String,java.lang.Object>` | `getInfo()`
    `private boolean` | `range(double x4)` Check that left < x4 < right, but allow for folding

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TWOPI

          private static final double TWOPI

      See Also:
        Constant Field Values

    - #### qCoefs

          private double[] qCoefs

    - #### a1

          private double a1

    - #### a2

          private double a2

    - #### center

          private double center

    - #### left

          private double left

    - #### right

          private double right

    - #### order

          private int order

    - #### axis

          private char axis

    - #### type

          private final char type

    - #### params

          private double[] params

    - #### utens

          private java.lang.String utens

    - #### delta2

          private double delta2

    - #### TYPE_DISP_FOURIER

          public static final char TYPE_DISP_FOURIER

      See Also:
        Constant Field Values

    - #### TYPE_SPIN_FOURIER

          public static final char TYPE_SPIN_FOURIER

      See Also:
        Constant Field Values

    - #### TYPE_SPIN_SAWTOOTH

          public static final char TYPE_SPIN_SAWTOOTH

      See Also:
        Constant Field Values

    - #### TYPE_DISP_SAWTOOTH

          public static final char TYPE_DISP_SAWTOOTH

      See Also:
        Constant Field Values

    - #### TYPE_OCC_FOURIER

          public static final char TYPE_OCC_FOURIER

      See Also:
        Constant Field Values

    - #### TYPE_OCC_CRENEL

          public static final char TYPE_OCC_CRENEL

      See Also:
        Constant Field Values

    - #### TYPE_U_FOURIER

          public static final char TYPE_U_FOURIER

      See Also:
        Constant Field Values

    - #### TYPE_DISP_LEGENDRE

          public static final char TYPE_DISP_LEGENDRE

      See Also:
        Constant Field Values

    - #### TYPE_U_LEGENDRE

          public static final char TYPE_U_LEGENDRE

      See Also:
        Constant Field Values

    - #### legendre

          static double[][] legendre

  - ### Constructor Detail

    - #### Modulation

          public Modulation(char axis,
                            char type,
                            double[] params,
                            java.lang.String utens,
                            double[] qCoefs)

      Each atomic modulation involves a fractional coordinate wave vector q, a Fourier power n, a modulation axis (x, y, or, z), and specified parameters that depend upon the type of function. Types supported: Fourier [csin, ccos] Legendre [center, width, coeff, order] Crenel [center, width, amplitude] Sawtooth [center, width, amplitude]
      Parameters:
        `axis` -
        `type` -
        `params` -
        `utens` - TODO
        `qCoefs` -

  - ### Method Detail

    - #### apply

          void apply(ModulationSet ms,
                     double[][] t)

      Parameters:
        `ms` -
        `t` - -- Vector of coordinates for [x4, x5, x6, ...]

    - #### range

          private boolean range(double x4)

      Check that left < x4 < right, but allow for folding
      Parameters:
        `x4` -
      Returns:
        true only if x4 is in the (possibly folded) range of left and right

    - #### getInfo

          public java.util.Hashtable<java.lang.String,java.lang.Object> getInfo()

    - #### calcLegendre

          void calcLegendre(int m)