Class OnlineCalibrator
java.lang.Object
neqsim.process.calibration.OnlineCalibrator
- All Implemented Interfaces:
Serializable
Online calibrator for continuously updating model parameters based on real-time data.
Designed for integration with AI platforms that require auto-calibrating physics models. Supports incremental updates for real-time applications and full recalibration for periodic maintenance.
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a data point for calibration. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<OnlineCalibrator.DataPoint> private doubleprivate Instantprivate CalibrationQualityprivate intprivate final ProcessSystemprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionOnlineCalibrator(ProcessSystem processSystem) Creates an online calibrator for a process system. -
Method Summary
Modifier and TypeMethodDescriptionprivate CalibrationQualitycalculateQuality(int samples, double rmse) Calculates calibration quality metrics.private booleanChecks if any variable exceeds the deviation threshold.voidClears the calibration history.Exports calibration history for external analysis.Performs full recalibration using historical data.intGets the calibration history size.Gets the last calibration timestamp.Gets the calibration quality metrics.Performs incremental calibration update (fast, for real-time).booleanRecords a data point and checks if calibration is needed.booleanrecordDataPoint(Map<String, Double> measurements, Map<String, Double> predictions, Map<String, Double> conditions) Records a data point with operating conditions.voidsetDeviationThreshold(double threshold) Sets the deviation threshold that triggers recalibration.voidsetMaxHistorySize(int size) Sets the maximum history size for calibration data.voidsetTunableParameters(List<String> params) Configures which parameters can be tuned online.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
processSystem
-
tunableParameters
-
calibrationHistory
-
deviationThreshold
private double deviationThreshold -
maxHistorySize
private int maxHistorySize -
lastCalibration
-
lastQuality
-
-
Constructor Details
-
OnlineCalibrator
Creates an online calibrator for a process system.- Parameters:
processSystem- the process system to calibrate
-
-
Method Details
-
setTunableParameters
-
setDeviationThreshold
public void setDeviationThreshold(double threshold) Sets the deviation threshold that triggers recalibration.- Parameters:
threshold- relative deviation threshold (e.g., 0.1 for 10%)
-
setMaxHistorySize
public void setMaxHistorySize(int size) Sets the maximum history size for calibration data.- Parameters:
size- maximum number of data points to retain
-
recordDataPoint
-
recordDataPoint
public boolean recordDataPoint(Map<String, Double> measurements, Map<String, Double> predictions, Map<String, Double> conditions) Records a data point with operating conditions.- Parameters:
measurements- actual measured valuespredictions- model predicted valuesconditions- operating conditions (P, T, etc.)- Returns:
- true if deviation exceeds threshold
-
checkDeviation
Checks if any variable exceeds the deviation threshold.- Parameters:
point- the data point to check- Returns:
- true if deviation exceeds threshold, false otherwise
-
incrementalUpdate
-
fullRecalibration
Performs full recalibration using historical data.- Returns:
- calibration result
-
calculateQuality
Calculates calibration quality metrics.- Parameters:
samples- the number of samples usedrmse- the root mean square error- Returns:
- the calibration quality assessment
-
getQualityMetrics
Gets the calibration quality metrics.- Returns:
- calibration quality or null if never calibrated
-
getLastCalibrationTime
Gets the last calibration timestamp.- Returns:
- last calibration time or null
-
getHistorySize
public int getHistorySize()Gets the calibration history size.- Returns:
- number of data points in history
-
clearHistory
public void clearHistory()Clears the calibration history. -
exportHistory
Exports calibration history for external analysis.- Returns:
- list of data points
-