Class IndustrialMPCExporter
- All Implemented Interfaces:
Serializable
This class provides export capabilities for integrating NeqSim-generated models with external MPC platforms commonly used in process industries. It supports multiple standard formats including:
- Step response coefficients (DMC-style) for dynamic matrix controllers
- Transfer function parameters (FOPDT, SOPDT) for model-based controllers
- Variable configuration with OPC-style naming conventions
- Gain matrices and time constants for linear MPC
The exports include complete variable definitions with engineering units, limits, tuning parameters, and model data in formats that can be directly imported into industrial MPC configuration tools.
Example usage:
// Configure and identify model
ProcessLinkedMPC mpc = new ProcessLinkedMPC("separator_control", process);
mpc.addMV("valve", "opening", 0.0, 100.0);
mpc.addCV("separator", "pressure", 30.0);
mpc.identifyModel(60.0);
// Export for industrial MPC
IndustrialMPCExporter exporter = new IndustrialMPCExporter(mpc);
exporter.exportStepResponseModel("model_step_response.json");
exporter.exportVariableConfiguration("variables.json");
exporter.exportGainMatrix("gains.csv");
- Since:
- 3.0
- Version:
- 1.0
- Author:
- Even Solbraa
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringApplication name for exported files.private final ProcessLinkedMPCThe MPC controller to export.private doubleDefault dead time for FOPDT models (seconds).private doubleDefault time constant for FOPDT models (seconds).private intNumber of step response coefficients to export.private static final longprivate StepResponseGeneratorStep response generator for detailed model export.private StringTag prefix for variable naming. -
Constructor Summary
ConstructorsConstructorDescriptionIndustrialMPCExporter(ProcessLinkedMPC controller) Construct an exporter for a ProcessLinkedMPC. -
Method Summary
Modifier and TypeMethodDescriptioncreateCVConfig(ControlledVariable cv, int index) Get a real-time data exchange object for online integration.createDVConfig(DisturbanceVariable dv, int index) createMVConfig(ManipulatedVariable mv, int index) Create a soft-sensor exporter for the process system used by this controller.voidexportComprehensiveConfiguration(String filename) Export the complete model configuration as a single comprehensive JSON file.voidexportGainMatrix(String filename) Export the gain matrix in CSV format.voidexportObjectStructure(String filename) Export model object structure as a hierarchical configuration.voidexportStepResponseCSV(String filename) Export step response coefficients in tabular CSV format.voidexportStepResponseModel(String filename) Export the complete MPC model in step response coefficient format.voidexportTransferFunctions(String filename) Export transfer function parameters in CSV format.voidexportVariableConfiguration(String filename) Export variable configuration in a format suitable for industrial control systems.private double[]generateStepCoefficients(double gain, double tau, double sampleTime) Generate step response coefficients for a first-order system.setApplicationName(String name) Set the application name for exported files.setDefaultTimeConstant(double timeConstant) Set the default time constant for FOPDT models.setNumStepCoefficients(int numCoefficients) Set the number of step response coefficients to export.setTagPrefix(String prefix) Set the tag prefix for variable naming.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
controller
The MPC controller to export. -
stepResponseGenerator
Step response generator for detailed model export. -
numStepCoefficients
private int numStepCoefficientsNumber of step response coefficients to export. -
defaultTimeConstant
private double defaultTimeConstantDefault time constant for FOPDT models (seconds). -
defaultDeadTime
private double defaultDeadTimeDefault dead time for FOPDT models (seconds). -
applicationName
Application name for exported files. -
tagPrefix
Tag prefix for variable naming.
-
-
Constructor Details
-
IndustrialMPCExporter
Construct an exporter for a ProcessLinkedMPC.- Parameters:
controller- the MPC controller to export
-
-
Method Details
-
setNumStepCoefficients
Set the number of step response coefficients to export.- Parameters:
numCoefficients- number of coefficients (typically 30-120)- Returns:
- this exporter for method chaining
-
setDefaultTimeConstant
Set the default time constant for FOPDT models.- Parameters:
timeConstant- time constant in seconds- Returns:
- this exporter for method chaining
-
setTagPrefix
Set the tag prefix for variable naming.This prefix is prepended to all variable names in exports, useful for matching plant tag naming conventions.
- Parameters:
prefix- the tag prefix (e.g., "UNIT1.")- Returns:
- this exporter for method chaining
-
setApplicationName
Set the application name for exported files.- Parameters:
name- the application name- Returns:
- this exporter for method chaining
-
exportStepResponseModel
Export the complete MPC model in step response coefficient format.This format is commonly used by Dynamic Matrix Control (DMC) style controllers. Each MV-CV pair is represented by a vector of step response coefficients that describe the dynamic response.
- Parameters:
filename- the output filename- Throws:
IOException- if writing fails
-
exportVariableConfiguration
Export variable configuration in a format suitable for industrial control systems.The output includes all MVs, CVs, and DVs with their limits, setpoints, engineering units, and tuning parameters in a standardized format.
- Parameters:
filename- the output filename- Throws:
IOException- if writing fails
-
exportGainMatrix
Export the gain matrix in CSV format.The matrix shows the steady-state gain from each MV to each CV. Row headers are CV names, column headers are MV names.
- Parameters:
filename- the output filename- Throws:
IOException- if writing fails
-
exportTransferFunctions
Export transfer function parameters in CSV format.Each row contains the FOPDT (First Order Plus Dead Time) parameters for one MV-CV pair: gain, time constant, and dead time.
- Parameters:
filename- the output filename- Throws:
IOException- if writing fails
-
exportComprehensiveConfiguration
Export the complete model configuration as a single comprehensive JSON file.This format includes all information needed to configure an external MPC controller: variable definitions, model parameters, tuning weights, and constraints.
- Parameters:
filename- the output filename- Throws:
IOException- if writing fails
-
createDataExchange
Get a real-time data exchange object for online integration.- Returns:
- a new ControllerDataExchange instance
-
createMVConfig
-
createCVConfig
-
createDVConfig
-
generateStepCoefficients
private double[] generateStepCoefficients(double gain, double tau, double sampleTime) Generate step response coefficients for a first-order system.- Parameters:
gain- steady-state gaintau- time constant (seconds)sampleTime- sample time (seconds)- Returns:
- array of step response coefficients
-
exportStepResponseCSV
Export step response coefficients in tabular CSV format.This format is designed for easy import into industrial MPC systems. Each row contains the step response coefficient for one time step, with columns for each MV-CV pair.
- Parameters:
filename- the output filename- Throws:
IOException- if writing fails
-
exportObjectStructure
Export model object structure as a hierarchical configuration.This format mirrors the object structure used by industrial control system cores for configuration storage and data logging. It provides a complete description of the controller that can be serialized/deserialized.
- Parameters:
filename- the output filename- Throws:
IOException- if writing fails
-
createSoftSensorExporter
Create a soft-sensor exporter for the process system used by this controller.- Returns:
- a new SoftSensorExporter
-