Class CompressorOptimizationHelper
java.lang.Object
neqsim.process.util.optimizer.CompressorOptimizationHelper
Helper class for compressor-specific production optimization.
This class provides utilities for extracting optimization bounds from compressor charts, creating compressor-specific objectives and constraints, and performing two-stage optimization for multi-train compressor systems.
Key Features:
- Extract adaptive bounds from compressor performance charts (speed, flow ranges)
- Create standard compressor objectives (minimize power, maximize efficiency, maximize surge margin)
- Two-stage optimization: first balance loads across parallel trains, then maximize total throughput
- Support for VFD (variable frequency drive) and multi-speed compressors
Two-Stage Optimization Pattern:
For facilities with multiple parallel compressor trains:
- Stage 1 - Load Balancing: At fixed total flow, optimize train split fractions to balance loads (minimize max utilization across trains)
- Stage 2 - Throughput Maximization: With optimal splits, maximize total flow subject to constraints
Usage Example (Java):
// Extract bounds from compressor chart
CompressorBounds bounds = CompressorOptimizationHelper.extractBounds(compressor);
// Create speed variable with chart-derived bounds
ManipulatedVariable speedVar = CompressorOptimizationHelper.createSpeedVariable(compressor,
bounds.getMinSpeed(), bounds.getMaxSpeed());
// Two-stage optimization
TwoStageResult result = CompressorOptimizationHelper.optimizeTwoStage(process, feedStream,
Arrays.asList(comp1, comp2, comp3), flowBounds, config);
Usage Example (Python via JPype):
from neqsim.neqsimpython import jneqsim
Helper = jneqsim.process.util.optimizer.CompressorOptimizationHelper
# Extract bounds from compressor chart
bounds = Helper.extractBounds(compressor)
print(f"Speed range: {bounds.getMinSpeed():.0f} - {bounds.getMaxSpeed():.0f} RPM")
# Run two-stage optimization
result = Helper.optimizeTwoStage(process, feed, [comp1, comp2], flow_bounds, config)
print(f"Optimal flow: {result.getTotalFlow():.0f} kg/hr")
- Version:
- 1.0
- Author:
- NeqSim Development Team
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classContainer for compressor operating bounds extracted from performance charts.static final classResult of two-stage optimization containing final flow, splits, and per-train data. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateEfficiencyObjective(List<Compressor> compressors, double weight) Create an objective to maximize average polytropic efficiency.createOutletPressureVariable(Compressor compressor, double minPressure, double maxPressure) Create a manipulated variable for compressor outlet pressure.createPowerObjective(List<Compressor> compressors, double weight) Create an objective to minimize total compressor power.createSpeedVariable(Compressor compressor, double minSpeed, double maxSpeed) Create a manipulated variable for compressor speed.createSpeedVariables(List<Compressor> compressors) Create a list of compressor speed variables with chart-derived bounds.createStandardConstraints(List<Compressor> compressors) Create standard constraints for compressor optimization.createStandardObjectives(List<Compressor> compressors) Create standard objectives for compressor optimization.createSurgeMarginConstraint(List<Compressor> compressors, double minMargin, ProductionOptimizer.ConstraintSeverity severity) Create a constraint requiring minimum surge margin on all compressors.createSurgeMarginObjective(List<Compressor> compressors, double weight) Create an objective to maximize minimum surge margin across compressors.createValidityConstraint(List<Compressor> compressors) Create a constraint requiring all compressor simulations to be valid.extractBounds(Compressor compressor) Extract operating bounds from a compressor's performance chart.optimizeTwoStage(ProcessSystem process, StreamInterface feedStream, List<Compressor> compressors, List<BiConsumer<ProcessSystem, Double>> trainStreamSetters, double flowLowerBound, double flowUpperBound, ProductionOptimizer.OptimizationConfig config) Perform two-stage optimization for multi-train compressor systems.
-
Constructor Details
-
CompressorOptimizationHelper
public CompressorOptimizationHelper()
-
-
Method Details
-
extractBounds
Extract operating bounds from a compressor's performance chart.This method analyzes the compressor chart to determine:
- Speed range (min/max RPM from chart curves)
- Flow range at each speed curve
- Surge and stone wall lines
- Parameters:
compressor- the compressor to analyze- Returns:
- bounds extracted from chart, or default bounds if no chart available
-
createSpeedVariable
public static ProductionOptimizer.ManipulatedVariable createSpeedVariable(Compressor compressor, double minSpeed, double maxSpeed) Create a manipulated variable for compressor speed.- Parameters:
compressor- the compressor to controlminSpeed- minimum speed in RPMmaxSpeed- maximum speed in RPM- Returns:
- manipulated variable for speed optimization
-
createOutletPressureVariable
public static ProductionOptimizer.ManipulatedVariable createOutletPressureVariable(Compressor compressor, double minPressure, double maxPressure) Create a manipulated variable for compressor outlet pressure.- Parameters:
compressor- the compressor to controlminPressure- minimum outlet pressure in baramaxPressure- maximum outlet pressure in bara- Returns:
- manipulated variable for pressure optimization
-
createPowerObjective
public static ProductionOptimizer.OptimizationObjective createPowerObjective(List<Compressor> compressors, double weight) Create an objective to minimize total compressor power.- Parameters:
compressors- list of compressors to includeweight- objective weight (typically 1.0)- Returns:
- optimization objective for power minimization
-
createSurgeMarginObjective
public static ProductionOptimizer.OptimizationObjective createSurgeMarginObjective(List<Compressor> compressors, double weight) Create an objective to maximize minimum surge margin across compressors.- Parameters:
compressors- list of compressors to includeweight- objective weight (typically 1.0)- Returns:
- optimization objective for surge margin maximization
-
createEfficiencyObjective
public static ProductionOptimizer.OptimizationObjective createEfficiencyObjective(List<Compressor> compressors, double weight) Create an objective to maximize average polytropic efficiency.- Parameters:
compressors- list of compressors to includeweight- objective weight (typically 1.0)- Returns:
- optimization objective for efficiency maximization
-
createSurgeMarginConstraint
public static ProductionOptimizer.OptimizationConstraint createSurgeMarginConstraint(List<Compressor> compressors, double minMargin, ProductionOptimizer.ConstraintSeverity severity) Create a constraint requiring minimum surge margin on all compressors.- Parameters:
compressors- list of compressors to constrainminMargin- minimum required surge margin (e.g., 0.10 for 10%)severity- constraint severity (HARD or SOFT)- Returns:
- optimization constraint for surge margin
-
createValidityConstraint
public static ProductionOptimizer.OptimizationConstraint createValidityConstraint(List<Compressor> compressors) Create a constraint requiring all compressor simulations to be valid.- Parameters:
compressors- list of compressors to validate- Returns:
- optimization constraint for simulation validity
-
optimizeTwoStage
public static CompressorOptimizationHelper.TwoStageResult optimizeTwoStage(ProcessSystem process, StreamInterface feedStream, List<Compressor> compressors, List<BiConsumer<ProcessSystem, Double>> trainStreamSetters, double flowLowerBound, double flowUpperBound, ProductionOptimizer.OptimizationConfig config) Perform two-stage optimization for multi-train compressor systems.Stage 1: At fixed total flow, optimize split fractions to balance loads across trains. Stage 2: With optimal splits, maximize total flow subject to constraints.
- Parameters:
process- the process systemfeedStream- the main feed streamcompressors- list of parallel compressors (one per train)trainStreamSetters- functions to set each train's flow fractionflowLowerBound- minimum total flowflowUpperBound- maximum total flowconfig- optimization configuration- Returns:
- two-stage optimization result
-
createSpeedVariables
public static List<ProductionOptimizer.ManipulatedVariable> createSpeedVariables(List<Compressor> compressors) Create a list of compressor speed variables with chart-derived bounds.- Parameters:
compressors- list of compressors- Returns:
- list of speed manipulated variables
-
createStandardObjectives
public static List<ProductionOptimizer.OptimizationObjective> createStandardObjectives(List<Compressor> compressors) Create standard objectives for compressor optimization.Returns a list with three objectives:
- Minimize total power (weight 0.4)
- Maximize minimum surge margin (weight 0.3)
- Maximize average efficiency (weight 0.3)
- Parameters:
compressors- list of compressors- Returns:
- list of standard objectives
-
createStandardConstraints
public static List<ProductionOptimizer.OptimizationConstraint> createStandardConstraints(List<Compressor> compressors) Create standard constraints for compressor optimization.Returns constraints for:
- Simulation validity (HARD)
- Minimum 10% surge margin (HARD)
- Parameters:
compressors- list of compressors- Returns:
- list of standard constraints
-