I have been firmly convinced, that selection of Modelica as implementation language for developing large physiological models will pay off.
Our experience - way from Simulink to Modelica:
We have many years used Matlab/Simulink platform as a main simulation tools. In Simulink we have developed an extensive physiolibrary (http://patf-biokyb.lf1.cuni.cz/wiki/projekty/physiolibrary) and model that is in the core of our Golem simulator (its first version is described here http://cmbi.bjmu.edu.cn/news/report/2001/medinfo_2001/Papers/Ch12/919_Kofranek.pdf ). We have been interested in using simulation in biomedical education for explaining complex physiological regulations – see http://www.physiome.cz/atlas/info/00EN/index.htm. We are designing a special Atlas of physiology and pathophysiology www.physiome.cz/atlas see paper: http://patf-biokyb.lf1.cuni.cz/wiki/_media/clanky/atlas_of_physiology_and_pathophysiology.pdf?id=wiki%3Auser%3Aseznam_publikaci&cache=cache
The Atlas is a combination of two main domains. One is multimedia presentations and the second are simulators or simulation games. The aim is to combine theoretical knowledge with a simulated experience. At this time, most of the Atlas is not translated to English, but it is a matter of time (and, we hope, cooperation with others). We sought the tools for design and implementations of mathematical models (Simulink/Matlab and nowadays Modelica) and the tools for designing e-learning tools and educational simulators (Adobe Flash, .NET tools like Microsoft Visual Studio or special tools for visualization of Industrial measurement and control systems – e.g. Control Web ). In connection with it we needed the tools for easy conversion of verified simulation models (e.g. written in Simulink) into core of educational simulators (e.g. written in C#). We have designed a special wizzards that help us to solve this problem – see http://patf-biokyb.lf1.cuni.cz/wiki/_media/clanky/development_of_web_accessible_medical_simulators.pdf?id=wiki%3Auser%3Aseznam_publikaci&cache=cache.
Year ago we have switch to Modelica. Unlike block oriented approach in Simulink, Modelica offers describing a model using net of equations. It is more clear then complicated block schemes in Siumulink.
Especially in the large physiological models Modelica is the tool that bring more understandable notation of model, than others simulation tools. E.g. – it may be demonstrated to comparison of implementation of old Guyton model in Simulink (http://dsp.vscht.cz/konference_matlab/MATLAB07/prispevky/kofranek_rusz/kofranek_rusz.pdf ) and in Modelica.
Modelica is standardized programming language, so we can write models that can be solved using commercial (Dymola or MathModelica) or noncommercial (Open Modelica) tools.
Now we have concentrated into one platform for designing of simulation models and educational simulators – Modelica and .NET environment.
Our aim in this area is to translate the mentioned QHP model and our physiolibrary into Modelica. Both are originally written in a "block oriented way" and it is a challenge for us to show the unique properties of Modelica language when properly modeling in physical manner.
Side by side with the translation of the QHP model and physiolibrary into Modelica, we want to develop a Physiological Modelica Library and give it open source to the Modelica community.
Modelica .NET open source project
- There is a long tradition in our lab with .NET as the target platform for simulation applications. Nowadays it seems even more interesting because of new bits like WPF and Silverlight that are a great graphical frameworks/platforms that can be used for graphically rich simulation games for education. Namely Silverlight will be used for simulators embedded into web pages. This will significantly simplify deployment, usability and portability (Silverlight runs on Win/Mac and its clone Moonlight runs on Linux). However, the ability to run in-browser has a non-trivial downside because all the code has to be managed due to security reasons (we used to run our Simulink models natively/unmanaged with full .NET previously, but this is not possible since the browser security sand-boxing). We have decided to sacrifice some performance penalty and the troubles connected with full managed .NET targeting in favour of the advantages of portability and usability.
-We have done some successful tests with retargeting the OMC to C# with some simple models (e.g. simple ODE model of blood circulation) and it gave us a real hope to be able write a model in Modelica and get its runnable representation in .NET. Our working copy of OMC was tweaked to produce C# simulation code. At this time, it works only for models without events and there is a limited support for functions, but it is good enough to get a model simulation code to .NET in a semi-manual manner.
Then, we have started to leverage the new .NET language F#, that is a perfect match for our .NET coding needs. To try it out properly, the IDA solver from SUNDIALS was translated to F# that will be the main part of our .NET simulation runtime for more complex models or just as an equivalent to DASSL solver to enable future whole .NET Modelica modelling (the F# IDA is not yet fully tested now, but coming soon).
As our passion for Modelica and the new graphical capabilities of .NET continued, we realized that it would be a great challenge to develop a Modelica graphical editor that can be run in-browser (Silverlight).
It will have a client/server architecture that will enable, for example, on-line collaborative modelling in Modelica. Models and libraries will be stored on the server in an SVN repository.
This project was already launched at the Charles University in Prague, Faculty of Mathematics and Physics as a master degree student's project (four students, http://www.codeplex.com/ModelicaEditor).
http://patf-biokyb.lf1.cuni.cz/wiki/modelica.net
Our Goals for next year:
1. Implement the large physiological models in Modelica – especially QHP. We will be use Dymola implementation of Modelica. The results of our work we will shared in this Modeling Workshop Group
2. Develop the Modelica .NET environment (as open source, as a part of Open Modelica project) – and tested this tool using our Modelica models designed by means of commercial Dymola and developed multimedia in-browser educationals simulators using Silverlight and .NET.