Skip to main content
European Commission logo print header

Modelica Model Library Development for Media, Magnetic Systems and Wavelets

Final Report Summary - MOMOLIB (Modelica Model Library Development for Media, Magnetic Systems and Wavelets)


Executive Summary:

Objective:

The modelling language Modelica and libraries based upon it are excellently suited for model-based design of future aircraft systems, e.g. more electric aircraft or sustainable air-conditioning systems. To improve the efficiency and application range of Modelica for such specific design tasks, the objective of the project MoMoLib was to develop or extend Modelica libraries for media models, electromagnetic devices and wavelet analysis. MoMoLib stands for Modelica Model Library Development for Media, Magnetic Systems and Wavelets and the work has been done by a consortium of three partners.

Work performed and achieved results:

Technische Universität Dresden, where the Modelica.Magnetic.¬FluxTubes library was originally developed, has extended this library with magnetic hysteresis models. Computation of static (ferromagnetic) and dynamic (eddy current) hysteresis now allows for accurate estimation of iron losses and hence, e.g. for subsequent simulation of heating. This becomes increasingly important with the growing requirements regarding energy efficiency and mass power densities during the design process of electromagnetic components and systems. In addition, models for one- and three phase transformers have been developed. Compared to simple transformer models already included in the Modelica Standard Library, the developed models include the transformer’s magnetic subsystem and hence consider saturation, remanence and core losses. A material library allows for simple adaption of the hysteresis elements to a specific material characteristic. That material library is mainly based on in-house measurements, contains hysteresis characteristics of different steel sheet qualities and cobalt-iron alloys, and is included in the Modelica.Magnetic.-FluxTubes library extension. The hysteresis elements and transformer models developed within MoMoLib have been successfully validated with in-house measurements.

XRG Simulation GmbH implemented two fluid property models, one for R134a and one for humid air, into a new Modelica library called MoMoLib. The models make use of interfaces provided by the Modelica.Media package (part of the Modelica Standard Library issued by the Modelica Association). Thus, the fluid property models can be used by any thermo-hydraulic Modelica model which refers to this interface specification.

The R134a model refers to Tillner-Roth’s fundamental equation of state and further models for dynamic viscosity, thermal conductivity and surface tension. The humid air is modeled as an ideal mixture of real gases including liquid water, steam and ice formation and dissociation. As a byproduct a separate model for air as a real gas has been implemented which can be used independently. All models were validated comparatively with software implementations of the corresponding references (RefProp and LibHuAir). Deviations were in general smaller or much smaller than 1%. The models have been integrated into Modelica Standard Library 3.2.1 and will be further exploited by XRG in the commercial XRG Media library.

Technische Universität München has developed a comprehensive Modelica Wavelet library for capture, identification and analysis of processes. This library provides new signal processing methods for analysis, reconstruction and modelling of signals, which will improve the power quality assessment in physical systems, e.g. in electrical systems of aircraft. The Modelica Wavelet library includes fifteen commonly used wavelet families. It provides functions for continuous wavelet transform, forward and inverse discrete transforms, and multi-level decomposition and reconstruction in one-dimensional space. In addition, special application tools for multi-resolution analysis and wavelet denoising are provided. Moreover, example models have been implemented to provide the users a quick start point to build up their own algorithms.

Project Context and Objectives:

Within the MoMoLib project model libraries for electromagnetic components, media and wavelet analysis for the modern and powerful model description language Modelica should be developed. These new and extended libraries shall contribute to an adaption of the Modelica language to the needs of research and development especially in the field of aircraft, e.g. more electric aircraft and sustainable air conditioning systems. The project is defined by three main objectives, each being realized by one of the three partners of the consortium. These objectives are summarized in the following.

 Objective 1: Extension of the Modelica.Magnetic.FluxTubes library (Technische Unverisität Dresden): Development of an extended and improved Modelica.Magnetic.FluxTubes library, which provides static and dynamic hysteresis models, transformer models and other electromagnetic devices, e.g. permanent magnets. Additionally it should also contain a material library of common magnetic materials, which is based on own measurements.
 Objective 2: Modelica Media library (XRG Simulation GmbH): A media library for tetrafluorethane and humid air should be developed, which provides all functions specified by the corresponding media interfaces (Modelica.Media.Interfaces.PartialTwoPhaseMedium) and by the media model (moist air), respectively.
 Objective 3: Modelica Wavelet library (Technische Universität München): Development of a Modelica wavelet library, which contains Modelica blocks and functions for continuous, discrete and reverse wavelet transformation of signals during simulation. Typical extended methods for data analysis based on wavelet transformation should be included as well as an interactive tool for off-line data analysis, different types of wavelets and the possibility to create user-defined wavelet functions.

The Objectives are explored in more detail below.

Objective 1: Extension of the Modelica.Magnetic.FluxTubes library

The Modelica.Magnetic.FluxTubes library included in the Modelica Standard Library is intended for rough design and system simulation of magnetic components and devices. This library is based on the well-established concept of magnetic flux tubes which enables modelling of electromagnetic devices with lumped networks. Before the completion of the project, ferromagnetic hysteresis has not yet been considered in that library. However, the prediction of losses due to static (ferromagnetic) and dynamic (eddy current) hysteresis becomes increasingly important during the design process of electromagnetic components. This is due to the increasing demands on energy efficiency and power densities of electromagnetic systems. Prominent examples for this engineering trend are electromobility and more electric aircraft, where the necessity of high mass power densities and loss power minimisation are obvious. Exactly this issue has been addressed with the MoMoLib project. Within the project the FluxTubes library should be extended by components which account for the static and dynamic hysteresis behavior of magnetic materials. Based on an analysis of different published static hysteresis models, selected models should be implemented in Modelica, tested and evaluated with regard to the applicability for electromagnetic lumped network simulation including simplicity, robustness, computational speed, configurability and accuracy. These static hysteresis models should be combined with an approach to also account for dynamic hysteresis effects caused by eddy currents. An automated measurement setup according to the standards DIN EN 6040-2/4/6 should be designed and built to characterize the hysteresis behavior of ferromagnetic material samples. Parameter identification and fitting algorithms should be implemented to fit the parameters of the implemented hysteresis models to the measured data. The found parameters sets should be the basis for a material library of selected common soft magnetic materials, which should be provided with the library extension. Based on the developed hysteresis flux tube elements, transformer models of typical single- and three-phase transformer topologies should be implemented. The models shall enable rough dimensioning of transformers (core geometry, winding parameters) and estimation of ohmic and core losses. Internal model properties like winding resistance should be automatically calculated from the model geometry.

Objective 2: Modelica Media library

A Modelica media library for tetrafluorethane and humid air should be developed, which provides all functions specified by the corresponding media interfaces (Modelica.Media.Interfaces.-PartialTwoPhaseMedium) and by the media model (moist air), respectively. The implementated library functions should be validated comparatively against software (RefProp 9.0 and FluidDYM LibHuAir). The software should be provided under the Modelica License 2.0 and the integration into the Modelica Standard Library 3.2.1 was planned.

Objective 3: Modelica Wavelet library

The third main objective of the project MoMoLib was development of an open-source wavelet library. The library should contain all basic wavelet transform functionalities including different wavelet family functions, discrete, inverse and continuous wavelet transform, wavelet denoising and customized presentation and visualization of data with interactive functionality. The realization of this library should facilitate Modelica with a new tool for signal and data processing. This should expand the application field and the usability of Modelica. In addition, this general library should release the Modelica users from developing their own wavelet algorithms for their specific applications. This shall drastically reduce the repeat efforts in the scientific and technical society, and thus improve efficiency.

Project Results:

At the end of the project three independent new or extended Modelica libraries are available: the extended Modelica FluxTubes library, a new Media library and the new Wavelet library. The FluxTubes and Media library will be integrated into the Modelica Standard library with one of the next releases of that library. The Modelica Standard Library is open source, free to all and distributed together with all software that uses the Modelica language. The Wavelet library, also open source, is available as a standalone library. Overall, this project has considerably expanded the capabilities of Modelica especially in the field of Modelica-based design of future aircraft systems, e.g. more electric aircraft and sustainable air conditioning systems. Since these extensions are freely available to all, the whole Modelica community can benefit from it. A summary of the main results from research and development, structured according to the individual work packages is given below.

Extension of the Modelica.Magnetic. FluxTubes library:

Several published static ferromagnetic hysteresis models have been analysed with respect to their utilization in lumped magnetic network simulations. From the analysed models the Tellinen and the Preisach hysteresis model have been selected for implementation in Modelica. The simplicity of the Tellinen hysteresis model promises robust and fast computing models, which is important for the successful implementation of dynamic hysteresis behavior or the utilization of several of such elements in more complex models, e.g. in three-phase transformers. Although the Preisach model is much more complex than the Tellinen model and its successful implementation in Modelica regarding stability, computational effort and simulation time was uncertain within the course of the project, it was decided by the topic manager that the Preisach model should also be implemented due to its higher accuracy and wide acceptance in the field of ferromagnetic hysteresis modeling.

Both models have been successfully implemented into lumped flux tube elements, which are compatible to the Modelica.Magnetic.FluxTubes library. To adapt these models to a specific material behavior (ferromagnetic hysteresis shape) four different methods have been realized. The first two methods are simple shape functions based on hyperbolic tangent functions specifically tailored to soft-magnetic or hard-magnetic material behavior. Both shape function approaches can be easily configured by only four meaningful parameters. These methods only allow for simple hysteresis shapes but the configuration is very simple and the resulting models are robust and fast. In the third method the hysteresis shape is defined with table data. This enables the use of almost arbitrary hysteresis shapes and the direct adaption e.g. to measurement data. The fourth method uses a special form of the Everett function to define the hysteresis behavior. Only this function allows an effective application of the Preisach hysteresis model. This function is parameterized with seven parameters and defines not only the hysteresis envelope curve but also the behavior of minor hysteresis loops. Together, these methods cover a wide range of possible applications. The static hysteresis models have then be combined with an approach to consider also the dynamic hysteresis caused by eddy currents. In this approach the dynamic hysteresis is computed based on the change of the magnetic flux density in the magnetic core and considers the thickness and the electrical conductivity of individual steel sheets. The computation of the transient flux density and magnetic field strength facilitates the accurate computation of instantaneous iron losses independently of the waveform of the excitation voltage. A conditional heat port has been added to the developed elements for an easy connection of the hysteresis elements to a thermal network model based on the Modelica.Thermal.HeatTransfer library. Subsequently, the hysteresis elements have been tested and optimized with regard to numerical stability, computational speed and user-friendliness. Since a material database of different magnetic materials should be provided with the library extension and hysteresis material data is hardly available, a measurement setup according to DIN EN 60404-2/4/6 has been built. It allows the automated measurement of static and dynamic hysteresis loops. Usage of the high-precision and drift-compensated fluxmeter EF5 from Magnet-Physik for secondary voltage integration ensures accurate measurements. For the material database the static hysteresis envelope loops of magnetic steel sheets of different quality and thickness have been measured. The measured data have been processed and integrated into the new material package FluxTubes.Material.HysteresisTableData. In contrast to the Tellinen hysteresis element, the Preisach element cannot be configured with table data. Instead, it uses a set of seven parameters for the definition of the Everett function. These parameters cannot be identified analytically. For this reason a parameter fitting tool has been programmed using Matlab/Guide. The tool has a graphical user interface, allows for loading of hysteresis reference curves, e.g. from measurements, and uses unconstrained non-linear optimization algorithms for identification of suitable parameter sets. This tool simplifies the provision of an additional material package FluxTubes.Material.HysteresisEverettParameter for the Preisach hysteresis element. Based on the developed hysteresis elements, elements for modeling permanent magnets and models for single- and three phase transformers have been derived. Since the implemented permanent magnet model also considers ferromagnetic hysteresis, even demagnetization processes can be considered during simulation. The transformer models can be widely configured (e.g. core geometry, winding parameters, stray flux, core material) and thus easily be adapted to specific needs. Compared to simple transformer models already included in the Modelica Standard Library, the developed models include the transformer’s magnetic subsystem and hence consider saturation, remanence and core losses. This allows for accurate simulation of saturation effects, inrush currents due to initial flux densities and, most important, the computation of transformer losses. The transformer losses are composed of ferromagnetic hysteresis and eddy current losses and even the omic losses of the windings are automatically considered. For a thermal analysis, the generated losses can directly be transferred via a conditional heat port to a thermal network model.

To verify the developed hysteresis elements and transformer models, several experiments have been carried out. Additional measurements, covering various magnitudes, frequencies and waveforms of the exciting voltage of a magnetization winding as well as different core materials and load cases, were carried out. These experiments have also been modelled and simulated using the developed hysteresis and transformer models. Additionally, simulation results have also been compared to steel sheet datasheets. By comparison of measured data, simulation results and data sheet specifications, the correct behavior of the models and a high accuracy over a wide range of magnetic flux densities and frequencies have been demonstrated.

A comprehensive user’s guide, a documentation of each new library element within its built-in documentation layer and simple example models assist the user in understanding the library and in developing own models.

A final version of the extended FluxTubes library has been delivered. The library is compatible to the Modelica Standard library 3.2 and will be integrated in one of the next release versions of the Modelica Standard library.

Modelica Media library:

At first, a suitable specification of a medium model for humid air had to be selected. It was decided to continue with an ideal mixture of real gases to achieve the highest possible accuracy for a broad range of air states. The ideal mixture of real gases is finally represented by a mixture of dry air as a real gas and a full representation of water steam and ice (from IAPWS). The range for the detailed humid air model is 143.15 to 2000 K and 611.2 Pa and 10e6 Pa. These models are also implemented in the FluidDYM LibHuAir software from the University Zittau/Görlitz which has been used to verify the MoMoLib property model.

For tetrafluoroethane (R134a) the required specification of Tillner-Roth has been implemented. Furthermore, functions for dynamic viscosity, thermal conductivity and surface tension were added to comply with the Modelica.Media specification (as a part of the Modelica Standard Library 3.2 issued by the Modelica Association) for two-phase media. For verification of the Modelica models the RefProp 9.0 software offered by the National Institute of Standards and Technology (USA) was applied since it contains the corresponding fundamental equations published by Tillner-Roth (1994).

In the course of the development of the media library it was found that for the humid air model the existing Modelica.Media interface for ideal condensing gases was not suitable. Thus, a new interface was developed for real condensing gases.

The mixture of real gases makes use of separate models for air, steam, ice and liquid water. Air properties are modelled by a fundamental equation according to Lemmon et al. Water steam and ice properties are detailed by the International Association for the Properties of Water and Steam (IAPWS). In parts the functions of the Modelica.Media.Water subpackage for the IAPWS/IF97 standard were applied and verified. For temperatures below 273.15 K and for ice additional Modelica functions were implemented with regard to IAPWS95 and IAPWS09.

An important part of the work was the creation of inverse functions for the fundamental equations to allow for other input arguments than the designated ones (reduced density and reduced temperature). This need is explained by thermo-hydraulic models which usually specify derivatives like pressure, specific enthalpy and mass fractions as effective states selected for the integration. Moreover, those inverse functions are used during initialization of thermo-hydraulic systems with other thermodynamic states.

The separate dry air model is provided explicit for pressure and specific enthalpy, pressure and temperature and density and temperature. Moreover, each model contains a routine to calculate thermodynamic states from pressure and specific entropy which is used to calculate isentropic transformations (e.g. required by turbine and compressor models).

The humid air model is explicit for pressure, temperature and mass fraction of water.

R134a was modelled explicit for pressure and enthalpy. Inverses for pressure and temperature are not included since this combination of states is ambiguous for specific enthalpy, density and more in the two-phase region.

The software FluidDYM LibHuAir from the University Zittau/Görlitz was used to validate the implementation of humid air. A range from -60 °C to 350 °C and 0.1 bar to 100 bar was scanned for the absolute humidity values between 0.001 and 0.5 kg water per kg dry air. Only for high absolute humidities xi the average deviations of the dynamic viscosity were above 1%.

After the validation, verification calculations have been conducted with 4 models. In each case the results obtained from the new MoistAir model were compared with those received from the Modelica.Media.Air.MoistAir model (ideal mixture of ideal condensing gases). It was found that the accuracy of the model is significantly higher for temperatures outside the range of 240-400 K and pressures higher or lower than atmospheric pressure. Furthermore, transport properties take the influence of humidity into account which is not the case for existing ideal mixture of ideal gases. The range for the detailed model is 143.15 to 2000 K and 611.2 Pa and 10e6 Pa. The much higher accuracy is achieved by complex numerical models which require more computation time than for the simpler ideal gas mixture approach already available from Modelica Standard Library.

The validation of R134a was carried out for discrete temperatures between -40 to 200°C (in steps of 10°C). The temperatures were used as inputs for the calculation of specific enthalpies together with a logarithmic pressure grid between 1 and 104 bar. The obtained pressure and enthalpy table was further used as an input to all property functions of the library. The Dymola result was compared to the values calculated from RefProp. The maximum deviations are in general much smaller than 1% except for the dynamic viscosity and thermal conductivity (which is relying on dynamic viscosity). This can be explained by a non-published modelling approach in the reference implementation.

The R134a package was verified successfully with 5 steady-state transient simulation models. After the validation of the models a final library was delivered which was compatible with Modelica Standard Library 3.2. Since the Modelica Association decided to integrate the models into the recent release of the Modelica Standard Library 3.2.1 a migration to that version was conducted. The result is available as a part of MSL 3.2.1. The result of the comparative validation with software was detailed in a verification report.

Modelica Wavelet library:

The wavelet library is developed according to the Modelica Language Specification 3.2 and using the simulation environment software Dymola 2013 (32-bit). The final Modelica wavelet library includes the following features:

- fifteen wavelet families,
- continuous transform,
- discrete forward and inverse transforms,
- multi-level decomposition and reconstruction,
- multi-resolution analysis,
- denoising and data compression,
- user friendly graphic user interface (GUI),
- importing simulation data from the hard disk,
- and the library is fully open source under the Modelica License 2.

Nevertheless, it has to be noted that the first release version of the library has the following limitations:

- only one-dimensional transformations are implemented yet,
- only post-processing is possible (algorithms cannot execute in real time yet),
- the data to be analyzed must have equidistant time grids,
- and the library is developed and tested using Dymola 2013 demo version.

Besides the Modelica Standard Library, the full performance of this library relies on two further libraries, the library Modelica_LinearSystem2 and the library Plot3D. The former one is a free library available from Modelica Association. The latter one is delivered with Dymola and is only used for visualizing Continuous wavelet transform (CWT) results within the wavelet library. In detail, the whole library is composed of eight packages and 64 single classes, plus an external C-file to support generating Meyer wavelets.

Overall, the following fifteen wavelet families have been implemented and included in the library:

- Haar,
- Daubechies (up to the 20-th order),
- Symlets (up to the 20-th order),
- coiflets (up to the 5-th order),
- biorthogonal spline (15 variations),
- reverse biorthogonal spline (15 variations),
- discrete Meyer,
- Meyer,
- Gaussian (up to the 8-th order),
- Mexican hat,
- Morlet,
- complex Gaussian (up to the 8-th order),
- complex Morlet ,
- complex Shannon,
- and complex frequency B-Spline (unlimited order).

Five variations of one-dimensional wavelet transform have been implemented in the library. Continuous wavelet transform (CWT) is provided with two variations for more flexibility. One CWT variation accepts a wavelet name while the other one accepts a wavelet function as the input parameter. According to the wavelet theory, no inverse transform exists for general CWT. For the discrete version, both forward and inverse wavelet transforms are possible. They are realized with two Modelica functions. In the discrete domain, the multi-level data decomposition and the reconstruction are carried out by actually applying the discrete wavelet transform and inverse transform in a cascaded manner.

The wavelet library additionally provides two applications, the wavelet multi-resolution analysis (MRA) and the wavelet denoising, which are supposed to be the most frequently used functionalities for processing simulation data. With wavelet MRA, the user is able to divide the signal into different scales or frequency regions and observe the signal with different resolutions. Using different Modelica functions, users can get the MRA results either in the numeric form or in the graphic form with curves. In addition, this tool provides the flexibility to tune the coefficients of every single level, so that the user can intentionally strengthen or suppress the information in some certain levels.

Like MRA, the wavelet denoising is carried out based on wavelet multi-level decomposition and reconstruction. The wavelet denoising is suitable only for data with high signal-to-noise ratio. Based on this condition, the wavelet coefficients representing the noise have smaller values compared with those representing useful information. By removing these small coefficients, the noise can be eliminated from the data. The threshold to separate the noise and the information coefficients is the key to this algorithm. It can be selected by the user or automatically estimated by the tool. As an additional possibility, data compression can be realized by the denoising application tool, since these two operations are actually based on the same algorithm.

A graphical user interface (GUI) is important for a user-friendly environment in this library. The GUI is mainly realized by using Modelica “Types” combining the simulation environment software for inputs and diagrams for outputs. By combining the GUIs for input and output, a very simple but convenient interactive operation is possible. It is also possible to realize more complex and user-friendly interactive performance using specific scripts written by users.

A complete User’s Guide in PDF format with a detailed description of every single class in this library is delivered with the release version. In addition, a “Help” folder is included in the delivered library. This folder contains HTML files with hyper-links. Additionally, a related description of all implemented Modelica classes, including packages, models, functions, types and records, has been directly embedded in documentation layer of the library. These descriptions can be easily accessed from within the simulation environment software. Hyper-links are included in the descriptions for quick navigation between different classes. The comprehensive documentation and the provided applications and exemplary models facilitate the each user to get started quickly.

Potential Impact:

The main results of the MoMoLib project (Modelica Model Library Development for Media, Magnetic Systems and Wavelets) are three independent, open-source and freely available Modelica libraries. These libraries considerably expand the application range of the modern object-orientated model description language Modelica, especially in the field of media, magnetic systems and wavelets. The addressed application fields play an important role in the Modelica-based design of future aircraft systems, e.g. more electric aircraft and sustainable air conditioning systems. The developed hysteresis elements of the FluxTubes provide new functionality for the development of high-efficiency, high-power density electromagnetic machines and transformers. For example, they allow for the first time to accurately consider magnetic hysteresis losses during Modelica-based simulation of electromagnetic devices.

The new media library provides media models for R134a with enhanced accuracy and an extended range of validity. This considerably enhances the capabilities of Modelica in the field of heating, ventilation and air conditioning. The application of that library is by far not limited to the aviation industry. The models are also of great interest in other application fields where media models for R134a are required, e.g. and above all the automotive industry.

In more electric aircraft the proper functionality and reliability of power electronic circuits and networks are of overriding importance. The new wavelet library delivers new approaches for the early stage fault detection in power-electronic circuits and provides lots of functions for failure analysis and data-visualization for such investigations. Thus, the library can considerably contribute to the reliability and safety of power-electronic systems.

Since all the developed Modelica extensions are published under the Modelica license 2.0 and are thus free to everyone, the whole Modelica community can benefit from these extensions. Additionally, the new Media and FluxTubes libraries will soon be integrated into the Modelica Standard Library (MSL). Since the MSL is the basis of all Modelica-based software environments, the new libraries will be distributed as part of the MSL with any Modelica simulation software.

Already during the course of the project the current work status of the FluxTubes library and the Wavelet library development have been introduced and presented to the Modelica community on the 9th Modelica conference (Munich, Germany, Sept. 2012) by means of two oral presentations and corresponding articles in the conference proceedings [1, 2]. For the next Modelica Conference (Lund, Sweden, May 2014) the presentation of the final results is also planned. The corresponding articles [3, 4] have already been submitted and are currently under review.

[1] J. Ziske and T. Bödrich, Magnetic Hysteresis Models for Modelica, Proc. of 9th Int. Modelica Conf., pp 151-158, Munich, Germany, Sept. 3-5, 2012
[2] J. Gao, Y. Ji, J. Bals and R. Kennel, Fault Detection of Power Electronic Circuit using Wavelet Analysis in Modelica, Proc. of 9th Int. Modelica Conf., pp 513 – 521. Munich, Germany, Sept. 3-5, 2012.
[3] (currently under review) J. Ziske and T. Bödrich, Modelica Models for Magnetic Hysteresis, Materials and Transformers, 10th International Modelica Conference, Lund, Sweden, March 10-12, 2014.
[4] (currently under review) J. Gao, Y. Ji, J. Bals and R. Kennel, Wavelet library for Modelica, 10th International Modelica Conference, Lund, Sweden, March 10-12, 2014.

List of Websites:

Extension of the Modelica FluxTubes Library (Technische Universität Dresden)

Modelica and the Modelica Association

www.modelica.org

Thomas Bödrich(1)

Thomas.Boedrich@tu-dresden.de

Johannes Ziske(1)

Johannes.Ziske@tu-dresden.de

(1) Dresden University of Technology (www.tu-dresden.de)

Faculty of Electrical Engineering and Information Technology (http://www.et.tu-dresden.de/etit)

Institute of Electromechanical and Electronic Design (www.ifte.de)