Conference PaperPDF Available

Physiolibrary -Modelica library for Physiology


Abstract and Figures

Physiolibrary is a free open-source Modelica library designed for modeling human physiology. It is accessible on the Modelica Libraries web page at This library contains basic physical laws governing human physiology, usable for cardiovascular circulation, metabolic processes, nutrient distribution, thermoregulation, gases transport, electrolyte regulation, water distribution, hormonal regulation and pharmacological regulation.
Content may be subject to copyright.
Physiolibrary - Modelica library for Physiology
Marek Mateják*, Tomáš Kulhánek*, Jan Šilar*, Pavol Privitzer*, Filip Ježek**, Jiří Kofránek*
*Institute of Pathological Physiology, 1st Faculty of Medicine, Charles University in Prague
U nemocnice 5, Prague 2, 128 53, Czech Republic
**Department of Cybernetics, Faculty of Electrical Engineering, Czech Technical University in
Prague, Technicka 2, Praha 6
Physiolibrary is a free open-source Modelica library
designed for modeling human physiology. It is ac-
cessible on the Modelica Libraries web page at This library con-
tains basic physical laws governing human physiolo-
gy, usable for cardiovascular circulation, metabolic
processes, nutrient distribution, thermoregulation,
gases transport, electrolyte regulation, water distribu-
tion, hormonal regulation and pharmacological
Keywords: Physiolibrary; HumMod; Modelica li-
brary; Physiology; Integrative physiology; System
1 Introduction
Our laboratory have a long tradition building
physiological libraries, starting with the
Matlab/Simulink environment [2]. The origin of this
Modelica Physiolibrary was in the first version of
our HumMod Golem Edition model implementation
[3-6], where it was called HumMod.Library. As the
successors of Guyton's Medical Physiology School
write, the original HumMod model [7] is The best,
most complete, mathematical model of human phys-
iology ever created [8].
We are also developing many types of smaller
physiological models for use in medical education
[9-11], so it was essential to separate this library
from our HumMod Modelica implementation. Some
other Modelica models and libraries covering the
biological domain already existed, e.g. [12-17],
which are useful in the process of system modeling
and parameter identification. Especially BioChem
Modelica library, that implements large part of
SBML library in Modelica language [14-18].
Our Physiolibrary contains only carefully-chosen
elementary physiological laws, which are the basis of
more complex physiological processes. For example
from only three type of blocks (ChemicalReaction,
Substance and MolarConservationMass) it is possi-
ble to compose the allosteric transitions [19] or the
Michaelis-Menten equation.
2 Physiology
Physiology is a very progressive discipline, that
examines how the living body works. And it is no
surprise that all processes in the human body are
driven by physical laws of nature. The great chal-
lenge is to marry old empirical experiments with the
new physical principles. Many teams and projects
in the word deal with this formalization of physiolo-
gy, for example: Physiome[20], SBML[17, 18],
EuroPhysiome[21], VPH[22], CellML[23] etc. It is
our hope that this library helps this unflagging effort
of physiologists to exactly describe the processes.
2.1 Display units in physiology
Energy in medicine and chemistry has a very long
tradition. One must not be confused by its different
units and definitions. The researcher must be aware
of multiple definitions of calorie, such as the interna-
tional calorie, the 15°C calorie, the thermal calorie or
the Calorie with a capital "C". The origin of this unit
is in the thermal energy needed to heat one gram of
water by one degree Celsius. But because the meas-
urement conditions may differ, these alternative def-
initions are necessary. In physiology it is recom-
mended to use only international calorie as defined
in Table 1. The flow of heat/energy is usually calcu-
lated in kcal/min, but in physics this is called power
and is expressed in the SI unit watts.
Pressure units in medicine are also mainly based
on historical measurements. For many years blood
pressure was measured by the mercury sphygmoma-
nometer, where the pressure is represented by the
change of mercury hydrostatic column height. And
because the scale of units on the column is in milli-
metres the pressure unit is called millimetre of mer-
cury 'mmHg'. There also exists a very small differ-
ence between this unit and torrs. It is caused again by
variance in measurement conditions.
Figure 1, Example parameter dialog for non-SI physio-
logical units. The Dymola environment automatically
converts this user’s non-SI-values to SI-values to en-
sure compatibility with any other Modelica library.
Many physiological processes are based on elec-
trical principles in the human body. The main cause
of this is that each cell has a nonconductive mem-
brane with molecular structures called channels,
through which the fluxes of electrolytes can be pre-
cisely regulated. Even more, the cells use energy
from metabolism to retain a small electric potential
between inside and outside. This view leads to a unit
called equivalents or “eq. A charge of 1eq, for ex-
ample, has 1mol of sodium cations (Na+). The fluxes
of electrically charged ions can be in meq/min, but in
physics the SI unit ampere is more generally used.
Unit conversion table
(for Modelica environment display-unit setting)
x kcal
x kcal/min
273.15 + x
Table 1, Selected Non-SI units in physiology
Another strange unit describing the amount of
substance is the osmol (“osm”), which has the same
value as the mol, but which highlights the property
that this substance cannot cross the membrane to-
gether with the flux of its solvent.
For gases, it is common to measure the amount as
volume, which for specific measurement conditions
is equivalent to the number of molecules.
The International Union of Pure and Applied Chem-
istry (IUPAC) set this standard condition for temper-
ature and pressure (STP) precisely at 0°C and
100kPa. But other standards exist. For example,
SATP is measured at 25°C and 100kPa, or the stand-
ard measurement condition at the National Institute
of Standards and Technology (NIST), which is 20°C
and 101.325kPa.
2.2 Chemical domains in physiology
In physiology books, chapters about chemical
substances are organized by their types. The main
reason for this is that each substance in the human
body is regulated in a different way. For example the
regulation of sodium is different from the regulation
of potassium, and from the regulation of glucose, and
so on. This view leads to the idea of having separate
models of each substance. The origin of different
flows and regulations is the (cellular) membrane.
Water and solutions can cross it in different direc-
tions at the same time. Crossings occur for different
reasons: water is driven mostly by osmotic gradients,
electrolytes are driven by charge to reach Donnan's
equilibrium, and some solutes can even be actively
transported against their concentration or electrical
gradients. And all this is specifically driven from the
higher levels by neural and hormonal responses.
In Physiolibrary flows and fluxes of solutes are
supported mostly by the Chemical package. All parts
inside this Physiolibrary.Chemical package use the
connector ChemicalPort, which defines the molar
concentration and molar flow/flux rate of one solute.
This is the supporting infrastructure for modeling
membrane diffusion, accumulations of substances,
reversal chemical reactions, Henry's law of gas solu-
bility, dilution with additional solvent flow, mem-
brane reabsorption, chemical degradation and physi-
ological clearance.
For usage examples, please open the Chemi-
cal.Examples package, where the chemical reaction
shown in Fig. 2 is implemented, along with many
other chemical processes.
Figure 2, Example of a chemical reaction: A <-> B + C.
Purple beakers (Substance) accumulate one type of
substance and generate its concentration in port. Block
for chemical reaction (ChemicalReaction) can have
any number of substrates or products with any stoi-
chiometric numbers. In this case there is only one sub-
strate and two products. Purple lines represent chemi-
cal connectors, are composed of molar concentration
and the molar flow of substance.
The graphically-created diagram shown in Fig. 2
generates this Modelica code:
model SimpleReaction2
import Physiolibrary.Chemical.Components.*;
Substance A(solute_start=0.9);
ChemicalReaction reaction(K=1, nP=2);
Substance B(solute_start=0.1);
Substance C(solute_start=0.1);
connect(A.q_out, reaction.substrates[1]);
connect(reaction.products[1], B.q_out);
connect(reaction.products[2], C.q_out);
end SimpleReaction2;
This means that before the numerical simulation
begins, each Substance.solute_start parameter must
be set to some initial amount of substance.
ChemicalReaction.nP must also be configured for
the number of products, and parameter
ChemicalReaction.K must be configured for the dis-
sociation constant of reaction in SI-units (please note
that concentration of 1 mol/m3 = 1 mmol/L). As
mentioned before, the values in text code are in SI-
units, but the Dymola environment support non-SI
units in the parameter dialog of each component.
2.3 Hydraulic domain in physiology
The main usage of the hydraulic domain in hu-
man physiology is modeling of the cardio-vascular
system. And because there are no extreme thermo-
dynamic conditions, the system can be really simple
it is only necessary to model conditions for in-
compressible water, at normal liquid-water tempera-
tures and with relative pressure 5-20kPa. This boring
thermodynamic state leads to using very simple
blocks of hydraulic resistance, hydrostatic pressure,
volumetric flow, inertia and finally a block repre-
senting blood accumulation in elastic vessels.
2.4 Thermal domain in physiology
For the human body to function optimally, it is
critical to hold the core temperature at 3539°C. A
fever of 41°C for more than a short period of time
causes brain damage. If the core temperature falls
below 10°C, the heart stops. As in the hydraulic do-
main, the thermal domain is simplified to these con-
The Physiolibrary.Thermal package extends the
package Modelica.Thermal.HeatTransfer from
Figure 3, Hydraulic example: the cardiovascular sub-
system of the famous Guyton-Coleman-Granger model
[1]. Yellow circles (ElasticVessel) represent blood ac-
cumulation and pressure generation, rectangles be-
tween them are hydraulic resistances (Resistance) of
blood vessels, blue triangles (Pump) represent a heart
pump driven by the Frank-Starling law. Heart-filling
pressures are determined by the block with the blue
tube icon (PressureMeassure) and a block-rectangle
(Blocks.Factors.Spline) converts filling pressure to
their effect on cardiac output. Black lines connect the
hydraulic connectors (HydraulicPort), which contains
pressure and volumetric flow variables.
Modelica Standard Library 3.2 (MSL), where the
connector is composed of temperature and heat flow.
The main blocks in Physiolibrary.Thermal are: Con-
ductor, IdealRadiator and HeatAccumulation. The
heat conductor conducts the heat from the source,
such us muscles or metabolically active tissue, to its
surrounding. IdealRadiator delivers heat to tissues by
blood circulation. HeatAccumulation plays a role in
accumulating thermal energy in each tissue mass
driven by its heat capacity. We recommend using
this block instead of Modelica.Thermal.HeatTransfer
.HeatCapacitor to allow the possibility of variable
mass amounts, and to have support for calculating
steady state, described in section 2.7.
Figure 4, Example of heat flow from a working muscle.
The muscle is represented by a red beaker
(HeatAccumulation), where heat energy is accumulat-
ed in a mass with defined weight and specific heat.
Heat transfer is processed by blood circulation
(IdealRadiator) with blood flow as its internal parame-
ter. The temperature of blood is set to a fixed value of
37°C to simulate well-regulated core body tempera-
Figure 5, Basic heat flow model of human body. Heat
production occurs in each tissue via metabolism, or
from warm (to cool) eaten food using the MSL block
with two red arrows (Modelica.Thermal.HeatTransfer.
Sources.FixedHeatFlow). This heat is stored in tissues
(HeatAccumulation) and transferred out by blood
(IdealRadiator) or together with mass (Stream,
HeatOutstream), where the model also integrates va-
porization heat loss. Heat radiation and conduction to
the environment is simplified using an MSL block for
heat conductor (Modelica.Thermal.HeatTransfer.
2.5 Osmotic domain in physiology
One of the basic phenomenon of biological sys-
tems is the osmotically-driven flow of water. This is
always connected with semipermeable membranes.
The different concentrations of impermeable solutes
on both sides of the membrane causes the hydrostatic
pressure at the concentrated side to rise[24]. This
pressure difference is called osmotic pressure. Os-
motic pressure is linearly proportional to the concen-
tration gradient of impermeable solutes. The
osmolarity (osmotic concentration) is also one of the
main indexes of human body balance, called homeo-
stasis. Its value should not significantly deviate for a
long period of time from a value of 285-295mosm/l.
In Physiolibrary the osmotic connector
OsmoticPort is composed of the osmotic concentra-
tion and the volumetric flux of permeable liquid. The
two main blocks are called Membrane and
OsmoticCell. Here, inside the membrane blocks, it is
of course possible to also define hydraulic pressure
and temperatures effects on both sides of membrane.
Figure 6, Osmotic example simulating water transfer
between intracellular and interstitial compartments in
hypertonic or hypotonic conditions.
2.6 Types and units
The most common errors in HumMod Golem
Edition were caused by using bad physical units. The
main problem of medical research, articles, and ex-
periments is using obscure units from medicine,
pharmacology, biology and non-physics disciplines.
The Physiolibrary fulfills the Modelica ideal of
using SI units as the main unit for each variable, and
the previously described physiological units are also
implemented as the displayUnits for each variable.
Using these displayUnits the user sets and sees the
"physiological" values. The implementation can also
be joined to any unit-correct Modelica models and
physical equations without crashing due to unit in-
compatibilities. The unit support of Physiolibrary is
so strong that one can even chose the right unit-typed
input real/output real from the library package
Types.RealIO or one can use unit-typed constants
(Types.Constants). As can be expected, only the non-
specific package Blocks in the Physiolibrary has var-
iables without units.
2.7 Steady states
One of the main questions in clinical medicine is
how to stabilize the patient. In modeling the oscillat-
ing heart, breathing, circadian rhythm or menstrua-
tion cycle the model can be designed as non-
oscillating, using variables such as period times, am-
plitudes, frequencies, mean values and other phase
space variables. This type of model has better nu-
merical stability for long simulation times, and even
more importantly, it can be "stabilized". This stabili-
zation we call a steady state.
To be mathematically exact, we define a steady
state system (SSS) as a non-differential system de-
rived from an original differential system (DS) by
using zero derivations and by adding additional
steady state equations (ASSE). The number of the
ASSE must be the same as the number of algebrai-
cally dependent equations in the non-differential sys-
tem derived from DS by setting zero derivations. The
ASSE describes the system mostly from the top
view, such as the equations of mass conservation
laws or the boundary equation of environment
To define a model as an SSS, the user must
switch each Simulation parameter in each block to
the value Types.SimulationType.SteadyState and
must have correctly defined all necessary ASSE.
This setting causes the system to ignore any start
values for any state and add zero derivation equa-
tions instead. There does not currently exist a
Modelica environment which can automatically find
and remove generated dependent equations by this
solution. So the correct number of states must be
marked as dependent (parameter isDependent) and
the same number of ASSE must be inserted. Howev-
er, despite the fact that a model in this steady-state
setting will not be locally balanced, it must be glob-
ally balanced and without any dependent equation.
Figure 7, Steady state system example: equilibrium of
chemical reaction A<->B+C is calculated with two
ASSE. Zero change of reactant A is automatically
propagated through a reaction to both products. So
both products must be marked as dependent (parame-
ter isDependent), and two mass conservation laws
must be added as green square blocks to the right
(MolarConservationLaw). Please note that conserva-
tion laws must be included only after designing the rest
of the system, because they are global properties, not
properties of individual substances or reactions.
Adding an ASSE is possible by inserting and
connecting the energy or mass conservation law
block from package SteadyState.Components. An-
other possibility is using environment sources
blocks, where setting the isIsolatedInSteadyState
parameter adds the equation of the zero
mass/volume/energy flow from or to environment.
The steady state model often changes to one big
nonlinear strong component, but without solver stiff
or convergence problems. Especially in quick chem-
ical kinetics, it is not necessary to have very rapid
molar fluxes, when it always reach equilibrium in the
end. This design is also useful in creating steady-
stated parts in a dynamical model without huge re-
building. It also brings other benefits. To see these
possibilities, one has to realize that conservation
laws could be invariances in a dynamical simulation.
This is really useful for debugging.
For example see the model
rium (Fig.7), which implements the equilibrium of
the closed system from Fig.2 as a solution of three
chemical substances with a simple reversible reac-
tion between them extended by two conservation
laws. Each of these laws describes the total possible
amount of one product in its free form and in its as-
sociated form.
It is always a big challenge to nicely solve initial
values of differential system. However, it should be
possible to solve the SSS in its initial phase. And this
is the idea behind the
Types.SimulationType.InitSteadyState option for
models already extended with ASSE.
2.8 File utilitiesinput/output manipulations
During the creation and debugging of huge inte-
grated models it is necessary to easily define con-
sistent input, output and test sets of all output varia-
bles for some subsystems. Let's imagine that we have
a model composed only of subsystems that converge
from some constant inputs to constant outputs. It
should be possible to substitute each main subsystem
for its chosen constant output values as parameters.
Comparing the model with these parametric values
and the original subsystem can show the wrong part
of the simulation.
For example in the huge HumMod model it is
necessary to debug smaller parts separately. These
tools could be use, because HumMod is the type of
constant-converged model. Each subsystem in the
first level has the constant input values set for its
output variables. Simulating, for example, the cardi-
ovascular subsystem is possible by creating the high-
level system with the original cardiovascular subsys-
tem, but with a constant metabolic, constant ther-
moregulation, constant hormonal, constant water,
constant proteins, constant gases, constant electro-
lytes and constant status subsystem.
Because the number of output variables for each
subsytem changes during development, it is a good
idea to have only one list for each subsystem. And
generating consistent sets to store, restore, compare
initial and final values is possible by the same pat-
tern as presented in the package Types.Example. In
this package it is also possible to define a customized
way to save and load the variables that connect sub-
systems together. For this purpose, one has to
redeclare the package Types.Utilities with simple
functions for reading and writing values, such as is
done in the default package FileUtilities.
The typical code of a parameter set could be:
model MyParameterSet
replaceable package T = Physiolibrary.Types.RealTypes
constrainedby Physiolibrary.Types.RealTypes;
T.Pressure v1(varName="Bone-Flow.PO2");
T.VolumeFlowRate v2(varName="Bone-Flow.BloodFlow");
T.MolarFlowRate v3(varName="Bone-Metabolism.O2-Need");
T.Volume v4(varName="Bone-Tissue.LiquidVol");
BusConnector busConnector;
connect(v1.y, busConnector.Bone_PO2);
connect(v2.y, busConnector.Bone_BloodFlow);
connect(v3.y, busConnector.Bone_O2Need);
connect(v4.y, busConnector.Bone_LiquidVol);
end MyParameterSet;
To redefine these sets of values to use inputs from
a file is simple. The user just redeclares the type of
the values to type InputParameter and redirects read-
ing functions to FileUtilities:
model InputParameterSet
extends MyParameterSet( T(redeclare block Variable =
Physiolibrary.Types.RealExtension.InputParameter (
redeclare package Utilities = Physiolibrary.Types.FileUtilities)));
end InputParameterSet;
And the same set of values can also be redefined
to file output at the end of the simulation:
model OutputFinalSet
extends MyParameterSet( T(redeclare block Variable =
Physiolibrary.Types.RealExtension.OutputFinal (
redeclare package Utilities = Physiolibrary.Types.FileUtilities)));
end OutputFinalSet;
3 Conclusion
In our opinion the best way to understand this li-
brary is to download it from the Modelica web pages
at and examine the ex-
amples. We recommend examining the package
Hydraulica.Examples, which provides an example of
a simplified cardiovascular system; the package
Chemical.Examples, which provides an example of
allosteric hemoglobin oxygen binding; the package
Osmotic.Examples, which simulates cell volume in
hypertonic and hypotonic environments; and finally
the package Thermal.Examples, which simulates the
heating of circulated blood inside active muscles.
This paper describes the outcome of research that has
been accomplished as part of a research program
funded by the Ministry of Industry and Trade of the
Czech Republic by the grant FRTI3/869 and by
The Ministry of Education, Youth and Sports by the
grant SVV-2013-266509.
In addition, the main author wants to thank Jan
Obdržálek for consultations about physical units, and
Austin Schaefer for English language editing.
[1] Guyton, A.C., T.G. Coleman, and H.J. Granger,
Circulation: overall regulation. Annual review
of physiology, 1972. 34(1): p. 13-44.
[2] Teaching, L.o.B.a.C.A. Physiolibrary in Matlab
and Simuling. 2008; Available from:
[3] Marek Mateják and J. Kofránek, HUMMOD
2011: p. 182-196.
[4] Marek Mateják and J. Kofránek, Rozsáhlý model
fyziologických regulací v Modelice. Medsoft,
2010: p. 126-146.
[5] Kofránek, J., M. Mateják, and P. Privitzer.
HumMod - large scale physiological model in
Modelica. in 8th. International Modelica
conference. 2011. Dresden, Germany.
[6] Kofránek, J., Mateják, M., Privitzer, P., Tribula,
M., Kulhánek, T., Šilar, J., Pecinovský, R.
HumMod-Golem Edition: large scale model of
integrative physiology for virtual patient
simulators. in World Congress in Computer
Science 2013 (WORLDCOMP'13), International
Conference on Modeling, Simulation and
Visualisation Methods (MSV'13). 2013.
[7] Hester, R.L., et al., HumMod: a modeling
environment for the simulation of integrative
human physiology. Frontiers in physiology, 2011.
[8] Center, L.b.U.o.M.M., HumMod. 2012: p.
[9] Kofránek, J., M. Mateják, and P. Privitzer.
Leaving toil to machines - building simulation
kernel of educational software in modern
software environments. in Mefanet 2009. 2009.
Masaryk University, Brno.
[10] Kofránek, J., M. Mateják, and P. Privitzer, Web
simulator creation technology. MEFANET
report, 2010. 3: p. 52-97.
[11] Kofranek, J., et al., The Atlas of Physiology and
Pathophysiology: Web-based multimedia enabled
interactive simulations. Computer methods and
programs in biomedicine, 2011. 104(2): p. 143-
[12] Proß, S. and B. Bachmann, An Advanced
Environment for Hybrid Modeling and
Parameter Identification of Biological Systems.
[13] Cellier, F.E. and A. Nebot. Object-oriented
Modeling in the Service of Medicine. in Proc. 6th
Asia Simulation Conference. 2005.
[14] Larsdotter Nilsson, E. and P. Fritzson. BioChem-
A Biological and Chemical Library for Modelica.
in Proceedings of the 3rd International Modelica
Conference (November 3-4, Linköping, Sweden).
2003. Modelica Assocation.
[15] Nilsson, E.L. and P. Fritzson, Biochemical and
metabolic modeling and simulation with
Modelica. BioMedSim. Linköping, Sweden,
[16] Nilsson, E.L. and P. Fritzson. A Metabolic
Specialization of a General Purpose Modelica
Library for Biological and Biochemical Systems.
in Paper presented at the 4th International
Modelica Conference. 2005.
[17] Brugård, J., et al. Creating a Bridge between
Modelica and the Systems Biology Community. in
7th International Modelica Conference, Como,
Italy. 2009.
[18] Hucka, M., et al., The systems biology markup
language (SBML): a medium for representation
and exchange of biochemical network models.
Bioinformatics, 2003. 19(4): p. 524-531.
[19] Monod, J., J. Wyman, and J.-P. Changeux, On
the nature of allosteric transitions: a plausible
model. Journal of Molecular Biology, 1965.
12(1): p. 88-118.
[20] Bassingthwaighte, J.B., Strategies for the
physiome project. Annals of Biomedical
Engineering, 2000. 28(8): p. 1043-1058.
[21] Fenner, J.W., et al., The EuroPhysiome, STEP
and a roadmap for the virtual physiological
human. Philosophical Transactions of the Royal
Society A: Mathematical, Physical and
Engineering Sciences, 2008. 366(1878): p. 2979-
[22] Hunter, P.J. and M. Viceconti, The VPH-
physiome project: standards and tools for
multiscale modeling in clinical applications.
Biomedical Engineering, IEEE Reviews in, 2009.
2: p. 40-53.
[23] Smith, L., et al., SBML and CellML translation in
Antimony and JSim. Bioinformatics, 2013: p.
[24] Mortimer, R.G., Mathematics for physical
chemistry. 1999: Access Online via Elsevier.
... To do this, we follow the design patterns from Jezek et al. [6]: that is, creating a library of modular hierarchical components using the Modelica language and Physiolibrary and assembling the model from replaceable components. Modelica has been designed for modular hierarchical development of large scale multi-domain systems, especially in the automotive, energy, and aerospace industries, but it has proven advantageous for physiological systems in numerous applications [19,6,20,21,22,23]. The development of this model was performed using Dymola 2021 (Dassault Systémes) but can be run and modified in an open source Modelica environment OpenModelica 1.17 (OpenModelica Consortium). ...
... The development of this model was performed using Dymola 2021 (Dassault Systémes) but can be run and modified in an open source Modelica environment OpenModelica 1.17 (OpenModelica Consortium). The Physiolibrary 2.4 utilized here is a Modelica library aimed to ease the development of physiological systems [21]. To construct a robust modular cardiovascular modeling suite, the source code fo the Safaei et al. [7] model was translated into Modelica language using a custom CellML2Modelica tool (https: // ...
Blood flows and pressures throughout the human cardiovascular system are regulated in response to various dynamic perturbations, such as changes to peripheral demands in exercise, rapid changes in posture, or loss of blood from hemorrhage, via the coordinated action of the heart, the vasculature, and autonomic reflexes. To assess how the systemic and pulmonary arterial and venous circulation, the heart, and the baroreflex work together to effect the whole-body responses to these perturbations, we integrated an anatomically-based large-vessel arterial tree model with the TriSeg heart model, models capturing nonlinear characteristics of the large and small veins, and baroreflex-mediated regulation of control vascular tone and cardiac chronotropy and inotropy. The model was identified by matching data on Valsalva maneuver (VM), exercise, and head-up tilt (HUT). Thirty-one parameters were optimized using a custom parameter-fitting tool chain, resulting in an uniquely high-fidelity whole-body human cardiovascular systems model. Because the model captures the effects of exercise and posture changes, it can be used to simulate numerous clinical assessments, such as HUT, the VM, and cardiopulmonary exercise stress testing. The model can also be applied as a framework for representing and simulating individual patients and pathologies. Moreover, it can serve as a framework for integrating multi-scale organ-level models, such as for the heart or the kidneys, into a whole-body model. Here, the model is used to analyze the relative importance of chronotropic, inotropic, and peripheral vascular contributions to the whole-body cardiovascular response to exercise. It is predicted that in normal physiological conditions chronotropy and inotropy make roughly equal contributions to increasing cardiac output and cardiac power output during exercise. Under upright exercise conditions, the nonlinear pressure-volume relationship of the large veins and sympathetic-mediated venous vasoconstriction are both required to maintain preload to achieve physiological exercise levels. The developed modeling framework is built using the open Modelica modeling language and is freely distributed.
... Physiolibrary is a library of specialized Modelica components for the building of complex physiological models (Mateják et al. 2014) that tries to give a solution for the lack of adoption of Modelica in biosciences. It emerged from the construction of a large model of human physiology, Physiomodel, which in turn is an extended Modelica version of the integrative human physiological model called HumMod (Hester et al. 2011). ...
... They show an interesting model that considers the complex interactions between cardiac circulation and arterial systems, founded on a hierarchy of subsystems that takes advantage of the encapsulation and acausal equation-based nature of Modelica. However, neither Physiolibrary (Mateják et al. 2014) nor the derived cardiovascular system model (Ježek et al. 2017) offer a modeling and simulation software tool oriented to the specific requirements and challenges in biosciences. For instance, it is not an easy task to adapt any of them for the solution of parameterized population PBPK models that predict the distribution, therapeutic response and potential interactions of a drug, which is a current standard problem in the pharmacology area. ...
Conference Paper
Full-text available
There is a lack of Modeling and Simulation software systems in the bioscience arena that give both solutions compliant with current methodologies in drug discovery (pharmaceutic) and precision medicine (healthcare) fields, besides to support the addition of new biological mechanisms under a multilevel and multiformalism perspective, without penalize strongly the model sharing and reusing. A novel modeling and simulation software that tries to fill the previous gap has been designed (CybSim) and it is presented in this work. CybSim is a platform for multilevel modeling of physiological - cybernetic systems, compliant but not limited to Physiologically based- , Pharmacokinetic and Pharmacodynamic (PBPK/PK/PD) methodologies. This capability is governed through the Physiological Scope setting value. The main physiological components are mechanistic. The underlying mechanisms may be changed during the model building thanks to the separation between mechanisms and physiological instances. This capability is based on a multilayer design. A preliminary version of CybSim has been implemented with OpenModelica (v1.14.1). A PBPK semiphysiological model published previously has been built as a case study to demonstrate the feasibility of CybSim. The accuracy of CybSim was verified during preliminary development phases. The two pointed out capabilities of CybSim demanded an object-oriented and acausal equation- based modeling language, able to support classes’ redeclaration, connectors’ causality, inner/outer scoping control and packages organization. These features are not supported by other modern acausal equation-based modeling languages like the EcosimPro language.
... References. The Physiolibrary is a Modelica library for physiological models that has graphical representations for each component 38 . ProMoT is a modeling tool that allows the composition of modular models in a graphical way 44 . ...
... In contrast to, e.g., reaction equations in metabolism models, physiology is not yet standardized enough to have a unifying theory that allows building libraries of components that can be used in multiple tissue or organ models. However, the Physiolibrary can be seen as a first approach in this direction, which also uses Modelica 38 . ...
Full-text available
Reuse of mathematical models becomes increasingly important in systems biology as research moves toward large, multi-scale models composed of heterogeneous subcomponents. Currently, many models are not easily reusable due to inflexible or confusing code, inappropriate languages, or insufficient documentation. Best practice suggestions rarely cover such low-level design aspects. This gap could be filled by software engineering, which addresses those same issues for software reuse. We show that languages can facilitate reusability by being modular, human-readable, hybrid (i.e., supporting multiple formalisms), open, declarative, and by supporting the graphical representation of models. Modelers should not only use such a language, but be aware of the features that make it desirable and know how to apply them effectively. For this reason, we compare existing suitable languages in detail and demonstrate their benefits for a modular model of the human cardiac conduction system written in Modelica.
... At a partial pressure of pCO 2 = 40 mmHg = 40/760 bar in the intracellular fluid, the concentration of freely dissolved CO 2 is measured as 1.24 mmol / L. Thus, the total number of intracellular fluid particles is 0.67 mol / L. This is roughly confirmed by measuring the volume fraction of water or the measurement of solubility for O 2 or even isoosmolarity expressed in the sum of molar fractions of passively impermeable substances. We then support these and many other physiological calculations using a software library designed for physiology [10][11][12][13]. ...
Full-text available
When modeling body fluids using physical chemistry, we en-countered a contradiction. We proceeded from the erroneous assumption that the molar amount of water in an aqueous so-lution is the molar amount of H2O molecules (mass divided by the mass of one H2O molecule). Thus, in one kilogram of pure water, we calculated 55.508 moles of water because the molar mass of H2O is 18.01528 g / mol. When calculating the molar fractions as the molar amount of the substance divided by the solution's total molar amount, we thus obtained numerically completely different values than for molalities or molarities. According to the theory, these values should be substitutable. However, it turned out that using these values in the calculati-ons of the solubility of gases in aqueous solutions showed us an error of about 55 mol/kg. Similar errors began to be reported for chemical processes with different numbers of reactants and products (at the same number, the error is annulled algebrai-cally). So is the water molality really about 55 mol/kg? No. This is because water forms bonds with each other, which cluster more H2O molecules into larger particles. From the required molar amount of water, we derived the dissociation constant and enthalpy of this bond. The results are compatible with data from the National Institute of Standards and Technology (NIST) and the data of formation energies of individual substances. Using these constants, it is possible to derive the molar amount of water in aqueous solutions and subsequently make calculati-ons over molar fractions, the results of which begin to coincide with the measured and published experiments.
... Tyto a mnohé další fyziologické výpočty pak podporujeme pomocí softwarové knihovny určené pro fyziologii [10][11][12][13]. ...
V poslední době se objevily nové elektronické učebnice, propo-jující hypertext, simulační modely a interaktivní grafiku (řízenou modelem na pozadí), které přinášejí zcela nové možnosti pro vysvětlování složitě propojených regulačních vztahů zejmé-na v medicíně. Jsou to většinou aplikace typu client-server, kdy celá aplikace běží na serveru a uživatel se k ní připojuje většinou pomocí internetového prohlížeče či jiného dediko-vaného rozhraní. Existují také aplikace které pracují lokálně na klientském počítači nebo tabletu. My jsme vyvinuli technologii Bodylight.js, která umožňuje tvorbu obdobných výukových aplikací s interaktivními simulátory spustitelnými přímo v inter-netovém prohlížeči na jakékoli platformě či operačním systému (notebooku, tabletu či chytrém telefonu), o níž jsme referovali v loňském ročníku MEDSOFT, V tomto sdělení tuto technologii popíšeme podrobněji a ukážeme i první aplikace.
... . Zároveň je možné změřit molární frakci látky A v plynu (a A(g) ) i molární množství látky A, která se rozpustila ve vodě (n A(aq) ). Pak lze N vyjádřit ze vztahu: Tyto a mnohé další fyziologické výpočty pak podporujeme pomocí softwarové knihovny určené pro fyziologii [10][11][12][13]. ...
Full-text available
Při modelování tělesných tekutin pomocí fyzikální chemie jsme narazili na rozpor. Vycházeli jsme přitom z mylného předpokla-du, že molární množství vody ve vodném roztoku je molárním množstvím molekul H2O (hmotnost dělená hmotností jedné molekuly H2O). V jednom kilogramu čisté vody jsme tedy počítali s 55.508 mol vody, protože molární hmotnost H20 je 18.01528 g/mol. Při počítání molárních frakcí jako molární množství látky dělené celkovým molárním množstvím roztoku jsme tak dostávali numericky úplně jiné hodnoty než při mola-litách nebo při molaritách. Přitom podle teorie by měly být tyto hodnoty zastupitelné. Ukázalo se však, že použití těchto hodnot ve výpočtech rozpustnosti plynů ve vodních roztocích nám vy-kazovaly právě chybu cca 55 mol/kg. Podobné chyby se začaly vykazovat pro chemické procesy s různým počtem reaktantů a produktů (při stejném počtu se chyba algebraicky anuluje). Je tedy skutečně molalita vody cca 55 mol/kg? Ne. Voda totiž mezi sebou vytváří vazby, které shlukují více molekul H2O do větších částic. Z požadovaného molárního množství vody jsme odvodili disociační konstantu i entalpii této vazby tak, aby výsledky byly kompatibilní s daty z National Institute of Standards and Tech-nology (NIST) i s daty formačních energií jednotlivých substan-cí. Použitím těchto konstant je zpětně možné odvodit molární množství vody ve vodních roztocích a následně dělat výpočty přes molární frakce, jejichž výsledky se začínají shodovat s na-měřenými a publikovanými experimenty.
There is a lack of medical simulation tools that can be understood and used, at the same time, by researchers, teachers, clinicians and students. Regarding this issue, in this work we report a virtual simulator (developed in OpenModelica) that allow to experiment with the fundamental variables of the cardiovascular and respiratory system of a neonate. We extended a long-tested lumped parameter model that represents the cardiovascular and respiratory physiology of a neonate. From this model, we implemented a physiological simulator using Modelica. The fidelity and versatility of the reported simulator were evaluated by simulating seven physiological scenarios: two of them representing a healthy infant (newborn and 6-months old) and five representing newborns affected by different heart diseases. The simulator properly and consistently represented the quantitative and qualitative behaviour of the seven physiological scenarios when compared with existing clinical data. Results allow us to consider the simulator reported here as a reliable tool for researching, training and learning. The advanced modelling features of Modelica and the friendly graphical user interface of OpenModelica make the simulator suitable to be used by a broad community of users. Furthermore, it can be easily extended to simulate many clinical scenarios.
Nové webové (HTML 5, WebAssembly, JavaScript, Web Components) a modelovací (FMI) standardy otevírají možnosti vytváření webových simulátorů propojujících simulační modely, grafiku, hypertext a multimédia, které lze spouštět na jakémkoliv zařízení s internetovým prohlížečem. Na těchto standardech je založena i naše technologie BodyLight.js.
Conference Paper
In order to teach different modeling techniques we demonstrate equation-based, block-schema based, compartment and component-based modeling using acausal and object-oriented modeling language - Modelica. Hands-on implementation using all these techniques and comparing them towards same system (in our case glucose-insulin regulation) we teach pros and cons of each technique. Equation-based or block-schema based may be rapidly implemented from literature. However, compartment based or component-based models brings better understanding of modeled reality. When students have such experience, they tend to assess published papers more critically and do more complex system analysis.
Full-text available
Biological systems are often very complex so that an appropriate formalism is needed for modeling their behavior. Hybrid Petri nets, consisting of time-discrete as well as continuous Petri net elements, have proven to be ideal. This formalism was imple-mented based on the Modelica language. Several Petri net components are structured within an ad-vanced Petri net library. A special sub-library con-tains so-called wrappers for specific biological reac-tions to simplify the modeling procedure. The Petri net models developed with the Dymola tool can be connected to Matlab Simulink to use all the Matlab power for parameter identification, sensi-tivity analysis and stochastic simulation. This paper illustrates the usage of the Petri net li-brary, the coupling to Matlab Simulink and further processing of the simulation results with algorithms in Matlab. In addition, the application is demonstrat-ed by modeling the metabolism of Chinese Hamster Ovary Cells.
Conference Paper
Full-text available
Model QHP (Quantitative Human Physiology) Colemana a spol. patří k nejrozsáhlejším modelům fyziologických systémů (obsahuje 4000 proměnných). Jeho struktura je na webových stránkách ( themodelingworkshop) do všech podrobností zveřejňována jako open source. Popis modelu je však rozčleněn do více než dvou tisícovek XML souborů roztroušených do stovek adresářů, z nichž speciální solver vytváří a spouští simulátor. Celková struktura modelu a jednotlivé návaznosti jsou proto velmi nepřehledné. Pro přehledné zobrazení matematických vztahů z XML notace QHP jsme proto nejprve vytvořili speciální softwarový nástroj QHPView. Model jsme implementovali v jazyce Modelica, což vedlo k mnohem přehlednější struktuře modelu. Odstranili jsme některé chyby a model rozšířili zejména o problematiku modelování vnitřního prostředí. Rozšířený model QHPGolem Edition je podkladem vytvářeného výukového trenažéru „eGolem“, určeného pro lékařskou výuku v oblasti klinické fyziologie akutních stavů, vyvíjeného v rámci výzkumného projektu MŠMT č. 2C067031, na webových stránkách tohoto projektu je možno i najít aktuální strukturu naší modelicové implementace modelu QHP (
Full-text available
The creation and exchange of biologically-relevant models is of great interest to many researchers. When multiple standards are in use, models are more readily used and re-used if there exist robust translators between the various accepted formats. Antimony 2.4 and JSim 2.10 provide translation capabilities from their own formats to SBML and CellML. All provided unique challenges, stemming from differences in each format's inherent design, in addition to differences in functionality. Both programs are available under BSD licenses; Antimony from and JSim from
Conference Paper
Full-text available
In the drug industry, the later a substance is dis- charged from the drug development pipeline, the higher the financial cost. In order to reduce the num- ber of lead compounds a number of computerized sys- tems have been suggested, and in most of these systems modeling and simulation of the lead compound's ef- fects on different metabolic pathways are essential. In these systems, substances that are expected to be harm- ful or lethal can be removed at an early stage and a reduced number of lead compounds can be chosen for the concluding tests. Given Modelica's previous success with modeling and simulation of huge and complex systems it is likely that it will also be suitable for modeling, simulation, and visualization of metabolic pathway systems, e.g., those systems used in the drug industry. A Modelica li- brary designed to be used for modeling, simulation, and visualization of metabolic pathways is the special- purpose library Metabolic, an extension of the abstract Modelica library BioChem.
Conference Paper
Full-text available
In the drug industry the later a substance is discharged from the drug development pipeline, the higher the financial cost. In order to reduce the number of lead compounds a number of systems have been suggested, and in most of these systems modeling and simulation of the lead compound's effects on different metabolic pathways are essential. In these systems, substances that are expected to be harmful or lethal can be re- moved at an early stage. Consequently, a reduced number of promising lead compounds can be chosen for the concluding tests. Given Modelica's previous success with huge and complex systems it is likely that it will also be suitable for modeling, simulation, and visualization of meta- bolic pathway systems, i.e., those systems used in the drug industry. A Modelica library designed to be used for modeling, simulation, and visualization of meta- bolic pathways is the special-purpose library Meta- bolic, an extension of the abstract Modelica library BioChem.
Conference Paper
Full-text available
Many biological, biochemical and chemical sys- tems have been mathematically defined for dec- ades. As laboratory techniques are becoming in- creasingly sophisticated, more systems can be mathematically defined. But sophisticated tech- niques usually means more expensive and time- consuming. Simulation and modeling tools have today therefore become a very important part of biological and chemical research. In this paper the advancement on developing a library for simula- tion of cellular pathways in the Modelica language will be presented.
Full-text available
The models employed in all aspects of science and engineering have grown increasingly complex, in order to allow them to capture more and more details of the systems that they are representing. Unfortunately, the increased complexity makes these models more difficult to maintain and harder to understand. Especially in a domain, such as medicine, with domain experts, who possess rather limited mathematical skills in general, the complexity of advanced models has become problematic, as these experts no longer are capable of fully understanding and criticizing these models. The object-oriented modeling paradigm offers a means to increase the overall model complexity, thereby enhancing the realism of its simulations, without making these models more difficult to understand or maintain than the simple toy models of the past. In this paper, the approach is demonstrated by means of a fairly elaborate model of human hemodynamics.
In past, simulation models had been created directly in the software development environment used for making the educational software itself. Recen tly, specialized development tools rather than universal programming languages have been used for making and verifi cation of simulation models. Common choice is that of the block oriented environments (e.g. Simulink). In these environments, hierarchically connected blocks that process input information to output information are used and connected when creating a simulation model. Signals fl ow in connections between individual blocks, transmitting the values of individual variables from the output of one block to the input of other. The s tructure of the interconnected network preserves the algorithm of calculation, i.e. clarifi es how the values of particular variables are calculated step by step. The whole process is known as causal modelling. The limitation of the causal approach to modelling is that it refl ects more the calculation procedure than the actual structure of the modelled reality. The physical structure of the modelled world is captured only by the structure of calculation. Causal modelling is especially arduous for intricate, hierarchically organized models, for instance the models of complex physiological systems, which biomedical simulators are based on. At present, new simulation environments have become available. Fundamental innovation of these environments comprises of the possibility to describe individual parts of the model as a system of equations directly describing the behaviour of that part and not the algorithm of solving of these equations. Model description is declarative (the structure of mathematical relationships instead of algorithm of calculation is described) and notation is therefore acausal. Acausal modelling environments work with interconnected components (i.e. blocks) as well. A component represents an instance of class for which equations or parameters are defi ned. Components are linked through connectors that are defi ned more precisely then usual, as they themselves help to defi ne the system of equations. Thus, the connections between components do not defi ne the calculation procedure but rather the modelled reality. The exact algorithm and method of solving the equations is "left to the machines". When large and complex systems are modelled in acausal simulation environments (e.g. based upon modelling language Modelica), the whole process can be facilitated so substantially, as to make it the breakthrough innovation in building the simulation kernel of biomedical educational software. Advantages of the acausal approach are demonstrated using Modelica implementation of a large-scale physiological system model "Quantitative Human Physiology" as an example.