Class FluidInterp

java.lang.Object
jline.solvers.fluid.FluidInterp

public final class FluidInterp extends Object
Clamped piecewise-linear interpolation of a vector-valued trajectory.

This is the shared time-varying-input evaluator of the fluid solver, used both by the trajectory-based iteration (TBI) transient, which reads the frozen complement trajectory of a cell, and by the time-varying rate multiplier of the closing ODE (FluidRateMultiplier). It mirrors MATLAB fluid_interpcols.m, transposed to the row-major (one row per time point) layout used throughout the Java fluid code: MATLAB samples a quantity in the columns of a matrix, here each row y[j] is the sample at time t[j].

Times outside [t[0], t[n-1]] are clamped to the boundary rows (zero-order hold outside the grid).

  • Method Details

    • interp

      public static double[] interp(double[] t, double[][] y, double tq, int dim)
      Interpolates the trajectory (t, y) at time tq.
      Parameters:
      t - strictly increasing time grid, length n
      y - n rows of dimension at least dim, row j sampled at t[j]
      tq - query time
      dim - number of components to return
      Returns:
      the interpolated (clamped) row, of length dim