LinearInteraction

Linear model of interaction between two stocks

Diagram

Information

This information is part of the Business Simulation Library (BSL).

The LinearInteraction component allows to model the interaction between two stocks A (portA) and A (portB) as linear equations:

Formula.svg

Note: Capital letters were chosen to represent the stocks (state variables) connected at portA and portB in the formula above. Also dot notation is used for a stock's rate of flow—its first derivative with respect to time.

Coefficient Unit Description
a_0

amount of A per second

Rate of growth for stock A

b_0

amount of B per second

Rate of growth for stock B

a_A

1/s

Fractional rate of growth for stock A
(e.g., the self-coupling coefficient for A)

b_B

1/s

Fractional rate of growth for stock B
(e.g., the self-coupling coefficient for B)

a_B

amount of A per amount of B per second

Rate of growth for stock A per stock B
(e.g., the coupling-cofficient for B towards A)

b_A

amount of B per amount of A per second

Rate of growth for stock B per stock A
(e.g., the coupling-coefficient for A towards B)

The coefficients can be given as parameters or as variables via the expandable connector dataIn.


Examples

A linear harmonic oscillator can be modeled as a special case of linear interactions where the rates for the mutual influences (e.g., fractionalGrowthRate_B_per_A and fractionalGrowthRate_A_per_B) are negative. In that case, positive stock A will decrease stock B and vice versa.

The Linear Interaction can be used to model Strogatz' famous model for the dynamics of a love affair (conspicuously between "Romeo" and "Juliet") as shown in →LoveHateDynamics [16].

See also

NonlinearInteractionComplexInteraction

Parameters (9)

hasConstantGrowthRates

Value: false

Type: Boolean

Description: = true, if the linear growth rates are given by constant parameters

hasConstantFractionalGrowthRates

Value: false

Type: Boolean

Description: = true, if the fractional growth rates are given by constant parameters

hasConstantCouplingCoefficients

Value: false

Type: Boolean

Description: = true, if the induced growth rates are given by constant parameters

a_0

Value: unspecified

Type: Rate (1/s)

Description: Constant rate of growth for stock A

b_0

Value: unspecified

Type: Rate (1/s)

Description: Constant rate of growth for stock B

a_A

Value: unspecified

Type: Rate (1/s)

Description: Constant fractional rate of growth for stock A (self-coupling)

b_B

Value: unspecified

Type: Rate (1/s)

Description: Constant fractional rate of growth for stock B (self-coupling)

a_B

Value: unspecified

Type: Rate (1/s)

Description: Constant Rate of growth for stock A per unit of B (coupling B to A)

b_A

Value: unspecified

Type: Rate (1/s)

Description: Constant cross-fractional rate of growth for stock B per stock A (coupling A to B)

Connectors (13)

portA

Type: FlowPort

Description: Flow from/to Stock A

portB

Type: FlowPort

Description: Flow to/from Stock B

y_B

Type: RealOutput_B

Description: Rate for flow to and from B (positive value indicates inflow)

y1_B

Type: RealOutput_B

Description: Rate for flow to and from B (positive value indicates inflow)

y1_A

Type: RealOutput_A

Description: Rate for flow to and from A (positive value indicates inflow)

y_A

Type: RealOutput_A

Description: Rate for flow to and from A (positive value indicates inflow)

dataIn

Type: Input_Connector

Description: Continuous inputs for the component

u_growthRate_A

Type: RealOutput

u_fractionalGrowthRate_A

Type: RealOutput

u_growthRate_A_per_B

Type: RealOutput

u_growthRate_B_per_A

Type: RealOutput

u_fractionalGrowthRate_B

Type: RealOutput

u_growthRate_B

Type: RealOutput

Components (18)

parGrowthRateA

Type: ConstantConverterRate

Description: Constant growth rate for A (optional)

parFractionalRateA

Type: ConstantConverterRate

Description: Constant fractional growth rate for A (optional)

parCrossFractionalRateA

Type: ConstantConverterRate

Description: Constant cross-fractional growth rate for A (optional)

parGrowthRateB

Type: ConstantConverterRate

Description: Constant growth rate for B (optional)

parFractionalRateB

Type: ConstantConverterRate

Description: Constant fractional growth rate for B (optional)

parCrossFractionalRateB

Type: ConstantConverterRate

Description: Constant cross-fractional growth rate for B (optional)

growingA1

Type: ExogenousChange

Description: Linear growth

growingA2

Type: ExponentialChange

Description: Exponential growth for A

growingA3

Type: ExogenousChange

Description: Cross-fractional growth rate for A per B

stockB

Type: FlowPortSensor

Description: Amount in stock B

stockA

Type: FlowPortSensor

Description: Amount in stock A

inducedGrowthA

Type: Product_2

Description: Rate of growth induced by stock B

totalRateA

Type: Add_3

growingB1

Type: ExogenousChange

Description: Linear growth

growingB2

Type: ExponentialChange

Description: Exponential growth for B

growingB3

Type: ExogenousChange

Description: Cross-fractional growth rate for B per A

inducedGrowthB

Type: Product_2

Description: Rate of growth induced by stock A

totalRateB

Type: Add_3

Used in Examples (1)

LoveHateDynamics

BusinessSimulation.Examples

Romeo and Juliet model as introduced by Strogatz

Used in Components (1)

ComplexInteraction

BusinessSimulation.Flows.Interaction

Combined linear and nonlinear interaction

Revisions

  • Input_Connector defined as encapsulated expandable connector in v2.1.0.

  • Values for optional parameters changed to unspecified in v2.1.0.