Harmonic function definition

@PHASE {φi}
@END_TIME {tei}
@COMMENTS {CommentText}


The harmonic function describes an harmonic function of a single variable, F = F(t), where t is the independent variable and F the value of the function defined as a superposition of harmonics, hi(t). Harmonic functions are used in conjunction with 1D functions. A plot of the function will be generated if plotting control parameters are defined.

Each harmonic is defined by an amplitude ai, a period Ti, and a phase φi, in [rad]. The harmonic function then becomes
F(t) = Σi hi(t) = Σi ai sin 2π (t/Ti + φi).

  • If period Ti =  0.0, the corresponding harmonic is a constant hi(t) = ai, phase φi is not used.
  • If period Ti = -1.0, the corresponding harmonic is a constant hi(t) = ai sin 2πφi. Note that in this case, the phase is taken into account.


  1. The nature of the data defined for the harmonic function is determined by parameter Fun1DType.
    • Possible values of parameter Fun1DType are listed for the associated 1D function.
    • Parameters Fun1DType defined for the harmonic function and associated 1D function must match.
    • Parameter Fun1DType defines the units of the independent variable, t, and of harmonic function F.
  2. The definition of each harmonic is introduced by keyword @TABLE_ENTRIES. Default values: amplitude ai = 1, period Ti = 1 s, and phase φi = 0 rad.
  3. Optionally, a start time, tsi, and an end time, tei, can be defined for the harmonic. Default values: tsi = - DBL_MAX and tei = DBL_MAX. These start and end times are used in the following manner
    hi(t) = hi(tsi), if t < tsi,
    hi(t) = hi(t), if tsi < t < tei,
    hi(t) = hi(tei), if tei < t.
  4. It is possible to attach comments to the definition of the object; these comments have no effect on its definition.

Example 1.

The following example defines a harmonic time function,

if 0 ≤ t ≤ 0.2f(t) = 0.1(1 - cos 2πt/0.4),
if t > 0.2 f(t) = 0.2.

The resulting time function is depicted in fig. 2.

@PERIOD {0.0}
@PHASE {0.00}
@PERIOD {0.4}
@PHASE {0.25}
@END_TIME {0.2}
Figure 2.Time function: (1 - cos) shape.