.BusinessSimulation.Functions.constrainedRateBoolean

Information

This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.

The real output actualRate is determined by checking whether the real input indicatedRate is complying with the restrictions signaled by a connected stock in form of the boolean flags stopInflow and stopOutflow. If the rate is found to violate either flag false is returned, in all other cases true is returned.

Syntax

Functions.constrainedRateBoolean( indicatedRateIsInflowToStock, stopInflow, stopOutflow)
Functions.constrainedRateBoolean(indicatedRate < 0, stopInflow, stopOutflow)

Examples


Functions.constrainedRateBoolean(-5.0 < 0, stopInflow = true, stopOutflow = false); //  false
Functions.constrainedRateBoolean( 5.0 < 0, stopInflow = true, stopOutflow = false); //  true
Functions.constrainedRateBoolean(-5.0 < 0, stopInflow = false, stopOutflow = true); //  true
Functions.constrainedRateBoolean( 5.0 < 0, stopInflow = false, stopOutflow = true); //  false

Notes

Rates are usually set by flow components and have to observe the flow-restrictions with regard to a connected stock component. By Modelica conventions a negative rate for the flow indicates an inflow with regard to the connected stock, while a positive rate indicates an outflow for the stock.

Thus, in the first example above the indicated negative rate for a →FlowPort would mean an outflow from the flow component and an inflow with regard to the connected →StockPort. Observing the flow restriction signaled by the stock false is returned.

See also

constrainedRate

Interface

function constrainedRateBoolean
  extends BusinessSimulation.Icons.Function;
  input Boolean indRateIsInflow "Proposed rate is inflow to a connected stock";
  input Boolean stopInflow "Signal from connected stock";
  input Boolean stopOutflow "Signal from connected stock";
  output Boolean useRate "= true, if the indicated rate does not violate restrictions";
end constrainedRateBoolean;

Revisions


Generated at 2024-12-21T19:25:56Z by OpenModelicaOpenModelica 1.24.3 using GenerateDoc.mos