About the library
A modular javascript library by Pascal Grafe to create user interfaces for simulations
SpiMoSim was originally created with simple models for physical, economic and social systems on a lattice of interacting spins, agents or similar in mind. Think of the Ising model or Conway's Game of Life.
The library is highly modular which makes it useful for a much broader range of applications. In principle it can function as a GUI for any program that has some settings chosen by the user and produces data in time steps. The settings might be a couple of numbers. The user sees plots of time series and an image visuaizes the state at each step.
A design goal of SpiMoSim is to minimize the amount of code necessary to build an application. For agent based models a JSON configuration file and two javascript functions can be enough.
(By the way, if you see an animated SpiMoSim logo on top of this page, SpiMoSim is running right now in your browser.1)
How to build applications with SpiMoSim?
SpiMoSim is build with web technologies in Javascript, HTML and CSS. But you do not need to be a web developer to use it for creating applications. You can try out the SpiMoSim Creator directly in your browser. It might be helpful if you know a little Javascript. Or download the latest version of SpiMoSim including some example applications (Ising model) and give it a try!
Due to the modularity of SpiMoSim the application/simulation does not need to run directly in the browser. It can communicate with an application running on some server or your local computer via a Websocket connection. You can write the application/simulation core in any language with a websocket library and let SpiMoSim provide the GUI. An implementation in Python is available in the Github repository.
License
SpiMoSim is free software under the terms and conditions of the MIT-LICENSE.
1What you see is the Multiple Epidemics Model by K. Sneppen et al. run on a 2D lattice (no connections between the text and the background):
Sneppen K, Trusina A, Jensen MH, Bornholdt S (2010) A Minimal Model for Multiple Epidemics and Immunity Spreading. PLoS ONE 5(10): e13326. doi:10.1371/journal.pone.0013326
2Please report errors or submit suggestions on Github
Demonstrations
-
Ising Model
A simple demonstration of the Ising model. This is the version included in the download.
-
The Bornholdt Model with strategy spins
A fully featured version of the market model by S. Bornholdt 3
-
Direct Simulation Monte Carlo
A particle simulator for low density gases. This demonstration with 3D graphics is also included in the download.
-
A collection of different models at Complex Systems Lab.
-
Different models implemented by Pascal Grafe available at pascalgrafe.net
3S. Bornholdt, Expectation bubbles in a spin model of markets: Intermittency from frustration across scales, Int. J. Mod. Phys. C, Vol. 12, No. 5 (2001) 667-674.