OrgPad logo

Compbiomed 2023 presentation Tomas Kulhanek

Created by Tomas Kulhanek

Compbiomed 2023 presentation Tomas Kulhanek

Bodylight.js - toolchain for in-browser simulation of simple and complex mathematical models

Bodylight.js 2.0 - Introduction

image

acknowledgment

imageimage

team current and past

image

What language/technology do you use for modeling?

image

Models

Is it a model? equations

20230913 142115crop

Elena Zappon Efficient Reduced Order Modeling for Coupled Problems in Cardiac Electrophysiology, CompBioMed2023, 13th September 2023

Is it a model? component diagram

20230913 132057crop

Magdalena Otta et al. A 0D model of lower limb haemodynamics: sensitivity analysis, CompBioMed2023, 13th September 2023

Is it a model? block schema

image

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 after reimplementation in 2010

image

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.

explanatory models

to explain:

who is the audience?

model of glucose insulin regulation - equations

image

image

image

model of glucose insulin regulation - block schema

image

model of glucose insulin regulation - acausal and component modeling (compartment modeling)

image

components

image

image

image

image

Tomas Kulhanek, Jiri Kofranek. Experience with Teaching Different Modeling Techniques on the example of Glucose Insulin Regulation Model, 

Annu Int Conf IEEE Eng Med Biol Soc. 2020 Jul;2020:6024-6027. doi: 10.1109/EMBC44109.2020.9176535

Guyton's original scheme

image

implementation in component and acausal modeling language

image

Frank-Starling law is  much more visible in component model - "force of the heart muscle depends on pressure of incoming blood". 

Physiomodel

firefox SHzAoizS4q

Complex model of physiology in Modelica based on HumMod and Physiolibrary

https://physiomodel.org

>60 000 equations

simulators

who is the audience?

from model to web simulator and where bodylight.js fills the missing pieces

image

bodylight.js

  1.  scripts translate model - FMU (standard C-source,C-binary following API) to WebAssembly
  2. javascript library
    1. custom element for model
    2. custom element for animation
    3. custom element for other useful web libraries and simplified elements
  3. Optional tools (composer, editor) to simplify creating and deploying web simulators

1. export model to FMU with C source code

image

2.compile to WebAssembly

image

Configuration and scripts to facilitate compilation with emscripten

emcc … -O3 –closure 0 …

https://github.com/creative-connections/Bodylight.js-FMU-Compiler

3. download JS with WebAssembly and use it in <bdl-fmi> web component

image

webcomponents - HTML elements

POWERPNT e4sDsmlrVX

webcomponents - custom elements

image

range

image

firefox I8uGRV2pqg

webcomponents - custom elements animation

image

firefox jMeSh19NxA

simulator with web components - src

<script src=" bodylight.bundle.js" ></script>

...

<body aurelia-app="webcomponents">

...

image

we can put HTML/CSS styling

image

in-browser simulation - serverless apps examples

web simulators in a browser / desktop/tablet

desktop

native mobile apps

imagePOWERPNT Mjc6Qcjhym

control HW mannequin

hwmanequin

bring virtual reality to life

vr

simulator of glucose/insulin

firefox C1zReN0kIX

circulation

hemodynamics

summary

image

bodylight.physiome.cz  (with source codes at GITHUB)

Currently only models in Modelica language can be simulated - in future other languages and technologies can be integrated just by implementing standard FMI API

image

simulator2

image

explanatory simulators

simulator1

model of circulation and its regulation

Physiolibrary

https://physiolibrary.org