SlideShare a Scribd company logo
Modeling and
Simulation
‫المحاكاة‬ ‫و‬ ‫النمذجة‬
‫د‬
.
‫العلي‬ ‫خولة‬
‫النظم‬
‫النظام‬ ‫مفهوم‬
‫النظام‬ ‫مهام‬ ‫ألداء‬ ً‫ا‬‫مع‬ ‫وتتعاون‬ ‫تتفاعل‬ ‫عناصر‬ ‫مجموعة‬ ‫النظام‬
‫النظم‬ ‫أنواع‬
‫ذهني‬ ‫أو‬ ‫فيزيائي‬
‫مغلق‬ ‫أو‬ ‫مفتوح‬
‫اصطناعي‬ ‫أو‬ ‫طبيعي‬
‫الحاسوبية‬ ‫األنظمة‬
Users +Software + Hardware
‫عن‬ ‫عامة‬ ‫لمحة‬
‫النمذجة‬

-
‫في‬ ً‫ا‬‫مهم‬ ً‫ا‬‫دور‬ ‫النماذج‬ ‫بناء‬ ‫و‬ ‫النمذجة‬ ‫تلعب‬
‫وفي‬ ‫االختصاصات‬ ‫مختلف‬ ‫و‬ ‫البحث‬ ‫مجاالت‬ ‫مختلف‬
‫مراحل‬ ‫مختلف‬
‫بناء‬
‫نظام‬
‫و‬
‫تطوير‬
‫تحليله‬ ‫و‬ ‫ه‬

-
‫مجاالت‬ ‫من‬ ‫مجال‬ ‫كل‬ ‫في‬
‫البحث‬
‫تقنيات‬ ‫هناك‬
‫النماذج‬ ‫لبناء‬ ‫خاصة‬
،
‫خصائص‬ ‫و‬ ‫وظائف‬ ‫مع‬ ‫تتناسب‬
‫الم‬ ‫الحالة‬
‫ن‬
‫مذجة‬
‫تعاريف‬
‫النمذجة‬
‫المحاكاة‬ ‫و‬ ‫النموذج‬ ‫و‬

‫النمذجة‬
:
‫و‬ ‫فهمه‬ ‫على‬ ‫يساعدنا‬ ،‫لنظام‬ ‫نموذج‬ ‫بناء‬ ‫فن‬
ً‫ا‬‫فعلي‬ ‫بنائه‬ ‫دون‬ ‫به‬ ‫التحكم‬ ‫أو‬ ‫بالتنبؤ‬ ‫والقيام‬ ‫تصميمه‬

‫النموذج‬
:
‫على‬ ‫قدرتنا‬ ‫تحسين‬ ‫به‬ ‫يراد‬ ‫للنظام‬ ‫مبسط‬ ‫تمثيل‬ ‫هو‬
‫لمجرد‬ ‫أو‬ ‫قائم‬ ‫هو‬ ‫ما‬ ‫على‬ ‫المحافظة‬ ‫أو‬ ‫للتغيير‬ ‫الضروري‬ ‫الفهم‬
‫سلوك‬ ‫على‬ ‫السيطرة‬ ‫ربما‬ ‫أو‬ ‫تفسيره‬ ‫و‬ ‫النظام‬ ‫سلوك‬ ‫معرفة‬
‫النظام‬
.

‫المحاكاة‬
:
‫تشبيه‬ ‫عملية‬ ‫هي‬
(
‫التأثيرات‬ ‫و‬ ‫المظهر‬ ‫في‬
)
‫نموذج‬ ‫وتجريب‬ ‫ببناء‬ ‫ذلك‬ ‫و‬ ‫النظام‬ ‫سلوك‬ ‫في‬ ‫الهامة‬ ‫للمفاهيم‬
‫النظام‬
.

‫المحاكاة‬
‫الحاسوبية‬
:
‫و‬
‫و‬ ‫المظهر‬ ‫في‬ ‫تشبيه‬ ‫عملية‬ ‫هي‬
‫التأثيرات‬
‫النظام‬ ‫سلوك‬ ‫في‬ ‫الهامة‬ ‫للمفاهيم‬
‫ببناء‬ ‫ذلك‬ ‫و‬
‫النموذج‬ ‫هذا‬ ‫تجريب‬ ‫و‬ ‫الحاسوب‬ ‫في‬ ‫لمحاكاة‬ ‫مكيف‬ ‫نموذج‬
ً‫ا‬‫حاسوبي‬
.
‫النماذج‬ ‫أنواع‬
:

‫نماذج‬
‫فيزيائية‬
:
‫ملموسة‬ ‫اشياء‬ ‫من‬ ‫مكونة‬

‫ذهنية‬ ‫نماذج‬

‫تدفقية‬ ‫مخططات‬ ‫نماذج‬

‫البيانية‬ ‫الرسوم‬ ‫و‬ ‫الخرائط‬ ‫نماذج‬

‫رمزية‬ ‫نماذج‬
:
‫ورياضية‬ ‫منطقية‬ ‫عالقات‬
-
‫خرائط‬
-
‫صور‬

‫الديناميكية‬ ‫النظام‬ ‫نماذج‬

‫الساكنة‬ ‫النظام‬ ‫نماذج‬
‫أمثلــــــــــــة‬

‫البناء‬ ‫هندسة‬ ‫مجال‬ ‫في‬ ‫أبنية‬ ‫نماذج‬ ‫انشاء‬
‫يتطلب‬
‫استخدام‬
‫و‬ ‫بناء‬ ‫مخططات‬
‫استخدام‬
‫إحصائية‬ ‫حسابات‬
‫المطلوب‬ ‫للنموذج‬ ‫للوصول‬ ‫لألبنية‬ ‫وحسابية‬

‫النمذجة‬
‫بالغراف‬
(
(Graph
:
‫تستخدم‬
‫الطريقة‬ ‫هذه‬
‫في‬
‫نمذجة‬
‫القطا‬ ‫وسكك‬ ‫الطرق‬
‫رات‬

‫النمذجة‬
‫أو‬ ‫نظام‬ ‫مكونات‬ ‫توصيف‬ ‫في‬ ‫وتستخدم‬ ‫الرياضية‬
‫حالة‬

‫النمذجة‬
‫وصنع‬ ‫الترجمة‬ ‫مجال‬ ‫في‬ ‫وتستخدم‬ ‫باألشجار‬
‫القرار‬

‫ساكنة‬ ‫نماذج‬ ‫هناك‬
‫ديناميكية‬ ‫ونماذج‬
‫من‬ ‫الهدف‬
‫النمذجة‬

‫البنى‬ ‫نمذجة‬
:
‫النموذج‬ ‫يظهر‬
‫النظام‬ ‫صفات‬
‫و‬
‫بينها‬ ‫والعالقة‬ ‫مكوناته‬
(directed graph - UML diagram)

‫السلوك‬ ‫نمذجة‬
:
‫النموذج‬ ‫يظهر‬
‫تغي‬ ‫خالل‬ ‫من‬ ‫النظام‬ ‫سلوك‬
‫حاالته‬ ‫ر‬
‫تأثيرات‬ ‫نتيجة‬ ‫أو‬ ‫للزمن‬ ‫بالنسبة‬
‫عليه‬ ‫مطبقة‬
(
UML
–Automata- Petri net )
‫النموذج‬ ‫بناء‬ ‫خطوات‬

‫غموض‬ ‫بال‬ ‫و‬ ‫منطقي‬ ‫بشكل‬ ‫و‬ ‫بوضوح‬ ‫المسألة‬ ‫تحديد‬

‫الخطوات‬ ‫من‬ ‫سلسلة‬ ‫النطالق‬ ‫تؤدي‬ ‫نمذجة‬ ‫منهجية‬
‫العالقات‬ ‫كل‬ ‫فهم‬ ‫الصعب‬ ‫من‬ ‫و‬ ‫جيدة‬ ‫بمعرفة‬ ‫المنطقية‬
‫الحقيقية‬ ‫لمبادلة‬ ‫نضطر‬ ‫لذلك‬ ‫الحقيقي‬ ‫للنظام‬ ‫الداخلية‬
‫المتغيرات‬ ‫بعض‬ ‫نتخذ‬ ‫حيث‬ ‫أبسط‬ ‫بعالقات‬ ‫العمومية‬ ‫و‬
‫للنظام‬ ‫الداخلية‬ ‫العالقات‬ ‫و‬ ‫فقط‬
.

‫المتغيرات‬ ‫من‬ ‫جزئية‬ ‫مجموعة‬ ‫أصغر‬ ‫اختيار‬ ‫على‬ ‫القدرة‬
‫مرغوب‬ ‫و‬ ‫واضح‬ ً‫ا‬‫كافي‬ ‫وصفا‬ ‫الحقيقي‬ ‫النظام‬ ‫تصف‬
‫للمنمذج‬

‫التنبؤ‬ ‫التقدير‬ ‫الحدس‬ ‫الخبرة‬ ‫على‬ ‫تعتمد‬ ‫النمذجة‬ ‫مهارة‬
‫الخيال‬ ‫و‬
Need to Model
If original system is:
1- not observable
2- very small or very big
3- very complex
4- not exist
5- not available-
Need to Model
If the work with original is:
1- very dangerous
2- Very expensive
3- Impossible
4- verboten
Simple models of complex
world
- Newtonian Physics is a special case
of more recent models.
- We hardly travel at relativistic speed
or operate in quantum dimensions
do we? So why do not use the
simpler model?
Simulation
Purposes of simulation :
1. Help to understand
2. Help to observe behavior of modeled
system
3. Help to test ,valid, verificate, or evaluate
4. Help to discover mistakes
5. To simulate real world
Petri Nets
Concurrency and causality
History
Petri nets were introduced by C.A. Petri in his
PH.D. Dissertation“ Kommunikation mit
Automaten.” Bonn 1962
In models of existing systems, automata imply an
approximation. (simple, but applicable only if their
assumptions hold)
In designs of new systems, automata involve over-
specification! (engineers have to implement the
assumptions)
The Aim of Petri Nets (PN)
PN are graphical tool for the formal description of
the flow of activities in complex systems.
PN are particularly useful from modeling Systems
with concurrent and asynchronous processing.
Typical situations that can be modeled by PN are
distribution, synchronization, sequentiality,
concurrency and conflict.
PN are particularly suited to represent in a natural
way logical interaction among parts or activities in a
system.
PN can be modeled real or abstract automat and
engines , communication and behaviors of software
and hardware components.
What is Petri net?
PN is a quintuple (P,T, I,O, M) where:
P=(p1, p2, p3, …, p np ) is the set of np places (drawn
- as
circles in the graphical presentation);
T=(t11, t2, t3, …, t nt ) is the set of nt transitions (drawn
- as
bars) ;
- I is the transition input relation and is represented by
means of arcs directed from places to transitions ;
- O is the transition output relation and is represented by
means of arcs directed from transitions to places;
- M={m1,m2,m3,…,mnp} is the marking. The generic entry
m i is the number of tokens (drawn as black dots) in place p i
in marking M.
- The graphical structure of a PN is a bipartite directed graph: the
nodes belong to tow different classes (places and transitions) and
edges (arcs) are allowed to connect only nodes of different
classes ( multiple arcs are possible in the definition of the I and O
relations)
What is Petri net?
The dynamics of a PN is obtained by moving the
tokens in the places by means of the following
execution rules:
1. A transition is enabled in marking M if all its input
places carry at least one token;
An enabled
2. transition fires by removing one token
per arc from each input place and adding one token
per arc to each output place
Given an initial marking M1, The reachability set
R(m1) is the set of all the markings that can be
obtained by repeated application of a above rules
A transition is enabled in marking M if all its input places
carry at least one token
An enabled transition fires by removing one token per arc
from each input place and adding one token per arc to
each output place
tk is enabled in marking M if:
For any ` , mi ≥ 1
Marking M`, obtained from M by firing tk , is said to be
immediately reachable from M and the firing operation is
denoted by the symbol (M
tk
M`)
M` is given by the following relationship:
M`=
M(p i) +1 if pi i ϵ O(t k), pi no ϵ I (t k )
M(p i) -1 if pi no ϵ O )t k ), p i ϵ I (tk )
M(pi ) otherwise
Petri Nets and the Modeling of
Systems
- PN used for modeling real systems are sometimes
referred to as condition /event nets
- Places identify the condition of the parts of the system
( working, failed, idle…)
- Transitions describe the passage from one condition
to
another
An event occurs (transition fires)
-
- Occurrence of the event modifies in whole or in part
the status of the conditions (marking)
- The number of tokens in a place can be used to
identify the number of resources
Typical Situation of Interaction of
activities arising in system modeling
1. concurrency ( or parallelism)
In figure 1 the activities modeled by tow
transitions run concurrently
2. Synchronization
In figure 2 the Synchronization activityis
modeled by means of transitionT1
3.conflict
In figure 3 t1 and t2 are allowed to fire
concurrently, but are connected to a
shared resource (one token), that can not
be accessed by t1, t2 simultaneously.
Examples
CONCURRENCY SYNCHRONISATION COMMUNICATION
(1) (2) (3)
A B A B A B
t1
t2 t3
Examples
multiplicity/resources individuality/data
A
A B
A B
A B
conflict / choic
(4) (5) (6)
t1 t2
t3
t4
Weighted Petri nets
- Original Petri nets : only 1 token can be
removed/added from a place when a
transition fires (i.e. the weight is always 1)
- Weighted Petri nets:
- Generalized the original Petri nets to
allow multiple tokens to be
added/removed when a transition fires.
- The edges are labeled with the weight(
i.e. number of tokens)
-If there is no label, then the default value
is 1.
Mathematical definition:
P={p1, p2, ….pm} is a finite set of places
T={t1,t2…,tn } is a finite set of transitions
F ⊆(pχT) U (pχT) is a set of arcs
W: F→ {1,2,3, …} is a weighting function
M0 :P → {1,2,3,….} is the initial marking
P∩T=Ø and P UT≠Ø
Example
Petri net before transition t1 fires after t1 fires
p1
p2
p3
t1
2
4
p1
p2
p3
t1
2
4
Reachability
• Reachability set and Reachability
Graph R(M0)is a set of all possible
markings reachable from the initial
marking M0
• If marking M is in the reachability set
R(M0), it means that there exist a firing
sequence transforming M0 into M
• This is an useful property for analysis of
systems. We can ask whether :
A desired stat can be reached at all?
Is it possible for a system to arrive at an
undesired state (erroneous) ?
Reachabilty Graph
• Reachabilty can be analysed by building a
reachabiltiy graph
• Reachabilty graph is a directed Graph where
nodes represents marking and edge –transitions
between tow Markings
• The Graph is constructed by finding all
possible transition from initial marking this gives
a set of markings reachable from the initial one
then all possible transitions from the previously
discovered
• May lead to extremely large graph
Example : two users share printer
End print
End print
start print start print
User1-work
User1-finish User2-finish
User2-work
Printer free
Properties of Petri nets
• Petri nets Properties are basis for their
formal analysis
• The following Properties are
commonly used:
- Reachability
- Liveness
- Boundedness
Properties of Petri nets
• Liveness: A potentially firable in M if there exist
sequence of transition firings which leads to a
marking in which the transition is enabled. A
transition is live if it is potentially firable in any
marking of R(M1 ). A transition is dead in M if it is
not potentially firable; if the PN enters marking M
the dead transition can not fire any more.
• In other words every transition of the net can fire
an infinite number of times
• A Petri net PN is structurally live, if any initial
marking of PN is live
• Liveness may be used to modeled the
occurrences of
deadlocks.
• Safeness
A place is safe if the token count does not exceed 1
in any marking of R(M1 ). A PN is safe if each place is
safe.
• Boundedness
A simple generalization of safeness is the concept of
boundedness. A place is bounded with bound k, if
the token count does not exceed k in any marking of
R(M1 ). A PN is k- bounded if each place is k-
bounded.
• Conservation
APN is strictly conservative if the total number of
tokens is constant in each Marking of R(M1).
High level Petri nets
• Petri nets have been extended over the year in
many
directions including time.
Hierarchical Petri nets :
• developed in the late 1980s
• Specifications for real systems have a tendency to
become large and complex
• An Abstraction mechanism, hierarchical structuring
reviewing and modifying the model easier
• The hierarchical construct is called a subnet
• A subnet is an aggregate of a number of places
transitions, and subsystem
Such a construct can be used to structure large
processes
• At one level we want to give a simple description of
the process (without having to consider all details).
• Another level we want to specify a more detailed
| behavior.
2. Coloured Petri Nets
• Developed in the late 1970s
K. Jensen, “colored Petri nets and invariant
method”
Theoretical computer science, volume 14, 1981.PP
317-336.
• Token often present objects (e.g. resources, goods,
humans) in the modeled system
• To represent attributes of these objects, the Petri
nets model is extended with colored or typed tokens
• Each token has a value often referred to as a color
• Transitions use the values of the consumed token to
determine the values of the produced tokens
• Transition describes the relation between the
values of the input tokens and the values of the
output tokens
It is also possible to specify preconditions which take
the color of tokens to be consumed into account
An overview of Performance
Evaluation
• Computer system users, administrators ,and designers
are all interested in Performance Evaluation
• Goal: the highest Performance at the lowest cost
The computer industry is becoming more competitive
Search the best cost - Performance
• Need to Performance Evaluation at every stage in life
cycle of computer system ( design- manufactoring-
sales/purchase-use- upgrade…)
• Designer compare number of alternatives designs to
find best
Even no alternatives to help in determining how well it is
performing, improvement need to be made
First to Performance Evaluation select ( right measure of
Per., right measurement environment, and right
techniques
 The use of M&S within engineering is well
recognized. Simulation technology belongs to
the tool set of engineers of all application
domains and has been included in the body
of knowledge of engineering management.
M&S helps to reduce costs, increase the
quality of products and systems, and
document and archive lessons learne

More Related Content

DOCX
Signals & systems
PDF
Ece4510 notes02
PDF
Modern Control - Lec 02 - Mathematical Modeling of Systems
PDF
V01 i010401
PDF
Petri Net.pdf
PDF
505 260-266
PDF
Yann lecun-20230424-santa-fe-institute.pdf
PPTX
Lec.2 Basics properties system for your information
Signals & systems
Ece4510 notes02
Modern Control - Lec 02 - Mathematical Modeling of Systems
V01 i010401
Petri Net.pdf
505 260-266
Yann lecun-20230424-santa-fe-institute.pdf
Lec.2 Basics properties system for your information

Similar to Modeling and Simulation lecture1.pdf (20)

PPTX
السلام عليكم ورحمة الله وبركاته وبعد ان قرأت الموضوع مفيده
PDF
Modern Control System (BE)
PDF
1-introduction-to-simulation-ioenotes.pdf
PPT
PPT
Introducción al Análisis y diseño de algoritmos
PPTX
IMPLEMENTATION OF DIFFERENT PATTERN RECOGNITION ALGORITHM
PDF
Master Thesis Presentation
PPTX
PPT Chapter-2-V2.pptx__26715_1_1539251776000.pptx.pptx
PDF
2.time domain analysis of lti systems
PDF
A SOFTWARE TOOL FOR LIVE-LOCK AVOIDANCE IN SYSTEMS MODELLED USING A CLASS OF ...
PDF
A S OFTWARE T OOL FOR L IVE - LOCK A VOIDANCE IN S YSTEMS M ODELLED USIN...
PDF
A C OMPREHENSIVE S URVEY O N P ERFORMANCE A NALYSIS O F C HAOTIC C OLOU...
PDF
C OMPREHENSIVE S URVEY O N P ERFORMANCE A NALYSIS O F C HAOTIC C OLOUR...
PDF
PROTOTYPE APPLICATION IN ANDROID PLATFORM FOR SYSTEM ADMINISTRATION OF HPC ...
PDF
A C LOUD -B ASED P ROTOTYPE I MPLEMENTATION OF A D ISEASE O UTBREAK N O...
PPTX
32 Properties of Fourier Transform .pptx
PDF
Analysis of intelligent system design by neuro adaptive control
PDF
Analysis of intelligent system design by neuro adaptive control no restriction
PPTX
all about petri netis model and simulation
PDF
Slides_Neural Networks for Time Series Prediction
السلام عليكم ورحمة الله وبركاته وبعد ان قرأت الموضوع مفيده
Modern Control System (BE)
1-introduction-to-simulation-ioenotes.pdf
Introducción al Análisis y diseño de algoritmos
IMPLEMENTATION OF DIFFERENT PATTERN RECOGNITION ALGORITHM
Master Thesis Presentation
PPT Chapter-2-V2.pptx__26715_1_1539251776000.pptx.pptx
2.time domain analysis of lti systems
A SOFTWARE TOOL FOR LIVE-LOCK AVOIDANCE IN SYSTEMS MODELLED USING A CLASS OF ...
A S OFTWARE T OOL FOR L IVE - LOCK A VOIDANCE IN S YSTEMS M ODELLED USIN...
A C OMPREHENSIVE S URVEY O N P ERFORMANCE A NALYSIS O F C HAOTIC C OLOU...
C OMPREHENSIVE S URVEY O N P ERFORMANCE A NALYSIS O F C HAOTIC C OLOUR...
PROTOTYPE APPLICATION IN ANDROID PLATFORM FOR SYSTEM ADMINISTRATION OF HPC ...
A C LOUD -B ASED P ROTOTYPE I MPLEMENTATION OF A D ISEASE O UTBREAK N O...
32 Properties of Fourier Transform .pptx
Analysis of intelligent system design by neuro adaptive control
Analysis of intelligent system design by neuro adaptive control no restriction
all about petri netis model and simulation
Slides_Neural Networks for Time Series Prediction
Ad

Recently uploaded (20)

PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
Classroom Observation Tools for Teachers
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
master seminar digital applications in india
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cell Structure & Organelles in detailed.
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Microbial diseases, their pathogenesis and prophylaxis
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Classroom Observation Tools for Teachers
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
human mycosis Human fungal infections are called human mycosis..pptx
A systematic review of self-coping strategies used by university students to ...
master seminar digital applications in india
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Module 4: Burden of Disease Tutorial Slides S2 2025
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
VCE English Exam - Section C Student Revision Booklet
2.FourierTransform-ShortQuestionswithAnswers.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cell Structure & Organelles in detailed.
Final Presentation General Medicine 03-08-2024.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Microbial diseases, their pathogenesis and prophylaxis
Ad

Modeling and Simulation lecture1.pdf

  • 1. Modeling and Simulation ‫المحاكاة‬ ‫و‬ ‫النمذجة‬ ‫د‬ . ‫العلي‬ ‫خولة‬
  • 2. ‫النظم‬ ‫النظام‬ ‫مفهوم‬ ‫النظام‬ ‫مهام‬ ‫ألداء‬ ً‫ا‬‫مع‬ ‫وتتعاون‬ ‫تتفاعل‬ ‫عناصر‬ ‫مجموعة‬ ‫النظام‬ ‫النظم‬ ‫أنواع‬ ‫ذهني‬ ‫أو‬ ‫فيزيائي‬ ‫مغلق‬ ‫أو‬ ‫مفتوح‬ ‫اصطناعي‬ ‫أو‬ ‫طبيعي‬ ‫الحاسوبية‬ ‫األنظمة‬ Users +Software + Hardware
  • 3. ‫عن‬ ‫عامة‬ ‫لمحة‬ ‫النمذجة‬  - ‫في‬ ً‫ا‬‫مهم‬ ً‫ا‬‫دور‬ ‫النماذج‬ ‫بناء‬ ‫و‬ ‫النمذجة‬ ‫تلعب‬ ‫وفي‬ ‫االختصاصات‬ ‫مختلف‬ ‫و‬ ‫البحث‬ ‫مجاالت‬ ‫مختلف‬ ‫مراحل‬ ‫مختلف‬ ‫بناء‬ ‫نظام‬ ‫و‬ ‫تطوير‬ ‫تحليله‬ ‫و‬ ‫ه‬  - ‫مجاالت‬ ‫من‬ ‫مجال‬ ‫كل‬ ‫في‬ ‫البحث‬ ‫تقنيات‬ ‫هناك‬ ‫النماذج‬ ‫لبناء‬ ‫خاصة‬ ، ‫خصائص‬ ‫و‬ ‫وظائف‬ ‫مع‬ ‫تتناسب‬ ‫الم‬ ‫الحالة‬ ‫ن‬ ‫مذجة‬
  • 4. ‫تعاريف‬ ‫النمذجة‬ ‫المحاكاة‬ ‫و‬ ‫النموذج‬ ‫و‬  ‫النمذجة‬ : ‫و‬ ‫فهمه‬ ‫على‬ ‫يساعدنا‬ ،‫لنظام‬ ‫نموذج‬ ‫بناء‬ ‫فن‬ ً‫ا‬‫فعلي‬ ‫بنائه‬ ‫دون‬ ‫به‬ ‫التحكم‬ ‫أو‬ ‫بالتنبؤ‬ ‫والقيام‬ ‫تصميمه‬  ‫النموذج‬ : ‫على‬ ‫قدرتنا‬ ‫تحسين‬ ‫به‬ ‫يراد‬ ‫للنظام‬ ‫مبسط‬ ‫تمثيل‬ ‫هو‬ ‫لمجرد‬ ‫أو‬ ‫قائم‬ ‫هو‬ ‫ما‬ ‫على‬ ‫المحافظة‬ ‫أو‬ ‫للتغيير‬ ‫الضروري‬ ‫الفهم‬ ‫سلوك‬ ‫على‬ ‫السيطرة‬ ‫ربما‬ ‫أو‬ ‫تفسيره‬ ‫و‬ ‫النظام‬ ‫سلوك‬ ‫معرفة‬ ‫النظام‬ .  ‫المحاكاة‬ : ‫تشبيه‬ ‫عملية‬ ‫هي‬ ( ‫التأثيرات‬ ‫و‬ ‫المظهر‬ ‫في‬ ) ‫نموذج‬ ‫وتجريب‬ ‫ببناء‬ ‫ذلك‬ ‫و‬ ‫النظام‬ ‫سلوك‬ ‫في‬ ‫الهامة‬ ‫للمفاهيم‬ ‫النظام‬ .  ‫المحاكاة‬ ‫الحاسوبية‬ : ‫و‬ ‫و‬ ‫المظهر‬ ‫في‬ ‫تشبيه‬ ‫عملية‬ ‫هي‬ ‫التأثيرات‬ ‫النظام‬ ‫سلوك‬ ‫في‬ ‫الهامة‬ ‫للمفاهيم‬ ‫ببناء‬ ‫ذلك‬ ‫و‬ ‫النموذج‬ ‫هذا‬ ‫تجريب‬ ‫و‬ ‫الحاسوب‬ ‫في‬ ‫لمحاكاة‬ ‫مكيف‬ ‫نموذج‬ ً‫ا‬‫حاسوبي‬ .
  • 5. ‫النماذج‬ ‫أنواع‬ :  ‫نماذج‬ ‫فيزيائية‬ : ‫ملموسة‬ ‫اشياء‬ ‫من‬ ‫مكونة‬  ‫ذهنية‬ ‫نماذج‬  ‫تدفقية‬ ‫مخططات‬ ‫نماذج‬  ‫البيانية‬ ‫الرسوم‬ ‫و‬ ‫الخرائط‬ ‫نماذج‬  ‫رمزية‬ ‫نماذج‬ : ‫ورياضية‬ ‫منطقية‬ ‫عالقات‬ - ‫خرائط‬ - ‫صور‬  ‫الديناميكية‬ ‫النظام‬ ‫نماذج‬  ‫الساكنة‬ ‫النظام‬ ‫نماذج‬
  • 6. ‫أمثلــــــــــــة‬  ‫البناء‬ ‫هندسة‬ ‫مجال‬ ‫في‬ ‫أبنية‬ ‫نماذج‬ ‫انشاء‬ ‫يتطلب‬ ‫استخدام‬ ‫و‬ ‫بناء‬ ‫مخططات‬ ‫استخدام‬ ‫إحصائية‬ ‫حسابات‬ ‫المطلوب‬ ‫للنموذج‬ ‫للوصول‬ ‫لألبنية‬ ‫وحسابية‬  ‫النمذجة‬ ‫بالغراف‬ ( (Graph : ‫تستخدم‬ ‫الطريقة‬ ‫هذه‬ ‫في‬ ‫نمذجة‬ ‫القطا‬ ‫وسكك‬ ‫الطرق‬ ‫رات‬  ‫النمذجة‬ ‫أو‬ ‫نظام‬ ‫مكونات‬ ‫توصيف‬ ‫في‬ ‫وتستخدم‬ ‫الرياضية‬ ‫حالة‬  ‫النمذجة‬ ‫وصنع‬ ‫الترجمة‬ ‫مجال‬ ‫في‬ ‫وتستخدم‬ ‫باألشجار‬ ‫القرار‬  ‫ساكنة‬ ‫نماذج‬ ‫هناك‬ ‫ديناميكية‬ ‫ونماذج‬
  • 7. ‫من‬ ‫الهدف‬ ‫النمذجة‬  ‫البنى‬ ‫نمذجة‬ : ‫النموذج‬ ‫يظهر‬ ‫النظام‬ ‫صفات‬ ‫و‬ ‫بينها‬ ‫والعالقة‬ ‫مكوناته‬ (directed graph - UML diagram)  ‫السلوك‬ ‫نمذجة‬ : ‫النموذج‬ ‫يظهر‬ ‫تغي‬ ‫خالل‬ ‫من‬ ‫النظام‬ ‫سلوك‬ ‫حاالته‬ ‫ر‬ ‫تأثيرات‬ ‫نتيجة‬ ‫أو‬ ‫للزمن‬ ‫بالنسبة‬ ‫عليه‬ ‫مطبقة‬ ( UML –Automata- Petri net )
  • 8. ‫النموذج‬ ‫بناء‬ ‫خطوات‬  ‫غموض‬ ‫بال‬ ‫و‬ ‫منطقي‬ ‫بشكل‬ ‫و‬ ‫بوضوح‬ ‫المسألة‬ ‫تحديد‬  ‫الخطوات‬ ‫من‬ ‫سلسلة‬ ‫النطالق‬ ‫تؤدي‬ ‫نمذجة‬ ‫منهجية‬ ‫العالقات‬ ‫كل‬ ‫فهم‬ ‫الصعب‬ ‫من‬ ‫و‬ ‫جيدة‬ ‫بمعرفة‬ ‫المنطقية‬ ‫الحقيقية‬ ‫لمبادلة‬ ‫نضطر‬ ‫لذلك‬ ‫الحقيقي‬ ‫للنظام‬ ‫الداخلية‬ ‫المتغيرات‬ ‫بعض‬ ‫نتخذ‬ ‫حيث‬ ‫أبسط‬ ‫بعالقات‬ ‫العمومية‬ ‫و‬ ‫للنظام‬ ‫الداخلية‬ ‫العالقات‬ ‫و‬ ‫فقط‬ .  ‫المتغيرات‬ ‫من‬ ‫جزئية‬ ‫مجموعة‬ ‫أصغر‬ ‫اختيار‬ ‫على‬ ‫القدرة‬ ‫مرغوب‬ ‫و‬ ‫واضح‬ ً‫ا‬‫كافي‬ ‫وصفا‬ ‫الحقيقي‬ ‫النظام‬ ‫تصف‬ ‫للمنمذج‬  ‫التنبؤ‬ ‫التقدير‬ ‫الحدس‬ ‫الخبرة‬ ‫على‬ ‫تعتمد‬ ‫النمذجة‬ ‫مهارة‬ ‫الخيال‬ ‫و‬
  • 9. Need to Model If original system is: 1- not observable 2- very small or very big 3- very complex 4- not exist 5- not available-
  • 10. Need to Model If the work with original is: 1- very dangerous 2- Very expensive 3- Impossible 4- verboten
  • 11. Simple models of complex world - Newtonian Physics is a special case of more recent models. - We hardly travel at relativistic speed or operate in quantum dimensions do we? So why do not use the simpler model?
  • 12. Simulation Purposes of simulation : 1. Help to understand 2. Help to observe behavior of modeled system 3. Help to test ,valid, verificate, or evaluate 4. Help to discover mistakes 5. To simulate real world
  • 14. History Petri nets were introduced by C.A. Petri in his PH.D. Dissertation“ Kommunikation mit Automaten.” Bonn 1962 In models of existing systems, automata imply an approximation. (simple, but applicable only if their assumptions hold) In designs of new systems, automata involve over- specification! (engineers have to implement the assumptions)
  • 15. The Aim of Petri Nets (PN) PN are graphical tool for the formal description of the flow of activities in complex systems. PN are particularly useful from modeling Systems with concurrent and asynchronous processing. Typical situations that can be modeled by PN are distribution, synchronization, sequentiality, concurrency and conflict. PN are particularly suited to represent in a natural way logical interaction among parts or activities in a system. PN can be modeled real or abstract automat and engines , communication and behaviors of software and hardware components.
  • 16. What is Petri net? PN is a quintuple (P,T, I,O, M) where: P=(p1, p2, p3, …, p np ) is the set of np places (drawn - as circles in the graphical presentation); T=(t11, t2, t3, …, t nt ) is the set of nt transitions (drawn - as bars) ; - I is the transition input relation and is represented by means of arcs directed from places to transitions ; - O is the transition output relation and is represented by means of arcs directed from transitions to places; - M={m1,m2,m3,…,mnp} is the marking. The generic entry m i is the number of tokens (drawn as black dots) in place p i in marking M. - The graphical structure of a PN is a bipartite directed graph: the nodes belong to tow different classes (places and transitions) and edges (arcs) are allowed to connect only nodes of different classes ( multiple arcs are possible in the definition of the I and O relations)
  • 17. What is Petri net? The dynamics of a PN is obtained by moving the tokens in the places by means of the following execution rules: 1. A transition is enabled in marking M if all its input places carry at least one token; An enabled 2. transition fires by removing one token per arc from each input place and adding one token per arc to each output place Given an initial marking M1, The reachability set R(m1) is the set of all the markings that can be obtained by repeated application of a above rules
  • 18. A transition is enabled in marking M if all its input places carry at least one token An enabled transition fires by removing one token per arc from each input place and adding one token per arc to each output place tk is enabled in marking M if: For any ` , mi ≥ 1 Marking M`, obtained from M by firing tk , is said to be immediately reachable from M and the firing operation is denoted by the symbol (M tk M`) M` is given by the following relationship: M`= M(p i) +1 if pi i ϵ O(t k), pi no ϵ I (t k ) M(p i) -1 if pi no ϵ O )t k ), p i ϵ I (tk ) M(pi ) otherwise
  • 19. Petri Nets and the Modeling of Systems - PN used for modeling real systems are sometimes referred to as condition /event nets - Places identify the condition of the parts of the system ( working, failed, idle…) - Transitions describe the passage from one condition to another An event occurs (transition fires) - - Occurrence of the event modifies in whole or in part the status of the conditions (marking) - The number of tokens in a place can be used to identify the number of resources
  • 20. Typical Situation of Interaction of activities arising in system modeling 1. concurrency ( or parallelism) In figure 1 the activities modeled by tow transitions run concurrently 2. Synchronization In figure 2 the Synchronization activityis modeled by means of transitionT1 3.conflict In figure 3 t1 and t2 are allowed to fire concurrently, but are connected to a shared resource (one token), that can not be accessed by t1, t2 simultaneously.
  • 22. Examples multiplicity/resources individuality/data A A B A B A B conflict / choic (4) (5) (6) t1 t2 t3 t4
  • 23. Weighted Petri nets - Original Petri nets : only 1 token can be removed/added from a place when a transition fires (i.e. the weight is always 1) - Weighted Petri nets: - Generalized the original Petri nets to allow multiple tokens to be added/removed when a transition fires. - The edges are labeled with the weight( i.e. number of tokens) -If there is no label, then the default value is 1.
  • 24. Mathematical definition: P={p1, p2, ….pm} is a finite set of places T={t1,t2…,tn } is a finite set of transitions F ⊆(pχT) U (pχT) is a set of arcs W: F→ {1,2,3, …} is a weighting function M0 :P → {1,2,3,….} is the initial marking P∩T=Ø and P UT≠Ø Example Petri net before transition t1 fires after t1 fires p1 p2 p3 t1 2 4 p1 p2 p3 t1 2 4
  • 25. Reachability • Reachability set and Reachability Graph R(M0)is a set of all possible markings reachable from the initial marking M0 • If marking M is in the reachability set R(M0), it means that there exist a firing sequence transforming M0 into M • This is an useful property for analysis of systems. We can ask whether : A desired stat can be reached at all? Is it possible for a system to arrive at an undesired state (erroneous) ?
  • 26. Reachabilty Graph • Reachabilty can be analysed by building a reachabiltiy graph • Reachabilty graph is a directed Graph where nodes represents marking and edge –transitions between tow Markings • The Graph is constructed by finding all possible transition from initial marking this gives a set of markings reachable from the initial one then all possible transitions from the previously discovered • May lead to extremely large graph
  • 27. Example : two users share printer End print End print start print start print User1-work User1-finish User2-finish User2-work Printer free
  • 28. Properties of Petri nets • Petri nets Properties are basis for their formal analysis • The following Properties are commonly used: - Reachability - Liveness - Boundedness
  • 29. Properties of Petri nets • Liveness: A potentially firable in M if there exist sequence of transition firings which leads to a marking in which the transition is enabled. A transition is live if it is potentially firable in any marking of R(M1 ). A transition is dead in M if it is not potentially firable; if the PN enters marking M the dead transition can not fire any more. • In other words every transition of the net can fire an infinite number of times • A Petri net PN is structurally live, if any initial marking of PN is live • Liveness may be used to modeled the occurrences of deadlocks.
  • 30. • Safeness A place is safe if the token count does not exceed 1 in any marking of R(M1 ). A PN is safe if each place is safe. • Boundedness A simple generalization of safeness is the concept of boundedness. A place is bounded with bound k, if the token count does not exceed k in any marking of R(M1 ). A PN is k- bounded if each place is k- bounded. • Conservation APN is strictly conservative if the total number of tokens is constant in each Marking of R(M1).
  • 31. High level Petri nets • Petri nets have been extended over the year in many directions including time. Hierarchical Petri nets : • developed in the late 1980s • Specifications for real systems have a tendency to become large and complex • An Abstraction mechanism, hierarchical structuring reviewing and modifying the model easier • The hierarchical construct is called a subnet • A subnet is an aggregate of a number of places transitions, and subsystem Such a construct can be used to structure large processes • At one level we want to give a simple description of the process (without having to consider all details). • Another level we want to specify a more detailed | behavior.
  • 32. 2. Coloured Petri Nets • Developed in the late 1970s K. Jensen, “colored Petri nets and invariant method” Theoretical computer science, volume 14, 1981.PP 317-336. • Token often present objects (e.g. resources, goods, humans) in the modeled system • To represent attributes of these objects, the Petri nets model is extended with colored or typed tokens • Each token has a value often referred to as a color • Transitions use the values of the consumed token to determine the values of the produced tokens • Transition describes the relation between the values of the input tokens and the values of the output tokens It is also possible to specify preconditions which take the color of tokens to be consumed into account
  • 33. An overview of Performance Evaluation • Computer system users, administrators ,and designers are all interested in Performance Evaluation • Goal: the highest Performance at the lowest cost The computer industry is becoming more competitive Search the best cost - Performance • Need to Performance Evaluation at every stage in life cycle of computer system ( design- manufactoring- sales/purchase-use- upgrade…) • Designer compare number of alternatives designs to find best Even no alternatives to help in determining how well it is performing, improvement need to be made First to Performance Evaluation select ( right measure of Per., right measurement environment, and right techniques
  • 34.  The use of M&S within engineering is well recognized. Simulation technology belongs to the tool set of engineers of all application domains and has been included in the body of knowledge of engineering management. M&S helps to reduce costs, increase the quality of products and systems, and document and archive lessons learne