.BusinessSimulation.Stocks.CapacityRestrictedStock

Information

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

This is a restricted reservoir of the system dynamics methodology, which accumulates material  (i.e., countable entities, some form of matter) transported by flow components connected to the component's StockPorts. Like a MaterialStock the CapacityRestrictedStock can never become negative—we are not collecting "antimatter"—and will prevent connected flow components from draining its value below zero. Unlike other stocks, minCapacity and maxCapacity are seen as capacity restrictions that for "physical" reasons cannot be violated—the restrictions can be given as either constant parameters (minValue, maxValue) or as variable inputs (u_min, u_max). Accordingly, the component will signal flow restrictions via its port that must be observed by connected flow components.

Implementation

The value of the stock will be set to zero if the calculated value x is less than a very small positive amount and if reinitializeStock = true is chosen in the Advanced tab:

  if reinitializeStock then
    when x < 0 then
      reinit(x, 0);
    end when;
  end if;

CapacityRestrictedStock components will prevent connected flows from draining the stock via their →StockPort connectors' Boolean flags, should the calculated state variable x be less than a very small positive amount:


  inflow.stopInflow = not x < maxCapacity - BusinessSimulation.Constants.small;
  outflow.stopInflow = inflow.stopInflow;

  inflow.stopOutflow = not x > minCapacity + BusinessSimulation.Constants.small;
  outflow.stopOutflow = inflow.stopOutflow;

Notes

See also

MaterialStockInformationLevel


Generated at 2024-12-03T19:25:34Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos