Class ReconciliationVariable
java.lang.Object
neqsim.process.util.reconciliation.ReconciliationVariable
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprivate StringOptional link to the equipment name inProcessSystemthat this variable measures.private booleanWhether this variable was flagged as a gross error.private booleanWhether a model value has been set.private doubleRaw measured value from plant instrumentation.private doubleModel-predicted value from process simulation.private StringVariable name (user-defined identifier).private doubleNormalized residual after reconciliation (set by engine).private StringOptional property name on the equipment (e.g., "massFlowRate", "temperature", "pressure").private doubleReconciled (adjusted) value after WLS solution.private static final longprivate doubleMeasurement uncertainty as standard deviation (sigma).private StringEngineering unit string (e.g., "kg/hr", "bara", "C"). -
Constructor Summary
ConstructorsConstructorDescriptionReconciliationVariable(String name, double measuredValue, double uncertainty) Creates a reconciliation variable with name, measured value, and uncertainty.ReconciliationVariable(String name, String equipmentName, String propertyName, double measuredValue, double uncertainty) Creates a reconciliation variable linked to a specific equipment property. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the adjustment: reconciled minus measured.Returns the linked equipment name.doubleReturns the raw measured value from the plant.doubleReturns the model-predicted value from process simulation.getName()Returns the variable name.doubleReturns the normalized residual after reconciliation.Returns the linked property name.doubleReturns the reconciled value after the WLS solve.doubleReturns the measurement uncertainty (standard deviation).getUnit()Returns the engineering unit string.booleanReturns whether a model value has been set.booleanReturns whether this variable was flagged as a gross error.setEquipmentName(String equipmentName) Sets the linked equipment name.voidsetGrossError(boolean grossError) Sets the gross error flag.voidsetMeasuredValue(double measuredValue) Sets the raw measured value from the plant.voidsetModelValue(double modelValue) Sets the model-predicted value from process simulation.voidSets the variable name.voidsetNormalizedResidual(double normalizedResidual) Sets the normalized residual.setPropertyName(String propertyName) Sets the linked property name.voidsetReconciledValue(double reconciledValue) Sets the reconciled value.voidsetUncertainty(double uncertainty) Sets the measurement uncertainty (standard deviation).Sets the engineering unit string.toString()Returns a summary string.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
Variable name (user-defined identifier). -
measuredValue
private double measuredValueRaw measured value from plant instrumentation. -
uncertainty
private double uncertaintyMeasurement uncertainty as standard deviation (sigma). -
reconciledValue
private double reconciledValueReconciled (adjusted) value after WLS solution. Set by the engine. -
modelValue
private double modelValueModel-predicted value from process simulation. Optional. -
hasModelValue
private boolean hasModelValueWhether a model value has been set. -
unit
Engineering unit string (e.g., "kg/hr", "bara", "C"). -
equipmentName
Optional link to the equipment name inProcessSystemthat this variable measures. -
propertyName
Optional property name on the equipment (e.g., "massFlowRate", "temperature", "pressure"). -
normalizedResidual
private double normalizedResidualNormalized residual after reconciliation (set by engine). -
grossError
private boolean grossErrorWhether this variable was flagged as a gross error.
-
-
Constructor Details
-
ReconciliationVariable
Creates a reconciliation variable with name, measured value, and uncertainty.- Parameters:
name- variable identifier, must be unique within the enginemeasuredValue- raw plant measurementuncertainty- 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 identifierequipmentName- name of equipment in the ProcessSystempropertyName- property measured (e.g., "massFlowRate")measuredValue- raw plant measurementuncertainty- measurement standard deviation (sigma), must be positive- Throws:
IllegalArgumentException- if uncertainty is not positive
-
-
Method Details
-
getName
-
setName
-
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 byDataReconciliationEngine.- 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
-
setUnit
Sets the engineering unit string.- Parameters:
unit- the unit to set- Returns:
- this variable for chaining
-
getEquipmentName
Returns the linked equipment name.- Returns:
- equipment name, or empty string if not linked
-
setEquipmentName
Sets the linked equipment name.- Parameters:
equipmentName- the equipment name in ProcessSystem- Returns:
- this variable for chaining
-
getPropertyName
Returns the linked property name.- Returns:
- property name, or empty string if not linked
-
setPropertyName
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) / adjustedSigmawhereadjustedSigmaaccounts 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 byDataReconciliationEngine.- 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 byDataReconciliationEngine.- Parameters:
grossError- true if flagged
-
toString
-