Physiolibrary.UsersGuide Physiolibrary.UsersGuide

Package Physiolibrary is a modelica package for Human Physiology that is developed from HumMod modelica implementation, see http://hummod.org. It provides constants, types, connectors, partial models and model components fitted for physiological models of human body.

This is a short User's Guide for the overall library. Some of the main sublibraries have their own User's Guides that can be accessed by the following links:

Chemical

Library of chemical domain.

Hydraulic

Library of hydraulic domain. For modeling of cardiovascular system.

Thermal

Library of termoregulation support. As extension of Modelica.Thermal.HeatTransfer.

Osmotic

Library to model water fluxes through semipermeable membrane caused by osmotic pressure.

Population

Library for population models such as predator-prey or cells population.

Icons

Icons

Types

Physiological types. Physiological unit vs. SI units, nominals, inputs/outputs, typed constants.

Blocks

Useful blocks, that are missing in package Modelica.Blocks (MSL 3.2), cubic interpolation curves, multiplication factors.

Extends from Modelica.Icons.Information (Icon for general information packages).

Package Content

Name Description
Physiolibrary.UsersGuide.Overview Overview Overview of Physiolibrary
Physiolibrary.UsersGuide.Connectors Connectors Connectors
Physiolibrary.UsersGuide.ReleaseNotes ReleaseNotes Release notes
Physiolibrary.UsersGuide.Contact Contact Contact
Physiolibrary.UsersGuide.License License BSD 3-Clause License
Physiolibrary.UsersGuide.NewRealease NewRealease Publishing new release

Physiolibrary.UsersGuide.Overview Physiolibrary.UsersGuide.Overview


Physiolibrary.UsersGuide.Overview

ThePhysiolibrary consists of the following main sub-libraries:

Library Components

Description

Chemical

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 directions 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 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 solubility, dilution with additional solvent flow, membrane reabsorption, chemical degradation and physiological clearance.

Hydraulic

The main usage of the hydraulic domain in human physiology is modeling of the cardio-vascular system. And because there are no extreme thermodynamic conditions, the system can be really simple —it is only necessary to model conditions for incompressible water, at normal liquid-water temperatures and with relative pressure 5-20kPa. This boring thermodynamic state leads to the very simple blocks of hydraulic resistance, hydrostatic pressure, volumetric flow, inertia and finally the block of blood accumulation in elastic vessels.

Thermal

For the human body to function optimally, it is critical to hold the core temperature at 35–39°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 domain, the thermal domain is simplified to these conditions.

In the Thermal package extends the package Modelica.Thermal.HeatTransfer from Modelica Standard Library 3.2 (MSL), where the connector is composed of temperature and heat flow. The main blocks in Thermal are: Conductor, 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 to use this block instead of Modelica.Thermal.HeatTransfer.HeatCapacitor to have possibility of variable mass amount or to have a support for calculation of steady state.

Osmotic

One of the basic phenomenon of biological systems 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. This pressure difference is called osmotic pressure. Osmotic pressure is linearly proportional to the concentration gradient of impermeable solutes. The osmolarity (osmotic concentration) is also one of the main indexes of human body balance, called homeostasis. Its value should not significantly deviate for a long period of time from a value of 285-295 mosm/l.

In Physiolibrary the osmotic connector OsmoticPort is composed of the osmotic concentration 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.

Population

Population models are based on increasing and decreasing of average number of population members. The number of population member is a nonflow variable in connectors and flow variable is the change of population members. The growth or differentiation of cells can be modeled as stream from one population component to another, where each population component could be defined by selected age, type, function or wathever..

Even the domain is integer, all is modeled by real numbers.

SteadyStates

One of the main question in clinical medicine is how to stabilize the patient. In the fact of the oscillating heart, breathing, circadian rhythm or menstruation cycle the model could be designed as non-oscillating with variables such as period times, amplitudes, frequencies, mean values and other phase space variables. This type of model has better numerical stability for longer simulation time and even more it can be "stabilized". This stabilization we called steady state.

To be mathematically exact, we define an steady state system (SSS) as a non-differential system derived from a 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 algebraically dependent equations in the non-differential system derived from DS by setting zero derivations. The ASSE describes the system from the top view mostly such as the equations of mass conservation laws or the boundary equation of environment sources. To define a model as an SSS the user must switch each Simulation parameter in each block to value Types.SimulationType.SteadyState and must have correctly defined all necessary ASSE. This setting caused to ignoring any start values for any state and add zero derivation equations instead. Today does not exist Modelica environment, which could automatically find and remove generated dependent equations by this way. So the correct number of states must be marked as dependent (parameter isDependent) and the same number of ASSE must be inserted. Despite the fact, that model in this steady-state setting will be not locally balanced it should be globally balanced and without any dependent equation.

Adding of one ASSE is possible by inserting and connecting of the energy or mass conservation law block from package SteadyState.Components. Other possibilities is in blocks of environment  sources, where the setting of parameter isIsolatedInSteadyState  add the equation of the zero mass/volume/energy flow from or to environment.

The model in steady state often changes to one big nonlinear strong component, but without solver stiff or convergence problems. Especially in quick chemical reaction kinetics is not necessary to have very rapid molar fluxes, when it always reach equilibrium. This design also approve to create steady stated parts in dynamical model without huge rebuilding. It also  brings other benefits. To see these possibilities, one have to realize that conservation laws could be invariances in a dynamical simulation. This is really useful for debugging.

It is always a big challenge to nicely solve initial values of differential system. However, it should be possible to solve the SSS in initial phase. And this is the idea behind the Types.SimulationTypes.InitSteadyState option for models already extended with ASSE to support SSS.

Extends from Modelica.Icons.Information (Icon for general information packages).


Physiolibrary.UsersGuide.Connectors Physiolibrary.UsersGuide.Connectors


Physiolibrary.UsersGuide.Connectors

The Physiolibrary defines the most important elementary connectors in various domains. If any possible, a user should utilize these connectors in order that components from the Physiolibrary and from other libraries can be combined without problems. The following elementary connectors are defined (the meaning of potential, flow, and stream variables is explained in section "Connector Equations" below):

domain

potential

variables

flow

variables

stream

variables

connector definition

icons

chemical

molar concentration

molar flow




Chemical.Interfaces

ChemicalPort, ChemicalPort_a, ChemicalPort_b

hydraulic

pressure

volumetric flow




Hydraulic.Interfaces

HydraulicPort, HydraulicPort_a, HydraulicPort_b

osmotic

osmolarity

permeable liquid volumetric flow




Osmotic.Interfaces

OsmoticPort, OsmoticPort_a, OsmoticPort_b

thermal

temperature

heat flow rate




Modelica.Thermal.HeatTransfer.Interfaces

HeatPort, HeatPort_a, HeatPort_b

Thermal.Interfaces

HeatPort, HeatPort_a, HeatPort_b


population

the number

of population members

change

of the number of population members




Population.Interfaces

PopulationPort, PopulationPort_a, PopulationPort_b

block

diagram

Real unit-typed variables







Types.RealIO

EnergyInput, EnergyOutput, TimeInput, TimeOutput, MassInput, MassOutput, MassFlowRateInput, MassFlowRateOutput, HeightInput, HeightOutput, AccelerationInput, AccelerationOutput, PressureInput, PressureOutput, VolumeInput, VolumeOutput, VolumeFlowRateInput, VolumeFlowRateOutput, ConcentrationInput, ConcentrationOutput, OsmolarityInput, OsmolarityOutput, AmountOfSubstanceInput, AmountOfSubstanceOutput, MolarFlowRateInput, MolarFlowRateOutput, DiffusionPermeabilityInput, DiffusionPermeabilityOutput, HeatInput, HeatOutput, TemperatureInput, TemperatureOutput, HeatFlowRateInput, HeatFlowRateOutput, ThermalConductanceInput, ThermalConductanceOutput, ElectricCurrentInput, ElectricCurrentOutput, ElectricChargeInput, ElectricChargeOutput, ElectricPotentialInput, ElectricPotentialOutput, FractionInput, FractionOutput, FrequencyInput, FrequencyOutput, OsmoticPermeabilityInput, OsmoticPermeabilityOutput, HydraulicConductanceInput, HydraulicConductanceOutput, HydraulicComplianceInput, HydraulicComplianceOutput, HydraulicInertanceInput, HydraulicInertanceOutput, GasSolubilityInput, GasSolubilityOutput, DensityInput, SpecificEnergyInput, SpecificEnergyOutput, SpecificHeatCapacityInput, SpecificHeatCapacityOutput






In all domains, usually 2 connectors are defined. The variable declarations are identical, only the icons are different in order that it is easy to distinguish connectors of the same domain that are attached at the same component.

Extends from Modelica.Icons.Information (Icon for general information packages).


Physiolibrary.UsersGuide.Contact Physiolibrary.UsersGuide.Contact


Physiolibrary.UsersGuide.Contact

Marek Matejak

email: marek@matfy.cz

skype: marek.matejak

tel: +420 776 301 395


Graphics of icons:

Martin Broz,

Veronika Sykorova

email: elvenfall@gmail.com

Extends from Modelica.Icons.Contact (Icon for contact information).


Physiolibrary.UsersGuide.License Physiolibrary.UsersGuide.License


Physiolibrary.UsersGuide.License

All files in this directory (Physiolibrary) and in all subdirectories, especially all files that build package "Physiolibrary" are licensed by Marek Matejak under the BSD 3-Clause License (with exception of files "Resources/*").

Licensor:

Marek Mateják,

Hviezdoslavova 632/41,

916 01 Stará Turá,

Slovak Republic,

email: marek@matfyz.cz

Organization:

Institute of Pathological Physiology, First Faculty of Medicine, Charles University in Prague,

U Nemocnice 5, 128 53 Prague 2, Czech Republic


Copyright notices of the files:

Copyright (c) 2008-2015, Marek Mateják, Charles University in Prague


All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Extends from Modelica.Icons.Information (Icon for general information packages).


Physiolibrary.UsersGuide.NewRealease Physiolibrary.UsersGuide.NewRealease


Physiolibrary.UsersGuide.NewRealease


New release must be numbered by Semantic Versioning 2.0, see semver.org.


If minor version, then the conversion script must be written and connected with package Physiolibrary using "annotation(conversion(from(version=..)))"!


To clean the code from dummy annotations try to use script ttws.


Update version number to "X.Y.Z":


Update release notes:


Publish release in GitHub:

Extends from Modelica.Icons.Information (Icon for general information packages).


Automatically generated Tue Sep 15 22:52:14 2015.