ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Modelica - Wikipedia, the free encyclopedia

Modelica

From Wikipedia, the free encyclopedia

Modelica is an object-oriented, multi-domain modeling language for component-oriented modeling of complex systems, e.g., systems containing mechanical, electrical, electronic, hydraulic, thermal, control, electric power or process-oriented subcomponents. The free Modelica lanuage[1] is developed by the non-profit Modelica Association[2]. The Modelica Association also develops the free Modelica Standard Library[3] that contains about 780 generic model components and 550 functions in various domains (in version 3.0 from Feb. 2008).

While Modelica resembles object-oriented programming languages, such as C++ or Java, it differs in two important respects. First, Modelica is a modeling language rather than a true programming language. Modelica classes are not compiled, in the usual sense, but are translated into objects which are then exercised by a simulation engine. The simulation engine is not specified by the language, although certain required capabilities are outlined.

Second, although classes may contain algorithmic components similar to statements or blocks in programming languages, their primary content is a set of equations. In contrast to a typical assignment statement, such as

x := 2 + y;,

where the left-hand side of the statement is assigned a value calculated from the expression on the right-hand side, an equation may have expressions on both its right- and left-hand sides, for example,

x + y = 3 * z;.

Equations do not describe assignment but equality. In Modelica terms, equations have no pre-defined causality. The simulation engine may (and usually must) manipulate the equations symbolically to determine their order of execution and which components in the equation are inputs and which are outputs.

Commercial front-ends for Modelica include Dymola[4] from the Swedish company Dynasim AB (now part of Dassault Systemes), MathModelica System Designer from the Swedish company MathCore AB, SimulationX[5] from the German company ITI GmbH, and LMS Imagine.Lab AMESim[6] from the French Company Imagine (now part of LMS International). Dassault Systemes selected Modelica for their product CATIA[7] (CATIA is one of the major CAD systems).

The goal of the OpenModelica project[8] is to create complete Modelica modeling, compilation and simulation environment based on free software distributed in source code form intended for research purposes.

The free simulation environment Scicos uses a subset of Modelica for component modeling. Support for a larger part of the Modelica language is currently under development.

Contents

[edit] Examples

The following code fragment shows a very simple example of a first order system (\dot x = - c \cdot x):

model FirstOrder
  parameter Real c=1 "Time constant";
  Real x "An unknown";
equation
  der(x) = -c*x "A first order differential equation";
end FirstOrder;

Interesting things to note about this example are the 'parameter' qualifier, which indicates that a given variable is time-invariant and the 'der' operator, which represents (symbolically) the time derivative of a variable. Also worth noting are the documentation strings that can be associated with declarations and equations.

The main application area of Modelica is the modeling of physical systems. The most basic structuring concepts are shown at hand of simple examples from the electrical domain:

[edit] Built-in and user derived types

Modelica has the 4 built-in types Real, Integer, Boolean, String. Typically, user-defined types are derived, to associate physical quantity, unit, nominal values and other attributes:

type Voltage = Real(quantity="ElectricalPotential", unit="V");
type Current = Real(quantity="ElectricalCurrent", unit="A");
  ...

[edit] Connectors describing physical interaction

The interaction of a component to other components is defined by physical ports, called connectors, e.g., an electrical pin is defined as:

connector Pin "Electrical pin"
   Voltage      v "Potential at the pin";
   flow Current i "Current flowing in to the component";
end Pin;

When drawing connection lines between ports, the meaning is that corresponding connector variables without the "flow" prefix are identical (here: "v") and that corresponding connector variables with the "flow" prefix (here: "i") are defined by a zero-sum equation (the sum of all corresponding "flow" variables is zero). The motivation is to automatically fulfill the relevant balance equations at the infinitesimal small connection point.

[edit] Basic model components

A basic model component is defined by a model and contains equations that describe the relationship between the connector variables in a declarative form (i.e., without specifying the calculation order):

model Capacitor
   parameter Capacitance C;
   Voltage u "Voltage drop between pin_p and pin_n";
   Pin pin_p, pin_n;
equation
        0 = pin_p.i + pin_n.i;
        u = pin_p.v - pin_n.v;
   der(u) = pin_p.i;
end Capacitor

The goal is that a connected set of model components leads to a set of differential, algebraic and discrete equations where the number of unknowns and the number of equations is identical. In Modelica this is achieved by requiring so called balanced models. This means that when "using" a model (making a model instance), all missing equations must be provided. From this requirement and the possibilities to provide missing equations for a model instance, e.g., by connecting connectors, Modelica requires in its simplest form that:

Number of model equations = Number of unknowns - number of flow variables - number of inputs

The Capacitor model above is balanced, since

number of equations =   5 (number of unknowns: 
                           pin_p.v, pin_p.i, pin_n.v, pin_n.i, u)
                      - 2 (number of flow variables: pin_p.i, pin_n.i) 
                    =   3.

[edit] Hierarchical models

A hierarchical model is built-up from basic models, by instantiating basic models, provide suitable values for the model parameters, and by connecting model connectors. A typical example is the following electrical circuit:

model Circuit
   Capacitor C1(C=1e-4) "A Capacitor instance from the model above";
   Capacitor C2(C=1e-5) "A Capacitor instance from the model above";
     ...
equation
   connect(C1.pin_p, C2.pin_n);
   ...
end Circuit;

Via the language element annotation(...) definitions can be added to a model that do not have an influence on a simulation. Annotations are used to defined graphical layout, documentation, version information. A basic set of graphical annotations is standardized in order that the graphical appearance and layout of models in different Modelica tools is the same.

[edit] Applications

Modelica is designed to be domain neutral and, as a result, is used in a wide variety of applications, such as fluid systems (e.g. steam power generation, hydraulics, etc), automotive applications (especially powertrain) and mechanical systems (e.g. multi-body systems, mechatronics, etc).

In the automotive sector, many of the major automotive OEMs are using Modelica. These include Ford [9] [10] [11], General Motors [12], Toyota [13] and BMW [14]. Modelica is also been increasingly used for the simulation of thermo-fluid and energy systems [15].

[edit] See also

[edit] Notes

  1. ^ Modelica language specification, vers. 3.0
  2. ^ Homepage of the Modelica Association
  3. ^ The Modelica Standard Library is available for download here
  4. ^ Dymola simulation tool
  5. ^ SimulationX from the German company ITI GmbH
  6. ^ LMS Imagine.Lab AMESim from the French Company Imagine
  7. ^ Announcement of DS' acquisition of Dynasim
  8. ^ OpenModelica project
  9. ^ Michael Tiller, Paul Bowles, Mike Dempsey Development of a Vehicle Modeling Architecture in Modelica, 3rd International Modelica Conference
  10. ^ Erik Surewaard, Eckhard Karden, Michael Tiller Advanced Electric Storage System Modeling in Modelica, 3rd International Modelica Conference
  11. ^ Charles Newman, John Batteh, Michael Tiller Spark-Ignited Engine Cycle Simulation in Modelica, 2nd International Modelica Conference
  12. ^ E. D. Tate, Michael Sasena, Jesse Gohl, Michael Tiller Model Embedded Control: A Method to Rapidly Synthesize Controllers in a Modeling Environment, 6th International Modelica Conference
  13. ^ S. Soejima, T. Matsuba Application of mixed mode integration and implicit inline integration at Toyota, 2nd International Modelica Conference
  14. ^ Henrik Wigermo, Johannes von Grundherr, Thomas Christ Implementation of a Modelica Online Optimization for an Operating Strategy of a Hybrid Powertrain, 6th International Modelica Conference
  15. ^ Michael Wetter, Christoph Haugstetter Modelica versus TRNSYS - A Comparison Between An Equation-Based and a Procedural Modeling Langage for Building Energy Simulation, 2nd SimBuild Conference, Cambridge, MA, USA, August 2006.

[edit] Interesting Links

Languages


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -