Functional Hybrid Modelling

Lead Research Organisation: University of Nottingham
Department Name: School of Computer Science

Abstract

Modelling and simulation plays an increasingly important role in the design,analysis, and implementation of real-world systems. Examples includeelectronic circuits, VLSI layout, chemical processes, manufacturing plants,weather prediction, biological processes, mechanical devices, traffic control,network congestion, and so on. Modelling and simulation efforts are sopervasive that specialised software tools have been designed to support them.Although such tools greatly facilitate software development, there isconsiderable room for improvement. In particular, to cope with the everincreasing size and complexity of models, it is of key importance is that theypromote modularity and facilitate reuse.The so called non-causal modelling languages are one recent development withthat aim. These languages are declarative in that they allow the modeller tofocus more on what to model and less on how to express the model forsimulation purposes. The result is models that are much more modular andreusable than those developed using the earlier causal techniques.Modularity and reuse is, of course, central to all programming paradigms.Modern declarative languages, in particular functional ones, have been verysuccessful in that respect thanks to powerful abstraction facilities andsophisticated type systems. However, these developments have largely gone byunnoticed in the modelling community. Earlier work on Functional ReactiveProgramming (FRP) has demonstrated the benefits a modern functional languagecan offer in the context of causal modelling by promoting higher-orderprogramming techniques and giving key simulation abstractions first classstatus. In particular, it was shown how this enabled hybrid modelling ofsystems with highly dynamic structure.As these benefits are complementary to those offered by non-causal modellinglanguages, it is highly desirable to merge the two approaches. That is thegoal of this project. The resulting approach to non-causal modelling is calledFunctional Hybrid Modelling (FHM). FHM will yield a non-causal modellinglanguage that not only makes the benefits of modern declarative languages withsophisticated type systems available to the non-causal modelling community,but also advances the state-of-the-art of non-causal hybrid modelling bysupporting modelling of highly dynamic systems.The key objectives are:* Integrating non-causal modelling capabilities into a modern functional language by giving first class status to model fragments and providing suitable language mechanisms for their composition.* Adding hybrid modelling capabilities to this language through a mechanism to switch between structural configurations that are computed at the time of switching, as opposed to being statically enumerated as is required by current mainstream non-causal languages.* Designing a type system for this language that helps ensure the correctness of models by enforcing important domain-specific invariants, such as the number of variables and model equations being equal, and physical dimensions being used consistently.
 
Description The project demonstrated that first-class models combined with support for highly structurally dynamic systems is feasible and offers advantages for modelling common hybrid systems in a more declarative manner as well as modelling system significantly beyond the capabilities of present approaches. Moreover, it demonstrated that Just-In-Time compilation allows for efficient simulation, and that some of the key design and implementation ideas in principle can be adapted to work with current industrial-strength languages for non-causal modelling and simulation, such as Modelica.
Exploitation Route Languages and tools that advances the state of the art of non-causal modelling and simulation of hybrid systems has applications across a large number of industrial sectors. Current sectors that have seen significant use of non-causal modelling languages include the automotive industry, the energy sector, robotics. These languages are particularly useful for applications spanning multiple physical domains, such as electrical, mechanical, thermo-hydraulic.
Sectors Aerospace/ Defence and Marine,Digital/Communication/Information Technologies (including Software),Education,Electronics

 
Title Hydra 
Description Haskell-embedded domain-specific language implementing the ideas of Functional Hybrid Modelling 
Type Of Technology Software 
Year Produced 2012 
Open Source License? Yes  
Impact Demonstrated the feasibility of modelling truly structurally dynamic systems while maintaining computational efficiency through JIT compilation. This has generated interest in the object-oriented modelling community; e.g., commercial languages like Modelica struggle with this. 
URL https://github.com/giorgidze/Hydra
 
Description Keynote address DSL 2009 
Form Of Engagement Activity Scientific meeting (conference/symposium etc.)
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Participants in your research or patient groups
Results and Impact Keynote speaker at IFIP Working Conference Domain-Specific Languages (DSL) 2009 in

Oxford (~50 participants).

Functional Programming Gets Physical: Pushing the Boundaries of Non-Causal Modelling Languages (Keynote Talk, IFIP TC 2 Working Conference on Domain-Specific Languages (DSL) 2009, Oxford, UK, 16 July 2009)



http://www.cs.nott.ac.uk/~nhn/Talks/DSLWC2009-FPGetsPhysical.pdf
Year(s) Of Engagement Activity 2009
URL http://www.cs.nott.ac.uk/~nhn/Talks/DSLWC2009-FPGetsPhysical.pdf