Pharmacolibrary lightning talk TK
Created by Tomas Kulhanek

Physiologically based pharmacokinetic modeling with MODELICA and FMI: demo integration with PK database
Tomáš Kulhánek
VITO, Mol, Belgium
1st Faculty of Medicine, Charles University, Prague, Czechia
standard Modelica language


Commercial tools:
Dymola,

, …
Open-source:

1. models
standard Modelica library 4.0.0

custom libraries for specific domains
Physiolibrary 3.0.0
www.physiolibrary.org

Physiomodel

Complex model of physiology in Modelica and Physiolibrary
https://physiomodel.org
blood-gas exchange

hemodynamics of cardiovascular system

respiration

co-simulation of multiple models via FMI in static web app with bodylight.js
i
https://egolem.online/demo/
new library: Pharmacolibrary 25.04 (beta)
connectors and components:

1-compartment model (in diagram)

equivalent 1-compartment model (in equations)

gentamicine

2-compartment model

midazolam

3-compartment model

fentanyl

Physiology based kinetic model

simulation PBK model

why in Modelica?
model of complex system may lead to implementation errors

A C Guyton, T G Coleman, H J Granger, Circulation: overall regulation, Annu Rev Physiol.1972;34:13-46.doi: 10.1146/annurev.ph.34.030172.000305.
Correction of schema after reimplementation in 2010

J.Kofránek, et al., Restoration of Guyton‘s Diagram for Regulation of the Circulation ...Physiol Res. 2010;59(6):897-908.doi: 10.33549/physiolres.931838.
comprehensibility
Frank-Starling law is much more visible in component model - "force of the heart muscle depends on pressure of incoming blood".
equivalent implementation in component and acausal modeling language

2.simulation
standard for simulation - FMI

Modelica tools support FMI
Matlab SIMULINK
FMPy for Python
Bodylight.js for web (model → FMI → emscripten → FMI JS with WebAssembly → + other components for charts, animation, markdown ...)
workflow - 1. export model to FMI unit 2. simulate in Python & fmpy & 3. get data from external data (PK-DB.com) 4. compare/fit/...

compile FMI unit to Webassembly & simulate FMI unit in web application (in-browser simulation)

powered by Bodylight.js: https://bodylight.physiome.cz
web app simulation & interactive animation

final remarks

pharmacology & influence of physiology