CMP 472 Merged
CMP 472 Merged
CMP 472 Merged
Simulation
Dr. S. A. Arekete
CMP 472 – MODELLING & SIMULATION
• Study of complex dynamic systems in relation to performance,
reliability, etc. Examples of simulation models used in the phase
of complex projects. Simulation models as approximations to
complex systems. Techniques for capturing essential properties
of the complex in the model. Behavior studies and test-runs of
simulation models. Analyzing the statistical properties of metrics
such as system response time and throughout. Course will
involve a major project to create a simulation model of a real-
world system. Simulation and Monte Carlo Methods: Uniform
random number generators, bootstrap methods. Use of MAPLE,
MATLAB, or MATHEMATICA.
Work Plan for the Course
Week 1: Course overview and outline; Complex Systems and its features
Week 2: Modelling; Why computer modelling? Type of Models
Week 3: Functions, Sequences and Dynamic systems;
Week 4: Dynamic Systems Model 1; Modelling change with difference equations
Week 5: Dynamic Systems Model 2; Approximating change with difference equations
Week 6: Dynamic Systems Model 3; Solutions to dynamic systems
Test 1
Week 7: Simulation Models; Models in Excel; Choosing samples for uncertain variables
Week 8: Probability distributions for Simulation
Week 9: Behaviour studies and test runs of simulation models
Week 10: Analysis of Simulation Reports
Mid-term Test
Week 11: Monte Carlo Simulation
Week 12: Bootstrapping
Revision
Recommended Textbooks
1. Modelling and Simulation - Exploring Dynamic System
Behaviour (Third Edition) by Louis G. Birta & Gilbert Arbez
(Springer)
2. Introduction to the Modeling and Analysis of Complex Systems
by Hiroki Sayama Published by Open SUNY Textbooks, Milne
Library State University of New York at Geneseo Geneseo, NY
14454
The Heart of Modelling and Simulation
Introduction 28
Types of Models
Physical
(Scale models, prototype plants,…)
Mathematical
(Analytical queueing models, linear programs,
simulation)
Introduction 29
What is Simulation?
A Simulation of a system is the operation of a model, which is a
representation of that system.
The model is amenable to manipulation which would be
impossible, too expensive, or too impractical to perform on the
system which it portrays.
The operation of the model can be studied, and, from this,
properties concerning the behavior of the actual system can be
inferred.
Introduction 30
CMP 472 Modelling and
Simulation
Dr. S. A. Arekete
CMP 472 – MODELLING & SIMULATION
• Study of complex dynamic systems in relation to performance,
reliability, etc. Examples of simulation models used in the phase
of complex projects. Simulation models as approximations to
complex systems. Techniques for capturing essential properties
of the complex in the model. Behavior studies and test-runs of
simulation models. Analyzing the statistical properties of metrics
such as system response time and throughout. Course will
involve a major project to create a simulation model of a real-
world system. Simulation and Monte Carlo Methods: Uniform
random number generators, bootstrap methods. Use of MAPLE,
MATLAB, or MATHEMATICA.
Work Plan for the Course
Week 1: Course overview and outline; Complex Systems and its features
Week 2: Modelling; Why computer modelling? Type of Models
Week 3: Functions, Sequences and Dynamic systems;
Week 4: Dynamic Systems Model 1; Modelling change with difference equations
Week 5: Dynamic Systems Model 2; Approximating change with difference equations
Week 6: Dynamic Systems Model 3; Solutions to dynamic systems
Test 1
Week 7: Simulation Models; Models in Excel; Choosing samples for uncertain variables
Week 8: Probability distributions for Simulation
Week 9: Behaviour studies and test runs of simulation models
Week 10: Analysis of Simulation Reports
Mid-term Test
Week 11: Monte Carlo Simulation
Week 12: Bootstrapping
Revision
Recommended Textbooks
1. Modelling and Simulation - Exploring Dynamic System
Behaviour (Third Edition) by Louis G. Birta & Gilbert Arbez
(Springer)
2. Introduction to the Modeling and Analysis of Complex Systems
by Hiroki Sayama Published by Open SUNY Textbooks, Milne
Library State University of New York at Geneseo Geneseo, NY
14454
Complex System
Emergence
• The idea of emergence was originally discussed in philosophy more than a
century ago.
• There are many natural phenomena where some property of a system
observed at macroscopic scales simply can’t be reduced to microscopic
physical rules that drive the system’s behavior.
• For example, you can easily tell that a dog wagging its tail is alive, but it is
extremely difficult to explain what kind of microscopic physical/chemical
processes going on in its body are making this organism “alive.”
• Another typical example is your consciousness. You know you are
conscious, but it is hard to describe what kind of neurophysiological
processes make you a “conscious” entity.
• Those macroscopic properties (livingness, consciousness) are called
emergent properties of the systems.
Complex System Science..
Emergence..
• There are a number of different definitions for the concept of
emergence in complex systems science. However, the one thing
that is common in most of the proposed definitions is that the
emergence is about the system’s properties at different scales.
• If you observe a property at a macroscopic scale that is
fundamentally different from what you would naturally expect
from microscopic rules, then you are witnessing emergence.
• More concisely, emergence is a nontrivial relationship between
the system’s properties at different scales.
Complex System Science..
Emergence..
• This definition was proposed by complex systems scientist
Yaneer Bar-Yam [4]:
• Emergence is a nontrivial relationship between the properties
of a system at microscopic and macroscopic scales.
Macroscopic properties are called emergent when it is hard to
explain them simply from microscopic properties.
Complex System Science..
Self-Organization
• Another key idea of complex systems science is self-organization,
which is sometimes confused with emergence.
• Some researchers even use these terms almost interchangeably.
• One clear distinction, though, is that, while emergence is about
scale, self-organization is about time (in addition to scale).
• That is, you call something self-organizing when you observe
that the system spontaneously organizes itself to produce a
nontrivial macroscopic structure and/or behaviour (or “order,” if
you will) as time progresses.
Complex System Science..
Self-Organization..
• In other words, self-organization is a dynamical process that looks as
if it were going against the second law of thermodynamics (which
states that entropy of a closed system increases monotonically over
time).
• Many physical, biological, and social systems show self-organizing
behaviour, which could appear mysterious when people were not
aware of the possibility of self-organization.
• Of course, these systems are not truly going against the law of
thermodynamics, because they are open systems that are driven by
energy flow coming from and going to the outside of the system.
• In a sense, the idea of self-organization gives a dynamical explanation
for emergent properties of complex systems.
Complexity
• Systems exhibit complexity when difficulties with modeling them
are prevalent.
• This means their behaviours cannot be understood apart from
the very properties that make them difficult to model, and they
are governed entirely, or almost entirely, by the behaviors those
properties produce.
• Any modeling approach that ignores such difficulties or
characterizes them as noise, then, will necessarily produce
models that are neither accurate nor useful.
Complexity..
• As yet no fully general theory of complex systems has emerged
for addressing these problems, so researchers must solve them
in domain-specific contexts.
• Researchers in complex systems address these problems by
viewing the chief task of modeling to be capturing, rather than
reducing, the complexity of their respective systems of interest.
Complexity..
Networks
• The interacting components of a complex system form a
network, which is a collection of discrete objects and
relationships between them, usually depicted as a graph of
vertices connected by edges.
• Networks can describe the relationships between individuals
within an organization, between logic gates in a circuit, between
genes in gene regulatory networks, or between any other set of
related entities.
Complexity..
Networks
• Networks often describe the sources of complexity in complex
systems. Studying complex systems as networks therefore enables
many useful applications of graph theory and network science.
• Some complex systems, for example, are also complex networks,
which have properties such as power-law degree distributions that
readily lend themselves to emergent or chaotic behaviour.
• The fact that the number of edges in a complete graph grows
quadratically in the number of vertices sheds additional light on the
source of complexity in large networks: as a network grows, the
number of relationships between entities quickly dwarfs the number
of entities in the network.
Complexity..
Features
• Complex systems may have the following features:
1. Cascading failures: Due to the strong coupling between
components in complex systems, a failure in one or more
components can lead to cascading failures which may have
catastrophic consequences on the functioning of the system.
Localized attack may lead to cascading failures in spatial networks.
2. Complex systems may be open: Complex systems are usually
open systems — that is, they exist in a thermodynamic
gradient and dissipate energy. In other words, complex systems
are frequently far from energetic equilibrium: but despite this
flux, there may be pattern stability.
Complexity..
Features
3. Complex systems may have a memory: The history of a complex
system may be important. Because complex systems are dynamical
systems they change over time, and prior states may have an
influence on present states. More formally, complex systems often
exhibit spontaneous failures and recovery as well as hysteresis.
Interacting systems may have complex hysteresis of many
transitions.
4. Complex systems may be nested: The components of a complex
system may themselves be complex systems. For example, an
economy is made up of organisations, which are made up of
people, which are made up of cells - all of which are complex
systems.
.
Complexity..
Features..
5. Dynamic network of multiplicity: As well as coupling rules, the dynamic
network of a complex system is important. Small-world or scale-free networks
which have many local interactions and a smaller number of inter-area
connections are often employed. Natural complex systems often exhibit such
topologies. In the human cortex for example, we see dense local connectivity
and a few very long axon projections between regions inside the cortex and to
other brain regions.
6. May produce emergent phenomena: Complex systems may exhibit behaviours
that are emergent, which is to say that while the results may be sufficiently
determined by the activity of the systems' basic constituents, they may have
properties that can only be studied at a higher level. For example, the termites
in a mound have physiology, biochemistry and biological development that are
at one level of analysis, but their social behaviour and mound building is a
property that emerges from the collection of termites and needs to be analysed
at a different level.
Complexity..
Features..
7. Relationships are non-linear: In practical terms, this means a
small perturbation may cause a large effect (see butterfly
effect), a proportional effect, or even no effect at all. In linear
systems, effect is always directly proportional to cause.
8. Relationships contain feedback loops: Both negative
(damping) and positive (amplifying) feedback are always found
in complex systems. The effects of an element's behaviour are
fed back in such a way that the element itself is altered.
CMP 472 Modelling and
Simulation
Dr. S. A. Arekete
Modelling; Type of Models;
Why computer modelling?
Modelling
• where xk = x(tk).
• We call CS[x] the
characterizing sequence for x.
Discrete-Time Variables..
Representation of Sample DTV
• We note that there are two
separate aspects of this
representation; namely, the
time sequence and the value
sequence.
• In fact, it is convenient to
separate the two underlying
sequences in the following
way:
Discrete-Time Variables..
Representation of Sample DTV
1
Module 6:
Mathematical Modelling
2
What is Mathematical Modeling?
• The application of mathematics to describe realworld problems
and investigating important questions that arise from it.
• Using mathematical tools, the real-world problem is translated
to a mathematical problem, which mimics the real-world
problem.
• A solution to the mathematical problem is obtained, which is
interpreted in the language of real-world problem to make
predictions about the real world.
3
What is Mathematical Modeling?
• Real-world problems are problems from biology, chemistry,
engineering, ecology, environment, physics, social sciences,
statistics, wildlife management and so on.
• Mathematical modeling (MM) can be described as an activity
which allows a mathematician to be biologist, chemist, ecologist,
economist depending on the problem that he/she is tackling.
• The primary aim of a modeler is to undertake experiments on
the mathematical representation of a real-world problem,
instead of undertaking experiments in the real world.
4
Challenges in mathematical modeling
• “........not to produce the most comprehensive descriptive model
but to produce the simplest possible model that incorporates
the major features of the phenomenon of interest.” - Howard
Emmons
5
Importance of Mathematical Modeling
• A mathematical model is a mathematical description of a real life
situation.
• Therefore, we can get a better understanding of the system
through proper analysis of the model using appropriate
mathematical tools.
• Moreover, in the process of building the model, we discover
various factors which govern the system, factors which are most
important to the system and that reveal how different aspects of
the system are related.
6
Importance of Mathematical Modeling..
• The importance of mathematical modeling in physics, chemistry,
biology, economics and even industry cannot be ignored.
• Mathematical modeling in basic sciences is gaining popularity,
mainly in biological sciences, economics and industrial problems.
• For example, if we consider mathematical modelling in the steel
industry, many aspects of steel manufacture, from mining to
distribution, are susceptible to mathematical modeling.
7
Importance of Mathematical Modeling..
• Steel companies have participated in several mathematics-
industry workshops, where they discussed various problems and
obtained solution through mathematical modeling - problems
involving control of ingot cooling, heat and mass transfer in blast
furnaces, hot rolling mechanics, friction welding, spray cooling
and shrinkage in ingot solidification, to mention a few [91].
8
Importance of Mathematical Modeling..
• Similarly, mathematical modeling can be used
i. to study the growth of plant crops in a stressed environment,
ii.to study mRNA transport and its role in learning and memory,
iii.
to model and predict climate change,
iv.to study the interface dynamics for two liquid films in the context of
organic solar cells,
v. to develop multi-scale modeling in liquid crystal science and many
more.
9
Importance of Mathematical Modeling..
• For gaining physical insight, analytical techniques are used.
• However, to deal with more complex problems, numerical
approaches are quite handy.
• It is always advisable and useful to formulate a complex system
with a simple model whose equation yields an analytical
solution.
• Then the model can be modified to a more realistic one that can
be solved numerically.
• Together with the analytical results for simpler models and the
numerical solution from more realistic models, one can gain maximum
insight into the problem.
10
Latest Developments in Mathematical
Modeling
• Mathematical modeling is an area of great development and
research.
• Recently, mathematical models have been used to validate
hypotheses made from experimental data, and at the same time the
designing and testing of these models has led to testable
experimental predictions.
• There are impressive cases in which mathematical models have
provided fresh insight into biological systems, physical systems,
decision making problems, space models, industrial problems,
economical problems and so forth.
• The development of mathematical modeling is closely related to
significant achievements in the field of computational mathematics.
11
Latest Developments in Mathematical
Modeling..
• Consider a new product being launched by a company. In the
development process, there are critical decisions involved in its
launch such as timing, determining price, launch sequence, etc.
• Experts use and develop mathematical models to facilitate such
decision making.
• Similarly, in order to survive market competition, cost reduction is
one of the main strategies for a manufacturing plant, where a large
amount of production operation costs are involved.
• Proper layout of equipment can result in a huge reduction in such
costs.
• This leads to dynamic facility layout problem for finding equipment
sites in manufacturing environments, which is one of the developing
areas in the field of mathematical modeling [122].
12
Latest Developments in Mathematical
Modeling..
• Mathematical modeling also intensifies the study of potentially
deadly flu viruses from mother nature and bio-terrorists.
• Mathematical models are also being developed in optical
sciences [6], namely, diffractive optics, photonic band gap
structures and wave guides, nutrient modeling, studying the
dynamics of blast furnaces, studying erosion, and prediction of
surface subsidence.
13
Latest Developments in Mathematical
Modeling..
• In geosciences, mathematical models have been developed for
talus.
• Talus is an accumulation of rock debris formed close to mountain
walls, mainly through many small rockfalls.
• Hiroyuki and Yukinori [90] have constructed a new mathematical
model for talus development and retreat of cliffs behind the
talus, which was later applied to the result of a field experiment
for talus development at a cliff composed of chalk.
• Their model was found to be in agreement with the field observations.
14
Latest Developments in Mathematical
Modeling..
• In geosciences, mathematical models have been developed for
talus.
• Talus is an accumulation of rock debris formed close to mountain
walls, mainly through many small rockfalls.
• Hiroyuki and Yukinori [90] have constructed a new mathematical
model for talus development and retreat of cliffs behind the
talus, which was later applied to the result of a field experiment
for talus development at a cliff composed of chalk.
• Their model was found to be in agreement with the field observations.
15
Latest Developments in Mathematical
Modeling..
• There has been tremendous development in the interdisciplinary field
of applied mathematics in human physiology in the last decade, and
development continues.
• One of the main reasons for this development is the researcher’s
improved ability to gather data, whose visualization have much better
resolution in time and space than just a few years ago.
• At the same time, this development also constitutes a giant collection
of data as obtained from advanced measurement techniques.
• Through statistical analysis, it is possible to find correlations, but such analysis
fails to provide insight into the mechanisms responsible for these correlations.
• However, when it is combined with mathematical modeling, new insights into
the physiological mechanisms are revealed.
16
Latest Developments in Mathematical
Modeling..
• There has been tremendous development in the interdisciplinary field
of applied mathematics in human physiology in the last decade, and
development continues.
• One of the main reasons for this development is the researcher’s
improved ability to gather data, whose visualization have much better
resolution in time and space than just a few years ago.
• At the same time, this development also constitutes a giant collection
of data as obtained from advanced measurement techniques.
• Through statistical analysis, it is possible to find correlations, but such analysis
fails to provide insight into the mechanisms responsible for these correlations.
• However, when it is combined with mathematical modeling, new insights into
the physiological mechanisms are revealed.
17
Latest Developments in Mathematical
Modeling..
• Mathematical models are being developed in the field of cloud
computing to facilitate the infrastructure of computing resources
in which large pools of systems (or clouds) are linked together
via the Internet to provide IT services (for example, providing
secure management of billions of online transactions) [25].
• Development of mathematical models are also noticed
(i) in the study of variation of shielding gas in GTA welding,
(ii) for prediction of aging behavior for Al-Cu-Mg/Bagasse Ash particular
composites,
18
Latest Developments in Mathematical
Modeling..
(iii) for public health decision making and estimations,
(iv) for developing of cerebral cortical folding patterns which have
fascinated scientists with their beauty and complexity for centuries,
(v) to predict sunflower oil expression,
(vi) in the development of a new three dimensional mathematical
ionosphere model at the European Space Agency/European Space
Operators Centre,
(vii) in battery modeling or mathematical description of batteries, which
plays an important role in the design and use of batteries, estimation of
battery processes and battery design.
19
Limitations of Mathematical Modeling
• Sometimes mathematical model may give unexpected results or
simply fail.
• This may indicate that we have reached the limit of the present
mathematical model and must look for a new refinement of the
real-world or a new theoretical breakthrough [10].
• A similar type of problem was addressed in [6], which deals with
Moire theory, involving the mathematical modeling of the
phenomena that occur in the superposition of two or more
structures (line gratings, dot screens, etc.), either periodic or
not.
20
Limitations of Mathematical Modeling..
• In MM, more assumptions must be made, as information about
real-world systems become less precise or harder to measure.
• Modeling becomes a less precise endeavor as it moves away
from physical systems towards social systems.
• For example, modeling an electrical circuit is much more
straightforward than modeling human decision making or the
environment.
• Since physical systems usually do not change, reasonable past
information about a physical system is quite valuable in
modeling future performance.
21
Limitations of Mathematical Modeling..
• However, both social systems and environments often change in
ways that are not of the past, and even correct information may
be of less value in forming assumptions.
• Thus, to understand a model’s limitations, it is important to
understand the basic assumptions that were used to create it.
22
Limitations of Mathematical Modeling..
• Real-world systems are complex and a number of interrelated
components are involved.
• Since models are abstractions of reality, a good model must try to
incorporate all critical elements and interrelated components of the
real-world system. This is not always possible.
• Thus, an important inherent limitation of a model is created by what
is left out.
• Problems arise when key aspects of the real-world system are
inadequately treated in a model or are ignored to avoid
complications, which may lead to incomplete models.
• Other limitations of a mathematical model are that they may assume
the future will be like the past, input data may be uncertain or the
usefulness of a model may be limited by its original purpose.
23
Limitations of Mathematical Modeling..
• However, despite all these limitations and pitfalls, a good model can
be formulated, if a modeler asks himself/herself the following
questions about the model:
(i) Does the structure of the model resemble the system being modeled?
(ii) Why is the selected model appropriate to use in a given application?
(iii) How well does the model perform?
(iv) Has the model been analyzed by someone other than the model authors?
(v) Is adequate documentation of the model available for all who wish to study
it?
(vi) What assumptions and data were used in producing model output for the
specific application?
(vii) What is the accuracy of the model output?
24
Limitations of Mathematical Modeling..
• One should not extrapolate the model beyond the region of fit.
• A model should not be applied unless one understands the
simplifying assumptions on which it is based and can test their
applicability.
• It is also important to understand that the model is not the reality
and one should not distort reality to fit the model.
• A discredited model should not be retained and one should not limit
himself to a single model, as more than one model may be useful for
understanding different aspects of the same phenomenon.
• It is imperative to be aware of the limitations inherent in models. There is no
best model, only better models.
25
Introduction to Discrete Models
• In discrete models, the state variables change only at a countable number of
points in time.
• These points in time are the ones at which the event occurs/change in state.
• Thus, in discrete time modeling, there is a state transition function which
computes the state at the next time instant given the current state and input.
• The changes are really discrete in many situations which occur at well defined
time intervals.
• Moreover, in many cases, the data are usually discrete rather than continuous.
• Hence, due to the limitations of the available data, we may be compelled to
work with the discrete model, even though the underlying model is
continuous.
26
Introduction to Discrete Models
• In discrete models, the state variables change only at a countable number of
points in time.
• These points in time are the ones at which the event occurs/change in state.
• Thus, in discrete time modeling, there is a state transition function which
computes the state at the next time instant given the current state and input.
• The changes are really discrete in many situations which occur at well defined
time intervals.
• Moreover, in many cases, the data are usually discrete rather than continuous.
• Hence, due to the limitations of the available data, we may be compelled to
work with the discrete model, even though the underlying model is
continuous.
27
Introduction to Discrete Models..
28
Introduction to Discrete Models..
29
Linear Models
We take a look at some linear models in this session
30
Population Model Involving Growth
31
Population Model Involving Growth
32
Population Model Involving Growth
33
Population Model Involving Growth
34
Population Model Involving Growth
Year0 0 150 Year0 0 150
Year1 1 146 .. .. ..
Year2 2 142 .. .. ..
Year3 3 137 Year153 153 2
Year4 4 133 Year154 154 2
Year5 5 129 Year155 155 2
Year6 6 125 Year156 156 2
Year7 7 122 Year157 157 2
Year8 8 118 Year158 158 2
Year9 9 115 Year159 159 2
Year10 10 111 Year160 160 2
Year11 11 108 Year161 161 2
Year12 12 105 Year162 162 2
Year13 13 101 Year163 163 2
Year14 14 98 Year164 164 2
Year15 15 95 Year165 165 1
35
Population Model Involving Growth
Population Growth, Initial Population = 150, growth Rate= -3%
160
140
120
100
80
60
40
20
0
0 20 40 60 80 100 120 140 160 180 200
36
Population Model Involving Growth
Year0 0 150 Year0 0 150
Year1 1 146 .. .. ..
Year2 2 142 .. .. ..
Year3 3 137 Year153 153 2
Year4 4 133 Year154 154 2
Year5 5 129 Year155 155 2
Year6 6 125 Year156 156 2
Year7 7 122 Year157 157 2
Year8 8 118 Year158 158 2
Year9 9 115 Year159 159 2
Year10 10 111 Year160 160 2
Year11 11 108 Year161 161 2
Year12 12 105 Year162 162 2
Year13 13 101 Year163 163 2
Year14 14 98 Year164 164 2
Year15 15 95 Year165 165 1
37
Population Model Involving Growth
Population Growth Po = 150 and Growth Rate = +3%
200
180
160
140
120
100
80
60
40
20
0
0 5000 10000 15000 20000 25000 30000
38
Newton’s Law of Cooling
39
Newton’s Law of Cooling..
40
Newton’s Law of Cooling..
41
Newton’s Law of Cooling..
42
Newton’s Law of Cooling..
43