Class ProductionOptimizer.ManipulatedVariable
java.lang.Object
neqsim.process.util.optimizer.ProductionOptimizer.ManipulatedVariable
- Enclosing class:
ProductionOptimizer
Definition of a manipulated decision variable for multi-variable optimization.
A manipulated variable represents a process parameter that can be adjusted during optimization. Each variable has bounds, a unit, and a setter function that applies the value to the process model.
Java Example
ManipulatedVariable flowVar = new ManipulatedVariable("feedFlow", 50000.0, 200000.0, // lower/upper
// bounds
"kg/hr", (proc, val) -> ((Stream) proc.getUnit("feed")).setFlowRate(val, "kg/hr"));
Python Example (via JPype)
from jpype import JImplements, JOverride
@JImplements("java.util.function.BiConsumer")
class FlowSetter:
@JOverride
def accept(self, proc, val):
proc.getUnit("feed").setFlowRate(float(val), "kg/hr")
flow_var = ManipulatedVariable("feedFlow", 50000.0, 200000.0, "kg/hr", FlowSetter())
- Version:
- 1.0
- Author:
- NeqSim Development Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleprivate final Stringprivate final BiConsumer<ProcessSystem, Double> private final Stringprivate final double -
Constructor Summary
ConstructorsConstructorDescriptionManipulatedVariable(String name, double lowerBound, double upperBound, String unit, BiConsumer<ProcessSystem, Double> setter) Constructs a manipulated variable. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ProcessSystem process, double value) Applies the variable value to the process model.doubleReturns the lower bound.getName()Returns the variable name.getUnit()Returns the engineering unit.doubleReturns the upper bound.
-
Field Details
-
name
-
lowerBound
private final double lowerBound -
upperBound
private final double upperBound -
unit
-
setter
-
-
Constructor Details
-
ManipulatedVariable
public ManipulatedVariable(String name, double lowerBound, double upperBound, String unit, BiConsumer<ProcessSystem, Double> setter) Constructs a manipulated variable.- Parameters:
name- unique name identifying this variablelowerBound- minimum allowed value for the variableupperBound- maximum allowed value for the variableunit- engineering unit string (e.g., "kg/hr", "bara", "C")setter- BiConsumer that applies the variable value to the process model- Throws:
NullPointerException- if name or setter is null
-
-
Method Details
-
getName
-
getLowerBound
public double getLowerBound()Returns the lower bound.- Returns:
- minimum allowed value
-
getUpperBound
public double getUpperBound()Returns the upper bound.- Returns:
- maximum allowed value
-
getUnit
-
apply
Applies the variable value to the process model.- Parameters:
process- the process system to modifyvalue- the value to set
-