0% found this document useful (0 votes)
26 views18 pages

Lecture08 - Modelica Libraries

Uploaded by

sudhansu samal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views18 pages

Lecture08 - Modelica Libraries

Uploaded by

sudhansu samal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Modelica Libraries

1 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Modelica Standard Library

Modelica Standard Library (called Modelica) is a


standardized predefined package developed by Modelica
Association

It can be used freely for both commercial and noncommercial


purposes under the conditions of The Modelica License.

Modelica libraries are available online including documentation


and source code from
http://www.modelica.org/library/library.html.

2 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

1
Modelica Standard Library cont’
The Modelica Standard Library contains components from
various application areas, including the following sublibraries:
• Blocks Library for basic input/output control blocks
• Constants Mathematical constants and constants of nature
• Electrical Library for electrical models
• Icons Icon definitions
• Fluid 1-dim Flow in networks of vessels, pipes, fluid machines, valves, etc.
• Math Mathematical functions
• Magnetic Magnetic.Fluxtubes – for magnetic applications
• Mechanics Library for mechanical systems
• Media Media models for liquids and gases
• SIunits Type definitions based on SI units according to ISO 31-1992
• Stategraph Hierarchical state machines (analogous to Statecharts)
• Thermal Components for thermal systems
• Utilities Utility functions especially for scripting

3 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Modelica.Blocks

Continuous, discrete, and logical input/output blocks


to build block diagrams.

Library

Continuous

Examples:

4 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

2
Modelica.Constants

A package with often needed constants from mathematics,


machine dependent constants, and constants of nature.

Examples:
constant Real pi=2*Modelica.Math.asin(1.0);

constant Real small=1.e-60 "Smallest number such that small and –small
are representable on the machine";

constant Real G(final unit="m3/(kg.s2)") = 6.673e-11 "Newtonian constant


of g
gravitation";
;

constant Real h(final unit="J.s") = 6.62606876e-34 "Planck constant";

constant Modelica.SIunits.CelsiusTemperature T_zero=-273.15 "Absolute


zero temperature”;

5 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Modelica.Electrical

Electrical components for building analog, digital, and


multiphase circuits

Library Library Library Library

Analog Digital Machines MultiPhase

Examples:
V2

R2 R4

Gnd9

C2 Gnd3 Gnd6 C4
R1 Transistor1 Transistor2 R3

V1 C1 I1 C5 C3 Gnd4

Gnd1 Gnd2 Gnd7 Gnd8 Gnd5

6 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

3
Modelica.Icons

Package with icons that can be reused in other libraries

Examples:

Library

Info Library Example

Info Library1 Library2 Example

RotationalSensor TranslationalSensor GearIcon MotorIcon

7 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Modelica.Math

Package containing basic mathematical functions:


sin(u) sine
cos(u) cosine
tan(u) tangent (u shall not be: …,-/2, /2, 3/2,… )
asin(u) inverse sine (-1  u  1)
acos(u) inverse cosine (-1  u  1)
atan(u) inverse tangent
atan2(u1, u2) four quadrant inverse tangent
sinh(u) hyperbolic sine
cosh(u)
h( ) h
hyperbolic
b li cosine
i
tanh(u) hyperbolic tangent
exp(u) exponential, base e
log(u) natural (base e) logarithm (u  0)
log10(u) base 10 logarithm (u  0)

8 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

4
Modelica.Mechanics

Package containing components for mechanical systems


Subpackages:
• Rotational 1-dimensional rotational mechanical components
• Translational 1-dimensional translational mechanical components
• MultiBody 3-dimensional mechanical components

9 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Modelica.SIunits

This package contains predefined types based on the


international standard of units:

• ISO 31-1992 “General principles concerning quantities, units and symbols”


• ISO 1000-1992 “SI units and recommendations for the use of their
multiples and of certain other units”.

A subpackage called NonSIunits is available containing non


SI units such as Pressure_bar, Angle_deg, etc

10 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

5
Modelica.Stategraph

Hierarchical state machines (similar to Statecharts)

11 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Modelica.Thermal

Subpackage FluidHeatFlow with components for heat flow


modeling.

Sub
S b package
k HeatTransfer f with ith components
t to
t model
d l11-
dimensional heat transfer with lumped elements

Example:

12 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

6
ModelicaAdditions Library (OLD)

ModelicaAdditions library contains additional Modelica


libraries from DLR. This has been largely replaced by the new
release of the Modelica 33.1
1 libraries
libraries.
Sublibraries:
• Blocks Input/output block sublibrary
• HeatFlow1D 1-dimensional heat flow (replaced by Modelica.Thermal)
• Multibody Modelica library to model 3D mechanical systems
• PetriNets Libraryy to model Petri nets and state transition diagrams
g
• Tables Components to interpolate linearly in tables

13 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

ModelicaAdditions.Multibody (OLD)

This is a Modelica library to model 3D Mechanical systems


including visualization
New version
N i hhas b
been released
l d ((march
h 2004) th
thatt iis called
ll d
Modelica.Mechanics.MultiBody in the standard library
Improvements:
• Easier to use
• Automatic handling of kinematic loops.
• Built-in animation properties for all components

14 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

7
MultiBody (MBS) - Example Kinematic Loop

Old library New library


(cutjoint needed) (no cutjoint needed)

15 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

MultiBody (MBS) - Example Animations

16 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

8
ModelicaAdditions.PetriNets

This package contains components to model Petri nets


Used for modeling of computer hardware, software, assembly
li
lines, etc
t

Transition

Place

17 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Other Free Libraries

• WasteWater Wastewater treatment plants, 2003


• ATPlus Building simulation and control (fuzzy control included), 2005
• MotorCycleDymanics Dynamics and control of motorcycles, 2009
• N
NeuralNetwork
lN k N
Neural l network
k mathematical
h i l models,
d l 2006
• VehicleDynamics Dynamics of vehicle chassis (obsolete), 2003
• SPICElib Some capabilities of electric circuit simulator PSPICE, 2003
• SystemDynamics System dynamics modeling a la J. Forrester, 2007
• BondLib Bond graph modeling of physical systems, 2007
• MultiBondLib Multi bond graph modeling of physical systems, 2007
• ModelicaDEVS DEVS discrete event modeling, 2006
• ExtendedPetriNets Petri net modeling
modeling, 2002
• External.Media Library External fluid property computation, 2008
• VirtualLabBuilder Implementation of virtual labs, 2007
• SPOT Power systems in transient and steady-state mode, 2007
• ...

18 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

9
Power System Stability - SPOT

The SPOT package is a Modelica Library for Power Systems


Voltage and Transient stability simulations

19 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Thermo-hydraulics Library – ThermoFluid


Thermo-
Replaced by the New Fluid/Media Library

ThermoFluid is a Modelica base library for thermo-hydraulic


models
• IIncludes
l d models
d l th
thatt d
describe
ib th
the b
basic
i physics
h i off flflows off flfluid
id and
d
heat, medium property models for water, gases and some
refrigerants, and also simple components for system modeling.

• Handles static and dynamic momentum balances

• Robust against backwards and


zero flow

• The discretization method is


a first-order, finite volume
method (staggered grid).

20 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

10
Vehicle Dynamics Library – VehicleDynamics
There is a Greatly Extended Commercial Version

This library is used to model vehicle chassis

21 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Some Commercial Libraries

• Powertrain
• SmartElectricDrives
• VehicleDynamics
• AirConditioning
• HyLib
• PneuLib
• CombiPlant
• HydroPlant
• …

22 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

11
Hydraulics Library HyLib
• Licensed Modelica package developed
originally by Peter Beater
• More than 90 models for Pumps

• Pumps

• Motors and cylinders


• Restrictions and valves
• Hydraulic lines Cylinders
• Lumped volumes and sensors
• Models can be connected in an
arbitrary way, e.g. in series or in parallel.
•HyLibLight is a free subset of Valves
HyLib
• More info: www.hylib.com
23 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

HyLib - Example

Hydraulic drive system with closed circuit

24 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

12
Pneumatics Library PneuLib
•Licensed Modelica package
developed by Peter Beater
Directional valves
•More than 80 models for
• Cylinders

• Motors
• Valves and nozzles
Flow control valves
• Lumped volumes
• Lines and sensors
• Models can be connected in an arbitrary
way, e.g. in series or in parallel.
•PneuLibLight is a free subset of Cylinders
HyLib.
• More info: www.pneulib.com

25 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

PneuLib - Example

Pneumatic circuit with multi-position cylinder, booster and


different valves

26 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

13
Powertrain Library - Powertrain

• Licensed Modelica package


developed by DLR
• Speed and torque dependent
friction
• Bus concept
• Control units
• Animation

27 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Some Modelica Applications

28 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

14
Example Fighter Aircraft Library

Custom made library, Aircraft*, for fighter aircraft


applications

• Six degrees of freedom (6 DOF)


• Dynamic calculation of center of
gravity (CoG)
• Use of Aerodynamic tables or
mechanical rudders

*Property of FOI (The Swedish


Defence Institute)

29 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Aircraft with Controller

• Simple PID
• Controls alpha and height

30 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

15
Example Aircraft Animation

Animation of fighter aircraft with controller

31 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Example Gas Turbine

42 MW gas turbine (GTX 100) from Siemens Industrial


Turbomachinery AB, Finspång, Sweden
Fuel

Compressed air Combustion Exhaust gas


chamber

Power output

Air Exhaust
C
Compressor T bi
Turbine

Courtesy Siemens Industrial Turbines AB

32 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

16
Example Gas Turbine

33 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

Example Gas Turbine – Load Rejection


Rotational speed (rpm) of the compressor shaft

Load rejection

Generator Switch pilot


to main fuel

34 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

17
Example Gas Turbine – Load Rejection

Percentage of fuel valve opening Generated power to the simulated


(red = pilot, blue = main) electrical grid

35 Peter Fritzson Copyright © Open Source Modelica Consortium pelab

18

You might also like