Multi-Domain Modeling Based on Modelica

. With the application of simulation technology in large-scale and multi-field problems, multi-domain unified modeling become an effective way to solve these problems. This paper introduces several basic methods and advantages of the multidisciplinary model, and focuses on the simulation based on Modelica language. The Modelica/Mworks is a newly developed simulation software with features of an object-oriented and non-casual language for modeling of the large (cid:712) multi-domain system , which makes the model easier to grasp , develop and maintain.It This article shows the single degree of freedom mechanical vibration system based on Modelica language special connection mechanism in Mworks. This method that multi-domain modeling has simple and feasible, high reusability. it closer to the physical system, and many other advantages.


Introduction
With the development of science and technology ,product design is becoming more and more complicated.Sophisticated product design not only involves multiple areas but also updates frequently.Therefore, in the modern industry, the simulation modeling technology plays an increasingly important role.
Generally, complex products is the product of cross subject, which will be involved in multiple areas, such as electronics, control, software, machinery, etc.Most traditional modeling software supports only a single field of modeling and simulation.In recent years, there are some solutions for multidisciplinary modeling, such as multiple domain modeling based on interface and modeling based on high level architecture [1], but these are more or less the problems.Through multidisciplinary modeling for complex product design, it not only be modeled in all areas, also need a lot of coordination simulation in the overall system level, it has brought a lot of difficulties for simulation modeling of complex product.
Multidisciplinary modeling (multi-domain modeling) is a model of different disciplines assembled into a larger simulation model.These areas generally relates to mechanical, control, electronic, hydraulic, pneumatic and other.It developed from a single to multi-domain modeling ,discrete modeling in continuous or discrete domain to hybrid modeling [2], eventually developed into the stage of object-oriented modeling.

The solutions of multiple domain modeling 2.1 Interface-based modeling method
It is the modeling method based on interface that when project is involved in different fields, to modeling it in the professional software of corresponding areas, then use the software provided interfaces between interaction to joint simulation.In this way, the modeling mainly focus on the real-time performance and stability of the data transmission in the interface.This presents the following questions: First, It must be such an interface between software.Second, the interface development is often a private company.There is no uniform standard, and do not open to the public.It's a heterosexual strong and difficult expansion upgrade.

HLA-based modeling method
The method that HLA (High Level of Architecture) multi-domain modeling is the Defense Modeling and Simulation Office proposed in 1995.This method that made use of HLA agreement is mapping output variables of model A to input variables of model B .This modeling method also has some problems: First, it does not solve the problem of multi-domain modeling fundamentally.It's just improved and enhanced to a method of interfacebased.Component model of different areas is still simulating in corresponding simulation software.Second, different simulation software need to write specific code in order to achieve the response configuration.Thus, the problem becomes complicated.The method that based on the Unified Modeling Language [3] solve the problems caused by the other two methods.It does not need to design additional interfaces for the different simulate software.It solves the problem caused due to the interdisciplinary modeling.In multidomain modeling based on unified language, all models by the same language, so that the form of consistency can be achieved.Coupling between different areas become better.

The modeling method based on the unified language
The most representative multi-domain unified modeling language called Modelica [4].Modeling by Modelica thought focus on knowledge which can be accumulated, reusable and reconfigurable.Excellent properties of Modelica language makes it have an advantage in other multidisciplinary modeling methods.It will inevitably become the mainstream of multidisciplinary physical system modeling method.

Multi-Domain modeling based on the modelica 3.1 Modelica language modeling thought
Modelica is a new kind of Modelica language.It contains a variety of advanced modeling theory.The basic principle of Modelica can describe multi-domain domain model is: it is based on energy conservation, use of mathematical equations to describe the model.It obey the kirchhoff's law.In general kirchhoff's law, the physical system is regarded as energy system composed of components with a port.The energy transfer between components is described by flow variables and the potential variables.Modelica language has some characteristics, such as Object oriented modeling, noncausal modeling and narrative modeling.

Object-oriented modeling
The real world is composed by various objects with their own internal state and movement.Modelica language uses the class as the basic unit.Class includs variables, equation and members of the class.Variables represent attributes of the class.Equations represents behavior of the class.Class through variety of ways to build the system model, such as inheritance and component connections.

Non-causal modeling
Characteristics of non-causal modeling idea is to use mathematical modeling equations to describe the behavior of physical objects and attributes.It has the advantage that when defining equation does not need to solution of the equation are given.This can greatly reduce the difficulty of modeling.Further, the modeling time is also reduced.

Narrative Modeling
Narrative modeling focus on description of physical objects.It focus on the following two parts: to describe the attributes and behavior of the object itself; to Describe the physical laws object by mathematical equations .Describes the behavior of the object is to describe the interactive interface between the objects.Modeling using this method, the topological structure and physical structure of the model are consistent.
In the Modelica, with the aid of connectors, components implemented data exchange with each other, as shown in Fig. 1.In the process of simulation, the component can use the connector to achieve communication with the other components.Take for example a RLC circuit, which embodies the characteristics of interface in Modelica.In modelica language, it is implemented using a connector, as shown in Fig. 2.

The characteristics of Modelica language modeling
Modelica is developed by Modelica association that is a nonprofit organization in Sweden.It is an object-oriented language suitable for large-scale modeling of complex physical systems and it is free to use.Using Modelica to (1) Using Modelica to build a model based on their physical structure, especially suitable for Hardware-inthe-loop simulation and embedded control systems.
(2) In the Modelica language, mathematical model is differential equations, algebraic equations, and discrete equations.So, it can be used directly associated physical formulas.Without demanding logic relationship , no need for a formula for further conversion.
(3) when it is solved, the directivity equation does not need to be concerned .So compared with other simulation software, It reduces the difficulty of modeling greatly.
(4) It has object-oriented features.Relative to the assignment, the equation does not require the direction of data flow , so there is no complex causality.It reduces the difficulty of modeling, and has better support component reuse and evolutionary model.
(5) It uses mathematical formulas (equations) to describe the physical laws and phenomena of subsystems in different areas .It is based on the topology of the physical model, and using the language internal component coupling mechanism, to achieve multidomain modeling.
(6) Modelica based modeling commonly used in two ways.One is the use of graphical modeling tool, by dragging and combining the components in the standard library.Finally, add a connection to complete the establishment of the model.Can be set in detail the corresponding parameters in the model components, the simulation model is made.Another way is to write Modelica language code using Modelica language to generate the corresponding model.
(7) Multi-domain modeling based on Modelica language, when the components modeling is completed, mainly depends on the connector for data exchange.
The following spring with a mass, for example, describe the linear damping moving under it a exciting force, as shown in Fig. 3.The tools used are Mworks, language is the Modelica language.Solving the amplitude-frequency characteristic curve and phase frequency characteristic curves [5].Then the The following simulation results, as shown in Fig. 4, Fig. 5 and Fig. 6.
In the end:

Conclusion
Modelica language is now widely accepted multi-domain modeling language.C language and it have a lot of similar places.And it is easy to use.Using this method can reduce the modeling difficulty.It using the mathematics modeling, and don't have to be limited to the area and tools.Based on the foundation libraries,more and more specicalized libraies will be built in the future.It will accelerate the development of multidiscipinary modeing tu more special fields and applications.

Figure 3 .
Figure 3. Degree of freedom under the harmonic excitation of the linear damping system

Figure 4 .Figure 5 .Figure 6 .
Figure 4. Interface window of Code a model based on their physical structure, so that different areas of the model can be consistent .It can be achieved unified multi-domain modeling .Mathematical description of Modelica models is the differential, algebraic and discrete equations.It can automatically solve equations, and no additional processing.It is good at Hardware-in-the-loop simulation and embedded control systems.Mainly based on the following consideration: build