OJMSi  Vol.10 No.2 , April 2022
StochSD: A Full Potential CSS Language for Dynamic and Stochastic Modelling, Simulation and Statistical Analysis
Abstract: It is vital that a well-defined conceptual model can be realized by a macro-model (e.g., a Continuous System Simulation (CSS) model) or a micro-model (e.g., an Agent-Based model or Discrete Event Simulation model) and still produce mutually consistent results. The Full Potential CSS concept provides the rules so that the results from macro-modelling become fully consistent with those from micro-modelling. This paper focuses on the simulation language StochSD (Stochastic System Dynamics), which is an extension of classical Continuous System Simulation that implements the Full Potential CSS concept. Thus, in addition to modelling and simulating continuous flows between compartments represented by “real” numbers, it can also handle transitions of discrete entities by integer numbers, enabling combined models to be constructed in a straight-forward way. However, transition events of discrete entities (e.g., arrivals, accidents, deaths) usually happen irregularly over time, so stochasticity often plays a crucial role in their modelling. Therefore, StochSD contains powerful random functions to model uncertainties of different kinds, together with devices to collect statistics during a simulation or from multiple replications of the same stochastic model. Also, tools for sensitivity analysis, optimisation and statistical analysis are included. In particular, StochSD includes features for stochastic modelling, post-analysis of multiple simulations, and presentation of the results in statistical form. In addition to making StochSD a Full Potential CSS language, a second purpose is to provide an open-source package intended for small and middle-sized models in education, self-studies and research. To make StochSD and its philosophy easy to comprehend and use, it is based on the System Dynamics approach, where a system is described in terms of stocks and flows. StochSD is available for Windows, macOS and Linux. On the StochSD homepage, there is extensive material for a course in Modelling and Simulation in form of PowerPoint lectures and laboratory exercises.
Cite this paper: Gustafsson, L. , Gustafsson, E. and Gustafsson, M. (2022) StochSD: A Full Potential CSS Language for Dynamic and Stochastic Modelling, Simulation and Statistical Analysis. Open Journal of Modelling and Simulation, 10, 219-253. doi: 10.4236/ojmsi.2022.102012.

[1]   Gustafsson, L. (2000) Poisson Simulation—A Method for Generating Stochastic Variations in Continuous System Simulation. Simulation, 74, 264-274.

[2]   Gillespie, D.T. (2001) Approximate Accelerated Stochastic Simulation of Chemically Reacting Systems. The Journal of Chemical Physics, 115, 1716-1733.

[3]   Gustafsson, L. (2003) Poisson Simulation as an Extension of Continuous System Simulation for the Modeling of Queuing Systems. Simulation, 79, 528-541.

[4]   Gustafsson, L. and Sternad, M. (2007) Bringing Consistency to Simulation of Population Models—Poisson Simulation as a Bridge between Micro and Macro Simulation. Mathematical Biosciences, 209, 361-385.

[5]   Gustafsson, L. and Sternad, M. (2010) Consistent Micro, Macro and State-Based Population Modelling. Mathematical Biosciences, 225, 94-107.

[6]   Gustafsson, L. and Sternad, M. (2013) When Can a Deterministic Model of a Population System Reveal What Will Happen on Average? Mathematical Biosciences, 243, 28-45.

[7]   Gustafsson, L. and Sternad, M. (2016) A Guide to Population Modelling for Simulation. Open Journal of Modelling and Simulation, 4, 55-92.

[8]   Gustafsson, L., Sternad, M. and Gustafsson, E. (2017) The Full Potential of Continuous System Simulation Modelling. Open Journal of Modelling and Simulation, 5, 253-299.

[9]   Forrester, J.W. (1961) Industrial Dynamics. MIT Press, Cambridge, MA.

[10]   Forrester, J.W. (1968) Principles of Systems. Wright/Allen Press Inc., Cambridge, MA.

[11]   Donella Meadows, H. (2008) Thinking in Systems: A Primer. Chelsea Green Pub., White River Junction, VT.

[12]   Fortmann-Roe, S. (2014) Insight Maker: A General-Purpose Tool for Web-Based Modeling & Simulation. Simulation Modelling Practice and Theory, 47, 28-45.

[13]   Fortmann-Roe, S. (2022) Manual for Insight Maker (Providing More Features, e.g. Functions, that Are Supported but Not Described in StochSD. Note that Only the System Dynamics Part of Insight Is Supported in StochSD). Insight Maker.

[14]   Fortmann-Roe, S. (2022) Insight Maker API. Dokumentation of Built-In Functions.

[15]   Bratley, P., Fox, B.L. and Schrage, L.E. (1983) A Guide to Simulation. 2nd Edition, Springer-Verlag, New York.

[16]   Grandell, J. (1997) Mixed Poisson Processes. Chapman & Hall/CRC, London.

[17]   Volterra, V. (1926) Fluctuations in the Abundance of a Species Considered Mathematically. Nature, 118, 558-560.

[18]   Luenberger, D.G. (1979) Introduction to Dynamic Systems. Theory, Models and Applications. John Wiley & Sons, New York.

[19]   Braun, M. (1993) Differential Equations and Their Applications. 4th Edition, Springer-Verlag, New York.

[20]   Kermack, W.O. and McKendrick, A.G. (1927) A Contribution to the Mathematical Theory of Epidemics. Proceedings of the Royal Society of London. Series A, 115, 700-721.

[21]   Gross, D. and Harris, C.M. (1998) Fundamentals of Queueing Theory. 3rd Edition, John Wiley & Sons, New York.

[22]   Lanchester, F.W. (1916) Aircraft in Warfare, the Dawn of the Fourth Arm. Tiptree, Constable & Co., Ltd., London.

[23]   Gustafsson, L. (2022) StochSD User’s Manual and Tutorial.

[24]   Nelder, J.A. and Mead, R. (1965) A Simplex Method for Function Minimization. The Computer Journal, 7, 308-313.

[25]   Press, W.H., Flannery, B.P., Teukolsky, S.A. and Vetterling, W.T. (1989) Numerical Recipes (in FORTRAN, Pascal or C). The Art of Scientific Computing. Cambridge University Press, Cambridge.

[26]   Gustafsson, L. (2019) Optim—An Optimiser for Deterministic StochSD Models.

[27]   Gustafsson, L. (2019) Sensi—A Sensitivity Analyser for StochSD Models.

[28]   Gustafsson, L. (2019) StatRes—A Tool for Statistical Analysis of Stochastic StochSD Models.

[29]   Gustafsson, L. (2019) ParmVar—A Tool for Studying the Variations of Parameter Estimates in StochSD Models.

[30]   Kreutzer, W. (1986) System Simulation: Programming Styles and Languages. Addison-Wesley Publishing Company, Inc., Boston.

[31]   Gustafsson, M. (2020) Evaluation of StochSD for Epidemic Modelling, Simulation and Stochastic Analysis. Master’s Thesis, Uppsala University, Uppsala.

[32]   StochSD’s Homepage (2022).

[33]   Pixabay (2022) A Community of Creatives, Sharing Copyright Free Images, Videos and Music. All Contents Are Released under the Pixabay License.

[34]   OpenStreetMap (2022) A Free, Editable Map of the Whole World that Is Being Built by Volunteers Largely from Scratch and Released with an Open-Content License.

[35]   JavaScript (2022) The Programming Language of HTML and the Web.

[36]   jqPlot (2022) A Plotting and Charting Plugin for the jQuery JavaScript Framework for Line, Bar and Charts with Many Features.

[37]   jQuery (2022) A JavaScript Library Designed to Simplify HTML DOM Tree Traversal and Manipulation, as Well as Event Handling.

[38]   jQuery UI (2022) Contains User Interface Components Built on Top of the jQuery JavaScript Library. It Handles Pop-Up Windows.

[39]   Normalize (2022) Makes the User Interface Look More Similar across Browsers.

[40]   CodeMirror (2022) A Text Editor. Used for Styling and Brackets Matching.

[41]   NW.js (2022) A JavaScript Desktop Wrapper (Previously Known as Node-Webkit). Runs JavaScript without a Browser.