Class NonlinearPredictor

java.lang.Object
neqsim.process.mpc.NonlinearPredictor
All Implemented Interfaces:
Serializable

public class NonlinearPredictor extends Object implements Serializable
Performs multi-step ahead prediction using full NeqSim nonlinear simulation.

The NonlinearPredictor uses the actual NeqSim ProcessSystem to predict future CV trajectories given a sequence of MV moves. Unlike linear prediction which uses gain matrices, this approach captures all nonlinear process behavior.

Use cases:

  • Validate linear MPC predictions
  • Nonlinear MPC with full simulation in the loop
  • What-if scenario analysis
  • Operator training simulators

Example usage:


NonlinearPredictor predictor = new NonlinearPredictor(processSystem);

// Configure prediction
predictor.addMV(new ManipulatedVariable("Valve", valve, "opening"));
predictor.addCV(new ControlledVariable("Pressure", separator, "pressure", "bara"));
predictor.setPredictionHorizon(20);
predictor.setSampleTime(60.0); // 60 seconds

// Define MV trajectory
MVTrajectory trajectory = new MVTrajectory();
trajectory.addMove("Valve", 0.52);
trajectory.addMove("Valve", 0.54);
trajectory.addMove("Valve", 0.55);

// Run prediction
PredictionResult result = predictor.predict(trajectory);

// Access results
double[] futurePressure = result.getTrajectory("Pressure");

Since:
3.0
Version:
1.0
Author:
Even Solbraa
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • processSystem

      private final transient ProcessSystem processSystem
      The process system to use for prediction.
    • manipulatedVariables

      private final List<ManipulatedVariable> manipulatedVariables
      List of manipulated variables.
    • controlledVariables

      private final List<ControlledVariable> controlledVariables
      List of controlled variables.
    • predictionHorizon

      private int predictionHorizon
      Prediction horizon (number of steps).
    • sampleTimeSeconds

      private double sampleTimeSeconds
      Sample time in seconds.
    • cloneProcess

      private boolean cloneProcess
      Whether to clone the process for each prediction (safer but slower).
  • Constructor Details

    • NonlinearPredictor

      public NonlinearPredictor(ProcessSystem processSystem)
      Construct a nonlinear predictor for a ProcessSystem.
      Parameters:
      processSystem - the NeqSim process to use for prediction
  • Method Details

    • addMV

      Add a manipulated variable.
      Parameters:
      mv - the manipulated variable
      Returns:
      this predictor for method chaining
    • addCV

      Add a controlled variable.
      Parameters:
      cv - the controlled variable
      Returns:
      this predictor for method chaining
    • setPredictionHorizon

      public NonlinearPredictor setPredictionHorizon(int horizon)
      Set the prediction horizon.
      Parameters:
      horizon - number of prediction steps
      Returns:
      this predictor for method chaining
    • setSampleTime

      public NonlinearPredictor setSampleTime(double seconds)
      Set the sample time.
      Parameters:
      seconds - sample time in seconds
      Returns:
      this predictor for method chaining
    • setCloneProcess

      public NonlinearPredictor setCloneProcess(boolean clone)
      Set whether to clone the process for each prediction.
      Parameters:
      clone - true to clone (safer), false to modify in-place (faster)
      Returns:
      this predictor for method chaining
    • getPredictionHorizon

      public int getPredictionHorizon()
      Get the prediction horizon.
      Returns:
      number of prediction steps
    • getSampleTimeSeconds

      public double getSampleTimeSeconds()
      Get the sample time.
      Returns:
      sample time in seconds
    • predict

      Predict CV trajectories given an MV trajectory.
      Parameters:
      trajectory - the MV trajectory to apply
      Returns:
      prediction result with CV trajectories
    • predictConstant

      public NonlinearPredictor.PredictionResult predictConstant(double... mvValues)
      Predict CV trajectories given constant MV values.
      Parameters:
      mvValues - constant MV values (one per MV)
      Returns:
      prediction result
    • clear

      public NonlinearPredictor clear()
      Clear all variable definitions.
      Returns:
      this predictor for method chaining