Class ProductionOptimizer.ManipulatedVariable

java.lang.Object
neqsim.process.util.optimizer.ProductionOptimizer.ManipulatedVariable
Enclosing class:
ProductionOptimizer

public static final class ProductionOptimizer.ManipulatedVariable extends Object
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 Details

    • name

      private final String name
    • lowerBound

      private final double lowerBound
    • upperBound

      private final double upperBound
    • unit

      private final String unit
    • setter

      private final BiConsumer<ProcessSystem, Double> 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 variable
      lowerBound - minimum allowed value for the variable
      upperBound - maximum allowed value for the variable
      unit - 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

      public String getName()
      Returns the variable name.
      Returns:
      variable name
    • 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

      public String getUnit()
      Returns the engineering unit.
      Returns:
      unit string
    • apply

      public void apply(ProcessSystem process, double value)
      Applies the variable value to the process model.
      Parameters:
      process - the process system to modify
      value - the value to set