Category: System Dynamics
Represents state element for information flows.
syState(RateOfChange, DiscreteChange, InitialValue, TimeNow)
The syState function syntax has the following arguments:
- RateOfChange: required. Rate of change as a number or a name of corresponding syLoop().
- DiscreteChange: required. Discrete change in particular timestep as a number or a name of corresponding syLoop().
- InitialValue: required. Initial state at the very beginning of simulation time.
- TimeNow: required. Reference to a cell with syClock().
Return value is current state.
syState provides a state variable in the model. Similar element is syStock() which is best suited to material flows modeling.
The value of the syState is changed according to the rate of change (in assumed unit of time; RateOfChange) that can be negative or positive. InitialValue is the value of syState at the start of the simulation time. At each timestep, a specific value can be added by setting DiscreteChange argument.
Feedback loops can be arranged by syLoop() elements. To implement the feedback loop, firstly refer to the model's "outcome" variables like syState and other elements in your model, by Excel formulas. These formulas should represent the system's behavior and interrelations between variables. The resulting value that directly influences the syState (rate of change or discrete change) can be provided to syState by the syLoop() element.
NOTE: If syState refers to a syLoop() that does not depend from the model, its return value is error #VALUE during simulation.
=syState(0,A3,0,A1)- Together with
=syScheduler(0.5,3,A1)in cell A3 we arranged a simple counter of events coming from syScheduler, discretely adding events to the state variable.