StochSD

Last updated
StochSD
Developer(s) Leif, Erik and Magnus Gustafsson
Initial releaseMay 15, 2017;7 years ago (2017-05-15)
Stable release
2022.01.02 / January 2, 2022;2 years ago (2022-01-02)
Repository github.com/stochsd/stochsd
Written in JavaScript
Operating system Windows, macOS, Linux
Type System Dynamics with stochastic extensions
License GNU Affero General Public License
Website stochsd.sourceforge.io

StochSD [1] (Stochastic System Dynamics) is a free, open-source Continuous System Simulation (CSS) package intended for small and medium-sized models in education, self-studies and research. Technically, StochSD is based on the Insight Maker [2] engine with its DE-solver, function library, error checker, macro facility, etc., while the design, graphical user's interface, construction elements, result presentation, file handling, link checking, etc. are different. Also, tools for sensitivity analysis, and optimisation with or without constraints are included. In particular, StochSD includes features for stochastic modelling, post-analysis of multiple simulations, and presentation of the results in statistical form.

Contents

The design and development of StochSD were done during 2017–2022 with support from Uppsala University, Karolinska Institute, and the Swedish University of Agricultural Sciences.

StochSD was designed to fulfil the two purposes:

Education and self-studies

To support the use in education and self-studies, the StochSD package as well as course material to enable courses in classical CSS and Full Potential CSS modelling and simulation are provided at the StochSD website. This course material contains lectures, laboratory exercises, instructive models, and StochSD manuals, which mainly are based on material developed at Uppsala University and the Swedish University of Agricultural Sciences for courses in modelling and simulation.

StochSD is downloaded in many countries from all continents, [11] and can also be run directly in a web browser (of which there is no statistics). It is described, compared and discussed, [12] [13] [14] [15] [16] demonstrated in educational videos, [17] [18] [19] and also referred to in various languages. [20] [21] [22]

Full potential CSS modelling

The Full Potential CSS concept is an extension of classical Continuous System Simulation, which provides the rules to make the results from macro-modelling consistent with those from micro-modelling. [6] [7] [8] [9]

Briefly, in addition to modelling and simulating continuous flows between stocks represented by ‘real numbers’, StochSD can also handle transitions of discrete entities by integer numbers. But in contrast to including individual entities into a CSS model, StochSD preserves the aggregated macro approach for discrete entities by transferring integer number of entities (e.g., arrivals, accidents, deaths) during a time-step. [6] However, such transitions may 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, as well as devices to collect statistics during a simulation and from multiple replications of the same stochastic model. [1] In StochSD the construction and simulation of e.g. queuing models [7] or combined discrete and continuous models [10] are done in a straightforward way (see example below).

The Full Potential concept also includes rules for how a stage has to be expanded into a structure of stocks and flows in order to reproduce a specific sojourn-time distribution, how attributes are to be handled, and where and how different types of uncertainty (structural, transition, initial value, parameter, and signal uncertainties) should be implemented. [9]

Example: continuous vs. combined discrete and continuous model

A continuous prey-predator model [23] [24] and a combined model with continuous prey (e.g. X = Grass) and discrete predators (e.g. Y = Sheep), as well as a replication of the combined model are shown below.

Continuous model

Now assume that the births and deaths of the sheep are discrete random events with the expected rate d⋅X⋅Y and e⋅Y, respectively, then the number of events per time interval is Poisson distributed. The StochSD function PoFlow(expected_value) handles this by drawing a random number for each DT. The modifications to obtain a combined model are shown in red, below.

Combined discrete and continuous model

The combined prey-predator model with continuous prey and discrete predators, and a replication of this model. (Note that the colouring of a primitive is preserved in the time plot.) Combined-Pray-Predator-Model.png
The combined prey-predator model with continuous prey and discrete predators, and a replication of this model. (Note that the colouring of a primitive is preserved in the time plot.)

In the replication shown, the discrete predators became extinct at around 235 time units (e.g., months). The continuous prey then increases logistically to an equilibrium without further stochastic variations.

Comparing a continuous prey-predator model with the combined model reveals that the continuous model, starting at the equilibrium state (as in this example), will only produce two straight horizontal lines. Starting the continuous model outside the equilibrium state will make it approach the equilibrium for both species without lasting variations. Further, a phenomenon such as extinction cannot occur for a continuous model.

Creating the combined model, shown above, is straightforward. The traditional alternative of constructing a combined continuous and discrete model, with its mixture of disparate DES and CSS concepts, synchronisation of two different time-handling methods, and requiring a special combined simulation language is not an attractive option for a macro study.

Related Research Articles

<span class="mw-page-title-main">Stochastic process</span> Collection of random variables

In probability theory and related fields, a stochastic or random process is a mathematical object usually defined as a family of random variables in a probability space, where the index of the family often has the interpretation of time. Stochastic processes are widely used as mathematical models of systems and phenomena that appear to vary in a random manner. Examples include the growth of a bacterial population, an electrical current fluctuating due to thermal noise, or the movement of a gas molecule. Stochastic processes have applications in many disciplines such as biology, chemistry, ecology, neuroscience, physics, image processing, signal processing, control theory, information theory, computer science, and telecommunications. Furthermore, seemingly random changes in financial markets have motivated the extensive use of stochastic processes in finance.

<span class="mw-page-title-main">Markov chain</span> Random process independent of past history

A Markov chain or Markov process is a stochastic process describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event. Informally, this may be thought of as, "What happens next depends only on the state of affairs now." A countably infinite sequence, in which the chain moves state at discrete time steps, gives a discrete-time Markov chain (DTMC). A continuous-time process is called a continuous-time Markov chain (CTMC). Markov processes are named in honor of the Russian mathematician Andrey Markov.

In mathematics, Itô's lemma or Itô's formula is an identity used in Itô calculus to find the differential of a time-dependent function of a stochastic process. It serves as the stochastic calculus counterpart of the chain rule. It can be heuristically derived by forming the Taylor series expansion of the function up to its second derivatives and retaining terms up to first order in the time increment and second order in the Wiener process increment. The lemma is widely employed in mathematical finance, and its best known application is in the derivation of the Black–Scholes equation for option values.

In mathematics, a Gaussian function, often simply referred to as a Gaussian, is a function of the base form and with parametric extension for arbitrary real constants a, b and non-zero c. It is named after the mathematician Carl Friedrich Gauss. The graph of a Gaussian is a characteristic symmetric "bell curve" shape. The parameter a is the height of the curve's peak, b is the position of the center of the peak, and c controls the width of the "bell".

<span class="mw-page-title-main">Discretization</span> Conversion of continuous functions into discrete counterparts

In applied mathematics, discretization is the process of transferring continuous functions, models, variables, and equations into discrete counterparts. This process is usually carried out as a first step toward making them suitable for numerical evaluation and implementation on digital computers. Dichotomization is the special case of discretization in which the number of discrete classes is 2, which can approximate a continuous variable as a binary variable.

The Hamilton-Jacobi-Bellman (HJB) equation is a nonlinear partial differential equation that provides necessary and sufficient conditions for optimality of a control with respect to a loss function. Its solution is the value function of the optimal control problem which, once known, can be used to obtain the optimal control by taking the maximizer of the Hamiltonian involved in the HJB equation.

Markov decision process (MDP), also called a stochastic dynamic program or stochastic control problem, is a model for sequential decision making when outcomes are uncertain.

<span class="mw-page-title-main">Linear time-invariant system</span> Mathematical model which is both linear and time-invariant

In system analysis, among other fields of study, a linear time-invariant (LTI) system is a system that produces an output signal from any input signal subject to the constraints of linearity and time-invariance; these terms are briefly defined in the overview below. These properties apply (exactly or approximately) to many important physical systems, in which case the response y(t) of the system to an arbitrary input x(t) can be found directly using convolution: y(t) = (xh)(t) where h(t) is called the system's impulse response and ∗ represents convolution (not to be confused with multiplication). What's more, there are systematic methods for solving any such system (determining h(t)), whereas systems not meeting both properties are generally more difficult (or impossible) to solve analytically. A good example of an LTI system is any electrical circuit consisting of resistors, capacitors, inductors and linear amplifiers.

In statistics and probability theory, a point process or point field is a set of a random number of mathematical points randomly located on a mathematical space such as the real line or Euclidean space.

In mathematics, the discrete Poisson equation is the finite difference analog of the Poisson equation. In it, the discrete Laplace operator takes the place of the Laplace operator. The discrete Poisson equation is frequently used in numerical analysis as a stand-in for the continuous Poisson equation, although it is also studied in its own right as a topic in discrete mathematics.

In Itô calculus, the Euler–Maruyama method is a method for the approximate numerical solution of a stochastic differential equation (SDE). It is an extension of the Euler method for ordinary differential equations to stochastic differential equations named after Leonhard Euler and Gisiro Maruyama. The same generalization cannot be done for any arbitrary deterministic method.

A stochastic simulation is a simulation of a system that has variables that can change stochastically (randomly) with individual probabilities.

A multi-compartment model is a type of mathematical model used for describing the way materials or energies are transmitted among the compartments of a system. Sometimes, the physical system that we try to model in equations is too complex, so it is much easier to discretize the problem and reduce the number of parameters. Each compartment is assumed to be a homogeneous entity within which the entities being modeled are equivalent. A multi-compartment model is classified as a lumped parameters model. Similar to more general mathematical models, multi-compartment models can treat variables as continuous, such as a differential equation, or as discrete, such as a Markov chain. Depending on the system being modeled, they can be treated as stochastic or deterministic.

In mathematics, in the study of dynamical systems, the Hartman–Grobman theorem or linearisation theorem is a theorem about the local behaviour of dynamical systems in the neighbourhood of a hyperbolic equilibrium point. It asserts that linearisation—a natural simplification of the system—is effective in predicting qualitative patterns of behaviour. The theorem owes its name to Philip Hartman and David M. Grobman.

In mathematics — specifically, in stochastic analysis — the infinitesimal generator of a Feller process is a Fourier multiplier operator that encodes a great deal of information about the process.

<span class="mw-page-title-main">Biological neuron model</span> Mathematical descriptions of the properties of certain cells in the nervous system

Biological neuron models, also known as spiking neuron models, are mathematical descriptions of the conduction of electrical signals in neurons. Neurons are electrically excitable cells within the nervous system, able to fire electric signals, called action potentials, across a neural network. These mathematical models describe the role of the biophysical and geometrical characteristics of neurons on the conduction of electrical activity.

In probability theory and statistics, a stochastic order quantifies the concept of one random variable being "bigger" than another. These are usually partial orders, so that one random variable may be neither stochastically greater than, less than, nor equal to another random variable . Many different orders exist, which have different applications.

<span class="mw-page-title-main">Finite element method</span> Numerical method for solving physical or engineering problems

The finite element method (FEM) is a popular method for numerically solving differential equations arising in engineering and mathematical modeling. Typical problem areas of interest include the traditional fields of structural analysis, heat transfer, fluid flow, mass transport, and electromagnetic potential. Computers are usually used to perform the calculations required. With high-speed supercomputers, better solutions can be achieved, and are often required to solve the largest and most complex problems.

The Monte Carlo method for electron transport is a semiclassical Monte Carlo (MC) approach of modeling semiconductor transport. Assuming the carrier motion consists of free flights interrupted by scattering mechanisms, a computer is utilized to simulate the trajectories of particles as they move across the device under the influence of an electric field using classical mechanics. The scattering events and the duration of particle flight is determined through the use of random numbers.

Biology Monte Carlo methods (BioMOCA) have been developed at the University of Illinois at Urbana-Champaign to simulate ion transport in an electrolyte environment through ion channels or nano-pores embedded in membranes. It is a 3-D particle-based Monte Carlo simulator for analyzing and studying the ion transport problem in ion channel systems or similar nanopores in wet/biological environments. The system simulated consists of a protein forming an ion channel (or an artificial nanopores like a Carbon Nano Tube, CNT), with a membrane (i.e. lipid bilayer) that separates two ion baths on either side. BioMOCA is based on two methodologies, namely the Boltzmann transport Monte Carlo (BTMC) and particle-particle-particle-mesh (P3M). The first one uses Monte Carlo method to solve the Boltzmann equation, while the later splits the electrostatic forces into short-range and long-range components.

References

  1. 1 2 "StochSD User's Manual and Tutorial" (PDF). 2024-02-02.
  2. Fortmann-Roe, Scrott (2014). "Insight Maker: A general-purpose tool for web-based modeling & simulation". Simulation Modelling Practice and Theory. 47: 28–45. doi: 10.1016/j.simpat.2014.03.013 .
    • Forrester, Jay W. (1968). Principles of Systems. Pegasus Communications. ISBN   9781883823412.
  3. Meadows, Donella (2008). Thinking In Systems: A Primer. Chelsea Green Publishing. ISBN   978-1844077250.
  4. 1 2 3 Gustafsson, Leif (2000). "Poisson Simulation—A Method for Generating Stochastic Variations in Continuous System Simulation" (PDF). Simulation. 74 (5): 264–274. doi:10.1177/003754970007400501.
  5. 1 2 3 Gustafsson, Leif (2003). "Poisson Simulation as an Extension of Continuous System Simulation for the Modeling of Queuing Systems" (PDF). Simulation. 79 (9): 528–541. doi:10.1177/003759703040234.
  6. 1 2 Gustafsson, Leif; Sternad, Mikael (2007). "Bringing consistency to simulation of population models – Poisson Simulation as a bridge between micro and macro simulation". Mathematical Biosciences. 209 (2): 361–385. doi:10.1016/j.mbs.2007.02.004. PMID   17412368.
  7. 1 2 3 Gustafsson, Leif; Sternad, Mikael (2010). "Consistent Micro, Macro and State-Based Population Modelling". Mathematical Biosciences. 225 (2): 94–107. doi:10.1016/j.mbs.2010.02.003. PMID   20171974.
  8. 1 2 "The Poisson Simulation Approach to Combined Simulation" (PDF). Technical Report R091, Signals and Systems, Uppsala University. Retrieved 2024-02-02.
  9. "SourceForge statistics of downloads for StochSD". sourcerforge.net. Retrieved 2024-02-02.
  10. "The Cosy Project – Inventory of Complex Systems Project (2020-1-SE01-KA203-077872) funded with support from the European Commission of the European Union". 2024-02-02.
  11. "OnWorks – StochSD download for Linux, description and screenshots". 2024-02-02.
  12. "Linux Mint – Installation of StochSD software". 2024-02-02.
  13. "AlternativeTo - Crowdsourced software recommendations". 2024-02-02.
  14. "zbMATH Open — an information service for mathematical software". 2024-02-02.
  15. "Simulation einer Bewegung mit konstanter Geschwindigkeit mit StochSD". YouTube (in German). 2024-02-02.
  16. "Simulation einer beschleunigten Bewegung mit StochSD". YouTube (in German). 2024-02-02.
  17. "Genauigkeit einer Simulation mit dem Eulerverfahren mit StochSD". YouTube (in German). 2024-02-02.
  18. "stochsd:随机系统动力学的实验室环境". csdn.net (in Chinese (China)). 2024-02-02.
  19. "StochSD описание, скриншоты и видео". vse-analogi.ru (in Russian). 2024-02-02.
  20. "Sobre Stochsd". alternativapara.com.br (in Brazilian Portuguese). 2024-02-02.
  21. Volterra, Vito (1926). "Fluctuations in the Abundance of a Species Considered Mathematically". Nature. 118 (2972): 558–560. Bibcode:1926Natur.118..558V. doi:10.1038/118558a0.