modelAccount
Basic model of an account with optional interest
Extends from Icons.SubsystemIncubator (General Icon for stocks), Interfaces.Basics.OutputTypeChoice (Partial model to set output type).
Information
This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
The output y reports the balance of an account that is increased or decreased by flows connected to the stock ports or at given rates (u_plus and u_minus respectively) if hasRateInputs = true. When there are interest payments (withInterest = true) positive and negative balances of the account will lead to interest earned and interest paid, respectively. The associated fractional rates can be given either as constants or as variable inputs.
Notes
- Usually rates for deposits and withdrawals are given as separate, positive inputs. Using
hasNetRateInput = truethe rate of flow for the account can be given as a netRate using the connectoru_plusonly. - Fractional rates are assumed to be continuously compounding rates (→ForceOfInterest).
- The
Accountis a more general structure than the widely known bathtub [6, pp.10f.]
See also
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| String | iconLabel (from SubsystemIncubator) | "" | |
| OutputType | initialBalance | 0 | Initial balance of the account |
| Rate | interestRatePlus | unspecified | Constant fractional interest rate for positive balances (optional) |
| Rate | interestRateMinus | unspecified | Constant fractional interest rate for negative balances (optional) |
| Structural Parameters | |||
| Boolean | hasRateInputs | true | = true, if input connectors should allow giving transaction rates increasing/decreasing the balance of the account |
| Boolean | hasNetRateInput | false | = true, if the rate of flow is given a net rate (u_plus only) |
| Boolean | withInterest | false | = true, if positive and negative balances lead to interest earned or paid |
| Boolean | hasConstantInterest | true | = true, if the optional interest rates are given as constant parameters |
| Advanced | |||
| InitializationOptions | init | modelSettings.init | Provide InitializationOptions (Free, FixedValue, SteadyState) (accountBalance.init) |
| Boolean | strict | true | = true, if strict limits with noEvent(..) (positiveBalance.strict) |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Interfaces.Connectors.StockPort | inflow | Increasing the balance of the account | |
| Interfaces.Connectors.StockPort | outflow | Decreasing the balance of the account | |
| Interfaces.Connectors.RealInput | u_plus | Rate of inflow increasing the account (or net rate of flow) | |
| Interfaces.Connectors.RealInput | u_minus | Rate of outflow decreasing the account | |
| Interfaces.Connectors.RealInput | u_interestPlus | Fractional interest rate for positive balances (optional) | |
| Interfaces.Connectors.RealInput | u_interestMinus | Fractional interest rate for negative balances (optional) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| RealOutput | y_intEarned | Interest earned (optional) | |
| RealOutput | y_intPaid | Interest paid (optional) | |
| RealOutput | y | Balance of the account (e.g., amount in the stock) | |
| ModelSettings | modelSettings |