The **PetriNets** library allows to model **discrete**
components by a special kind of **Petri nets** with at most one
token on a place, as well as by **state transition diagrams**
(which are special kinds of Petri nets). Petri nets and state
transition diagrams are "higher level" constructs for the
description of switching elements, parallel activities or
syncronization. For several kinds of applications it is much easier
and clearer to use these components instead of modeling the
discrete behaviour directly with the basic language constructs of
Modelica ("if" or "when" statements). A typical Petri net is shown
in the following figure:

A **Petri net** is defined in the following way:

- It consists of a set of
**places**and of a set of**transitions**. The places are split into start places which are "active" at the start of the simulation and of "normal" places which are "non-active" at the beginning. - Places are connected by
**transitions**, whereby no places and no transitions are directly connected (i.e., a place is connected to a transition which in turn is connected to another place). Any number of start places can be present. - An "
**active**" place is characterized by a "**token**" placed on the place. In the ModelicaAdditions.PetriNets libray a place is "active" when the public variable "**state**" of the place is**true**. - There are
**several transition**elements in the library. Whenever the**states**of**all inputs**to the transition elements are**active**and when the**condition**of the transition is**true**then the following actions are performed:- all
**input states**are marked as "**inactive**", i.e., the token is removed. - all
**output states**are marked as "**active**", i.e., they are marked by new tokens.

**conditionPort**connector of a transition element is used to signal via a Boolean signal whether the condition of a transition is true or false. Alternatively, the condition can be provided as an equation to set the public variable**condition**of the corresponding transition element. - all
- There are several
**place**components in this library (such as Place01, Place10, Place11) which have different number of input and output transition connectors. This is due to the current limitations of the annotations of Modelica, which do not allow to define the graphical location of the elements of a vector of (transition) connectors with unknown length. - If two or more transitions of a place would fire at the same
time instant,
**priorities**are used in order that exactly one of them fires. The highest priority has a transition connector of a place with the lowest index (e.g. outTransition1 has a higher priority as outTransition2).

The method used in this library to realize Petri nets in Modelica is described in detail in:

- Mosterman P.J., Otter M. and Elmqvist H. (1998):
**Modeling Petri-Nets as Local Constraint Equations for Hybrid Systems using Modelica.**1998 Summer Computer Simulation Conference (SCSC'98), Reno, U.S.A., 19.-20. Juli (download from here).

This package is not part of the Modelica standard library,
because it is planned to realize a package with only **one**
place and **one** transition component, once vector connectors
with unknown length have better support in Modelica.

**Main Author:**- Martin
Otter

Deutsches Zentrum für Luft und Raumfahrt e.V. (DLR)

Institut für Robotik und Mechatronik

Postfach 1116

D-82230 Wessling

Germany

email: Martin.Otter@dlr.de

**Release Notes:**

*June 12, 2000*by Martin Otter:

Realized.

**Copyright © 2000-2002, DLR.**

*The ModelicaAdditions.PetriNets package is free
software; it can be redistributed and/or modified under the terms
of the Modelica license, see the license conditions and the
accompanying disclaimer in the documentation of package
Modelica in file "Modelica/package.mo".*

Name | Description |
---|---|

Interfaces | |

Examples | |

Place01 | Place with one output transition |

Place10 | Place with one input transition |

Place11 | Place with one input and one output transition |

Place21 | Place with two input and one output transition |

Place12 | Place with one input and two output transitions |

Place22 | Place with two input and two output transitions |

Transition | Transition with one input and one output connection |

Parallel | Transition with one input and two output connections |

Synchronize | Transition with two input and one output connections |

Generated at 2023-03-20T01:31:51Z by OpenModelicaOpenModelica 1.21.0~dev-362-g4101671 using GenerateDoc.mos