CloseGap

Determine the rate of flow (action) to close a gap between a quantity and its desired value

Diagram

Information

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

The output y is given by the expression:

y = (u_reference - u_current) / u_adjTime

where the time to close the gap (u_adjTime) can alternatively be a constant (adjTime). If the adjustement time is zero, then the output y will be zero as well.

Limitations

  • The adjustment time must not be negative. Negative values will be caught by an assert statement and will cause the simulation to stop.

  • Catching a division by zero (e.g., adjustement time is zero) by returning a zero output will not be an adequate structure if some kind of discrete behavior is what is wanted:  Adjustement time being zero may then mean that the stock should change immediately which usually only makes sense at defined events. If such discrete behavior is intended this structure should not be used.

Notes

  • The output may be multiplied with (-1) in order to use the output to control an outflow.

  • See [6, p. 30] or Jim Hines' Molecules of Structure website (→Close Gap) for more details on the use of this structure within system dynamics.

Parameters (8)

adjTime

Value: 1

Type: Time (s)

Description: Time to close the gap

maxRate

Value: inf

Type: OutputType

Description: Maximum rate feasible

minRate

Value: 0

Type: OutputType

Description: Minimum rate feasible

hasConstantAdjTime

Value: true

Type: Boolean

Description: = true, if the time to close the gap is a constant paramater

invertOutput

Value: false

Type: Boolean

Description: = true, if the output is to be multiplied with (-1)

clipOutput

Value: false

Type: Boolean

Description: = true, if the indicated rate is to clipped to not exceed limitations

strict

Value: true

Type: Boolean

Description: = true, if strict limits with noEvent(..) (constantLimiter.strict) (clip1.strict)

homotopyType

Value: LimiterHomotopy.Linear

Type: LimiterHomotopy

Description: Simplified model for homotopy-based initialization (clip1.homotopyType)

Connectors (4)

y

Type: RealOutput

Description: Policy output signal

u_reference

Type: RealInput

Description: Desired or reference value for the controlled quantity (i.e., the goal)

u_current

Type: RealInput

Description: Current value of controlled quantity

u_adjTime

Type: RealInput

Description: Time to close the gap

Components (8)

modelSettings

Type: ModelSettings

Description: Setting important global variables within a model

unchanged1

Type: PassThrough

Description: Use the calculated net rate of flow

invertedAction

Type: Gain

Description: This will turn negative rates to positive ones (for use with an outflow)

unchanged2

Type: PassThrough

Description: Use the calculated net rate of flow

clip1

Type: Clip

Description: Clips input signal so that it remains within a given interval

parAdjTime

Type: ConstantConverterTime

Description: Constant time to close the gap (optional)

gap

Type: Gap

Description: Difference between the goal and the current value

actionToCloseGap

Type: Division_Guarded

Description: Rate of (net) flow to close the gap

Used in Components (5)

SimpleControl

BusinessSimulation.CausalLoop

Directly influencing a stock to keep it at setpoint value

ForceToInputValue

BusinessSimulation.CausalLoop

Flow is obtained as closing the gap to input value

ForceToStockValue

BusinessSimulation.CausalLoop

Flow is obtained as closing the gap to input stock value

HinesCoflow

BusinessSimulation.Stocks

Accounting for changes in average quality of a stock as new entries with different characteristic flow in

FirstOrderStockAdjustment

BusinessSimulation.MoleculesOfStructure.Policy

Maintain a stock at a desired level