CloseGapDetermine the rate of flow (action) to close a gap between a quantity and its desired value 
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.
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 homotopybased initialization (clip1.homotopyType) 
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 
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 
BusinessSimulation.CausalLoop Directly influencing a stock to keep it at setpoint value 

BusinessSimulation.CausalLoop Flow is obtained as closing the gap to input value 

BusinessSimulation.CausalLoop Flow is obtained as closing the gap to input stock value 

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

BusinessSimulation.MoleculesOfStructure.Policy Maintain a stock at a desired level 