MPC, the semi-automated Modular Program Constructor
MPC is an open-source Java based modeling utility, built upon JSim's Mathematical Modeling Language (MML), JSim website, that uses directives embedded in model code to construct larger, more complicated models quickly and with less error than manually combining models.
- Article giving a short overview of MPC.
- Get the MPC utility and simple examples, as described in F1000Research article, on GitHub.
- Explore the MPC created model from the F1000Research article.
- MPC requires JSim be installed on your system to use models generated by it.
Modular Program Constructor (MPC): in-depth examples:
The Modular Program Constructor (MPC) has been designed to work with JSim's Mathematical Modeling Language (MML). MPC is a pre-compiler written in Java. It reads an input file, FileName.mpc, and generates an output file, FileName.mod, a JSim model file. The input file combines MML with “directives” embedded as comments and is able to utilize code from other JSim model files %” so they are comments. Directives control the identification, fetching, relabeling of variables and parameters, and assembling and recombining code into new equations. MPC currently has thirteen directives: %COM (comment directive not copied to final model file) %START codeBlockName %END codeBlockName %INSERTSTART codeBlockName %INSERTEND codeBlockName %STARTDELETE %ENDDELETE % continuation, used only with GET, REPLACE, and COLLECT directives %GET Model.mod codeBlockName (“oldName1=newName1”, ...) %SETGLOBALVAL %replacer%=("replacement") %REPLACE %replacer%=(“replacement1”, ... “replacementN”) %ENDREPLACE %COLLECT(“variableName”) Download the presentation and MPC Guide for details (below). Project file contains the ODE generated version of the diffusion equation using the SETGLOBALVAL directive and finite difference approximation and compares the result with the PDE solution. (Run setglobalval model). Project file shows an ode model of a transporter between two compartments and a pde model of a four species transporter both generated using much of the same code. (run getODE and getPDE; run Loops on getPDE to explore the effect of cold substrate on the outflow of tracer substrate.) Final three models illustrate generating models sequentially to build reuseable models of increasing complexity to simulate an organ-level model with heterogeneous flow for two substrates. The models are BTEX30: a three region model (capillary, interstitial fluid region, and parenchymal cell) with flow, diffusion, exchange between regions, and consumption for single metabolite A. (Plotted on BTEX30plotpage.) The following two models are plotted on plotpages with prefix B30. BTEX30A2B: two copies of BTEX30 for two species with enzymatic conversion of metabolite A to metabolite B in parenchymal cell. BTEX30A2B10paths: a copy of BTEX30A2B is modified removing the flow declaration. A ten flow path model is generated combining 10 copies of the modified BTEX30A2B model with the multiflow algorithm.
|View MPC examples in JSim: ||    Help running a JSim model.|
MacOS: Adjust "System Preferences" -> "Security & Privacy" to allow Java JSim jnlp app to execute.
More info here.
Download MPC examples JSim project file:
- Quick Overview of MPC Download presentation file (PDF).
- Modular Program Constructor Guide Download PDF file.
- Making BTEX20radialDiffusion Model Download PDF file.
- Introduction to MML and the MML Reference Manual. Additional documentation for MML can be found by using the search option at the Physiome home page.
- BTEX20radialDiffusion : BTEX20 with radial diffusion in parenchymal cell: A 2-d PDE in (x,r,t) with Java interface to Matlab(TM) ,
- Heat equation: A 2-d PDE in (x,y,t) ,
- How the Modular Program Constructor (MPC) tool generated the BTEX20radialDiffusion model (contains documentation and code for MPC)
- Recirculating O2-CO2 BTEX model built using MPC.
Contact: email@example.com for questions or comments.
Please cite www.physiome.org in any publication for which this software is used and send one reprint to the address given below:
The National Simulation Resource, Director J. B. Bassingthwaighte, Department of Bioengineering, University of Washington, Seattle WA 98195-5061.
[This page was last modified 17Jul18, 12:29 pm.]
Model development and archiving support at physiome.org provided by the following grants: NIH U01HL122199 Analyzing the Cardiac Power Grid, 09/15/2015 - 05/31/2020, NIH/NIBIB BE08407 Software Integration, JSim and SBW 6/1/09-5/31/13; NIH/NHLBI T15 HL88516-01 Modeling for Heart, Lung and Blood: From Cell to Organ, 4/1/07-3/31/11; NSF BES-0506477 Adaptive Multi-Scale Model Simulation, 8/15/05-7/31/08; NIH/NHLBI R01 HL073598 Core 3: 3D Imaging and Computer Modeling of the Respiratory Tract, 9/1/04-8/31/09; as well as prior support from NIH/NCRR P41 RR01243 Simulation Resource in Circulatory Mass Transport and Exchange, 12/1/1980-11/30/01 and NIH/NIBIB R01 EB001973 JSim: A Simulation Analysis Platform, 3/1/02-2/28/07.