# MCSim

GNU MCSim is a suite of simulation software. It allows one to design one's own statistical or simulation models, perform Monte Carlo simulations, and Bayesian inference through (tempered) Markov chain Monte Carlo simulations. The latest version allows parallel computing of Monte Carlo or MCMC simulations.

## Description

GNU MCSim is a simulation and statistical inference tool for algebraic or differential equation systems, optimized for performing Monte Carlo analysis. The software comprises a model generator and a simulation engine:
* The model generator facilitates structural model definition and maintenance, while keeping execution time short. The model is coded using a simple grammar, and the generator translates it into C code. Starting with version 5.3.0, models coded in SBML can also be used.
* The simulation engine is a set of routines that are linked to the model in order to produce executable code. The result is that one can run simulations of the structural model under a variety of conditions.
Internally, the software uses the GNU Scientific Library for some of its numerical calculations.

## History

The project began in 1991 in Berkeley when Don Maszle and Frederic Y. Bois translated in C and reorganized a program that Bois had developed at Harvard for his PhD thesis. The primary motivation for the work was to be able to quickly develop and easily maintain PBPK models. However, the syntax was defined with enough generality that many algebraic and first-order ordinary differential equations can be solved. The capability to perform efficient Monte Carlo simulations was added early on, for the research needs of the group. The code was made freely available from a server at UC Berkeley. Discussions with Stuart Beal at UCSF School of Pharmacy, led the team to investigate the use of Markov chain Monte Carlo techniques for PBPK models' calibration. The corresponding code was developed by Maszle, during a project in collaboration with Andrew Gelman, then professor at UC Berkeley Statistics Department. Additional code written by Ken Revzan allowed the definition and Bayesian calibration of hierarchical (multilevel) statistical models. At the time of these developments (around 1996) those capabilities were unique for a freely distributed, easily accessible, very powerful and versatile software. Since then the software has been consistently maintained and extended.

### Released versions

* 6.2.0 (3 June 2020)
* 6.1.0 (19 February 2019)
* 6.0.1 (5 May 2018)
* 6.0.0 (24 February 2018)
* 5.6.6 (21 January 2017)
* 5.6.5 (27 February 2016)
* 5.6.4 (30 January 2016)
* 5.6.3 (1 January 2016)
* 5.6.2 (24 December 2015)
* 5.6.1 (21 December 2015)
* 5.6.0 (16 December 2015)
* 5.5.0 (17 March 2013)
* 5.4.0 (18 January 2011)
* 5.3.1 (3 March 2009)
* 5.3.0 (12 January 2009)
* 5.2 beta (29 January 2008)
* 5.1beta (18 September 2006)
* 5.0.0 (4 January 2005)
* 4.2.0 (15 October 2001)
* 4.1.0 (1 August 1997)
* 4.0.0 (24 March 1997)
* 3.6.0
* 3.3.2

## Licensing

GNU MCSim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

## Platform Availability

The C source code is provided and can be compiled on any machine with a C compiler. The GNU Scientific Library needs to be also available on the target platform to use a few extra distributions in statistical models. To take advantage of the SBML translation capabilities, the LibSBLM library should be installed. Starting with version 6.0.0 the Sundials Cvodes integrator is also used. To take advantage of parallel computation (from version 6.2.0 on) a MPI library needs to be installed.