GNU Mcsim: a Monte Carlo Simulation Program by Fr´Ed´Ericy
Total Page:16
File Type:pdf, Size:1020Kb
GNU MCSim: A Monte Carlo Simulation Program by Fr´ed´ericY. Bois and Don R. Maszle User's Manual, software version 6.2.0 Copyright c 1997-2020 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". contact: Frederic Bois [email protected] i Table of Contents 1 Software and Documentation Licenses :::::::: 1 1.1 Software license :::::::::::::::::::::::::::::::::::::::::::::::: 1 1.2 Documentation license ::::::::::::::::::::::::::::::::::::::::: 1 2 Overview :::::::::::::::::::::::::::::::::::::::: 9 2.1 General procedure:::::::::::::::::::::::::::::::::::::::::::::: 9 2.2 Types of simulations :::::::::::::::::::::::::::::::::::::::::: 10 2.3 Major changes introduced with version 5.4.0 ::::::::::::::::::: 10 2.4 Major changes introduced with version 5.5.0 ::::::::::::::::::: 10 2.5 Major changes introduced with version 5.6.0 ::::::::::::::::::: 11 2.6 Major changes introduced with version 6.0.0 ::::::::::::::::::: 11 2.7 Major changes introduced with version 6.1.0 ::::::::::::::::::: 12 2.8 Major changes introduced with version 6.2.0 ::::::::::::::::::: 12 2.9 Coming soon :::::::::::::::::::::::::::::::::::::::::::::::::: 12 3 Installation ::::::::::::::::::::::::::::::::::::: 13 3.1 System requirements :::::::::::::::::::::::::::::::::::::::::: 13 3.2 Distribution::::::::::::::::::::::::::::::::::::::::::::::::::: 13 3.3 Machine-specific installation::::::::::::::::::::::::::::::::::: 14 3.3.1 Unix and GNU/Linux operating systems ::::::::::::::::: 14 3.3.2 Other operating systems:::::::::::::::::::::::::::::::::: 15 4 Working Through an Example ::::::::::::::: 17 5 Writing and Compiling Structural Models :: 19 5.1 Using mod to preprocess model description files :::::::::::::::: 19 5.2 Using makemcsim to preprocess and compile model files :::::::: 20 5.3 Syntax of the model description file ::::::::::::::::::::::::::: 20 5.3.1 General syntax ::::::::::::::::::::::::::::::::::::::::::: 21 5.3.2 Declarations of global variables ::::::::::::::::::::::::::: 23 5.3.3 Model types:::::::::::::::::::::::::::::::::::::::::::::: 25 5.3.4 Special functions ::::::::::::::::::::::::::::::::::::::::: 25 5.3.5 Input functions::::::::::::::::::::::::::::::::::::::::::: 27 5.3.6 In line functions:::::::::::::::::::::::::::::::::::::::::: 29 5.3.7 Model initialization :::::::::::::::::::::::::::::::::::::: 29 5.3.8 Dynamics section::::::::::::::::::::::::::::::::::::::::: 30 5.3.9 Delay differential equations ::::::::::::::::::::::::::::::: 31 5.3.10 Output calculations ::::::::::::::::::::::::::::::::::::: 31 5.3.11 Comments on style :::::::::::::::::::::::::::::::::::::: 32 5.4 Reading SBML models and applying a template ::::::::::::::: 32 5.5 Working with the R package deSolve :::::::::::::::::::::::::: 35 ii GNU MCSim User's Manual 6 Running Simulations :::::::::::::::::::::::::: 37 6.1 Using the compiled program::::::::::::::::::::::::::::::::::: 37 6.2 Syntax of the simulation definition file ::::::::::::::::::::::::: 38 6.2.1 General input file syntax ::::::::::::::::::::::::::::::::: 39 6.2.2 Input functions (revisited) :::::::::::::::::::::::::::::::: 40 6.2.3 Global specifications ::::::::::::::::::::::::::::::::::::: 40 OutputFile() specification::::::::::::::::::::::::::::::::::: 41 Integrate() specification:::::::::::::::::::::::::::::::::::: 41 MonteCarlo() specification::::::::::::::::::::::::::::::::::: 42 MCMC() specification:::::::::::::::::::::::::::::::::::::::::: 43 SetPoints() specification:::::::::::::::::::::::::::::::::::: 45 OptimalDesign() specification ::::::::::::::::::::::::::::::: 46 Distrib() specification :::::::::::::::::::::::::::::::::::::: 48 SimType() specification :::::::::::::::::::::::::::::::::::::: 52 6.2.4 Specifying basic conditions to simulate:::::::::::::::::::: 52 Simulation sections ::::::::::::::::::::::::::::::::::::::::: 52 Events() specification for state discontinuities ::::::::::::::: 53 StartTime() specification:::::::::::::::::::::::::::::::::::: 54 Print() specification :::::::::::::::::::::::::::::::::::::::: 54 PrintStep() specification:::::::::::::::::::::::::::::::::::: 54 6.2.5 Setting-up statistical models:::::::::::::::::::::::::::::: 55 Level sections ::::::::::::::::::::::::::::::::::::::::::::::: 57 Data() specification:::::::::::::::::::::::::::::::::::::::::: 58 6.3 Analyzing simulation output :::::::::::::::::::::::::::::::::: 58 6.4 Error handling :::::::::::::::::::::::::::::::::::::::::::::::: 59 7 Common Pitfalls::::::::::::::::::::::::::::::: 61 8 XMCSim ::::::::::::::::::::::::::::::::::::::: 63 Bibliographic References ::::::::::::::::::::::::: 65 Appendix A Keywords List :::::::::::::::::::: 67 Appendix B Examples :::::::::::::::::::::::::: 71 B.1 linear.model :::::::::::::::::::::::::::::::::::::::::::::::: 71 B.2 1cpt.model: A example model description file :::::::::::::::: 71 B.3 perc.model: A example model description file :::::::::::::::: 73 B.4 perc.lsodes.in:::::::::::::::::::::::::::::::::::::::::::::: 78 Concept Index ::::::::::::::::::::::::::::::::::::: 79 Chapter 1: Software and Documentation Licenses 1 1 Software and Documentation Licenses 1.1 Software license 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. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 1.2 Documentation license The GNU Free Documentation License Version 1.2, November 2002 Copyright c 2000,2001,2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or non- commercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of \copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The \Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as \you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. 2 GNU MCSim User's Manual A \Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A \Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The \Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then itis not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The \Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A \Transparent" copy of the Document means a machine-readable