Class ReconciliationVariable

java.lang.Object
neqsim.process.util.reconciliation.ReconciliationVariable
All Implemented Interfaces:
Serializable

public class ReconciliationVariable extends Object implements Serializable
A measured process variable participating in data reconciliation.

Each variable represents a single plant measurement (flow rate, temperature, pressure, etc.) with its measured value and uncertainty (standard deviation). After reconciliation, the adjusted value satisfies all balance constraints while minimizing weighted deviations from measurements.

Typical usage from Python:

var = ReconciliationVariable("feed_flow", 1000.0, 20.0)
var.setUnit("kg/hr")
engine.addVariable(var)
Version:
1.0
Author:
Process Optimization Team
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • name

      private String name
      Variable name (user-defined identifier).
    • measuredValue

      private double measuredValue
      Raw measured value from plant instrumentation.
    • uncertainty

      private double uncertainty
      Measurement uncertainty as standard deviation (sigma).
    • reconciledValue

      private double reconciledValue
      Reconciled (adjusted) value after WLS solution. Set by the engine.
    • modelValue

      private double modelValue
      Model-predicted value from process simulation. Optional.
    • hasModelValue

      private boolean hasModelValue
      Whether a model value has been set.
    • unit

      private String unit
      Engineering unit string (e.g., "kg/hr", "bara", "C").
    • equipmentName

      private String equipmentName
      Optional link to the equipment name in ProcessSystem that this variable measures.
    • propertyName

      private String propertyName
      Optional property name on the equipment (e.g., "massFlowRate", "temperature", "pressure").
    • normalizedResidual

      private double normalizedResidual
      Normalized residual after reconciliation (set by engine).
    • grossError

      private boolean grossError
      Whether this variable was flagged as a gross error.
  • Constructor Details

    • ReconciliationVariable

      public ReconciliationVariable(String name, double measuredValue, double uncertainty)
      Creates a reconciliation variable with name, measured value, and uncertainty.
      Parameters:
      name - variable identifier, must be unique within the engine
      measuredValue - raw plant measurement
      uncertainty - measurement standard deviation (sigma), must be positive
      Throws:
      IllegalArgumentException - if uncertainty is not positive
    • ReconciliationVariable

      public ReconciliationVariable(String name, String equipmentName, String propertyName, double measuredValue, double uncertainty)
      Creates a reconciliation variable linked to a specific equipment property.
      Parameters:
      name - variable identifier
      equipmentName - name of equipment in the ProcessSystem
      propertyName - property measured (e.g., "massFlowRate")
      measuredValue - raw plant measurement
      uncertainty - measurement standard deviation (sigma), must be positive
      Throws:
      IllegalArgumentException - if uncertainty is not positive
  • Method Details

    • getName

      public String getName()
      Returns the variable name.
      Returns:
      the name
    • setName

      public void setName(String name)
      Sets the variable name.
      Parameters:
      name - the name to set
    • getMeasuredValue

      public double getMeasuredValue()
      Returns the raw measured value from the plant.
      Returns:
      measured value in engineering units
    • setMeasuredValue

      public void setMeasuredValue(double measuredValue)
      Sets the raw measured value from the plant.
      Parameters:
      measuredValue - the measurement reading
    • getUncertainty

      public double getUncertainty()
      Returns the measurement uncertainty (standard deviation).
      Returns:
      sigma in engineering units
    • setUncertainty

      public void setUncertainty(double uncertainty)
      Sets the measurement uncertainty (standard deviation).
      Parameters:
      uncertainty - sigma, must be positive
      Throws:
      IllegalArgumentException - if uncertainty is not positive
    • getReconciledValue

      public double getReconciledValue()
      Returns the reconciled value after the WLS solve.
      Returns:
      adjusted value satisfying balance constraints
    • setReconciledValue

      public void setReconciledValue(double reconciledValue)
      Sets the reconciled value. Called by DataReconciliationEngine.
      Parameters:
      reconciledValue - the adjusted value
    • getAdjustment

      public double getAdjustment()
      Returns the adjustment: reconciled minus measured.
      Returns:
      reconciledValue - measuredValue
    • getModelValue

      public double getModelValue()
      Returns the model-predicted value from process simulation.
      Returns:
      model value, or NaN if not set
    • setModelValue

      public void setModelValue(double modelValue)
      Sets the model-predicted value from process simulation.
      Parameters:
      modelValue - the simulation prediction
    • hasModelValue

      public boolean hasModelValue()
      Returns whether a model value has been set.
      Returns:
      true if setModelValue was called
    • getUnit

      public String getUnit()
      Returns the engineering unit string.
      Returns:
      unit string (e.g., "kg/hr")
    • setUnit

      public ReconciliationVariable setUnit(String unit)
      Sets the engineering unit string.
      Parameters:
      unit - the unit to set
      Returns:
      this variable for chaining
    • getEquipmentName

      public String getEquipmentName()
      Returns the linked equipment name.
      Returns:
      equipment name, or empty string if not linked
    • setEquipmentName

      public ReconciliationVariable setEquipmentName(String equipmentName)
      Sets the linked equipment name.
      Parameters:
      equipmentName - the equipment name in ProcessSystem
      Returns:
      this variable for chaining
    • getPropertyName

      public String getPropertyName()
      Returns the linked property name.
      Returns:
      property name, or empty string if not linked
    • setPropertyName

      public ReconciliationVariable setPropertyName(String propertyName)
      Sets the linked property name.
      Parameters:
      propertyName - the property name (e.g., "massFlowRate")
      Returns:
      this variable for chaining
    • getNormalizedResidual

      public double getNormalizedResidual()
      Returns the normalized residual after reconciliation.

      Computed as (reconciledValue - measuredValue) / adjustedSigma where adjustedSigma accounts for the constraint correction covariance. Used for gross error detection.

      Returns:
      normalized residual (dimensionless)
    • setNormalizedResidual

      public void setNormalizedResidual(double normalizedResidual)
      Sets the normalized residual. Called by DataReconciliationEngine.
      Parameters:
      normalizedResidual - the computed normalized residual
    • isGrossError

      public boolean isGrossError()
      Returns whether this variable was flagged as a gross error.
      Returns:
      true if the normalized residual exceeds the gross error threshold
    • setGrossError

      public void setGrossError(boolean grossError)
      Sets the gross error flag. Called by DataReconciliationEngine.
      Parameters:
      grossError - true if flagged
    • toString

      public String toString()
      Returns a summary string.
      Overrides:
      toString in class Object
      Returns:
      human-readable representation of this variable