Post on 07-Oct-2020
Ministry of Education, Youth and Sports Project No. 2C06031
eGolem: Medical Training Simulator of Human Physiological Functions as the Foundation for eLearningBased Teaching of Acute
Conditions Medicine
Implementation Stage 3: January – December, 2008
Appendix 1: Selected Publications Supported by the MŠMT (Ministry of Education, Youth and Sports) Project No. 2C06031 in 2008
Creative Connections s.r.o.
ComSys Trade spol. s.r.o.
The project is implemented in close cooperation with the 1st Faculty of Medicine, Charles University
Praha, January 2009
Jackson Cardiovascular-Renal Meeting 2008
Jiří Kofránek, Jan Rusz, Marek Mateják: From Guyton's graphic diagram to
multimedia simulators for teaching physiology. (Resurection of Guyton's Chart
for educational purpose) Proceedings of the Jackson Cardiovascular-Renal Meeting 2008. (Stephanie Lucas Ed), appendix to poster presentation.
Jackson Cardiovascular-Renal Meeting 2008
1
FROM GUYTON'S GRAPHIC DIAGRAM TO MULTIMEDIA SIMULATORS FOR
TEACHING PHYSIOLOGY (RESURRECTION OF GUYTON’S CHART FOR EDUCATIONAL PURPOSE)
Jiří Kofránek, Jan Rusz, Marek Matejak
Laboratory of Biocybernetics, Department of Pathophysiology, 1st
Faculty of Medicine, Charles University,
Prague, Czech Republic Summary:
The authors describe an implementation of a classic many ‐times‐copied Guyton's circulatory‐system‐control chart in the Simulink environment. They point out that there were mistakes in the original pictographic chart that were necessary to be corrected before the implementation. The appearance of the model has been preserved in the Simulink similar to the Guyton's graphic chart ‐the scheme layout, the wiring placement, the quantity names and the block numbers are the same. The model behaviour demonstrates the pathogenesis of different pathological states truly enough to be used for teaching of physiological regulatory systems in the biomedical‐engineering‐students education, as well as as a theoretical basis for a multimedia simulator, created in the .NET environment and web ‐accessible for medicine students at Charles university in Prague.
1. Introduction:
Thirty‐six years ago, an especial article appeared in Annual Review of Physiology, Guyton et al. 1972 [4] that surpassed all the traditional papers on physiology of that time. It was introduced by a large diagram in a tip‐in plate (a detail at Fig. 1). The chart full of lines and interconnected elements reminded of an electrical device at first sight. Instead of the vacuum tubes or other electrical components, coupled computational blocks (multipliers, divisors, summators, integrators, and functions) were displayed here symbolising mathematical operations performed on the physiological quantities. The leader bundles between the blocks expressed complicated feedback bindings. The blocks were clustered into eighteen groups, each one representing a particular interconnected physiological subsystem.
Fig. 1: A detail of the large circulatory‐dynamics chart
Jackson Cardiovascular-Renal Meeting 2008
2
2. A web of physiological regulations
In this completely new way, the Guyton's paper described physiological circulatory ‐system regulations and wider context of other organism subsystems ‐kidneys, blood volume and ion balance etc. by a mathematical model. Instead of listing sets of equations, graphical illustration of mathematical relations was employed. This syntax enabled the author to depict the dependencies between particular physiological quantities in the form of interconnected blocks representing mathematical operations.
The definition of the model consisted only of this basic (yet fully illustrative) figure. Comments and justifying of the mathematical formulation were very brief, e. g., "blocks 266 ‐270 compute the influence of the cellular pO2, the autonomous stimulation and the basal oxygene consumption on the real tissue‐oxygene‐consumption rate". This required a high level of concentration (and even certain physiological and mathematical knowledge) from the reader to understand the meaning of the formalised relations between the physiological quantities.
One year later, in 1973, a monograph appeared [5] that explained many of the used approaches more in detail. The Guyton's model was a milestone ‐it was the first large‐scale mathematical description of physiological functions of coupled organism subsystems and launched a brand‐new research area, known as integrative physiology today. The integrative physiology aspires to formalised description of the interconnected physiological regulations, with computer models as the methodical tool. The main activities in this branch are concentrated under the PHYSIOME project (Bassingthwaighte 2000, Hunter et al. 2002) under the auspices of the International Union of Physiological Sciences (www.physiome.org), or the project EUROPHYSIOME for the European Union respectively (www.europhysiome.org).
The Guyton's school kept on evolving the model. In 1983, Thomas Coleman, one of his scholars and colleagues, built a model called "Human" intended mainly for the educational purposes [3]. "Human" allowed simulation of a number of pathological states (cardiac and renal failure, hemorrhagic shock etc.) as well as the influence of some therapeutic interventions (blood transfusion, artificial pulmonary ventilation, dialysis and others). A modern interactive Java implementation of this model can be found at http://venus.skidmore.edu/human.
The latest outcome of Guyton's followers is the Quantitative Human Physiology simulator [8] representing the most complex and most extended model of physiological functions so far. The model has been created as an open‐source Windows‐based project and all its aspects, including over 3000 variables and the mathematical equations describing the physiological processes, have an XML text ‐readable description. The simulator demonstrates human physiology applying whole‐body properties, organs and multi‐organ systems, users can view time‐dependent solutions and interactively alter parameters to investigate new hypotheses. Model can be downloaded from http://physiology.umc.edu/themodelingworkshop/. 3. Implementation and errors in Guyton's chart The Guyton's model and his further modifications were originally implemented in Fortran and later in C++. Today, there are specialised software simulation tools available for its development, tuning and verification. One of them is the Matlab/ Simulink environment by the MathWorks company, supporting successive model assembly ‐the particular components can be joined into the simulation networks by
Jackson Cardiovascular-Renal Meeting 2008
3
computer‐mouse dragging of connecting lines. Simulink computational elements are very alike to those used by Guyton for the formalised expression of physiological relations. The only difference is in their graphic form.
This similarity (and also the last year's 35th anniversary of the idea publishing) has inspired us to resurrect the old classic Guyton's chart and convert it in a functional simulation model [10]. In the Simulink implementation, we have employed switches to turn on and off the particular subsystems and regulatory loops even while running the simulation. We have tried to keep the outer model appearance identical to the original graphic chart ‐the scheme layout, the wiring placement, the quantity names and the block numbers are the same.
Fig. 2: The most significant errors in chart and their correction
The simulatory visualisation of the old diagram was not as easy as expected ‐in the original model, several mistakes were found. Although it does not matter in a figure, if we try to animate it in Simulink then the model collapses as a whole instantly. There were not many of those errors ‐inverse signs, a divisor in place of a multiplier, a mutually interchanged block connection, a missing decimal point in a constant etc. However, they were sufficient for the model not to work. Some of them were evident even with no physiology knowledge ‐it was obvious from the chart that during the run, the values in some integrators would (due to the wrongly applied feedback) steeply increase to the infinite and the model would break down. With some physiological and system‐analysis background and with some effort, all the mistakes could be found eventually (Fig. 3). A detailed description of the errors and the corrections provides Kofránek [10].
Jackson Cardiovascular-Renal Meeting 2008
4
It is interesting, that Guyton’s chart was many times overprinted as a complicated picture in several publications [7] and nobody made an effort to fix these errors. After all, at the time the pictographic chart was created, there had been no convenient drawing tool yet – the picture had originated as a complex schematic figure – and to copy it manually was not so easy. It is not impossible that the authors didn’t even want to correct the errors – who took the pain over analysing the model, easily uncovered the diagrams mistakes – who wanted to just blindly copy, failed.
The Fortran implementation was very typical for this time – because of the scant power of processors, advanced numerical methods were engaged to accelerate the program run that were using a various integration step in different part of the model. A direct conversion of the Fortran source to a Simulink model results in a very confusing code [12].
Our implementation was based on original Guyton’s chart with graphical mistakes fixed. The point was in creating a visual educational tool for the course Physiological regulatory systems. The model enables connecting and disconnecting single loops, analysing individually regulation circuits and their importance in development of particular pathological states. The source code in Simulink of both the corrected original, and much more sophisticated late Guyton’s model is available to download at http://www.physiome.cz/guyton, together with a detailed description and explanation of all the mathematical relations included. As a new simulation framework for design and implementation of simulation models we have chosen modern simulation language Modelica and we are developing original framework ”ModelicaNet” based on Modelica.NET (see http://patf‐biokyb.lf1.cuni.cz/wiki/modelica.net). Implementation of Guyton’s model in Modelica simulation language is available to download at http://www.physiome.cz/guyton
Renal deficiency causing limited salt‐load‐elimination ability leads to an increase of the total extracellular‐fluid volume and consequently of the blood volume after a higher salt and water intake. The hypervolemia incites a cardiac‐output increase and the initial hypertension. Via the baroreflex, the sympathetic activity is reduced which in combination with the vascular stretching effect of the elevated
.
4. Experiments
The aimed resurrection was intended to produce a graphical application displaying all the regulatory connections which would allow to verify the influence of the individual parameters on the progress of pathological conditions. Since the first implementation in 1972, the basic pictographic model has been many times upgraded, however, having brought it to life now give us a unique opportunity to apprehend the circulatory‐dynamics physiology. This can be observed in the following experiments corresponding to those published in Guyton’s first paper in 1972.
4.1. Hypertension in a salt‐loaded, renal‐deficient patient
This was the first and very fundamental experiment revealing the importance of kidneys in blood‐pressure control and their influence of essential‐hypertension development.
Jackson Cardiovascular-Renal Meeting 2008
5
arterial pressure dilates the peripheral blood vessels so that the total peripheral resistance falls below normal.
Fig. 4.1.: Simulation of hypertension in a salt‐loaded, renal‐deficient patient
This shows that all the initial arterial‐pressure increase is caused only by the raised cardiac output and not by a change in total peripheral resistance. But as the regulatory mechanisms try to suppress the tissue hyperperfusion, even the peripheral resistance starts to grow significantly after two days which becomes the factor that eventually maintains the arterial hypertension, whereas the cardiac output is decreasing towards the norm since the day 3 of the process.
The experimental simulation was run for an 8‐days time equivalent (Fig. 4.1.). In the day 1, renal mass was decreased to 30 % of the norm by modifying the REK parameter (percent of normal renal function) of the model. In the day 2, the salt intake was five‐times heightened compared to the norm by setting the NID‐parameter (rate of sodium intake) value to 0.5.
Jackson Cardiovascular-Renal Meeting 2008
6
The results are displayed in the plots in Fig. 3: the initial renal mass reduction affected the monitored variables only slightly, except of a moderate decrease in cardiac output due to simultaneous elevation of total peripheral resistance and depressed urine production. Applying the salt load caused more dramatic effects. The extracellular ‐fluid and blood volume arose wherefore the cardiac output increased considerably and then stabilised, while the total peripheral resistance fell, yet not enough to prevent the arterial ‐pressure augmentation.
By 120 hours of simulation, the cardiac output had stabilised but the peripheral resistance was still rising. As the arterial pressure continued increasing, this demonstrates that it is the peripheral resistance, not the cardiac output, that is responsible for the long‐term arterial hypertension.
4.2. Nephrosis due to protein loss by plasma
Fig. 4.2.: Simulation of nephrosis due to protein loss by plasma
Jackson Cardiovascular-Renal Meeting 2008
7
Fig. 4.3.: Simulation of circulatory changes during severe muscle exercise
The second experiment illustrates the progress of a nephrotic edema caused by a plasma ‐protein loss. The principal effect of nephrosis consists of urine protein excretion that may not be associated with any significant changes in other renal functions. A deficit of the total plasma protein reduces the oncotic pressure, resulting in a fluid redistribution from the blood to the interstitial compartment and an increase of the (mostly free‐) interstitial‐fluid volume. Another effect is a mild cardiac‐output and arterial‐pressure decrease.
A 12‐days simulation was run (Fig. 4.2.). In the day 1, the plasma‐protein loss was seven‐times multiplied
Jackson Cardiovascular-Renal Meeting 2008
8
by setting the DPO parameter (rate of plasma‐protein loss) to 0.05 g/min. After 7 days, the value was reduced to 0.02 g/min which is still three‐times above the norm.
The initial hypoproteinemia only slightly decreased both arterial pressure and cardiac output but induced a notable restriction of the urinary output. Thus the fluid was being retained in the organism causing the interstitial swelling, although the volume of the free interstitial fluid remained relatively unchanged until the interstitial‐fluid pressure stayed negative. After it reached positive values, an apparent edema occurred with a sharp drop in the arterial pressure. As soon as the renal protein loss returned to the level of possible liver compensation capacity by plasma protein production in the day 8 of the experiment, the edema receded which was accompanied by high diuresis and cardiac‐output adjustment.
4.3. Circulatory changes during severe muscle exercise
Next experiment describes simulation changes of extremely severe exercise.
A 5‐minutes simulation was run (Fig. 4.3.). In the half minute, the exercise activity was sixty times their normal resting level changed by setting the EXC parameter (exercise activity‐ratio to activity at rest) to 60. After 3 minutes exercise was over, the value was set back to 1.
At the onset of exercise, cardiac output and muscle blood flow increased considerably and within seconds. Urinary output fell to its obligatory level while arterial pressure rose moderately. Muscle cell and venous P02 fell rapidly. Muscle metabolic activity showed an instantaneous increase, but then decreased considerably because of the development of a metabolic deficit in the muscles. When exercise was stopped, muscle metabolic activity fell to below normal, but cardiac output, muscle blood flow, and arterial pressure remained elevated for a while as the person was repaying his oxygen debt. 4.4. Atrioventricular fistula
A 8‐days simulation was run (Fig. 4.4.). In the day 1, a fistula, which would double cardiac output was increased 5% normal by setting the FIS parameter (fistula) to 0.05. After 5 days fistula was closed, the value was set back to 0.
Opening the fistula caused an immediate dramatic change in cardiac output, total peripheral resistance, and heart rate. Urinary output decreased to obligatory levels. As the body adapted, extracellular fluid volume and blood volume increased to compensate for the fistula with the result that after a few days arterial pressure, heart rate, and urinary output were near normal levels, while cardiac output doubled and peripheral resistance halved.
When the fistula was closed, dramatic effects again occurred with rapid decrease in cardiac output, rapid increase in peripheral resistance, moderate increase in arterial pressure, and moderate decrease in heart rate. Marked diuresis reduced extracellular fluid volume and blood volume to normal or slightly below. After several days, the patient was nearly normal.
Jackson Cardiovascular-Renal Meeting 2008
9
Fig. 4.4.: Simulation of atrioventicular fistula
5. Conclusion
The implementation of Guyton's model as an interactive control scheme is a helpful educational instrument for our biomedical‐engineering students. However, the intricate web of physiological
Jackson Cardiovascular-Renal Meeting 2008
10
regulatory systems of the chart is hardly intelligible to medics and medicine students who would prefer interactive picture animations of a physiological atlas, extended by plots, diagrams and explaining texts. Therefore this model is only a theoretical basis for an educational web ‐accessible simulator which still represents a long and hard future development that can be partially simplified by using suitable tools [11]. We have started a new educational tool “Atlas of physiology and pathophysiology” (www.physiome.cz/atlas) that combined interactive animation with simulation models in the background of multimedia interactive user interface.
The most valuable advantage of this work lies in the resurrection of the original Guyton's chart, now available for anyone interested. The previously described (and similar) experiments are of fundamental importance for understanding of the pathogenesis of different disorders that is essential both for biomedical engineers, and for medical doctors.
References
[1] Abram SR, Hodnett BL, Summers RL, Coleman TG, Hester RL (2007). Quantitative Circulatory Physiology: An Integrative Mathematical Model of Human Physiology for medical education. Advannced Physiology Education, 31 (2), 202‐210.
[2] Bassingthwaighte JB (2000). Strategies for the Physiome Project. Annals of Biomedical Engeneering, 28, 1043‐1058.
[3] Coleman TG and Randall JE (1983). HUMAN. A comprehensive physiological model. The Physiologist, 26 (1), 15‐21.
[4] Guyton AC, Coleman TA, and Grander HJ (1972). Circulation: Overall Regulation. Ann. Rev. Physiol., 41, 13‐41.
[5] Guyton AC, Jones CE, and Coleman TA (1973). Circulatory Physiology: Cardiac Output and Its Regulation. Philadelphia: WB Saunders Company.
[6] Hunter PJ, Robins P, Noble D (2002). The IUPS Physiome Project. Pflugers Archive ‐European Journal of Physiology, 445, 1‐9.
[7] Hall JE (2004). The pioneering use of system analysis to study cardiac output regulation. Am. J. Physiol. Regul. Integr. Comp. Physiol., 287, R1009‐R10011.
[8] Hester RL, Coleman T, Summers T (2008). A multilevel open source integrative model of human physiology, FASEB J., 22, 756.8.
[9] Kofránek J, Andrlík M, Kripner T, Stodulka P (2005). From Art to Industry: Development of Biomedical Simulators. The IPSI BgD Transactions on Advanced Research 2 (Special Issue on the Research with Elements of Multidisciplinary, Interdisciplinary, and Transdisciplinary: The Best Paper Selection for 2005), 62‐67.
[10] Kofránek J, Rusz J, Matoušek S (2007). Guytons Diagram Brought to Life ‐from Graphic Chart to Simulation Model for Teaching Physiology. In: Technical Computing Prague 2007. Full paper CD‐ROM proceedings. (P. Byron Ed.), Humusoft s.r.o. & Institute of Chemical Technology, Prague, ISBN 978‐80‐78‐658‐6, 1‐13. The paper, incl. the source code, is available online at http://phobos.vscht.cz/konference_matlab/MATLAB07/#k
[11] Stodulka P, Privitzer P, Kofránek J, Tribula M, Vacek O (2007). Development of WEB accessible medical educational simulators. In: Proceedings of the 6th EUROSIM Congress on Modeling and Simulation, Vol. 2. Full Papers (CD). (B. Zupanic, R. Karba, S. Blažič Eds.), University of Ljubljana, ISBN 978‐3‐901608‐32‐2, MO‐3‐P4‐2, 1‐6. The paper is available online at http://patf‐biokyb.lf1.cuni.cz/wiki/_media/clanky/
Jackson Cardiovascular-Renal Meeting 2008
11
[12] Thomas SR, Baconnier P, Fontecave J, Francoise JP, Guillard F, Hannaert P, Hernándes A, La Rolle V, Maziere P, Tahi F, White W (2008). SAPHIR: a physiome core model of body fluid homeostasis and blood pressure regulation. Phil. Trans. R. Soc., 366, 3175‐3197.
[13] Van Vliet BN, Montani JP (2005). Circulation and fluid volume control. In: Integrative Physiology in the Proteomica and Post Genomics Age. Humana Press, ISBN 918‐1‐58829‐3152, 43‐66.
Acknowledgement
This research was supported by aid grant MŠMT 2C06031 and Creative Connections Ltd.
Address of author for correspondence
Jiří Kofránek, M.D., Ph.D. Laboratory Laboratory of Biocybernetics, Dept.of Pathophysiology U nemocnice 5, 128 53 Prague, Czech Republic kofranek@gmail.com
Digital Technologies 2008
Jan Rusz, Jiří Kofránek: Tools development for physiological educational
simulators. In Digital Technologies 2008 (Editor: Daša Ticha) [CD-ROM]. Žilina:
University of Žilina, Fakulty of electrical engineering, 2008, vol. 1, ISBN 978-80-
8070-953-2, 4 strany (CD ROM)
Tools development for physiological educational simulatorsJan Rusz1, Jiří Kofránek2
1Faculty of Electrical Engineering, Czech Technical University in Prague2Department of Pathophysiology, 1st Faculty of Medicine, Charles University in Prague
ruszj1@fel.cvut.cz, kofranek@gmail.com
Abstract — One of our main goals is to incorporate the usage of computers into the process of education. The aim of the work lies in the development of applications that would demonstrate non-trivial physiological systems behavior, their dynamics and regulation. In the process of the development of simulators, our main focus is creating the model and creating high quality animations to visualize the simulation results. In this paper, we describe our approach to usage of simulators, the development of these applications, their layered architecture and technologies we use. We use Matlab/Simulink for creating physiological models, .NET framework or Control Web as the main platforms and Adobe Flash for controllable animations. Simulation models are used for biomedical-engineering-students education, as well as a theoretical basis for a multimedia simulator for medicine students at Charles University in Prague and biomedical engineering students at Czech Technical University in Prague.
1 INTRODUCTION
The development of personal computers and internet in the end of last century brought new opportunities for a practical use of simulating models. Simulating model doesn’t have to be just a tool for scientific research but also a very useful educational tool. Educational programs with simulating components aren’t just a multimedia replacement of traditional textbooks. They are new educational tools, where old J. A. Komensky’s credo "Schola Ludus" (School of game) finds its modern usage [1]. Connection of multimedia environment (sound and visual interface) with simulating models enables students to become familiar with problem in virtual reality and brings entirely new possibility for explanation of difficult problems. In simulating game, behavior of simulated object can be tested without any risks. You can try e.g. land with virtual airplane, cure virtual patient or test behavior of particular physiological subsystems. Simulating games can clearly explain complex relations in physiological regulating systems and causal chains in pathogenesis of all sorts of diseases.
2 PRINCIPLE OF DEVELOPING SIMULATORS
Development of effective educational program, which combines multimedia with simulation games [2-4] isn’t easy and expects a working team of many
professions – experienced pedagogue creating basic scenario, creators of simulation models, medics, artists and programmers. This interdisciplinary collective production is being effected by using useful tools, which enable a component creation, connection of simulating programs and interactive multimedia according to given scenario to compact complex. There are two types of problems which we have to consider during the creation of simulation model. First is the theoretical research itself, which basis in formalization of physiological relations expressed by a mathematical model. In our case, problem was solved within the branch of research grants and research purposes. Second problem is creating an own multimedia simulator, or more precisely creating an educational program which uses simulation games – is the practical application of the theoretical results which is related to the results of the research. The principle of creating the simulator is in the creation or verification of mathematical models.
Figure 1: Two types of problems during educational models development
We are using more software technologies to build simulators, because we haven’t found a single environment that would satisfy all our needs regarding effective visual expressiveness of physiological models, richness and maturity of the resulting simulators user interface and the ability to produce standalone and web-accessible applications. Generally we use either Microsoft .NET or Control Web as the base platforms we build upon. The models are created in Matlab Simulink and the animations created in Adobe Flash are used as a user interface [5]. We have spent significant amount of time on development of our own unique tools that allow the
Simulink model to be used in a .NET or Control Web application [6]. Flash animations are inserted into the form of ActiveX objects.
Figure 2: Development cycle of simulator application
2 MATLAB/SIMULINK
We use Simulink from Mathworks company as a modeling tool providing graphical design and simulation of mathematical models. Simulink allows us to gradually create models using single components connected to each other by a simulating net, which can remind us of electronic circuits. We can graphically express very complicated mathematical relations in Simulink. The created net is not only a well-arranged illustration; it is at the same time a functional simulating model. To each element we can we can add a virtual display or oscilloscope. After starting the simulation we can see the numerical or graphical form of the values flowing thru the connectors. Elements of a model can be grouped and hierarchically ordered, giving rise to subsystems with user defined inputs and outputs. We have adopted the concept of simulation chips that represent the building blocks of our simulation models. Another Matlab toolbox, Real-Time Workshop (RTW), exports the model as a C/C++ code. This code consists of a routine that executes the model logic, a structure that holds the model data and an ODE solver. We have developed two new RTW targets (we call them Wizards) that transform this code to be compatible with the .NET or Control Web. For the .NET the code is wrapped in a C++ .NET class that exposes the model’s inputs and outputs as its interface. For Control Web the code is transformed into a C++ class that implements the interface making it possible to be used as a virtual driver in a CW application. Thus, the
final output of the Wizards is a Matlab independent dynamic library.
Figure 3: Example of “non-muscle oxygen delivery” subsystem created in Simulink as a graphic chart (left) and same subsystem as a simulation chips
(right).
3 THE .NET PLATFORM
The .NET represents a modern and strong platform that allows rapid and comfortable application development with support for visual design of the GUI, creation of custom visual controls and the web deployment. The .NET platform is nowadays most supported for Windows, but open source projects such as Mono or Portable.NET promise the future of portable Simulator based on this platform. Verification relationships formalization
Figure. 4: Example of educational simulator created in .NET platform
4 CONTROL WEB
Control Web of the Moravian instruments company is a platform mainly intended for development of industrial visualization and control applications on the WIN32 platform. It is optimized for realtime controlling and visualization. Its visual framework is component based and gives a great efficiency and rapid application development. We used the Control Web platform mainly for its advantages such as rapid prototyping and easy visual interconnection of model and visual controls.
Figure 5: Example of a renal function simulator (up) in Control Web and virtual device generation
(down) for Control Web
5 FLASH
Although it is possible to create the presentation layer of the application using standard or custom made .NET (or CW) visual components, for more sophisticated visualizations we use movie clips created in Adobe Flash. Fundamental feature of these animations is the possibility to control them programmatically (using Action Script) and thus affect the presentation. It is also possible to get the user input from a Flash clip and that way create animated user controls.As the execution speed of the Flash and Action Script is increasing over the time, it is a good platform for implementation of simulators based on less komplex models. Pure Flash based simulators are very portable and in-browser what is the most desirable deployment scenario for our simulation games. Some of our Flash based simulators can be seen in our Atlas of Physiology and Pathophysiology [6]. In our complex simulators based on the .NET or Control Web the Flash animations are embedded as ActiveX objects. Their behavior is than controlled by the underlying model layer.
Figure 6: Demonstrating of right heart failure (up) and plasma buffer system (down) in Flash
6 LAYERS
In case of more complicated architecture the logic of connection between the flash animation and the simulation model can be relatively complex; therefore it is preferable to input an operation layer between layer with visual elements and the layer with simulation model. This operation layer takes care of the communication logic between user interface and the model. Between model layer and GUI layer is useful paste a control layer, where are directed all messages and events in the virtual GUI machines and where are simultaneously solved all communications with the model. The layer solves all context of imaging data and appropriate requirements on communication with the model by using finite state machines [7]. Logic is concentrated to one place, which essentially saves time through modification of GUI or model changes.
Figure 7: Architecture layers along simulators developing
7 CONCLUSION
We have shown our motivations for using simulators as simulation games in medical education. Our main improvement is usage of rich graphical user interface as a gaming element in simulators based on complex models. We use Matlab/Simulink for physiological modeling, Adobe Flash for controllable animations and the .NET or Control Web as the base environment. We have developed a unique way of exporting the Simulink model into the .NET framework and into the Control Web platform.
Acknowledgments
This work was supported by research MSM 0021620806 and by aid grant MŠMT 2C06031 and BAJT servis s.r.o company and by the research program “Transdisciplinary Research in Biomedical Engineering” No. MSM6840770012 and by the grant „Analysis and modelling biological and speech signals”, GAČR č. 102/08/H008.
References
[1] Comenius Johann Amos (1592-1670): The Great Didactic. ed. by M. W. Keatinge (PDF files at Roehampton), available on: http://onlinebooks.library.upenn.edu/webbin/book/lookupid?key=olbp34684
[2] Clark Aldrich's web page: http://clarkaldrich.blogspot.com/2007/03/immersive-learning-simulation_14.html
[3] Kofránek J, Andrlík M, Kripner T, Stodulka P.:From Art to Industry: Development of Biomedical Simulators. The IPSI BgD Transactions on Advanced Research 1 #2[Special Issue on the Research with Elements of Multidisciplinary,
Interdisciplinary, and Transdisciplinary: The Best Paper Selection for 2005], 63-68. 2005. New York, Frankfurt, Tokyo, Belgrad. 2005. Journal (Full)
[4] Kofránek J, Andrlík M, Kripner T.: Multimedia educational simulators in pathophysiology – how to design and why to use them. In: Gamal Attiya and Yskandar Hamam editors. Proceedings of the 5th EUROSIM Congress on Modeling and Simulation. Full Papers CD Volume.; Marne la Vallee, Paris, France: Eurosim - Francosim - Argesim; 2004. p. Simulation in Education 22-27.
[5] Atlas of physiology and pathophysiology available on: http://physiome.cz/atlas
[6] Stodulka, P., Privitzer, P., Kofránek, J., Tribula, M., Vacek, O. Development of WEB accessible medical educational simulators. In. Proceedings of the 6th EUROSIM Congress on Modeling and Simulation, Vol. 2. Full Papers (CD). (B. Zupanic, R. Karba, S. Blažič Eds.), University of Ljubljana, ISBN 978-3-901608-32-2, MO-3-P4-2, 1–6. 2007. Available on: http://patf-biokyb.lf1.cuni.cz/wiki/_media/clanky/
[7] Harel, D.: Statecharts (1987): A visual formalism for complex systems. Science of Computer Programming, vol. 8, 1987, 231-274.
Technical Computing Prague 2008
Jiří Kofránek, Marek Mateják, Pavol Privitzer: Causal or acausal modeling:
labour for humans or labour for machines. In Technical Conmputing Prague 2008, 16th Annual Conference Proceedings. (Editoři: Cleve Moler, Aleš
Procházka, Robert Bartko, Martin Folin, Jan Houška, Petr Byron). Humusoft
s.r.o., Prague, 2008, ISBN 978-80-7080-692-0. CD ROM, str. 1-16, [Online]
http://www2.humusoft.cz/kofranek/058_Kofranek.pdf
CAUSAL OR ACAUSAL MODELLING: LABOUR FOR HUMANS OR LABOUR FOR MACHINES
J. Kofránek, M. Mateják, P. Privitzer, M. Tribula
Laboratory of Biocybernetics, Institute of Pathological Physiology, First Faculty of Medicine, Charles University in Prague
Abstract
Models designed using classical Simulink networks provide a clear graphic visualization of individual mathematical relationships. Signals flow in connections between individual blocks, transmitting values of individual variables from the output of one block to inputs of other blocks. Processing of input information to output information takes place in the blocks. Interconnection of the blocks in Simulink thus reflects rather the calculation procedure than the very structure of the modelled reality. This is the so called causal modelling. However, it is important in designing and especially presenting and describing the model that the very structure of the model, rather than the very algorithm of the simulation calculation, captures well especially the physical essence of the modelled reality. Therefore, declarative (acausal) notation of models is starting to be used in a growing extent in modern simulation environments; this means that individual components of the model describe the equations directly and not the algorithm of their solution. By interconnecting individual components, the systems of equations become connected with each other. Interconnection of the components does not define the calculation procedure but the modelled reality. The way of solving the equations is then “left up to the machines”. Application of acausal approach has been made possible by new Simulink libraries Simscape, and linked domain libraries SimElectronics, SimHydraulics, SimMechanics etc. Modelica is a modern simulation language built directly on acausal notation of models. Implementation of this language of the company Dynasim is interesting for Mathworks products users as it allows for direct connection with Simulink and Matlab (Modelica is implemented under the name Dymola in this case).
1 Introduction
An article was published in the journal Annual Review of Physiology [3] 36 years ago, whose form surpassed at the very first sight the accustomed form of the then physiological articles. It was introduced by a large diagram pasted in as an attachment (Fig. 1). At the first sight, the diagram full of lines and mutually connected elements remotely resembled a drawing of some electrotechnical device. However, instead of tubes or other electrotechnical parts, computational blocks were shown in the diagram (multiplication, division, summation, integration, functional blocks), symbolizing mathematical operations performed with physiological quantities. Bunches of connecting conductors between the blocks seemed at the first sight to express complex feedback interconnection of physiological quantities. The blocks were grouped in 18 groups, representing individual interconnected physiological subsystems.
The very article gave a quantitative description of physiological regulation of the circulation system in a manner absolutely new in the then medical professional literature, as well as its connexion with and linkage to other subsystems of the organism – the kidneys, regulation of volumetric and electrolyte equilibrium etc. Instead of writing a set of mathematical equations, the article made use of graphic depiction of mathematical relationships. This syntax made it possible to provide a graphic depiction of connexions among individual physiological quantities in the form of interconnected blocks representing mathematical operations. These elements are very similar to Simulink blocks; there is a difference only in their graphic shape.
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
2
Figure 1: Extensive diagram of the physiological circulatory regulations according to A. C. Guyton et al from 1972
This resemblance inspired us to bring the old classical Guyton’s diagram back to life using Simulink, and to transform it into the shape of a functional simulation model. We developed an effort to preserve the outside appearance of the Simulink model quite the same as that of the original graphic diagram – the layout, placement of conductors, quantity names as well as block numbers. We reported on this implementation last year [10].
2 Web of Physiological Relationships in Simulink
Simulation visualization of the old diagram was not quite easy – there are namely mistakes in the original image diagram of the model! This is no problem in a drawn picture; however, upon attempting at bringing it to life in Simulink, the model collapses as a whole immediately. Not many mistakes were found – switched signs, a division block instead of a multiplication one, switched connection between blocks, missing decimal point in a constant etc. However, they were enough to make sure the model did not function (Fig. 2). Some mistakes could be seen at the first sight (even without any physiological knowledge) – it is apparent from the diagram that during the run of the model, value of some quantities in some integrators (due to wrongly indicated feedback) would rise quickly to the infinite and the model would collapse. However, with knowledge of physiology and system analysis, all the mistakes could be found upon exerting some effort. For a detailed description of the mistakes and their corrections see [10].
It is interesting that the Guyton’s diagram as a complex image has been reprinted many times in various publications (recently, see for example [5, 12]). However, no one called attention to the mistakes and took the trouble to remove them. This was understandable in the times the image-based diagram was being created. No drawing programs existed – the image was created as a complex manual drawing – and manual redrawing of the complex diagram was not easy. However, it is also possible that the model authors themselves did not really want to correct the mistakes perhaps – those who took the trouble analyzing the model revealed the image “spelling mistakes”; those who wanted
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
3
nothing but copy the diagram mindlessly had bad luck. After all, in those times, the authors also mailed out source program codes of their model in the Fortran programming language – thus if somebody wanted only to test the model behaviour, there was no need to program anything (perhaps only to perform a routine conversion from Fortran to another programming language at the maximum).
Our Simulink implementation of the (corrected) Guyton’s model (Fig. 3) is available to those interested at www.physiome.cz/guyton. On this website, our Simulink implementation of a much more complex model version of Guyton et al from subsequent years can be found, as well. At the same time, very detailed description of all the mathematical relationships applied is presented together with the reasons.
Figure 2: Correction of the most significant errors in the model of A. C. Guyton et al.
3 Block-Oriented Simulation Networks
The Guyton’s block diagram augured occurrence of block-oriented simulation languages. However, in the year 1972, Guyton himself and his collaborators implemented the model in Fortran – Simulink version 1 was not marketed until 18 years later (in 1990). Block-oriented simulation languages, Simulink being one of their typical representatives, make it possible to set up computer models using individual hierarchically arranged blocks with defined inputs and outputs. It is apparent from such a hierarchically arranged block-oriented description how the values of individual variables are calculated in the model – i.e. the computational algorithm. The blocks can be grouped into individual subsystems, which communicate with the surrounding environment through defined input and output “pins”, thus representing something like “simulation chips”. A simulation chip hides the simulation network structure from the user, similarly as an electronic chip hides the interconnection of individual transistors and other electronic elements. The user can thus be concerned only with the chip behaviour, without having to take care of its inner structure and the computational algorithm. Behaviour of a simulation chip can be thus tested by observing the outputs on connected virtual displays or virtual
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
4
oscilloscopes. This is very advantageous especially in testing the model behaviour and to express mutual dependencies among variables. The entire complex model can be then displayed as interconnected simulation chips, while it is clear from the structure of their mutual connections what effects are taken into account in the model and how.
NON-MUSCLE OXYGEN DELIVERY
269
268
261
260
270
262
263
264
271
272
265
266
267
259
258
257
256
255
POV
OSV
POT
RDO
MO2
DOB
QO2POTP1O
P4O
02M
AOM
271
MUSCLE BLOOD FLOW CONTROL AND PO2
227
226
225
224
223
228
229
230
231
232
233
234
235
238236
237239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
OSA
OVA
BFM
RMO
BFM
PK1
PK2
DVS
PVO
PMO
PM5
RMO
QOM
PMO
PM3
PK3
PM4
P2O
P3O
EXC
AOM
02A
AUAMM
POE
POM
PDO
PVO
POV
POT
OVA
P2O
AOM
AMM
HM
BFN
VPFHM
OVA
upper limit 8
upper limit 8
lower limit 50
lower limit .005
lower limit .001
2400
0.7
0.7
1
2400
Xo
u^3 POT^3
u^2PM1^2
u^3 P40^3
u^3P3O^3
1s xo
1s xo
1s
xo
1s
xo
1s xo
0.9864
2.859
0.9999
40
7.983
198.7
8
512
5
5
0.00333
57.14
8.0001
2688
1
1
8
200
8
40
168
1
1
1
400.0125
200
2.8
40
1
800
2500
122
1
57.14
5
0.5
1
840
0.08
5
1
0.25
0.15
1
60
1
512
8.0001
-1
51
NON-MUSCLE OXYGEN DELIVERY
269
268
261
260
270
262
263
264
271
272
265
266
267
259
258
257
256
255
POV
OSV
POT
RDO
MO2
DOB
QO2POTP1O
P4O
02M
AOM
271
NON-MUSCLE LOCAL BLOOD FLOW CONTROL
if (POD<0) {POJ=PODx3.3}
278 277 276 275 274 273
285 282 281 280 279
290
284
283284b286287
288
289
AR1
AK1
POB
POK
POD
POV
ARM
AR1AR3
PON
POA
A2K
AR2
POJ
POZ
POC
A3K
AR3
POR
VASCULAR STRESS
RELAXATION
65
64
63
62
61
VV7
VV7
VV1
VV2
VVE
SRK
VV6
195
196
197
198
199
200
201
202
203
205
206
207
208
209
210
211
212
213 214
215
216
217
218
219
220
221
222
KIDNEY DYNAMICS AND EXCRETIONTHIRST AND DRINKING
192 193 194
190 191
Z10 Z11
STH
TVD
POT
ANTIDIURECTIC HORMONE CONTROL
181
180179178177
175 176 182183
184
185
158A
186
187
188189
AHM AH4
AH2 AH1
AHC
AH
CNZ
CN8
CNR
CNA
PRAAHZ
AH7
AHY
AH8AU
CIRCULATORY DYNAMICS
VIM
AUM
AUM
VIM
AUM
BFN1
2
3
4
36
35
31
3233
PGS
RSM
38
34
37
RVS
43
42 41A
41
40
39
VBD
VVE
5 6
7 8 9
DAS
QAO30
QLO
LVM
HPL
HMD
QLN
2959
58
28
50
16
PA2
60
PLA
24
25
26
27
VVS
QLO
AUH
HMD
QRO
QRO
AUH
VPEPPA
PL1
PPA
RPV
RPT
RPT
PP1
5453
5556
57
52
51
2322 21
2019 18
48
49
4645
47
44
10
11
12
13
1415
LVM
CAPILLARY MEMBRANE DYNAMICS66
67
68
69
70 71
7473
6261
80
79
7877
75
74
72
RVS
BFNPVG
PVS
VB
VP
VRC
PTC
PPCPIF
CFC
VPDVUD
DFP
TVD
VP
CPKCPI
CP1
CPP
CPP PRP
VP
CPRLPK
DLP
PPD
DP0
DPL
DPP
DPC
ANGIOTENSIN CONTROL
154 155 156 157 158
159
160161
162163
153b153a
CNA CNEANM
AN1
ANT
ANC
AN2AN3
AN5ANM
REK
RFN
TISSUE FLUIDS, PRESSURES AND GEL
105PTC
108
107
106
109
104
110
103102
112
113
98
97
96
99
92919089
9394 95
100
101
86
85
84
8387
88
111
DPL
VTL
CPI
PIF
PLD
PTT
GP1
GPD
GPR
VG
VIF PTS
PIF
GPD
DPL
VTC
VTL
VID
VTS
VTD
PTT
DPIVIF
IFP
GP2
VGD
VG
V2D
PG2PGC
PTC
PIF
PIFPTS
PRMCHY
HYL
VG
PGR
PGP
PGH
ALDOSTERONE CONTROL
165 166
167
164
168
169
170
171
172173174AM AM5
AM3AM2
AMC
AMT
AM1AMP
KN1CKE
CNA
ANM
AMR
ELECTROLYTES AND CELL WATER
114 115
116
117 118119
120
121
126
125
122123 124
127
128129130
131
135134133
132
CKI CCD
CNA
VIC
VIDVIC
KI
KCD KIE KIR
KE1
AM
CKEKEKED
KCD
KID
KOD
REK
NEDNAE
CNA
VTW
VIC
VEC
STH
NID
VP
VPF
VTS
HEART HYPERTROPHY OR DETERIORATION
340
341
342
343
344 349
348
347
346
345
350
351
352
PA
PPA4
HPLHPR
PP3
PPAHSL HSR
POT
DHM
HMD
RED CELLS AND VISCOSITY
329
330
331
332
333334
335
337
338
339
POT
PO1
POY
PO2
RC1
RCD
VRC
RKC
RC2VRC
VB
HM
VIE
VIM
PULMONARY DYNAMICS AND FLUIDS
PLA
136
137
138
139
140
141
142
143
144
145152
146
147
148
149
150
151
PPA
PCP
PPC
POS
PPI
CPF
PFI
PLF
DFP VPF
PPI
PLF
PLF
PPO
POS
CPN
VPF
PPR
PPD
PPN
PPC
CPP
AUTONOMIC CONTROL
292291
294
293
296297298
295
307303302
301
305
304308
309
310
311
312
313
315
314
316317
318
319320
POQPOT
PA
EXE
POQ
P2O
Z12EXC
AUCPA1
A1B
AUB
AUN
AU8
AUK AU2
AU6
DAU
Z8
AUJ
AUL
VV9
VVR
AUH
AUM
AVE
AUY
AUD
AUV
AU9
AU
HEART RATE AND STROKE VOLUME
328327 323
322
321324325326
SVO
QLO
HR
PRA
AUHMD
MUSCLE BLOOD FLOW CONTROL AND PO2
227
226
225
224
223
228
229
230
231
232
233
234
235
238236
237239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
OSA
OVA
BFM
RMO
BFM
PK1
PK2
DVS
PVO
PMO
PM5
RMO
QOM
PMO
PM3
PK3
PM4
P2O
P3O
EXC
AOM
02A
AUAMM
POE
POM
PDO
PVO
POV
POT
ARM
OVA
P2O
AOM
AMM
AMM
VVE
VV7
VUD
RBF
RFN
NOD
AU
VVR
AUH
AUM
AVE
SVO
HM
BFN
VPFHM
OVA
PPCREK
CNEAUM AHM
AM
AHM
PA
NOD
DPC
AUZ
ARM
VIM
AUM
ANM
AVE
RBF
PC
VVR
VV7
AUH
HMD
HSR
HPR
STH
TVD
VTL
AHM
ANM
CNE
AM
VID
CKE
CNA
VTW
PCVB
VP
DPC
CPP
VTC
VTL
DPL
PTC
CPI
VTS
PIF
HPR
HPL
HMD
VIM
HM
VRC
DFP
VPF
PPD
BFN
BFM
RVS
PVS
PRA
QLOPLA
PPA
PA
HSL
PPCVTC
PC
GP3APD
algebraic loop
breaking
algebraic loop
breaking
336
HM2
336b
HMK
upper limit 8
upper limit 8lower limit 4
upper limit 8
upper limit 15.0lower limit 0.4
upper limit 1
lower_limit_0
lower limit 6
lower limit 50
lower limit 5
lower limit 4
lower limit 3
lower limit 0.95
lower limit 0.7lower limit 0.5
lower limit 0.3
lower limit 0.2375
lower limit 0.2
lower limit 0.0003
lower limit 0.0001
lower limit 0
lower limit 0
lower limit .005
lower limit .001
12
12
171
3
210
90
1
0
2
2400
1
1
1
75
25
2130
3550
1
11.4
0.7
0
1
0.7
1
1
2400
Xo
00
1.4
50
RVM = f(PP2)
30.5
RAR
96.3
RAM
0-4
15
20
QRN = f(PRA)
0.6
QRF
0-4
15
20
QLN = f(PLA)
(u/12)^2PTT = (VTS/12)^2
00
20
10PTS = f(VIF)
2-(0.15/u) PPI = 2 - (0.15/VPF)
u^0.625 PP3^0.1
u^3 POT^3
0.33
u^2PM1^2
u^3
PC^3
u^0.625 PA4^0.625
u^3 P40^3
u^3P3O^3
10u
10u
sqrt
10u
00
1.4
260
LVM = f(PA2)
1sxo
1sxo
1sxo
1s
xo
1s
xo
1s
xo
1sxo
1s
xo
1s xo
1s
xo
1s
xo
1s
xo
1s xo
1sxo
1s xo
1s xo
1s xo
1s xo
1s
xo
1s xo
1s
1s
1sxo
1sxo
1s
xo
1s
xo
1s xo
1s
5
GF4
0.01028
0.3216
0.9864
2.859
100
0.9999
15.18
0.014535.07
0.09477
3.774
2.781
1.011
2.859
-9.648e-008
0.01252
40
-1.154e-008
2
40
0.999
1
1
1
-6.334
11.98
20.18
7.983
5.045
0.037910.001879
0.001879
16.7969.76
0.03824
3.002
5.00216.79
198.7
39.97
142.1
5
8.154e-006
0.9984
10
1.004
0.9996
0.0009964
1
0.9387
0.07026
0.9997
0.9994
0.9998
2.949
0.9993
0.1024
1.2
1.2
0.001022
8
0.0005
4.0
3.3
0.042
150.1152
1.6379
0.00047
85
512
0.007
1.6283e-007
0.007 0.4
0.1
1.79
0.4
0.4
0.003550.495
5
2.738
1
0.026
1
0.035720
0.85
0.0048
0.30625
3.25
5
1717
1
0.38
0.005
0.1
0.1
100
1
0.0007
0.00333
2
1
139
0.3333
0.0785
6
0.14
6
8.25 4
57.14
0.009
0.01
1
1
1
0.125
0.00781
1851.66
31.67
8.0001
0.0250.001
1000
0.8
1
33
0.5
11
15
0
5
100
1
2.8
0
0.301
0.3
2.9
3.7
28
5
17
0.002
0.04
70
3
0.3
1
1
2.95
1
1
1
0
0
0.0125
40
0.1
2688
1
2
1 1
1
20
-6.3
0.04
0.002
5
1
12
142
5
0
1
10
1
1
0
1
20
1.2
1.2
0.1
0.001
0
1
0.04
20
0
0.002
1
0.001
0
5
-6.3
2
3.72.8
2.9
0.001
1
0.06
1
51
1
1
1
0
2.95
17
1.2
40
1
1
1
1
1
1.6
40
1
1
8
1
8
100
5
0
1
1
70
28
0
15
1
5
8
8
8
200
15100
0.04
0
0.002
1
12
3
0.0125
1
0.1
8
1
142
5
100
11520
1
1.2
142
401
8
142
0
1
1
1
168
1
1
10
1
1
28
100
0.3
1
1
1
1
400.0125
200
2.8
40
1
800
2500
122
1
57.14
5
0.5
1
840
0.08
5
1
0.25
0.15
1
32
0.5 1
40
2
0.21
6
0.0005
1
1
1.24
1
8
3
1
0.5
1
0.85
0.15
0.7
60
0.3
3.159
8
0.4
0.375
0.000225
0.0003
11
0.0003
0.4667
1
0.0125
0.55
0.3331.5
0.5333
8.25
100
0.0000058
464e-7
512
0.0025
6
57600
15
57600
100
2850
0.01
140
0.013
8.0001
0.0028
0.00014
0.00042
0.1
0.00352
20.039
19.8
-0.017
60
9
-1
0.25
24.2
-5.9
57
0.4
0.1
0.004
7.8
0.25
0.013332
51
0.0825
CV
6
CNY
2.5
CNX
0.2
CN7
0.0212
CN2
u^2 CHY^2
PA1 AUN
AUN CALCULATION
when PA1<50: AUN=6 when 20>PA1<50: AUN=0.2*(50-PA1)
when PA1>=50: AUC=0
AUN calculation
uv
AUJ^AUZ
PA1 AUC
AUC CALCULATION
when PA1<40: AUC=1.2 when 40>PA1<80: AUC=0.03*(80-PA1)
when PA1>=80: AUC=0
AUC calculation
u^3 AUB^3
PA1 AUB
AUB CALCULATION
when PA1<40: AUB=1.85718 when 40>PA1<170: AUB=0.014286*(170-PA1)
when PA1>=170: AUB=0
AUB calculation
1.5
ARF
00
4
200AMP = f(PA)
1
(1.2/u)̂ 3
(1.2/RFN)̂ 3
1s
xo
VVS
1s
xo
VRA
1s
xo
VPA
1s
xo
VLA
1sxo
1s
xo
1s
xo
VAS31sxo
1s xo
1s xo
lower limit 0.35
lower limit 0
VIM
VIM
AAR
AAR
AAR
RR
RFN
GLP
PPC
PFL
GFN
GFR
TRR
VUD
AHM
AM
AM
NOD
EVR
RBF
ANU
ANU
RAR
VAS
VAS VAE
PA
PA
PAMPAM
RAM
PGS
RSN
BFM
QAO
RV1
RV1
VVS VV8
PVS
PVS
PVS
PVS
QVO
QVO
QVO
DVS
QLO
QLN
QLN
DLA
VLA
VLA
VLE
PLA
PLA
PLA
VB
RVM
RVM
QRN
RVG
DRA
VRA
VRA
PRA
PRA
PR1
PR1
PP2
VPA
VPAPGL
QPO
QPO
RPA
CPA
RFN
GF3
GF3
Figure 3: Implementation of the model of A. C. Guyton et al in Simulink
This means a high advantage for multidisciplinary cooperation – especially in borderline areas such as, for example, biomedical systems modelling [9]. An experimental physiologist is not forced to examine in detail what mathematical relationships are hidden “inside” the simulation chip; however, based on interconnection of individual simulation chips with each other he or she can understand the model structure and can verify its behaviour in an appropriate simulation visualization environment.
Hierarchical block-oriented simulation tools have therefore found their significant application in description of complex regulation systems, which can be seen in physiology. The international project PHYSIOME is devoted to formalized description of physiological systems; it is the successor of
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
5
GENOME project. GENOME project output was represented by detailed description of the human genome; PHYSIOME is aimed at formalized description of physiological functions. Computer models are used as the methodological tool [2, 7].
Several block-oriented simulation tools were designed as part of PHYSIOME project, serving as a reference database for formalized description of the structure of complex physiological models. They include JSIM [11] (http://www.physiome.org/model/doku.php) and also the CEllML language (http://www.cellml.org/). Disciples and followers of Prof. Guyton expanded the original extensive simulator of the circulatory system (Quantitative Circulatory Physiology [1]) by an integrated connection of all important physiological systems. The simulator Quantitative Human Physiology is the most recent result, which describes the currently most complex and most extensive model of physiological functions. The model can be downloaded from http://physiology.umc.edu/themodelingworkshop/. In order to express the complex structure of the model, its authors created a special, block-oriented simulation system, QHP.
4 Causal and Acausal Approach
Block-oriented tools use hierarchical connected blocks. Signals are transmitted through links between individual blocks; the signals serve to transfer values of individual variables from the output of one block to inputs of other blocks. Input information is processed in the blocks to output information. Interconnection of blocks therefore reflects rather the calculation procedure than the very structure of the modelled reality.
In complex systems, physical reality of the modelled system slowly disappears under the computation structure thanks to this approach.
That is why in recent times, such tools are starting to be used in modelling complex systems, in which individual parts of the model are directly described as equations and not as an algorithm of the solution of such equations. This is the so called declarative (acausal) notation of models, unlike causal notation in block-oriented languages where the (causal) description of the way of calculating individual model variables must be (for example, also visually using graphic connection of individual computational elements) expressed.
Acausal approach is made possible by the new Simulink libraries Simscape and linked domain libraries SimElectronics, SimHydraulics, SimMechanics etc.
A modern simulation language built directly on acausal notation of models is the programming language Modelica [4]. Originally, it was developed in Sweden and now is available both as an open-source version (developed under the auspices of the international organization Modelica Association, http://www.modelica.org/), and in two commercial implementations. One of them is the commercial implementation of the company Dynasim AB – purchased recently by the supranational concern Dassault Systemes (marketed under the name Dymola, currently version 7.1) and the other one is offered by MathCore (marketed as MathModelica). Dynasim Modelica provides good linkage to Matlab and Simulink while MathModelica can connect with the Mathematica environment supplied by the company Wolfram.
Modelica utilizes mutually connected components, which represent instances of individual classes. Unlike implementation of classes in other object-oriented languages (such as jw C#, Java etc.), classes in Modelica have a special section in addition, in which equations are defined. The equations do not express assignment (i.e. saving of the calculation result of an assigned statement into a given variable) but a definition of relationships among variables (as is the custom in mathematics and physics).
In Modelica, components (instances of classes) can be connected through exactly defined interfaces – connectors. Connectors are instances of connector classes in which variables used for connection are defined. Connectors falling in the same connector classes can be connected (while in these classes, variables of equivalent types can be connected). In other words – in the connection, the type of plugs must correspond exactly to the socket types.
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
6
The important thing is that by connecting the components, connection of sets of equations in individual components with each other occurs actually. in cases an identical variable is defined in the connector of connected components (and if it does not represent the flow – see further), by establishing the connection it is defined that the value of this variable should be the same in all components. When the variable is a part of equations in the connected components, by means of connection we also define interconnection of the equations in which the given variable is found. At the point where multiple components are connected, values of the variables connected through the common point must be the same (similarly to voltage on the common terminal in electric circuits, which must correspond to Kirchhoff’s first law). And not only that. In the connector, it is possible to define that some connected variables shall represent the flow – in such a case, this means that values of all variables marked in this way shall be set in all components interconnected at the same point to such a value so that their algebraic sum is equal to zero (similarly to the sum of currents on the common terminal in electric circuits, which must correspond to Kirchhoff’s second law).
If a variable marked in this way is a part of equations in interconnected components, another equation is thus added to the connected set of equations, which defines the requirement of the zero value of the algebraic sum of this variable’s values).
By means of connecting Modelica components, we thus do not define the computation procedure but the modelled reality. The way of solving the equations is then “left up to the machines”.
5 Generalized System Properties
e
f
p q
C
Rq=Ce
e=Rf
Lp=Lf
Figure 4: Relationships among generalized system properties: e means generalized effort – matched by force in mechanics, voltage in electric
diagrams, pressure in hydraulics etc. f is generalized flow – matched by velocity in mechanics, current in electric
diagrams, flow in hydraulics, temperature flow in thermodynamics etc. q is generalized accumulation or deflection, represented by the generalized flow
integral. It is matched, for example, by spring stretching in mechanics, liquid volume in hydraulics, charge in electric diagram, accumulated heat in thermodynamics etc.
p represents generalized inertance – generalized effort integral, representing kinetic energy; matched by the flow velocity change proportional to pressure difference (inertance of flow) in hydraulics, potential needed to change electric current (induction) in electric circuits etc.
R, C and L represent constants of proportionality among individual generalized system properties. Matched, for example, by resistance, capacitance or mass.
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
7
Depiction of the model in the acausal simulation environment thus resembles the physical reality of the modelled world more than classical interconnected block schemata in Simulink or QHP. This is related to generalized system properties of the real world (Fig. 4) in which generalized efforts (to which the force, pressure, voltage etc. correspond in real world) and generalized flow (to which the current, flow etc. correspond in real world) play an important role.
Provided that the reality is depicted in Modelica by means of connected components, then as for flow variables, the value at the connection point must correspond to Kirchhoff’s second law (the current cannot accumulate or be lost at the connection point), and equality must hold true for other variables at the common connecting point (according to Kirchhoff’s first law).
In Modelica, there is a standard library of varied classes to model electric, mechanical, hydraulic objects of the real world. Mathworks, too, has responded to development trends of acausal modelling by creating Simscape toolboxes and linked application libraries to model electric circuits, mechanical and hydraulic systems.
We shall illustrate the difference between modelling in block-oriented simulation tools and in Modelica on two examples of modelling physiological reality: On the model of simple mechanics of pulmonary ventilation and on implementation of a classical model of cellular membrane of the neurone pursuant to Hodgkin-Huxley [6].
6 Pulmonary Ventilation Mechanics Model
Let us consider a simple model of pulmonary mechanics, shown schematically in Fig. 5. Upon applying significant simplification, the lungs can be viewed as three bags connected using two tubes. The lungs are connected to the ventilator of artificial pulmonary ventilation, which blows air into the lungs periodically under the pressure PAO. P0 is the pressure of ambient atmosphere. The air flow Q flows through upper respiratory tract whose resistance is RC. From the upper respiratory tract, air struggles through the lower respiratory tract into alveoli. The resistance of the lower respiratory tract is RP, the pressure in central parts of the respiratory tract (at the borderline of the upper and lower respiratory tract) is PAW, pressure in alveoli is PA.
RC RP
CLCW
PPL PAPAW
CS
Q QA
Q-QA
RC RP
CSCL
CW
PAWPA
PPL
PAO
P0
P0
QAQ
Q-QA
P0
PAO
Figure 5: Simple model of pulmonary mechanics (hydraulic and electric similarity)
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
8
The air expands pulmonary alveoli whose elasticity is CL (as total pulmonary elasticity). The interpleural cavity is found between the lungs and the chest. The pressure in the chest is PPL. In artificial pulmonary ventilation in which case the air is blown into the lungs under pressure, the chest must expand in addition – chest elasticity is CW. A small part of air, which does not reach all the way to the alveoli only expands the respiratory tract – its elasticity is CS (the so called dead space breathing).
Now the equations can be set up. According to Ohm’s law the following must hold true:
QRCPAWPAO
QARPPAPAW
(1)
The relationship between elasticity, pressure gradient and volume (expressed as the flow integral) is expressed by the equations:
dtQAQCS
PPAW
dtQACW
PPPL
dtQACL
PPLPA
10
10
1
(2)
According to the generalized Kirchhoff’s law, the sum of all pressures (voltages) along a closed loop must be equal to zero, i.e. the following must hold true in the loop along the PAW node and along the PA0 node:
0)0()0()()( PAWPPPPLPPLPAPAPAW
0)()0()( PAOPOPPAWPAWPAO
And upon substitution using Ohm’s law and elasticity equations:
0)0()(
1
0)(111
PAOPdtQAQCS
RCQ
dtQAQCS
dtQACWCL
QARP
(3)
6.1 Implementation of the Pulmonary Ventilation Mechanics Model in Simulink
When setting up the model in Simulink, the computation procedure from input variables to the output ones must be exactly defined. If we want to calculate the reaction of air flow to/from the lungs (Q) to the input – i.e. pressure changes at the initial point of the respiratory tract (PAO) caused by the artificial pulmonary ventilation apparatus – the Simulink model shall be similar to that in Fig. 6.
The Simulink model can also be expressed in a simpler form. At first, from Equation (3) we shall derive the differential equation (input variable PAO, output variable Q):
QCWCLCSRPdt
dQ
CTRP
RC
CSdt
QdRC
dt
dPAO
CTRPdt
PAOd
111112
2
2
2
(4)
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
9
Qs
Pao QQA
Pawdu/dt
dPaw/dt
Volume vs time
Ventilator
respm2.mat
To File
Sum3 Sum2
Sum1Sum
0.5
Rp
Q vs timePao vs time
Mux
Mux
Memory
1/s
Integrator1
1/s
Integrator
-K-
CS
1
1/Rc
1/0.2
1/Cw
1/0.2
1/CL
PA
PAW
Figure 6: Implementation of the model in Simulink according to Equations (3)
Upon entering the following numerical parameters of resistances (in the units: cm H2O/L/sec) and elasticities (in the units: L/cmH2O) [8]:
005.0;2.0;2.0;5.0;1 CSCWCLRPRC
Equation (4) becomes simplified:
Qdt
dQ
dt
Qd
dt
dPAO
dt
PAOd4000620420
2
2
2
2
(5)
Upon Laplace transform of Equation (5) we obtain:
4000620
420
)(
)(2
2
ss
ss
sPAO
sQ
(6)
This gives us the possibility to simplify the Simulink model (Fig. 7):
PAO
Q
Volume vs timeVentilator
respm1.mat
To File
s +420s2
s +620s+40002
Respiratory Mechanics
Q vs time
PAO vs time
Mux
Mux
1/s
Integrator
Figure 7: Implementation of the model in Simulink using Laplace transform according to Equation (6)
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
10
However, when the parameter values change, the transformation function (6) must be recalculated and the Simulink model changes. Now let us make the model slightly more complicated by taking into account inertia of air in the upper respiratory tract (Fig. 8).
Now we shall moreover include the inertial element LC=0.01 cm H2O s2 L-1:
dt
dQP
LC
where P is the pressure gradient and dt
dQ
is flow acceleration, or:
dt
dQLCP
(7)
RC RP
CLCW
PPLPAPAW
CS
Q QA
Q-QA
RP=0,5
CS=0,005CL=0,2
PAWPA
PPL
PAO
P0
P0
QAQ
Q-QA
P0
RC=1
LC=0,01
LC
CW=0,2
Figure 8: Simple model of pulmonary mechanics taking inertia into account (hydraulic and electric similarity)
Then instead of the Set of Equations (3) we shall obtain:
001
0111
2
2
dt
dPAO
dt
dPQAQ
CSdt
QdLC
dt
dQRC
QAQCS
QACWCLdt
dQARP
(8)
And instead of Equation (5):
Qdt
dQ
dt
Qd
dt
Qd
dt
dPAO
dt
PAOd40006202,501,0420
2
2
3
3
2
2
(9)
And finally, upon Laplace transform:
40006202,501,0
420
)(
)(23
2
sss
ss
sPAO
sQ
(10)
The Simulink model shall change (Fig. 9):
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
11
PAO
Q
Volume vs timeVentilator
respm1.mat
To File
s +420s2
0.01s +5.2s +620s+40003 2
Respiratory Mechanics
PAO vs time
Mux
Mux
1/s
Integrator
Flow vs time
Figure 9: Implementation of the model in Simulink using Laplace transform according to Equation (10)
Thanks to the fact that the computational direction must be always taken into account in Simulink, the very Simulink diagram is quite distant from the actual physical reality of the system described. Even a small change in the model, such as addition of the inertial element, causes the need of careful calculation and change of the model structure. An essential change of the model occurs also in the case that spontaneous breathing is considered instead of artificial pulmonary ventilation. The model input shall not be represented by the pressure PAO created by the artificial pulmonary ventilation respirator but, for example, the thoracic wall elasticity CW (function of the breathing muscles can be modelled by cyclic change of elasticity).
Connection of blocks in Simulink reflects rather the calculation procedure and not the modelled reality structure.
6.2 Implementation of the Pulmonary Ventilation Mechanics Model in Modelica
In Modelica (or even in the Simulink library Simscape), the situation is different (source codes of the example can be downloaded from http://patf-biokyb.lf1.cuni.cz/wiki/objekty_2008). Instead of blocks, Modelica operates with connected components, which represent instances of individual classes, in Modelica moreover equipped with a special section in which equations are defined. By connecting Modelica components, not the calculation procedure but the modelled reality is defined. The way of solving the equations is thus “left up to the machines”.
The model representation in Modelica thus resembles rather the physical reality of the modelled world than connected block diagrams in Simulink. The simple ventilation mechanics model according to Fig. 3 can be expressed in a very straightforward way in Modelica. We shall make use of the fact that Modelica includes libraries of various classes to model electric, mechanical and hydraulic objects of the real world. Representation of the relationships of resistance, pressure gradient and flow according to Equation (1) and relationships of elasticity, pressure and flow according to Equation (2) thus takes the following form in Modelica:
Making the model more complex by adding the inertial element - pursuant to Equation (7) and Fig. 7 is easy (see Figure 11).
In the given case, we have used visual components of electric circuits for quick setting up of the model; however, nothing prevents us from creating a different shape of icons representing individual resistance, capacity and inertial elements in the lungs. These are far more than picture icons. Modelica is an object language and there is no obstruction in creating a special class using which it is possible, for example, to model oxygen and carbon dioxide flows (considering the oxygen bond to hemoglobin, CO2 conversion to bicarbonate, acidobasic equilibrium effect on blood gases transport etc.).
Formation of the physiological relationships library is one of our future aims. We are planning to transfer (and extend further in Modelica) our Simulink library of physiological relationships, Physiology Blockset (www.physiome.cz/simchips).
In respect of the fact that there are numerous relationships in physiological models (leading to solution of implicit equations in Simulink), acausal description of modelled relationships applied in Modelica provides a great advantage. Acausal description describes much better the essence of
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
12
modelled reality and the simulation models are much more legible, and thus much less prone to mistakes, as well. Modelica is therefore a very suitable environment to model physiological systems.
Figure 10: Simple model of pulmonary mechanics according to Fig. 5 in Modelica
Figure 11: Modified model of pulmonary mechanics upon adding the inertia element in Modelica
7 Excitable Membrane of the Neuron according to Hodgkin and Huxley
In 1963, Alan Lloyd Hodgkin and Andrew Huxley were awarded the Nobel Prize for physiology and the mathematical model of the action membrane potential. Precisely their article [6] has become the foundation of many models describing the membrane potentials behaviour in varied cell types.
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
13
Primarily, the model provides explanation of the nervous impulse spreading by depolarization of the cellular membrane using the connection of two physical domains – the electric and chemical one. Thanks to the conductivity study of membrane channels, in dependence on time and current membrane voltage, the model describes the course of electric current that is formed by the flow of sodium and potassium ions through the membrane.
This electric current subsequently affects the current electric voltage. At rest, the inside of the cellular membrane has a negative charge. Proteins with the negative charge cannot pass through the cellular membrane and remain on the inside of the membrane. Potassium and sodium ions are (thanks to the sodium-potassium pump) distributed non-uniformly between the cell and its surroundings – inside the cell, there is a high potassium concentration and low sodium concentration in respect of the surroundings of the cell. Transfer of the ions can take place only through ionic channels. The concentration and electric gradient has an impact on the ions movement – at rest, the cellular membrane has a negative charge and sodium concentration outside the cell is much higher than inside. Sodium is pushed into the cell both by the electric and concentration gradient. As for potassium, both gradients act against each other; however, the concentration gradient prevails (and potassium thus shows the tendency to leave the cell).
Nernst equation describes how the chemical and concentration gradients can be compared. Differences in concentrations are transformed using this equation to the membrane voltage needed to maintain their different concentrations on both sides of the membrane. These concentration differences in the model form a kind of power supplies for specific ions. When the difference of the Nernst minus current voltage for the cation is greater than zero, the cation is pushed into the cell. The sodium-potassium pump (Na-K-ATPasis) takes care, from the long-term point of view, of maintaining the concentration differences of potassium and sodium in the cell and outside the cell; this pump keeps pumping sodium from the cell and potassium into the cell constantly. However, its functionality and change of sodium and potassium concentrations is disregarded in this model and the concentrations are considered constant, and the concentration differences (thanks to the Nernst equation) form a power supply of +40 mV for sodium and -87 mV for potassium.
Charge accumulation on the membrane is a typical example of a capacitor, where the non-conductive cellular membrane acts as a medium, which separates two charged surfaces.
However, sodium and potassium flows through appropriate channels depend on the channels permeability (much lower for sodium than for potassium at rest). The channels permeability depends on the membrane voltage. If the membrane voltage rises from the rest (negative) voltage to a certain boundary value, sodium channels start to open for a very short moment and the current of sodium ions breaks into the cell and “discharges the negatively charged membrane capacitor” – and even charges it to the opposite (positive) value – we speak of depolarization and occurrence of the action potential. At the same time, sodium channels start to close again due to the change of the voltage (and thus make sure that the concentration of ions in the cell virtually does not change). At the same time, permeability for potassium channels changes, potassium starts to leave the cell more rapidly (and the current of positive potassium ions flowing out of the cell recharges the “membrane capacitor” again to the rest negative value).
7.1 Implementation of the Model according to Hodgkin and Huxley in Modelica
The model implementation in Modelica corresponds to an electric diagram (Fig. 12). Source codes can be downloaded from http://patf-biokyb.lf1.cuni.cz/wiki/objekty_2008. Special components are represented by membrane channels for sodium (or potassium, respectively). These behave as a power supply with changing inner resistance. Its constant voltage is given by the chemical gradient of sodium (or potassium, respectively) according to the Nernst equation, while their inner resistance corresponds to the open state (permeability) of the channels. Only potassium cations can pass through potassium channels and only sodium ones through sodium channels. Other electrically charged atoms that can pass through the membrane are implemented using a constant power supply and constant resistance, not changing in dependence on time and voltage.
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
14
Figure 12: Diagram of the Hodgkin-Huxley’s model in Modelica (in the Dymola environment)
Figure 13: Model simulation outputs. Time units are given in ms.
capacitor.v is current voltage of the cellular membrane in mV
k_channels.G is electric conductivity for potassium channels
na_channels.G is electric conductivity for sodium channels
na_channels.R is electric resistance for sodium channels = 1/(1000*G)
When implementing the model in Modelica, basic electric components from the standard library can be used: We shall thus use models of a constant voltage supply, a capacitor. Afterwards, it is only necessary to define the membrane channel classes and connect all elements visually.
Membrane channels can be modelled as special components. Using the empirically confirmed relationships (equations) from the Hodgkin’s and Huxley’s article [6], we shall create a new type of an electric component describing the behaviour of membrane channels as constant voltage sources
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
15
(pursuant to the Nernst equation) with changing inner resistance dependent on the membrane voltage. And finally, it only remains to connect all the elements visually.
Upon running the simulation of the entire circuit actuated by electric current pulses, the required course of the action potential and conductivity of the channels during an impulse is obtained (Fig. 13).
7.2 Implementation of the Model according to Hodgkin and Huxley in Simulink
In implementation of the model in Simulink, the model structure corresponds more to the calculation process than the physical structure of the modelled system. Comparison of the model implementation in Simulink (Fig. 14) and Modelica (Figs. 12 and 13) is very eloquent.
Figure 14: The Hodgkin-Huxley’s model [6] can also be implemented using the block-oriented Matlab/Simulink environment; however, this environment remains tied to the calculation procedure.
8 Conclusion
New technologies provide new opportunities and challenges in simulation models creation. One of such technologies is represented by acausal simulation environments, such as the library Simscape in Simulink and especially the new object simulation language Modelica, which shall make modelling of complicated and complex systems such as physiological systems considerably easier.
In respect of the fact that numerous relationships are found in physiological models (leading to solution of implicit equations in block-oriented languages), the acausal description of modelled relationships used in Modelica (but also in Simscape) provides a great advantage. Acausal description captures the essence of the modelled reality much better, and the simulation models are much more legible and thus also less prone to mistakes. Acausal simulation tools therefore represent a very suitable environment in physiological systems modelling.
References
[1] Abram, S.R., Hodnett, B.L., Summers, R.L., Coleman, T.G., Hester R.L.: Quantitative Circulatory
Physiology: An Integrative Mathematical Model of Human Physiology for medical education. Advanced Physiology Education, 31 (2), 2007, 202 - 210.
[2] Bassingthwaighte J. B. Strategies for the Physiome Project. Annals of Biomedical Engineering 28, 2000, 1043-1058.
[3] Guyton AC, Coleman TA, and Grander HJ. (1972): Circulation: Overall Regulation. Ann. Rev. Physiol., 41, p. 13-41.
Technical Computing Prague 2008. Conference Proceedings. Prague, 2008,
16
[4] Fritzson P. (2003). Principles of Object-Oriented Modeling and Simulation with Modelica 2.1, Wiley-IEEE Press.
[5] Hall J.E. (2004): The pioneering use of system analysis to study cardiac output regulation. Am.J.Physiol.Regul.Integr.Comp.Physiol. 287:R1009-R10011,2004,287: p. 1009-1001.
[6] Hodgkin, A.L., Huxley A.F.: The components of membrane conductance in the giant axon of Loligo. Journal of Physiology, 116, 1952, p. 473-496.
[7] Hunter P.J., Robins, P., Noble D. (2002) The IUPS Physiome Project. Pflugers Archive-European Journal of Physiology, 445, p.1–9
[8] Kho M.C.K. (2000) Physiological control systems. IEE Press, New York 2000, ISBN 0-7808-3408-6
[9] Kofránek J., Andrlík M., Kripner T, and Mašek J.: From Simulation chips to biomedical simulator. Amborski, K. and Meuth, H. 2002. Darmstadt, SCS Publishing House. Modelling and Simulation 2002 Proc. of 16th European Simulation Multiconference, p. 431-436 (full text version: http://patf-biokyb.lf1.cuni.cz/wiki/technical_computing_2007 ).
[10] Kofránek, J, Rusz, J., Matoušek S., (2007): Guytons Diagram Brought to Life - from Graphic Chart to Simulation Model for Teaching Physiology. In Technical Computing Prague 2007. Full paper CD-ROM proceedings. (P. Byron Ed.), Humusoft s.r.o. & Institute of Chemical Technology, Prague, ISBN 978-80-78-658-6, 1-13, 2007. The article including source program codes is available at http://www.humusoft.cz/akce/matlab07/sbor07.htm#k
[11] Raymond, G. M., Butterworth E, Bassingthwaighte J. B.: JSIM: Free Software Package for Teaching Physiological Modeling and Research. Experimental Biology 280, 2003, p. 102-107
[12] Van Vliet, B.N., Montani J.P. (2005):,Circulation and fluid volume control. In: Integrative Physiology in the Proteomica and Post Genomics Age. Humana Press, 2005, ISBN 918-1-58829-315-2, p. 43-66
Acknowledgments This work has been supported by research MSM 0021620806 and by the aid grant MŠMT 2C06031, and by Creative Connections s.r.o. Jiří Kofránek, M.D., Ph.D. Laboratory of Biocybernetics, Institute of Pathological Physiology, First Faculty of Medicine, Charles University in Prague U Nemocnice 5 128 53 Praha 2 e-mail: kofranek@gmail.com Tel.: 777 68 68 68
MEFANET 2008
Jiří Kofránek, Marek Mateják, Stanislav Matoušek, Pavol Privitzer, Martin
Tribula, Ondrřej Vacek: School as a (multimedia simulation) play: use of
multimedia applications in teaching of pathological physiology. In MEFANET 2008. (Editoři: Daniel Schwarz, Ladislav Dušek, Stanislav Štípek, Vladimír Mihál),
Masarykova Univerzita, Brno, 2008, ISBN 978-80-7392-065-4, CD ROM, str. 1-
26, [Online] http://www.mefanet.cz/res/file/articles/prispevek-mefanet-
anglicky-kofranek.pdf
SCHOOL AS A (MULTIMEDIA SIMULATION) PLAY: USE OF MULTIMEDIA APPLICATIONS
IN TEACHING OF PATHOLOGICAL PHYSIOLOGY
J. Kofránek, M. Mateják, S. Matoušek, P. Privitzer, M. Tribula, O. Vacek
Laboratory of Biocybernetics, Institute of Pathological Physiology, First Faculty of Medicine, Charles University in Prague
Abstract Nowadays, the old Comenius`s motto – “schola ludus“ (“school as a play”) has found its modern use in interactive educational programs using simulation games. Connection of the Internet and a multimedia environment serving as an audio and visual user interface with simulative models makes it possible to have a graphic feel in the virtual reality of the problem currently studied, upon connecting to the magical Internet network. By means of a simulation game it is possible to test, without any risk, the simulated object’s behaviour – e.g. trying to land with a virtual airplane or to heal a virtual patient. Through the simulation game we can test the behaviour of individual physiological subsystems, both under normal conditions and in the presence of a disorder. The Atlas of Physiology and Pathophysiology (http://www.physiome.cz), designed as a multimedia-teaching tool, which helps to explain the function of individual physiological systems, causes and symptoms of their disorders in a visual way through the Internet is one of the projects in which we want to utilize new opportunities of multimedia and simulation models. Development of the Atlas requires cooperation of many professionals: Starting from experienced teachers whose design provides the foundation of quality educational applications, system analysts responsible for creating simulation models for educational simulation games in cooperation with professionals in their field, artists creating the visuals, and finally up to programmers who “knit” together the whole application to achieve its final form. For the inter-disciplinary collective creation to be successful, specific development tools with sufficient technical support must be used in each phase of creation; such tools allow for component-based creation of simulation models, creation of interactive multimedia and their final interconnection into a compact unit based on the given design. Creative interconnection of the various professions is the key to success. The Atlas of Physiology and Pathophysiology is a freely available application. Any form of cooperation in its gradual development is welcome.
Keywords: Internet, Multimedia, Simulation Games
Schola Ludus in a Modern Garment Multimedia programs with simulation components for educational purposes are not only a replacement of classical textbooks. They serve as an entirely new instruction aid making it possible to explore the studied problem in virtual
MEFANET 2008
2
reality through instruction simulation games, thus bringing quite new possibilities to explain complex problems – and this is precisely the point where the old credo of John Amos Comenius “Schola Ludus” (School as a Play), promoted by this European pedagogue as early as in the 17th century, finds its modern application.
Many instruction-oriented simulators of individual physiological subsystems for free pedagogical use can be found on the Internet. Thus for example, the simulator ECGsim makes it possible to study the generation and spreading of electric potential in heart ventricles and to study the mechanism of origination of the ventricular complex QRS in various pathologies (from impulse conduction disorders to ischemias and infarctions) [14]. The heart simulator from Columbia University allows for observing the pressure-circulation curves in heart ventricles in various cardiac pathologies (valvular defects, left-sided or right-sided failure) [2]; anaesthesiological device simulators from the University of Florida provide the possibility to administer anaesthesia to a virtual patient [17] and to observe appropriate physiological responses (however, more complex simulators require paid access) etc.
Complex Methods of Integrative Physiology and Teaching Complex simulators are of large importance for teaching of pathophysiology and study of pathogenesis of varied pathological conditions; such simulators include models of not only individual physiological subsystems but also their mutual connection into a more complex unit.
Prof. Guyton was a pioneer of making these models. In 19972, he published an article [6] in the journal Annual Review of Physiology, whose form quite surpassed the usual forms of physiological articles of those times at the very first sight. An extensive diagram pasted in as an attachment was used as introduction, showing interconnection of essential subsystems that have an effect on circulation, by means of special symbols expressing mathematical operations.
Guyton’s model was the first extensive mathematical description of physiological functions of interconnected subsystems of an organism, and it initiated development of physiological research, sometimes described today as integrative physiology. From this point of view, it was a certain milestone, which attempted at capturing the dynamics of relationships among the controls of circulation, kidneys, breathing, the volume and ionic composition of body fluids using a mathematical model, while applying a system view of physiological regulation. The Guyton’s diagram (Fig. 1) was reprinted many times in various publications (even in recent years). However, in spite of that, none of the authors reprinting the Guyton’s monumental diagram pointed out the fact that there were mistakes in the diagram. Provided that the classical Guyton’s model is implemented using current simulation tools and accurately according to
MEFANET 2008
3
the graphic scheme, the model shall not work. However, such special tools were not available at the time this diagram was designed. The diagram was made only as a figure, the very program to implement the model was written by the authors in Fortran; however, the original source code is not available today.
Figure 1: Extensive diagram of physiological circulatory regulations according
to A. C. Guyton et al from 1972.
As our aim was to apply the original classical Guyton’s model in education of bioengineers, we had to correct the original diagram (Fig. 2). The correction required thorough revision of the entire model and system analysis of physiological regulations of the circulation system as well as numerous simulation experiments and their comparison with published results. A system of formalized physiological relationships expressed in the graphic form is the result; the system corresponds to the original model of Guyton et al [11] in its appearance but also behaviour. The model has been implemented as an interactive physiological diagram, making it possible, through simulation experiments, to understand better and deeper the physiological meaning of regulating bonds and their application in development of numerous pathophysiological conditions. We apply this diagram as an instruction teaching aid in education of physiological regulation systems for bioengineering specializations (Fig. 3).
MEFANET 2008
4
Figure 2: Corrections of the most significant errors in the graphic diagram of
physiological circuit regulations according to A. C. Guyton et al.
However, the diagram is not very suitable for teaching of medical students – as they require simulators whose user interface looks more like interactive images of a physiological atlas than a control circuit diagram. Simulink implementation of the (corrected) Guyton’s model created by us is available for download at www.physiome.cz/guyton. Our Simulink implementation of a much more complex version of the Guyton et al model from later years is available at the same address, as well. At the same time, very detailed description of all mathematical relationships, together with reasoning, is provided on the website.
Guyton and his disciples continued constant further development of the model. In 1982, Thomas Coleman, Guyton’s disciple and collaborator, created the model “Human” intended especially for educational purposes. The model allowed for simulating numerous pathological conditions (cardiac and renal failure, haemorrhagic shock etc.), as well as the effect of some therapeutic interventions (infusion therapy, effect of some drugs, blood transfusion, artificial pulmonary ventilation, dialysis etc.) [4]. Recently, Meyers et al made the original Coleman’s model available on the web using Java implementation [13].
MEFANET 2008
5
Figure 3: Application of the physiological regulation model according to A. C.
Guyton et al in education of bioengineers. However, the model is not quite suitable for medical education; an educational simulator should be designed for
teaching of medical students, the user interface of which shall evoke images from medical textbooks and monographs rather than an interactive regulation
diagram
The simulator Quantitative Human Physiology is the most recent result of Guyton’s disciples and followers, representing probably the most complex and extensive model of physiological functions at present times. The simulator is an extension of the original large circulatory system simulator (Quantitative Circulatory Physiology [1]) achieved by integrated connection of all important physiological systems. The model can be downloaded from the Internet [3].
We, too, created an instruction simulator “Golem” in the past, based on a complex model of integrated physiological regulations [8]. Our simulator “Golem” was focused on teaching of complex disorders of the internal environment [9].
MEFANET 2008
6
Internet Atlas of Physiology and Pathophysiology: Explanation Using Simulation Games However, experience in application of complex models (of the Golem or QHP type mentioned above) in teaching shows that large and complex models are connected with a disadvantage from the didactic point of view, namely their complex control. The large number of input variables as well as the broad scale of options of observing the input variables require rather thorough understanding of the very structure of the simulation model on part of the user, as well as knowledge of what processes should be observed in simulations of certain pathological conditions. In the opposite case, a complex sophisticated model seems to the user only as a “complicated and not very understandable technical play” (similarly as if the user should face a complex airbus simulator without a prior theoretical instruction).
Instruction models (and apparently not only complex ones with hundreds of variables) in themselves therefore are not enough for efficient use in teaching. They must be accompanied by explanation of their application – using interactive educational applications at best. The possibility of using all advantages of virtual reality to explain complex pathophysiological processes arises only upon establishing connection between explanation and simulation play. In order to link the possibilities offered by interactive multimedia and simulation models in medical teaching, we have designed the concept of an Internet computer project, the Atlas of Physiology and Pathophysiology [10], conceived as a multimedia instruction aid that should help to explain, in a visual way using the Internet and simulation models, the function of individual physiological subsystems, the causes and manifestations of their disorders – see http://physiome.cz/atlas. The Atlas thus combines explanation (using an audio and animation) with interactive simulation play with physiological subsystems models, all available for free from the Internet.
Simulation Models as “Live” Interactive Illustrations The user interface of models used as the foundation for simulation plays rather evokes animated images from the printed Atlas of Physiology [15] or Atlas of Pathophysiology [16] than abstract regulation diagrams used in teaching of bioengineers (similar to those in Fig. 3). Unlike printed illustrations, however, images forming the user interface of multimedia simulators are “live” and interactive – changes of the simulation model variables are manifested by changes of the images. Using interactive illustrations thus conceived, it is possible to implement simulation plays which shall help to explain dynamic connexions in physiological systems, better than a static image or even a simple animation, and help especially to understand casual connexions in development of pathogeneses of varied diseases.
MEFANET 2008
7
Figure 4a: Interactive educational model of the buffering plasma system. Fluid
level values represent concentrations. Initial condition.
Figure 4b: Dilution can be invoked using the control slide; levels of all
substances including CO2 concentration and hydrogen ions concentration shall become reduced.
MEFANET 2008
8
Figure 4c: Chemical equilibrium establishment in the buffering system can be engaged by pressing the button “Buffering Equilibration”; at the same time,
plasma pH value returns to 7.4.
Figure 4d: Respiration increases (originally decreased upon dilution) the CO2
concentration value to the original level 1.2 mmol/L. Upon establishing new chemical equilibrium, hydrogen ions concentration increases and plasma pH
value decreases.
MEFANET 2008
9
The model of acid-base equilibrium in plasma can be mentioned as an example of a “pictorial” user interface in an instruction simulation play, where buffering systems in the user interface are shown as interconnected containers displaying compartments of individual substances. The model can be downloaded from: http://www.physiome.cz/atlas/acidobaze/02/ABR_v_plazme1_2.swf.
The “level” in these containers represents concentration. Chemical reactions are shown as “flows of liquid” among the containers with individual buffering system components. Substances from/into metabolism, respiratory system or kidneys can “flow in or out” of the containers. Using simulation plays with this models, the development of various acidobasic equilibrium disorders can be visually explained. Fig. 4a-d shows application of this simulator in a simulation play to explain pathogenesis of dilution acidosis. Dilution of individual buffer components is shown as expansion of appropriate containers – as the amount of components in the containers remains the same, the level (representing concentration) drops. The level of hydrogen ions drops as well (Fig. 4b). By pressing the button “buffering equilibration”, chemical reactions are started in the buffering systems, visualized as “flowing in/out” of individual components. Upon dissociation of carbonic acid and weak buffering acids (denoted as HBUF in the model – represented especially by albumin and phosphates in reality), the hydrogen ions level settles on the original value again (Fig. 4c). Nevertheless, the value of carbonic acid, just like the value of CO2, remains reduced due to dissociation. However, respiration in the organism maintains the CO2 level in arterial blood on a constant level (given especially by the alveolar ventilation value). By pressing the button “respiratory regulation”, the CO2 level increases back to its original value before dilution. By pressing the button “buffering equilibration”, a chemical reaction takes place, establishing a new chemical equilibrium with increased concentration of hydrogen ions (Fig. 4d).
The “Ceteris Paribus” Principle in Instruction Simulation Plays From the didactic point of view, it is always necessary to proceed from simple to more complex things in explanations. According to this principle, it is therefore suitable to use rather simple aggregated models (with few variables) during explanation, explain essential principles using these models, and then start making the model (and described physiological reality) more complex gradually. Instruction simulation plays forming part of the Atlas need not be always based on a highly complex model demanding from the calculation point of view with hundreds of variables – even a simple interactive model can be a good helper in explaining pathogenic chains of development of various pathological conditions.
MEFANET 2008
10
From the didactic point of view, it is very efficient to disconnect regulation loops in the model at first and enable the students to study the responses of the selected physiological subsystem on changes of input variables in the simulation play (however, themselves regulated in a real organism). The dynamics of behaviour in gradual changes according to a single input are observed at first, while other inputs are set on a chosen constant value (the so called „ceteris paribus“ principle).
This shall enable the students to understand better the meaning of individual regulation circuits and to study the effect (of disconnected and manually controlled at first) regulation bonds on behaviour of the organism in various pathological disorders and responses to relevant therapy. Based on our experience, it is precisely this approach that leads to better understanding of the meaning of individual regulation loops and understanding of their task in pathogenesis of various diseases, as well as understanding of pathophysiological principles of relevant therapeutic interventions.
Thus for example, it is not suitable to start with a simulation play with a model when explaining physiology and pathophysiology of circulation as its complexity is approximately on the same or higher level compared to the Guyton’s circulation model mentioned in the introduction (see Fig. 1). It is more advisable to choose a simple aggregated model at the beginning, making it possible to demonstrate fundamental principles of the blood circulation structure and behaviour, as well as possibilities of its affection by means of regulation. The simplest circulation system model with disconnected regulation bonds as part of our Atlas is available at: http://www.physiome.cz/atlas/cirkulace/05/ SimpleUncontrolledSimulation.swf.
Its control (see Fig. 5) is very easy and serves especially to clarify fundamental relationships among individual variables of the circulatory system (i.e. pressures and flows in the pulmonary and body circulation) and essential variables affecting the pressures and flows (however, themselves regulated in neurohumoral ways). They are as follows:
• Peripheral resistances (system and pulmonary);
• Pumping function of the right and left ventricle – implemented using the simplest way in the model, namely as inclination of the Starling curve (expressing dependence of the minute heart volume on filling pressures in the right and left atrium);
• Elasticity of arteries and veins (expressing pressure dependence on the vascular fill);
• Total volume of circulating blood.
MEFANET 2008
11
The organism regulates the variables mentioned above (resistance is controlled by means of nervous and humoral regulation; myocardial frequency and inotropy modifies the shape of the Starling curve; venous tonus of large veins changes their elasticity; and the circulating blood volume is affected especially by renal activity, renin-angiotensin regulation etc.). However, these variables represent input (i.e. non-regulated) quantities in an aggregated model – the aim of the simulation play with the model is to obtain a clear notion of the meaning of these quantities for regulation of pressures, flows and distribution of the blood volume among individual parts of the bloodstream. Simulation play with this model makes it possible to explain the meaning of regulation of essential quantities of the circulatory system in pathogenesis of various circulatory system disorders to the students.
Figure 5 shows a simulation play of development of right-sided circulatory failure.
Figure 5: Use of a simple (non-controlled) circulatory system model to explain pathogenesis of right-sided circulation failure. See the text for more detailed
explanation.
The procedure is to reduce the Starling curve inclination in the right heart using the slide at first – this models reduction of contractility of the right heart
MEFANET 2008
12
upon acute right-sided circulatory failure (Fig. 5b). Minute heart volume drops to the value 3.29 L/min; mean system arterial pressure decreases to 59.56 Torr. Sympaticus responds to the blood pressure decrease by distinct vasoconstriction especially in the splanchnic region, in order to preserve perfusion of coronary blood vessels.
The next step is therefore to increase peripheral system resistance by moving the slide right (Fig. 5c) – mean arterial pressure increases to 89.21 Torr; however, minute heart volume drops further from 3.29 L/min to 3.07 L/min! However, sympaticus does not affect only vasoconstriction of arterioles and subsequent increase of peripheral resistance.
It also increases the tonus of large veins, which is manifested by increased pressure in them with the same blood fill – the venous tonus increase can be modelled by reduced elasticity of system veins (Fig. 5c). Reduced elasticity increases the pressure in large system veins and thus also the filling pressure in the right atrium, leading to increased minute heart volume (however, at the same time, the increase of venous pressure leads to higher filtration in capillaries and to oedemas). Mean arterial pressure increases to the normal value and it is not necessary to maintain the resistance value in the system bloodstream too high in order to preserve the pressure value – therefore the resistance should be reduced using the slide from 28.37 Torr/L/min to 19.24 Torr/L/min.
The simulation play can be continued further by demonstrating the meaning of the total blood volume increase, which occurs due to activation of the renin-angiotensin-aldosterone loop (not shown in the figure). Upon increasing the circulating blood volume using the slide, it can be shown in the model that peripheral resistance as well as venoconstriction can be reduced further (i.e. elasticity of large veins can be increased) in order to maintain normal minute heart volume and normal mean arterial pressure.
The simulation experiment can be furthermore used to demonstrate the effect of therapy, as well: Administration of cardiotonics can be illustrated by increasing the Starling curve inclination, and administration of diuretics can be simulated by reducing the increased circulating blood volume – pressure in large veins decreases as a consequence with subsequent reduction of oedemas.
It was our intention to illustrate using the example above how simulation plays with a model shall contribute to better understanding of the meaning of individual regulation circuit application in pathogenesis of various pathological conditions and in subsequent therapeutic interventions.
The Atlas as a Web-Based Application The Atlas of Physiology and Pathophysiology is currently designed as a web-based application that can be run in an Internet browser (a Flash player installed
MEFANET 2008
13
in the browser is a prerequisite). Some simulation models require Microsoft .NET framework installed on the computer (if this part is not installed, its installation is offered before installing the first simulator, which requires .NET).
Explanatory chapters of the Atlas are designed as audio lectures accompanied by interactive multimedia images (see Fig. 6). Every animation is synchronized accurately with the explanatory text.
Figure 6: Audio interactive lecture in the explanatory part of the Atlas of Physiology and Pathophysiology. Every explanation is accompanied by
animated images synchronized with the explanatory part. Explanation can be stopped in any moment, to have a more detailed look at the accompanying animation. Explanation including the synchronized animations can also be
moved backward using the slide in the bottom part of the player.
However, the Internet-based Atlas of Physiology and Pathophysiology is much more than just an animated explanation with an audio track. The foundation of didactic efficiency is represented by explanation accompanied by a simulation games. Simulation models forming part of the Atlas are implemented as Flash applications and need not be installed separately (such as, for example, simulators in Figs. 4, 5 and 7) or (in more complex models) their separate installation is required directly from the Internet browser.
MEFANET 2008
14
More complex models require somewhat more complicated control – a suitable scenario is therefore important, according to which the model can be used in the simulation play as an instruction aid to explain more complicated physiological relationships.
Some simulators combine the model as well as the explanatory part – simulator of mechanical properties of muscles (Fig. 7) can be mentioned as an example.
Figure 7: Simulator of the skeletal muscle mechanical properties is a Flash application designed as an explanatory chapter, which includes practical
exercises with the model (accessible at http://www.physiome.cz/atlas/sval/svalEN/SvalEN.html )
Other simulators can be run separately and scenarios used in their control are designed as part of relevant explanatory chapters. The complex model of blood gases transport can be given as an example; this model shall be used as an instruction aid in explanation of physiology and pathophysiology of oxygen and carbon dioxide transport. Examples of using this simulator in explanation of consequences of ventilation-perfusion relationships disorders are shown in Figs. 8a-8e. The simulator can be downloaded from our Atlas using the link: http://physiome.cz/atlas/sim/BloodyMary/.
MEFANET 2008
15
Figure 8a: Simulation play with the blood gases transport model to explain the consequences of ventilation – perfusion non-uniformity failures. Initial
condition.
Figure 8b: Setting of different ventilation distribution shall cause decrease of
PO2 and increase of pCO2 in mixed arterial blood.
MEFANET 2008
16
Figure 8c: Slight increase of the breath frequency means achievement of pCO2 normalization in mixed arterial blood; however, PO2 still remains low. Different shape of O2 and CO2 dissociation curves is the cause – see
the following figure.
Figure 8d: Comparison of total concentrations and partial pressures O2 and CO2 in hyperventilated, hypoventilated alveoli and in mixed arterial blood.
MEFANET 2008
17
Beyond the Atlas of Physiology and Pathophysiology Curtain – Creation Technology of Instruction Simulators The creation process of the Atlas takes the form of a joint work made by creative specialist's team encompassing various professions (Fig. 9):
• Experienced teachers whose scenario is the foundation of a quality educational application;
• System analysts, responsible in cooperation with professionals of the given field, for designing simulation models for educational simulation plays;
• Artists designing the outside visual form;
• Computer science engineers (programmers) whose role is to “knit” the entire application into the resulting form.
For the interprofessional collective creation process described above to be efficient, each stage of the process should utilize specific development tools, with sufficient technical support, making it possible to apply component-based
Figure 8e: Perfusion limitation by poorly ventilated alveoli limits admixing
of hypooxygenated blood from hypoventilated alveoli, thus causing increased partial pressure of oxygen in mixed arterial blood. However, another
consequence is also represented by increased resistance of the pulmonary bloodstream and development of precapillary pulmonary hypertension.
MEFANET 2008
18
creation of simulation models, interactive multimedia preparation, and their final interconnection pursuant to a given scenario into a compact unit.
Creative interconnection of various professions and development tools is therefore a prerequisite of success.
A multimedia presentation available from the Internet, found at http://www.physiome.cz/atlas/info/01EN/index.htm discusses the technologies used in the building process; methodology of creating educational simulators is described in [12].
Foundation of an e-learning Educational Application – Scenario of Good Quality The foundation of every explanatory chapter of the Atlas is represented by a quality scenario, designed by an experienced pedagogue. High attention must be paid to preparing the scenario. According to our experience, underestimating of thorough scenario preparation is paid for dearly by the necessity of unnecessary
Figure 9: Atlas of Physiology and Pathophysiology is a joint work of a
multidisciplinary team of pedagogues, system analyst, artists and computer scientists. In its process of creation, we strive to connect specialists of
various professions as well as the development tools.
MEFANET 2008
19
iteration steps in development of the educational application and in subsequent extension of the development time.
The scenario must include a detailed proposal of assignment for the artist concerning the graphic appearance of every individual page, including animations, and the interactive behaviour proposal. The final graphic appearance is then up to the artist cooperating with the author of the given chapter. At the same time, the scenario must include key points of synchronizing the audio track with beginnings of individual animations.
When the explanation is accompanied by a simulation play (in the form of “training” using the simulation model), the scenario according to which the students should manipulate with the model must be thought over carefully so that the model behaviour clarifies those relationships, which are rather difficult to explain without a simulation play with the model (see the example of simulation plays application in Figs. 4, 5, 8).
Interactive Animations Built using the Threads of Simulation Models The making of interactive animated images (interconnected with explanations and simulation models) is frequently and wrongly underestimated – the truth is that precisely the graphic appearance of an educational application is frequently the aspect which “sells“ the e-learning product to potential users from the marketing point of view.
However, at the same time it should be noted that a professional artistic appearance of educational applications is demanding as for financial as well as human resources. Every image is an author’s work of art. The number of artists on the labour market who have mastered making of interactive computer animations is not really excessive. Moreover, thanks to development of Internet media, digital television, computer gaming industry and other information technology branches, the demand for these professionals on the labour market is rather increasing.
We tried to resolve the lack of interactive graphics professionals years ago already by establishing narrow working cooperation with Václav Hollar School of Fine Arts where we have built our external workplace – Interactive Graphics Laboratory. Our activities focused on training the teachers at first (and later students, as well) of the school in the field of using modern computer graphics tools, and thanks to our joint efforts we have created a new, three-year specialization “Interactive Graphics” at this school (at present, there are graduates from two year-classes already). We provide especially teaching of “Interactivity Mastering” specialization at the Václav Hollar College of Fine Arts, as well as guidance of the students’ practical experience. The students (and
MEFANET 2008
20
also graduates today) of this college are those who provide the prevailing part of artistic appearance of our educational applications.
Until today, we have used especially Adobe products in designing interactive graphics – especially Adobe Flash and Adobe Flex. Lately we have started to turn to the Microsoft development environment, which offers very suitable tools allowing for good cooperation between programmers and artists – Microsoft Expression Blend (on part of the artists) and Visual Studio 2008 (with the WPF framework on part of the programmers) [7].
“Brain” of the Educational Simulator – Mathematical Model The core of the simulator consists in a mathematical model representing a
formalized (mathematical) description of the physiological reality. Special development tools exist for development of mathematical models. In our laboratory, we have been using the environment Mathworks Matlab/Simulink on a long-term basis. We have developed a special library of formalized physiological relationships Physiology Blockset in Simulink, available for free on our website (http://www.physiome.cz/simchips).
Today, Mathworks development tools (Matlab and Simulink) rank among well-established industrial standards. As a rule, Simulink operates using connected blocks. Signals are transmitted through links between individual blocks; the signals serve to transfer values of individual variables from the output of one block to inputs of other blocks. Input information is processed in the blocks to output information. Interconnection of blocks in Simulink therefore reflects rather the calculation procedure than the very structure of the modelled reality. This is the so called causal modelling.
Recently, development of new, the so called “acausal” tools occurred, intended for making of simulation models. An essential innovation introduced by such tools consists in declarative (thus acausal) writing of models when individual parts of the model are described directly as equations and not as an algorithm to solve the equations.
These tools operate using interconnected components in which equations are defined. The equations do not express assignment (i.e. saving of the calculation result of an assigned statement into a given variable) but a definition of relationships among variables (as is the custom in mathematics and physics). These components (representing instances of classes with equations) can be connected through exactly defined interfaces – connectors. The important aspect is the fact that by connecting the components, sets of equations in individual components become connected with each other.
A typical representative of acausal modelling tools is the new object-oriented programming language Modelica [5]. Originally, it was developed in
MEFANET 2008
21
Sweden and now is available both as an open-source version (developed under the auspices of the international organization Modelica Association, http://www.modelica.org/ ), and in two commercial implementations (Dymola of the company Dynasim AB and MathModelica of the company MathCore).
Mathworks, the producer of well-established Matlab/Simulink tools, responded to the new trends by designing a special Simulink library Simscape and related domain libraries SimElectronics, SimHydraulics, SimMechanics etc.
In accordance with modern trends, lately we have expanded the development tools used in making mathematical models (i.e. Matlab/Simulink) by tools using the acausal modelling language – Modelica. We are in the process of making our own development tool for this perspective modelling language, which shall make it possible to generate the resulting model in the environment Microsoft .NET, thus facilitating conversion of created and debugged models in the environment in which the very educational simulator shall be designed.
Development of the Very Educational Simulator Development of the educational simulator is demanding programming work, linked to the results of the mathematical model development and to the created elements of interactive graphics. In accordance with the designed scenario, graphic elements of the user interface must be “knitted” together with the mathematical model programmed in the background.
In the past, we have used the development environment Control Web to create simulators; this environment was originally designed to make industrial applications (control, management, control centres design) using a PC. Control Web provides numerous tools to create a complex user interface, allows for connecting Flash animations to the interface and to control it according to values of variables on the background. A Control Web application in its classical industrial deployment form communicates through a software controller of the hardware control and measurement card with the industrial technological device. Using the Control Web environment to create simulators, we have programmed a special software controller in whose core a simulation model is programmed. Control Web was thus “cheated”: It did not communicate with some industrial technology through the relevant software input/output channels but with a simulation model in the controller (see Fig. 10).
In order to facilitate development of “virtual measurement/control card” controllers containing a simulation model and not to have to write such a controller for each model “manually” in the C programming language, we have developed a special program that enables us to generate the source text of the relevant virtual controller in C directly from a Simulink diagram. This has
MEFANET 2008
22
allowed for simple and quick modification of the controller for Control Web upon making various adaptations and new versions of the simulation model.
For example, in Control Web we have created the simulator Golem [8] and as for the Atlas of Physiology and Pathophysiology, the kidneys simulator.
Currently, we are using classical programming tools to design the simulators. As far as simple Flash simulators are concerned, these are programmed directly in ActionScript, thus the programming language for Flash applications. As for the Atlas of Physiology and Pathophysiology, the simulator of mechanical properties of skeletal muscles is programmed in this language (see Fig. 7).
However, the ActionScript language development environment is not sufficient for more complex simulators. Therefore we use the Microsoft Visual Studio .NET programming environment in our laboratory, which, especially its latest version, provides extensive possibilities for programming work. In this environment, we are no more limited by “preset” elements of the user interface as is the case of Control Web, and moreover we can use all the power of a
Figure 10: Simulator development in the Control Web environment,
originally designed for visualization of control and measurement industrial applications. The simulation model is programmed as a software controller of a (non-existent) virtual card, and the application under development in
Control Web communicates with the model as if it was a technological device.
MEFANET 2008
23
modern software application development tool; however, on the other hand, we must program ourselves many elements of the user interface for the application under development.
In order to make writing of the simulators easier (and not to have to program an already debugged simulation model “manually” in Visual Studio .NET), here, too, we have developed a special software tool [12] to automatically generate the simulation model from Simulink in the form of a component for the .NET environment (see Fig. 11).
To facilitate conversion of mathematical models from the Modelica language environment into .NET, we are extending OpenModelica compiler (as part of the international project Open Modelica) to C# simulation code generation (see Fig. 11).
Figure 11: Making simulators in the .NET environment. The model is
programmed as a component of the .NET environment (the so called .NET assembly) – preferably by means of automatic generation from models
development tools (from the Matlab/Simulink or Modelica programming language environment). Graphic components are created in Adobe Flash or Microsoft Expression Blend. Creating animations in Expression Blend offers the advantage of creating both the animations as well as the simulator in the
common .NET platform
MEFANET 2008
24
Besides interconnection with the model creation tools, easy connection to graphic components of the user interface under development is important, as well. Flash components can be incorporated into the simulator in the process of creation through an Active X component.
The new .NET environment version also introduces entirely new possibilities of creating graphic components. Thanks to the new WPF (Windows Presentation Foundation) technology, complex graphic components can be created directly in the .NET platform, which include animations, vector graphics, 3D elements etc. (similarly as in Adobe Flash or even with potentially greater possibilities). It is important that the graphic user interface under development is directly integrated with the .NET platform, which removes the need of bridging the heterogeneous worlds of .NET and Adobe Flash in the simulators development.
Besides the above, the development tool to create graphic components (Microsoft Expression Blend) provides considerable support of cooperation of artists and programmers [13] thanks to the interface, which separates (and connects) the work of an artists and programmer. An artist can create complex animations in this tool very comfortably (using a graphic user interface), and the animations can be controlled easily. The programmer specifies such control by connecting to relevant program modules (the animations can be thus controlled by the simulation model on the background similarly as puppets on strings). Currently, we have trained artists in using this perspective tool.
Moreover, the new tool Silverlight shall make it possible to develop simulators, which can run directly in the Internet browser (even on computers with different operating systems – it is only necessary to install the relevant plugin in the browser).
New development tools of Microsoft provide a very perspective environment for development of simulators, and for the future, they represent our main development platform.
Conclusion Educational applications using simulation play, available through the web, represent a new educational aid, very efficient from the didactic point of view in explaining complex pathophysiological processes.
However, their process of creation is not very easy – it requires multidisciplinary team cooperation and use of suitable development tools.
Their making is a combination of research and development work. Research work consists in formalizing physiological reality by designing
MEFANET 2008
25
mathematical models, while development work is the very creation of multimedia simulators, which make use of the mathematical models designed.
As our contribution to making modern e-learning tools which combine multimedia explanation with simulation plays, we have established the Internet-based Atlas of Physiology and Pathophysiology project.
The Atlas project is open-based – We shall make its results available in the Czech language for all those interested, and in the course of its development, we shall welcome cooperation with all who would like to take part in its gradual building process.
References [1] Abram S. R., Hodnett, B. L., Summers R. L., Coleman T. G., Hester R.L.,
(2007), "Quantitative Circulatory Physiology: An Integrative Mathematical Model of Human Physiology for medical education.", Advanced Physiology Education, 31 (2), 202 – 210.
[2] Burkhoff D. [2008, August] The Heart Simulator. [Online]. http://www.columbia.edu/itc/hs/medical/heartsim/
[3] Coleman T. (2008, September). Quantitative Human Physiology [Online]. Available: http://physiology.umc.edu/themodelingworkshop/ .
[4] Coleman T. G. Randall J.E., (1983). "HUMAN. A comprehensive physiological model.", The Physiologist, vol. 26, (1): 15-21.
[5] Fritzson P. (2003). Principles of Object-Oriented Modeling and Simulation with Modelica 2.1, ISBN 0-471-47163-1,Wiley-IEEE Press.
[6] Guyton AC, Coleman TA, and Grander HJ. (1972). "Circulation: Overall Regulation." Ann. Rev. Physiol., 41, p. 13-41.
[7] Januszewski K., Rodrigues J. (2008 November) The new iteration. How XAML transform the collaboration between designers and developers in window presentation foundation. [Online] Available: http://windowsclient.net/wpf/white-papers/thenewiteration.aspx
[8] Kofránek J. Anh Vu L. D., Snášelová H., Kerekeš R., Velan T., (2001). "GOLEM – Multimedia simulator for medical education." In Patel, L., Rogers, R., Haux R. (Eds.). MEDINFO 2001, Proceedings of the 10th World Congress on Medical Informatics. London: IOS Press, 1042-1046.
[9] Kofránek J., Andrlík M, Kripner T and Matoušek S., (2005). "Biomedical Educations with Golem." In: Interdisciplinary Aspects of Human-Machine Co-existence and Co-operation, edited by Mařík V, Jacovkis P, Štěpánková O and Kléma J. Prague: Czech Technical University in Prague, 142-151.