This page will look better in a graphical browser that supports web standards, but is accessible to any browser or internet device.

Served by Samwise.

Cardiac Physiome Society workshop: November 6-9, 2017 , Toronto

MML variable constants

This page is for the current JSim version 2.0. Click here for the earlier JSim 1.6 version.



A MML variable constant

JSim MML variable constants are calculated at compile time but can be changed by the user at run time.

For example:

 real Rgas = 8.31441 J/(mol*K); 
After compilation the value '8.31441' is visible in the 'Model Inputs' section of the JSim GUI Run Time page. The variable has no dependency on any other variable, but since 'Rgas' is an input, the user can change the value of it before running a simulation. This is why it can be referred to as a variable constant. This behavior can be confusing if your constant is defined with operators in it:
real x = (8.31441*310.6)/96484.56;  
At run time, 'x' has a value of '.0267275655' and is a model input. As a model input, the user can still change the value of 'x' to whatever value they want and the source code calculation for 'x' is ignored. Importantly, if you want the original value back, as specified in the source MML, you must use the 'ParSet ->Revert to Model defaults' option available in the JSim GUI Run Time page. Changing the value in the source code and compiling it again will not update the value in the Run Time page as user specified model input values have precedence over the source code values. If you do not want the user to see or adjust a variable declare it as private.

A Simple MML Model

Below is a simple model using MML variable constants. Change the numeric values in the source code and at run time and observe the behavior of JSim:

(Java plugin required)

Items of note:

Comments or Questions?

[This page was last modified 30Dec15, 1:26 pm.]

Model development and archiving support at provided by the following grants: 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.