Class SoftSensor
java.lang.Object
neqsim.util.NamedBaseClass
neqsim.process.measurementdevice.MeasurementDeviceBaseClass
neqsim.process.measurementdevice.StreamMeasurementDeviceBaseClass
neqsim.process.measurementdevice.vfm.SoftSensor
- All Implemented Interfaces:
Serializable, MeasurementDeviceInterface, NamedInterface
Soft sensor for calculating derived properties from primary measurements and thermodynamic
models.
Soft sensors provide real-time estimates of properties that cannot be directly measured, using a combination of available measurements and physics-based models. This is essential for AI-augmented production optimization.
Supported properties include:
- Gas-Oil Ratio (GOR)
- Water Cut
- Density
- Viscosity
- Compressibility
- Heating Value
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTypes of properties that can be estimated. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate double[]private SoftSensor.PropertyTypeprivate static final longFields inherited from class StreamMeasurementDeviceBaseClass
streamFields inherited from class MeasurementDeviceBaseClass
unitFields inherited from class NamedBaseClass
name -
Constructor Summary
ConstructorsConstructorDescriptionSoftSensor(String name, StreamInterface stream, SoftSensor.PropertyType propertyType) Creates a new soft sensor. -
Method Summary
Modifier and TypeMethodDescriptionprivate doubleprivate doublecalculateDewPoint(SystemInterface fluid) private doublecalculateGasFVF(SystemInterface fluid) private doublecalculateGOR(SystemInterface fluid) private doubleprivate doublecalculateOilFVF(SystemInterface fluid) private doublecalculateProperty(SystemInterface fluid) Calculates the property from a flashed fluid.private doubleprivate doublecalculateWaterCut(SystemInterface fluid) doubleestimate()Estimates the property value from current inputs.doubleEstimates the property value from specified inputs.double[]Gets the last calculated sensitivities.doublegetMeasuredValue(String unit) Get Measured value in specified unit.Gets the property type being estimated.double[]Calculates sensitivity (Jacobian) of the output to input changes.getUncertaintyBounds(double pressureUncertainty, double temperatureUncertainty) Gets uncertainty bounds for the estimate.private static StringGets the default unit for a property type.voidSets a single input value.voidSets input values for the estimation.voidsetPropertyType(SoftSensor.PropertyType propertyType) Sets the property type to estimate.Methods inherited from class StreamMeasurementDeviceBaseClass
getStream, setStreamMethods inherited from class MeasurementDeviceBaseClass
acknowledgeAlarm, applySignalModifiers, displayResult, doConditionAnalysis, evaluateAlarm, getAlarmConfig, getAlarmState, getConditionAnalysisMaxDeviation, getConditionAnalysisMessage, getDelaySteps, getMaximumValue, getMeasuredPercentValue, getMinimumValue, getNoiseStdDev, getOnlineMeasurementValue, getOnlineSignal, getUnit, isLogging, isOnlineSignal, runConditionAnalysis, setAlarmConfig, setConditionAnalysis, setConditionAnalysisMaxDeviation, setDelaySteps, setIsOnlineSignal, setLogging, setMaximumValue, setMinimumValue, setNoiseStdDev, setOnlineMeasurementValue, setOnlineSignal, setQualityCheckMessage, setRandomSeed, setUnitMethods inherited from class NamedBaseClass
getName, getTagName, setName, setTagNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MeasurementDeviceInterface
equals, getMeasuredValue, getOnlineValue, hashCodeMethods inherited from interface NamedInterface
getName, getTagName, setName, setTagName
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
propertyType
-
inputValues
-
lastEstimate
private double lastEstimate -
lastSensitivity
private double[] lastSensitivity
-
-
Constructor Details
-
SoftSensor
Creates a new soft sensor.- Parameters:
name- the sensor name/tagstream- the stream to analyzepropertyType- the property to estimate
-
-
Method Details
-
getUnitForProperty
Gets the default unit for a property type.- Parameters:
type- property descriptor- Returns:
- canonical engineering unit for the property
-
setInputs
-
setInput
Sets a single input value.- Parameters:
name- input name (e.g., "pressure", "temperature")value- input value
-
estimate
public double estimate()Estimates the property value from current inputs.- Returns:
- estimated property value
-
estimate
-
calculateProperty
Calculates the property from a flashed fluid.- Parameters:
fluid- equilibrated fluid instance- Returns:
- property value expressed in the default unit
-
calculateGOR
-
calculateWaterCut
-
calculateHeatingValue
-
calculateBubblePoint
-
calculateDewPoint
-
calculateOilFVF
-
calculateGasFVF
-
calculateSolutionGOR
-
getSensitivity
public double[] getSensitivity()Calculates sensitivity (Jacobian) of the output to input changes.Uses finite differences to estimate partial derivatives.
- Returns:
- array of sensitivities [dOutput/dPressure, dOutput/dTemperature]
-
getLastSensitivity
public double[] getLastSensitivity()Gets the last calculated sensitivities.- Returns:
- array of [dOutput/dP, dOutput/dT]
-
getUncertaintyBounds
public UncertaintyBounds getUncertaintyBounds(double pressureUncertainty, double temperatureUncertainty) Gets uncertainty bounds for the estimate.- Parameters:
pressureUncertainty- pressure measurement uncertainty in bartemperatureUncertainty- temperature measurement uncertainty in K- Returns:
- uncertainty bounds for the estimated property
-
getPropertyType
Gets the property type being estimated.- Returns:
- the property type
-
setPropertyType
Sets the property type to estimate.- Parameters:
propertyType- the property type
-
getMeasuredValue
Description copied from class:MeasurementDeviceBaseClassGet Measured value in specified unit.
- Specified by:
getMeasuredValuein interfaceMeasurementDeviceInterface- Overrides:
getMeasuredValuein classMeasurementDeviceBaseClass- Parameters:
unit- aStringobject- Returns:
- a double
-