Hands On Simulation Modeling With Python Develop Simulation Models to Get Accurate Results and Enhance Decision Making Processes 1st Edition by Giuseppe Ciaburro 1838985093 9781838985097 - Read the ebook now with the complete version and no limits
Hands On Simulation Modeling With Python Develop Simulation Models to Get Accurate Results and Enhance Decision Making Processes 1st Edition by Giuseppe Ciaburro 1838985093 9781838985097 - Read the ebook now with the complete version and no limits
https://ebookball.com/product/hands-on-simulation-modeling-
with-python-develop-simulation-models-to-get-accurate-
results-and-enhance-decision-making-processes-1st-edition-
by-giuseppe-ciaburro-1838985093-9781838985097-15116/
OR CLICK BUTTON
DOWLOAD NOW
ebookball.com
ebookball.com
https://ebookball.com/product/excel-data-analysis-modeling-and-
simulation-1st-edition-by-hector-guerrero-
isbn-3642108342-9783642108341-15884/
ebookball.com
https://ebookball.com/product/computational-modeling-and-simulation-
of-intellect-1st-edition-by-boris-igelnik-
isbn-1609605527-9781609605520-9100/
ebookball.com
Excel Data Analysis Modeling and Simulation 1st Edition by
Hector Guerrero ISBN 3642108350 9783642108358
https://ebookball.com/product/excel-data-analysis-modeling-and-
simulation-1st-edition-by-hector-guerrero-
isbn-3642108350-9783642108358-9454/
ebookball.com
https://ebookball.com/product/modeling-and-simulation-of-dynamic-
systems-1st-edition-by-robert-woods-kent-
lawrence-0133373797-9780133373790-18476/
ebookball.com
ebookball.com
ebookball.com
ebookball.com
Hands-On
Simulation Modeling
with Python
Giuseppe Ciaburro
BIRMINGHAM—MUMBAI
Hands-On Simulation Modeling with Python
Copyright © 2020 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system,
or transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers
and distributors, will be held liable for any damages caused or alleged to have been caused
directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
Why subscribe?
• Spend less time learning and more time coding with practical eBooks and Videos
from over 4,000 industry professionals
• Improve your learning with Skill Plans built especially for you
• Get a free eBook or video every month
• Fully searchable for easy access to vital information
• Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at packt.com and as a print
book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
[email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for
a range of free newsletters, and receive exclusive discounts and offers on Packt books and
eBooks.
Contributors
About the author
Giuseppe Ciaburro holds a PhD in environmental technical physics, along with two
master’s degrees. His research was focused on machine learning applications in the study
of urban sound environments. He works at the Built Environment Control Laboratory
at the Università degli Studi della Campania Luigi Vanvitelli, Italy. He has over 18 years’
professional experience in programming (Python, R, and MATLAB), first in the field
of combustion, and then in acoustics and noise control. He has several publications to
his credit.
About the reviewers
Greg Walters has been involved with computers and computer programming since
1972. He is well versed in Visual Basic, Visual Basic.NET, Python, and SQL, and is an
accomplished user of MySQL, SQLite, Microsoft SQL Server, Oracle, C++, Delphi,
Modula-2, Pascal, C, 80x86 Assembler, COBOL, and Fortran. He is a programming
trainer and has trained numerous individuals in many pieces of computer software,
including MySQL, Open Database Connectivity, Quattro Pro, Corel Draw!, Paradox,
Microsoft Word, Excel, DOS, Windows 3.11, Windows for Workgroups, Windows 95,
Windows NT, Windows 2000, Windows XP, and Linux. He is currently retired and, in his
spare time, is a musician and loves to cook. He is also open to working as a freelancer on
various projects.
Yoon Hyup Hwang is a seasoned data scientist in the marketing and finance industries
and is the author of two applied machine learning books. He has almost a decade of
experience building numerous machine learning models and data science products.
He holds an M.S.E. in Computer and Information Technology from the University of
Pennsylvania and a B.A. in Economics from the University of Chicago. He enjoys training
various martial arts, snowboarding, and roasting coffee. He currently lives in the Greater
New York Area with his artist wife, Sunyoung, and a playful dog, Dali (named after
Salvador Dali).
Preface
Section 1:
Getting Started with Numerical Simulation
1
Introducing Simulation Models
Introducing simulation models 4 Problem analysis 11
Decision-making workflow 5 Data collection 11
Comparing modeling and simulation 6 Setting up the simulation model 11
Pros and cons of simulation modeling 6 Simulation software selection 13
Simulation modeling terminology 7 Verification of the software solution 14
Validation of the simulation model 15
Classifying simulation models 9 Simulation and analysis of results 16
Comparing static and dynamic models 9
Comparing deterministic and Dynamical systems modeling 16
stochastic models 9 Managing workshop machinery 17
Comparing continuous and discrete Simple harmonic oscillator 18
models10 Predator-prey model 20
2
Understanding Randomness and Random Numbers
Technical requirements 24 Examples of stochastic processes 26
Stochastic processes 24 The Bernoulli process 26
Random walk 27
Types of stochastic process 25
The Poisson process 29 Exploring generic methods for
random distributions 51
Random number simulation 30
The inverse transform sampling method 51
Probability distribution 31
The acceptance-rejection method 52
Properties of random numbers 32
Random number generation
The pseudorandom number using Python 53
generator33
Introducing the random module 54
The pros and cons of a random
The random.random() function 54
number generator 33
The random.seed() function 55
Random number generation algorithms 34
The random.uniform() function 56
Linear congruential generator 34
The random.randint() function 56
Random numbers with uniform
The random.choice() function 57
distribution37
The random.sample() function 58
Lagged Fibonacci generator 39
Generating real-valued distributions 58
Testing uniform distribution 42
Summary 59
The chi-squared test 42
Uniformity test 45
3
Probability and Data Generation Processes
Technical requirements 62 Exploring probability
Explaining probability concepts 62 distributions69
Types of events 62 Probability density function 70
Calculating probability 63 Mean and variance 71
Probability definition with an example 63 Uniform distribution 72
Binomial distribution 76
Understanding Bayes’ theorem 66 Normal distribution 79
Compound probability 66
Bayes’ theorem 68 Summary83
Section 2:
Simulation Modeling Algorithms and
Techniques
4
Exploring Monte Carlo Simulations
Technical requirements 88 simulation101
Introducing Monte Carlo Generating probability distributions 101
simulation88 Numerical optimization 102
Monte Carlo components 89 Project management 103
First Monte Carlo application 89
Performing numerical
Monte Carlo applications 90
integration using
Applying the Monte Carlo method for
Monte Carlo 104
Pi estimation 91
Defining the problem 104
Understanding the central limit Numerical solution 106
theorem96 Min-max detection 108
Law of large numbers 96 Monte Carlo method 109
Central limit theorem 97 Visual representation 111
5
Simulation-Based Markov Decision Processes
Technical requirements 116 The Bellman equation
Overview of Markov processes 116 explained138
The agent-environment interface 117 Dynamic programming concepts 139
Exploring MDPs 119 Principle of optimality 139
Understanding the discounted The Bellman equation 140
cumulative reward 122
Multi-agent simulation 140
Comparing exploration and
exploitation concepts 123 Summary142
7
Using Simulation to Improve and Optimize Systems
Technical requirements 170 Approaching Newton-Raphson for
numerical optimization 184
Introducing numerical
optimization techniques 170 Applying the Newton-Raphson
technique 185
Defining an optimization problem 171
Explaining local optimality 173 Deepening our knowledge of
Defining the descent methods 174 stochastic gradient descent 189
Approaching the gradient descent Discovering the multivariate
algorithm174 optimization methods in Python191
Understanding the learning rate 177
The Nelder–Mead method 191
Explaining the trial and error method 178
Powell's conjugate direction algorithm 195
Implementing gradient descent in
Summarizing other optimization
Python178
methodologies197
Facing the Newton-Raphson Summary198
method183
Using the Newton-Raphson algorithm
for root-finding 183
Section 3:
Real-World Applications
8
Using Simulation Models for Financial Engineering
Technical requirements 202 Handling the stock price trend as time
series213
Understanding the geometric
Brownian motion model 202 Introducing the Black-Scholes model 215
Applying Monte Carlo simulation 216
Defining a standard Brownian motion 203
Addressing the Wiener process as Studying risk models for
random walk 204 portfolio management 220
Implementing a standard Brownian
Using variance as a risk measure 221
motion 205
Introducing the value-at-risk metric 221
Using Monte Carlo methods for Estimating the VaR for some NASDAQ
stock price prediction 207 assets223
Exploring the Amazon stock price trend 208 Summary232
9
Simulating Physical Phenomena Using Neural Networks
Technical requirements 234 Splitting the data 256
Introducing the basics of neural Explaining multiple linear regression 258
networks 234 Understanding a multilayer perceptron
regressor model 260
Understanding biological neural
networks 235 Exploring deep neural networks264
Exploring ANNs 236
Getting familiar with convolutional
Understanding feedforward neural networks 264
neural networks 242 Examining recurrent neural networks 265
Analyzing LSTM networks 266
Exploring neural network training 243
11
What's Next?
Summarizing simulation Modeling in healthcare 304
modeling concepts 295 Modeling in financial applications 305
Generating random numbers 296 Modeling physical phenomenon 306
Applying Monte Carlo methods 298 Modeling public transportation 307
Addressing the Markov decision process299 Modeling human behavior 308
Analyzing resampling methods 300
Next steps for simulation
Exploring numerical optimization
modeling309
techniques302
Increasing the computational power 309
Using artificial neural networks for
simulation303 Machine learning-based models 311
Automated generation of simulation
Applying simulation model to models312
real life 304
Summary313
Other Books You May Enjoy
Leave a review - let other
readers know what you think 317
Preface
Simulation modeling helps you to create digital prototypes of physical models to analyze
how they work and predict their performance in the real world. With this comprehensive
guide, you’ll learn about various computational statistical simulations using Python.
Starting with the fundamentals of simulation modeling, you’ll learn about concepts
such as randomness and explore data generating processes, resampling methods,
and bootstrapping techniques. You’ll then cover key algorithms such as Monte Carlo
simulations and the Markov Decision Process, which are used to develop numerical
simulation models, and discover how they can be used to solve real-world problems.
As you make progress, you’ll develop simulation models to help you get accurate results
and enhance decision-making processes. Using optimization techniques, you’ll learn to
modify the performance of a model to improve results and make optimal use of resources.
The book will guide you through creating a digital prototype using practical use cases
for financial engineering, prototyping project management to improve planning, and
simulating physical phenomena using neural networks.
By the end of this book, you’ll be able to construct and deploy simulation models of your
own to solve real-world challenges.
Chapter 10, Modeling and Simulation for Project Management, deals with practical cases
of project management using the tools we learned how to use in the previous chapters.
We will see how to evaluate in advance the results of the actions undertaken in the
management of a forest using Markov processes, and then move on to evaluating the time
required for the execution of a project using the Monte Carlo simulation.
Chapter 11, What’s Next?, provides a better understanding of the problems associated with
building and deploying simulation models and additional resources and technologies to
learn how to hone your machine learning skills.
If you are using the digital version of this book, we advise you to type the code yourself
or access the code via the GitHub repository (link available in the next section). Doing
so will help you avoid any potential errors related to the copying and pasting of code.
Once the file is downloaded, please make sure that you unzip or extract the folder using
the latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/
PacktPublishing/Hands-On-Simulation-Modeling-with-Python. In case
there’s an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at
https://github.com/PacktPublishing/. Check them out!
Conventions used
There are a number of text conventions used throughout this book.
Code in text: Indicates code words in text, database table names, folder names,
filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles.
Here is an example: “Mount the downloaded WebStorm-10*.dmg disk image file as
another disk in your system.”
A block of code is set as follows:
import random
import statistics
import matplotlib.pyplot as plt
When we wish to draw your attention to a particular part of a code block, the relevant
lines or items are set in bold:
import random
import statistics
import matplotlib.pyplot as plt
Preface xi
$ python jakknife_estimator.py
Bold: Indicates a new term, an important word, or words that you see onscreen. For
example, words in menus or dialog boxes appear in the text like this. Here is an example:
“Select System info from the Administration panel.”
Get in touch
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book
title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you have found a mistake in this book, we would be grateful if you would
report this to us. Please visit www.packtpub.com/support/errata, selecting your
book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet,
we would be grateful if you would provide us with the location address or website name.
Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in
and you are interested in either writing or contributing to a book, please visit authors.
packtpub.com.
Reviews
Please leave a review. Once you have read and used this book, why not leave a review on
the site that you purchased it from? Potential readers can then see and use your unbiased
opinion to make purchase decisions, we at Packt can understand what you think about
our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packt.com.
Section 1:
Getting Started
with Numerical
Simulation
In this section, the basic concepts of simulation modeling are addressed. This section
helps you to understand the fundamental concepts and elements of numerical simulation.
This section contains the following chapters:
Chapter 1, Introducing Simulation Models
Chapter 2, Understanding Randomness and Random Numbers
Chapter 3, Probability and Data Generating Processes
1
Introducing
Simulation Models
A simulation model is a tool capable of processing information and data and predicting
the responses of a real system to certain inputs, thus becoming an effective support for
analysis, performance evaluation, and decision-making processes. The term simulation
refers to reproducing the behavior of a system. In general, we speak of simulation both in
the case in which a concrete model is used and in the case in which an abstract model is
used that reproduces reality using a computer. An example of a concrete model is a scale
model of an airplane that is then placed in a wind tunnel to carry out simulated tests to
estimate suitable performance measures.
Although, over the years, physicists have developed theoretical laws that we can use to
obtain information on the performance of dynamic systems, often, the application of these
laws to a real case takes too long. In these cases, it is convenient to construct a numerical
simulation model that allows us to simulate the behavior of the system under certain
conditions. This elaborated model will allow us to test the functionality of the system in a
simple and immediate way, saving considerable resources in terms of time and money.
4 Introducing Simulation Models
Important Note
In this chapter, an introduction to simulation techniques will be discussed.
In order to deal with the topics at hand, it is necessary that you have a basic
knowledge of algebra and mathematical modeling.
Important Note
Simulation is used when working on real systems is not convenient due to
high costs, technical impossibility, and the non-existence of a real system.
Simulation allows you to predict what happens to the real system if certain
inputs are used. Changing these input parameters simulates different scenarios
that allow us to identify the most convenient one from various points of view.
Introducing simulation models 5
Decision-making workflow
In a decision-making process, the starting point is identifying the problematic context
that requires a change and therefore a decision. The context that's identified is then
analyzed in order to highlight what needs to be studied for the decisions that need to be
made; that is, those elements that seem the most relevant are chosen, the relationships
that connect them are highlighted, and the objectives to be achieved are defined. At this
point, a formal model is constructed, which allows us to simulate the identified system in
order to understand its behavior and to arrive at identifying the decisions to be made. The
following diagram describes the workflow that allows us to make a decision, starting from
observing the problematic context:
Important Note
Simulation is the process that puts the model into operation and allows you
to evaluate its behavior under certain conditions. Simulation is a fundamental
tool for modeling because, without necessarily resorting to physical
prototyping, the developer can verify the functionality of the modeled system
with the project specifications.
Simulation allows us to study the system through a wide spectrum of conditions so that
we can understand how representative the model is of the system that it refers to.
• The simulation provides indications of the behavior of the system, but not
exact results.
• The analysis of the output of a simulation could be complex and it could be difficult
to identify which may be the best configuration.
• The implementation of a simulation model could be laborious and, moreover, it may
take long calculation times to carry out a significant simulation.
• The results that are returned by the simulation depend on the quality of the input
data: it cannot provide accurate results in the case of inaccurate input data.
• The complexity of the simulation model depends on the complexity of the system it
intends to reproduce.
Nevertheless, simulation models represent the best solution for the analysis of
complex scenarios.
System
The context of an investigation is represented through a system; that is, the set of elements
that interact with each other. The main problem linked to this element concerns the
system boundaries, that is, which elements of reality must be inserted in the system that
represents it and which are left out and the relationships that exist between them.
State variables
A system is described in each instant of time by a set of variables. These are called
state variables. For example, in the case of a weather system, the temperature is a state
variable. In discrete systems, the variables change instantly at precise moments of time
that are finite. In continuous systems, the variables vary in terms of continuity with
respect to time.
8 Introducing Simulation Models
Events
An event is defined as any instantaneous event that causes the value of at least one of
the status variables to change. The arrival of a blizzard for a weather system is an event,
as it causes the temperature to drop suddenly. There are both external events and
internal events.
Parameters
Parameters represent essential terms when building a model. They are adjusted during
the model simulation process to ensure that the results are brought into the necessary
convergence margins. They can be modified iteratively through sensitivity analysis or in
the model calibration phase.
Calibration
Calibration represents the process by which the parameters of the model are adjusted in
order to adapt the results to the data observed in the best possible way. When calibrating
the model, we try to obtain the best possible accuracy. A good calibration requires
eliminating, or minimizing, errors in data collection and choosing a theoretical model
that is the best possible description of reality. The choice of model parameters is decisive
and must be done in such a way as to minimize the deviation of its results when applied
to historical data.
Accuracy
Accuracy is the degree of correspondence of the simulation result that can be inferred
from a series of calculated values with the actual data, that is, the difference between
the average modeled value and the true or reference value. Accuracy, when calculated,
provides a quantitative estimate of the quality expected from a forecast. Several indicators
are available to measure accuracy. The most used are mean absolute error (MAE), mean
absolute percentage error (MAPE), and mean squared error (MSE).
Sensitivity
The sensitivity of a model indicates the degree to which the model's outputs are affected
by changes in the selected input parameters. A sensitivity analysis identifies the sensitive
parameters for the output of the model. It allows us to determine which parameters
require further investigation so that we have a more realistic evaluation of the model's
output values. Furthermore, it allows us to identify which parameters are not significant
for the generation of a certain output and therefore can possibly be eliminated from
the model. Finally, it tells us which parameters should be considered in a possible and
subsequent analysis of the uncertainty of the output values provided by the model.
Classifying simulation models 9
Validation
This is the process that verifies the accuracy of the proposed model. The model must be
validated to be used as a tool to support decisions. It aims to verify whether the model
that's being analyzed corresponds conceptually to our intentions. The validation of a
model is based on the various techniques of multivariate analysis, which, from time to
time, study the variability and interdependence of attributes within a class of objects.
A final distinction is based on how the system evolves over time: this is why we
distinguish between continuous and discrete simulation models.
Important Note
The stochastic or deterministic, or continuous or discrete, nature of a model
is not its absolute property and depends on the observer's vision of the system
itself. This is determined by the objectives and the method of study, as well as
by the experience of the observer.
Now that we've analyzed the different types of models in detail, we will learn how to
develop a numerical simulation model.
1. Problem analysis
2. Data collection
3. Setting up the simulation model
4. Simulation software selection
Approaching a simulation-based problem 11
To fully understand the whole simulation process, it is essential to analyze the various
phases that characterize a study based on simulation in depth.
Problem analysis
In this initial step, the goal is to understand the problem by trying to identify the aims
of the study and the essential components, as well as the performance measures that
interest them. Simulation is not simply an optimization technique and therefore there
is no parameter that needs to be maximized or minimized. However, there is a series of
performance indices whose dependence on the input variables must be verified. If an
operational version of the system is already available, the work is simplified as it is enough
to observe this system to deduce its fundamental characteristics.
Data collection
This represents a crucial step in the whole process since the quality of the simulation
model depends on the quality of the input data. This step is closely related to the
previous one. In fact, once the objective of the study has been identified, data is collected
and subsequently processed. Processing the collected data is necessary to transform
it into a format that can be used by the model. The origin of the data can be different:
sometimes, the data is retrieved from company databases, but more often than not, direct
measurements in the field must be made through a series of sensors that, in recent years,
have become increasingly smart. These operations weigh down the entire study process,
thus lengthening their execution times.
For example, when managing stocks, the distribution of the product being requested and
the distribution of time between an order and the receipt of the goods is necessary. On
the other hand, when managing production systems with machines that can occasionally
fail, it will be necessary to know the distribution of time until a machine fails and the
distribution of repair times.
If the system is not already available, it is only possible to estimate these distributions by
deriving them, for example, from the observation of similar, already existing systems.
If, from the analysis of the data, it is seen that this form of distribution approximates a
standard type distribution, the standard theoretical distribution can be used by carrying
out a statistical test to verify whether the data can be well represented by that probability
distribution. If there are no similar systems from which observable data can be obtained,
other sources of information must be used: machine specifications, instruction manuals
for the machines, experimental studies, and so on.
As we've already mentioned, constructing a simulation model is a complex procedure.
Referring to simulating discrete events, constructing a model involves the following steps:
After following these steps, we will have the simulation model ready for use. At this
point, it will be necessary to implement this model in a dedicated software platform;
let's see how.
Approaching a simulation-based problem 13
Now that we've made the choice of the software platform we're going to use and have
elaborated on the numerical model, we need to verify the software solution.
Important Note
One of the best techniques that can be used to verify a discrete-event
simulation program is one based on tracking. The status of the system, the
content of the list of events, the simulated time, the status variables, and the
statistical counters are shown after the occurrence of each event and then
compared with handmade calculations to check the operation of the code.
A track often produces a large volume of output that needs to be checked event by event
for errors. Possible problems may arise, including the following:
Important Note
Validation is a where the level of accuracy between the model and the system is
respected. It is necessary to establish whether the model adequately represents
the behavior of the system. The value of a model can only be defined in relation
to its use. Therefore, validation is a process that aims to determine whether a
simulation model accurately represents the system for the set objectives.
In this step, the ability of the model to reproduce the real functionality the system is
ascertained; that is, it is ensured that the calibrated parameters, relative to the calibration
scenario, can be used to correctly simulate other system situations. Once the validation
phase is over, the model can be considered transferable and therefore usable for the
simulation of any new control strategies and new intervention alternatives. As widely
discussed in the literature on this subject, it is important to validate the model parameters
that were previously calibrated on the basis of data other than that used to calibrate the
model, always with reference to the phenomenon specific to the scenario being analyzed.
16 Introducing Simulation Models
Based on these rules and the evaluation times indicated in the previous table, we can
insert the sequence of the jobs, along with the events scheduled according to the execution
times, into a table:
• is the force.
• is the elastic constant.
• is the horizontal coordinate that indicate the position of the mass m.
From the second law of dynamics, we can derive the component of acceleration along x
as follows:
𝑘𝑘
𝑎𝑎𝑥𝑥 = − ∗ 𝑥𝑥
𝑚𝑚
Here, we have the following:
• is the acceleration.
• is the elastic constant.
• is the mass of the block.
• is the horizontal coordinate that indicate the position of the mass m.
20 Introducing Simulation Models
= =
If we indicate with the rate of change of the speed and with the speed,
we can obtain the evolution equations of the dynamic system, as follows:
𝑑𝑑𝑑𝑑
= 𝑣𝑣
{ 𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑
= − 𝜔𝜔2 ∗ 𝑥𝑥
𝑑𝑑𝑑𝑑
Here, we have the following:
𝑘𝑘
• 𝜔𝜔2 = −
𝑚𝑚
For these equations, we must associate the initial conditions of the system, which we can
write in the following way:
𝑥𝑥(0) = 𝑥𝑥0
{
𝑣𝑣(0) = 𝑣𝑣0
The solutions to the previous differential equations are as follows:
𝑣𝑣0
𝑥𝑥(𝑡𝑡) = 𝑥𝑥0 cos(𝜔𝜔𝜔𝜔) + sin (𝜔𝜔𝜔𝜔)
{ 𝜔𝜔
𝑣𝑣(𝑡𝑡) = 𝑣𝑣0 cos(𝜔𝜔𝜔𝜔) − 𝑥𝑥0 𝜔𝜔 sin (𝜔𝜔𝜔𝜔)
In this way, we obtained the mathematical model of the analyzed system. In order to study
the evolution of the oscillation phenomenon of the mass block m over time, it is enough
to vary the time and calculate the position of the mass at that instant and its speed.
In decision-making processes characterized by high levels of complexity, the use of
analytical models is not possible. In these cases, it is necessary to resort to models that
differ from those of an analytical type for the use of the calculator as a tool not only for
calculation, such as in mathematical programming models, but also for representing the
elements that make up reality why studying the relationships between them.
Predator-prey model
In the field of simulations, simulating the functionality of production and logistic
processes is considerably important. These systems are, in fact, characterized by high
complexity, numerous interrelationships between the different processes that pass through
them, segment failures, unavailability, and the stochasticity of the system parameters.
Dynamical systems modeling 21
To understand how complex the analytical modeling of some phenomena is, let's analyze
a universally widespread biological model. This is the predator-prey model, which was
developed independently by the Italian researcher Vito Volterra and the American
biophysicist Alfred Lotka.
On an island, there are two populations of animals: prey and predators. The vegetation
of the island provides the prey with nourishment in quantities that we can consider as
unlimited, while the prey is the only food available for the predators. We can consider
the birth rate of the prey constant over time; this means that in the absence of predators,
the prey would grow by exponential law. Their mortality rate, on the other hand, depends
on the probability they have of falling prey to a predator and therefore on the number of
predators present per unit area.
As for the predators, the mortality rate is constant, while their growth rate depends on
the availability of food and therefore on the number of prey per unit area present on the
island. We want to study the trend of the size of the two populations over time, starting
from a known initial situation (number of prey and predators).
To carry out a simulation of this biological system, we can model it by means of the
following system of finite difference equations, where x(t) and y(t) are the number of prey
and predators at time t, respectively:
𝑑𝑑𝑑𝑑
= 𝛼𝛼 ∗ 𝑥𝑥(𝑡𝑡) − 𝛽𝛽 ∗ 𝑥𝑥(𝑡𝑡) ∗ 𝑦𝑦(𝑡𝑡)
{ 𝑑𝑑𝑑𝑑
𝑑𝑑𝑑𝑑
= 𝛾𝛾 ∗ 𝑦𝑦(𝑡𝑡) − 𝛿𝛿 ∗ 𝑥𝑥(𝑡𝑡) ∗ 𝑦𝑦(𝑡𝑡)
𝑑𝑑𝑑𝑑
Here, we have the following:
• α, β, γ, δ are positive real parameters related to the interaction of the two species
Summary
In this chapter, we learned what is meant by simulation modeling. We understood
the difference between modeling and simulation, and we discovered the strengths of
simulation models, such as defects. To understand these concepts, we clarified the
meaning of the terms that appear most frequently when dealing with these topics.
We then analyzed the different types of models: static versus dynamic, deterministic
versus stochastic, and continuous versus discrete. We then explored the workflow
connected to a numerical simulation process and highlighted the crucial steps. Finally, we
studied some practical modeling cases to understand how to elaborate on a model starting
from the initial considerations.
In the next chapter, we will learn how to approach a stochastic process and understand
the random number simulation concepts. Then, we will explore the differences between
pseudo and non-uniform random numbers, as well as the methods we can use for random
distribution evaluation.
2
Understanding
Randomness and
Random Numbers
In many real-life situations, it is useful to flip a coin in order to decide what to do. Many
computers also use this procedure as part of their decision-making process. In fact, many
problems can be solved in a very effective and relatively simple way by using probabilistic
algorithms. In an algorithm of this type, decisions are made based on random
contributions that remember the dice roll with the help of a randomly chosen value.
The generation of random numbers has ancient roots, but only recently has the process
been sped up, allowing it to be used on a large scale in scientific research as well. These
generators are mainly used for computer simulations, statistical sampling techniques, or
in the field of cryptography.
In this chapter, we're going to cover the following topics:
• Stochastic processes
• Random number simulation
• The pseudorandom number generator
24 Understanding Randomness and Random Numbers
Technical requirements
In this chapter, we will introduce random number generation techniques. In order to
understand these topics, a basic knowledge of algebra and mathematical modeling is
needed.
To work with the Python code in this chapter, you need the following files (available on
GitHub at https://github.com/PacktPublishing/Hands-On-Simulation-
Modeling-with-Python):
• LinearCongruentialGenerator.py
• LearmouthLewisGenerator.py
• LaggedFibonacciAlgorithm.py
• UniformityTest.py
• Random.Generation.py
Stochastic processes
A stochastic process is a family of random variables that depends on a parameter, t. A
stochastic process is specified using the following notation:
{𝑋𝑋𝑡𝑡 , 𝑡𝑡 ∈ 𝑇𝑇}
This means the values that the random variables, Xt, can take are called system states and
represent the possible results of an experiment. The Xt variables are linked together by
dependency relationships. We can know a random variable if we know both the values
it can assume and the probability distribution. So, to understand a stochastic process,
it is necessary not only to know the values that Xt can take but also the probability
distributions of the variables and the joint distributions between the values. Simpler
stochastic processes, in which the variability range of t is a discrete set of time values,
can also be considered.
Important note
In practice, there are numerous phenomena that are studied through the
theory of stochastic processes. A classic application in physics is the study of
the motion of a particle in each medium, the so-called Brownian motion.
This study is carried out statistically using a stochastic process. There are
processes where even by knowing the past and the present, the future cannot
be determined; whereas, in other processes, the future is determined by the
present without considering the past.
• Space of states
• Time index
• Type of stochastic dependence between random variables
The state space can be discrete or continuous. In the first case, the stochastic process
with discrete space is also called a chain, and space is often referred to as the set of
non-negative integers. In the second case, the set of values assumed by the random
variables is not finite or countable, and the stochastic process is in continuous space.
The time index can also be discrete or continuous. A discrete-time stochastic process is
also called a stochastic sequence and is denoted as follows:
{𝑋𝑋𝑛𝑛 | 𝑛𝑛 ∈ 𝑇𝑇}
In this case, the changes of state are observed only in certain instances: finite or countable.
If state changes occur at any instant in a finite or infinite set of real intervals, then there is
a continuous-time process, which is denoted as follows:
{𝑋𝑋(𝑡𝑡) | 𝑡𝑡 ∈ 𝑇𝑇}
The stochastic dependence between random variables, X(t), for different values of t
characterizes a stochastic process and sometimes simplifies its description. A stochastic
process is stationary in the strict sense that the distribution function is invariant with
respect to a shift on the time axis, T. A stochastic process is stationary in the broad sense
that the first two moments of the distribution are independent of the position on the
T axis.
• There are only two possible mutually exclusive results for each trial, arbitrarily
called success and failure.
• The probability of success, p, is the same for each trial.
• All tests are independent.
Stochastic processes 27
Independence means that the result of a test is not influenced by the result of any other
test. For example, the event, the third test was successful, is independent of the event, the
first test was successful.
The toss of a coin is a Bernoulli trial: the heads event can be considered successful, and
the tails event can be considered unsuccessful. In this case, the probability of success is p
= 1/2. In rolling two dice, the event, the sum of the points is seven, and the complementary
event are both unsuccessful. In this case, it is a Bernoulli trial and the probability of
success is p = 1/6.
Important note
Two events are said to be complementary when the occurrence of the first
excludes the occurrence of the second but one of the two will certainly occur.
Let p denote the probability of success in a Bernoulli trial. The random variable, X, which
counts the number of successes in n trials is called the binomial random variable of the n
and p parameters. X can take integer values between 0 and n.
Random walk
The random walk is a discrete parameter stochastic process in which Xt, where X
represents a random variable, describes the position taken at time t by a moving point.
The term, random walk, refers to the mathematical formalization of statistics that describe
the displacement of an object that moves randomly. This kind of simulation is extremely
important for a physicist and has applications in statistical mechanics, fluid dynamics, and
quantum mechanics.
Random walks represent a mathematical model that is used universally to simulate a path
formalized by a succession of random steps. This model can assume a variable number
of degrees of freedom, depending on the system we want to describe. From a physical
point of view, the path traced over time will not necessarily simulate a real motion, but it
will represent the trend of the characteristics of the system over time. Random walks find
applications in chemistry, biology, and physics, but also in other fields such as economics,
sociology, and information technology.
28 Understanding Randomness and Random Numbers
This shows the average number of returns to the origin of the particle, named p. The
probability of a single return is given by the following geometric series:
∞ ∞
1
𝜇𝜇 = ∑ 𝑛𝑛 𝑝𝑝𝑛𝑛 (1 − 𝑝𝑝) = ∑ 𝑛𝑛 𝑝𝑝𝑛𝑛 →∞
𝑛𝑛=0 𝑛𝑛=0
√𝑛𝑛 ∗ 𝜋𝜋
We assume that the probability of the particle returning to the origin tends to 1. This
means that despite the frequency of the returns decreasing with the increase in the
number of steps taken, they will always be in an infinite value of steps taken. So, we can
conclude that a particle with equal probability of left and right movement, left free to
walk casually to infinity with great probability, returns infinite times to the point from
which it started.
Stochastic processes 29
• The realizations of the events are independent, meaning that the occurrence of
an event in a time or space interval has no effect on the probability of the event
occurring a second time in the same, or another, interval.
• The probability of a single realization of the event in each interval is proportional to
the length of the interval.
• In any arbitrarily small part of the interval, the probability of the event occurring
more than once is negligible.
An important difference between the Poisson distribution and the binomial distribution
is the number of trials and successes. In a binomial distribution, the number, n, of trials
is finite and the number, x, of successes cannot exceed n; in a Poisson distribution, the
number of tests is essentially infinite and the number of successes can be infinitely large,
even if the probability of having x successes becomes very small as x increases.
30 Understanding Randomness and Random Numbers
Important note
These techniques have a big problem that is inherent to the algorithmic nature
of the process: the final string can be predicted from the starting seed. This is
why we call this process pseudorandom.
Despite this, many problems of an algorithmic nature are solved very effectively and
relatively simply using probabilistic algorithms. The simplest example of a probabilistic
algorithm is perhaps the randomized quicksort. This is a probabilistic variant of the
homonymous sorting algorithm, where, by choosing the pivot element, the algorithm
manages to randomly guarantee optimal complexity in the average case, no matter
the distribution of the input. Cryptography is a field in which randomness plays
a fundamental role and deserves specific mention. In this context, randomness does
not lead to computational advantages, but it is essential to guarantee the security of
authentication protocols and encryption algorithms.
Random number simulation 31
Probability distribution
It is possible to characterize a random process from different points of view. One of
the most important characteristics is the probability distribution. The probability
distribution is a model that associates a probability with each observable modality
of a random variable.
The probability distribution can be either discrete or continuous, depending on whether
the variable is random, discrete, or continuous. It is discrete if the phenomenon is
observable with an integer number of modes. The throw of the dice is a discrete
statistical phenomenon because the number of observable modalities is equal to 6. The
random variable can take only six values (1, 2, 3, 4, 5, and 6). Therefore, the probability
distribution of the phenomenon is discrete. The probability distribution is continuous
when the random variable assumes a continuous set of values; in this case, the statistical
phenomenon can be observed with an infinite or very high number of modalities. The
probability distribution of body temperature is continuous because it is a continuous
statistical phenomenon, that is, the values of the random variable vary continuously.
Let's now look at different kinds of probability distributions.
Uniform distribution
In many cases, processes characterized by a uniform distribution are considered and
used. This means that each element is as likely as any of the others to be selected if an
infinite number of extractions is performed. If you represent the elements and their
respective probabilities of being extracted on a graph, you get a rectangular graph
as follows:
“This is the fairest wedding I have ever seen,” said the preacher.
“It has always been my opinion that the lady ought to help pay the
preacher, and she receives as much benefit from the ceremony as
does the man. I hope you will always share each other’s burdens in
this way.” And wishing them happiness and prosperity, he sent them
on their way rejoicing.
The local paper gave a flowery account of the wedding that took
place on the ice, stating that it was the “slickest” wedding that had
ever occurred in that section. But the minister’s fee and the manner
of paying it was not allowed to become public, lest it should become
a troublesome precedent in matrimonial circles.
The following year, which was spent on the Centerpoint charge,
was a most fruitful one. Here, as in so many other places, he found
a splendid opportunity of demonstrating his favorite doctrine of the
resurrection—the resurrection of dead churches. The spiritual life of
the churches at Centerpoint was at ebb tide, and had been for an
indefinite time. Soon after his arrival the Methodist pastor, who was
also new in the town, called upon him to confer as to their plans for
revival work. As workers were scarce, it was thought best to plan
their meetings so that they would not conflict. Rev. Mr. Newgent,
Abraham-like, let his brother do the choosing, and the brother,
perhaps as anxious as Lot to get in on the ground floor, decided to
commence a revival at once. Newgent began a meeting at the same
time some few miles in the country. Newgent’s meeting immediately
developed into a revival of so great proportions that it became the
one overshadowing event of the whole country, drawing the
Methodist pastor’s congregation from him and rendering it
impracticable for him to continue. His situation was a rather lonely
one. In his extremity he sought another interview with his fellow
pastor, proposing to close his meeting at once if Newgent would join
him later in a union revival effort.
This Newgent consented to do on three conditions, as follows:
1. That the meetings be held in the United Brethren church.
2. That the United Brethren pastor do all the preaching.
3. That the United Brethren pastor do the managing.
Hard as the conditions seemed, the brother agreed to them. The
conditions, in fact, look egotistical and perhaps selfish on the
surface, but when the United Brethren pastor explained his reasons
for them they were seen to be neither. On the contrary they were
meant for the highest good of both churches, and were abundantly
vindicated by the outcome. He was intensely anxious that
Centerpoint have a genuine revival of religion. To promote such a
revival at any cost was his purpose. That this purpose might be
realized he would not permit modesty, formality, or any other
creature to stand in the way.
The United Brethren Church was the more commodious and had
the advantage in location. This was the reason for the first condition.
The reason for the second and third conditions was that Centerpoint
had been preached to death. A change of methods was imperative if
the people were to be reached. He wanted a meeting without
preaching, without too much human agency, but where God himself
might control to his own glory. Only by having the management left
to him could he apply the remedy needed according to his diagnosis
of the case.
His plan was now to be put to the test—a revival without
preaching, the laity to do the work as they felt divinely moved. The
meeting began on a Friday evening. But with no life there could be
no real activity. The chariot wheels dragged heavily at the first. On
Sunday morning he announced that at four o’clock p. m., a children’s
meeting would be held. Aside from selected helpers, only children
within a certain age limit would be admitted. Such meetings even at
that date were quite uncommon. The announcement, therefore,
aroused a great deal of curiosity. But that was one point in the
announcement. Something must be done to stir the people. There
must be a new avenue of approach to their cold hearts.
The children’s service produced the desired effect. At the
appointed hour the house was filled to overflowing. There were
three helpers, all ministers, present, who did their part according to
Newgent’s directions. Songs were sung, prayers offered by the
ministers as they were called upon, a brief talk by the leader, some
simple propositions, and the meeting closed in less than a half-hour
from the time it began. But that half-hour turned the tide in
Centerpoint. The children became the vanguard in a religious
movement that was to shake the town from center to circumference.
Many of them went home weeping to speak of the longing of their
tender hearts to fathers and mothers, who, in turn, were awakened
to a consciousness of their own need.
At the evening service which followed, seventy-five persons came
to the altar, most of whom professed conversion. The revival was no
longer a problem. It spread throughout the town and community like
fire in dry stubble. The church arose from the grave of lethargy and
formalism, cast off her grave clothes—and the doctrine of the
resurrection was again abundantly demonstrated.
Chapter Thirteen.
Becomes a Missionary Superintendent—Second
Marriage—An Unexpected Welcome—Forms a
Quaker Friendship—The Spirit Moves in a Quaker
Meeting—A Quaker’s Prayer Answered—Builds a
College—Shows What to do for a Dead Church—
Another Tilt on the Doctrine of Baptism—
Conversion of a Dunkard Preacher—Turns a Great
Movement in the Right Direction.
In the fall of 1876, Rev. Mr. Newgent entered upon his duties as
Superintendent of the Tennessee Mission Conference, under
appointment of the Home, Frontier, and Foreign Missionary
Association. In the meantime he had married Miss Annie Crowther,
of Terre Haute, Indiana, who, under the divine blessing, abides as
the companion of his joys and sorrows amid the lengthening
shadows. She is a woman of rare and excellent qualities, which
especially fitted her for her position as the wife of an active and
ambitious minister. She is in fullest accord with her husband’s
ambitions and tastes, and has contributed her part toward the
success of his career. He freely accords to her this credit. With this
queenly woman ordering its affairs, the Newgent home has ever
been a haven of real rest, a retreat for God’s servants especially. It
extends a welcome and hospitality—a true home spirit—that at once
makes the wayworn pilgrim feel at ease in body and mind, and
charms the hearts of the young as well.
At the time of their removal to Tennessee, the United Brethren
Church was new in the South. Its attitude of open hostility to slavery
largely shut it out of regions south of Mason and Dixon’s line. The
Tennessee Conference then had less than four hundred members,
with only six houses of worship. So a great field spread out before
the new Superintendent, taking him back to conditions in many
respects similar to those in which he began his ministerial labors. It
was still a time of reconstruction in church affairs as well as in
matters political. But his was a work of construction rather than of
reconstruction.
Aside from the need of laborers and the vast opportunities
afforded for building up the church in this section, one reason he
had for accepting this appointment was the condition of his own and
his wife’s health. Both were threatened with failing health, and a
change of climate was advised, the high altitude of eastern
Tennessee being recommended as especially adapted to their
physical needs.
They arrived at Limestone, Tennessee, on a Friday evening in
September. Here was illustrated how his fame as a genial, good
humored personality had spread throughout the Church, so that the
people felt that they were acquainted with “Jack” Newgent (later
Uncle Jack) even though they had never met him personally. Arriving
at the city some time after dark, worn by the long journey, the
discomforts of which were aggravated by their poor health, they
little dreamed of finding in that particular realm an acquaintance or
anyone who had any concern for them.
Great indeed was Newgent’s surprise when, as he alighted from
the train, a gentleman, a total stranger, with a lantern on his arm,
stepped up and in a familiar manner accosted him, “Hello! Is this
Jack Newgent?”
He had been so familiarly known as “Jack,” that he had resolved to
be known by the more grave and dignified appellation of Andrew J.
Newgent when he came into his new kingdom. But his expectation
perished, as it would have done even had the circumstances been
otherwise. A man’s name, like his clothes, is a part of him, and if it
does not fit, his friends will persist in trimming it until it does. The
personality and the title cannot be unequally yoked together.
“Well,” said the reverend gentleman from the Hoosier State, “I
suppose if I should land in the heart of Africa, some Hottentot would
come rushing out of the jungle and say, ‘Hello, Jack Newgent!’ Who
are you, anyway?” The stranger was Mr. W. C. Keezel, a prominent
layman in the conference, who had been advised of their coming by
Dr. D. K. Flickinger, Secretary of the Missionary Society, and was
there to take them to his hospitable home. It was a pleasant
surprise, and they felt at once that they were among friends whose
hearts God had touched with his spirit of kindness and tenderness.
Their anxieties were dispelled, and they felt as near heaven in
Tennessee as in Indiana.
Next day his host took him on a ten-mile ride by horseback over a
mountain road to a quarterly conference, where he met a number of
ministers, and began to get acquainted with his new co-workers. His
presence filled the little band of faithful toilers with new hope and
courage. He preached the following day (Sunday) at a neighboring
church to an immense crowd. Here he met Rev. Eli Marshall, a
minister of repute in the Quaker—or Friends—church, with whom he
was destined to form a close friendship, a friendship which revealed
later to both of these servants of God how mysteriously God moves
in answer to the earnest prayers of his faithful children.
Rev. Mr. Marshall was not only an able minister, but was also a
successful business man, being the owner of several plantations. He
took Newgent to his home, and later showed him a congenial
cottage on one of his plantations. “This is at thy disposal,” he said,
“if it suits thee.” Newgent replied that it was just such a place as he
was looking for, as it was but a short distance from town and the
railroad station, and inquired as to the rental value.
“Just move in,” said Marshall, “we will talk about that some other
time.”
But when Newgent insisted, he set a nominal price, which
indicated that he was not especially concerned about the financial
side of the transaction. He furthermore insisted on transporting
Newgent’s household goods from the station, but this privilege he
was compelled to share with Mr. Keezel. While they were moving his
goods from the train, his Quaker neighbors set to work and filled the
smoke-house with provisions, and supplied sufficient fuel to last him
through the winter. Such expressions of kindness and generosity
seldom had been seen.
The fourth week in October was the time for the Quakers’ yearly
meeting, to be held at Rev. Mr. Marshall’s home church. He had
issued an order to Newgent to have no engagement for that time, as
his presence and help were desired at the meeting. Under the
circumstances there was but one thing to do, and that was to
respect the order. These meetings were matters of no small
significance in that denomination. They usually lasted several days,
and were great seasons of fellowship. They were very largely
attended so that the program sometimes had to be carried out in
several sections. Newgent had never had the privilege of attending a
Quaker meeting, but his appreciation of the Quakers by this time
knew no bounds.
He first went to the meeting on Saturday morning and was
surprised to find more than a thousand people on the ground. His
friend, Rev. Mr. Marshall, met him immediately and said, “If the Spirit
moves thee to preach to-day, we want thee to preach in the church
this morning.” Some one was to preach in the school house nearby.
The Spirit moved, and Newgent preached.
In the afternoon he was “moved” to preach again. He was urged
to preach again at night. This time the Spirit was not consulted, but
his preaching had touched a responsive chord in the Quaker heart,
so it was taken for granted that the Spirit would be favorable. An
out-door service and a service in the school house besides that in
the church were required in order to accommodate the crowd.
Newgent declined to preach at this time, not wishing to usurp the
honors that belonged to the Quaker preachers. But the Quaker
“Spirit” refused to let him off. He was even urged to sing a special
song, which was a great departure from Quaker usage in those
days. While preaching with his usual power, it was evident to him
that great conviction prevailed in the congregation. As he had been
invited to depart from one of the Quaker usages, he now felt bold to
depart from another. Indeed he felt strongly moved by the Spirit to
give an invitation for seekers to come to the altar. The invitation
given, the altar was soon crowded with anxious penitents. He then
called upon the Quakers to come forward and to sing and pray with
the seekers. This a considerable number did, casting aside all
reserve, and the meeting became a typical United Brethren revival.
It was one time when the Spirit “moved” beyond question in a
Quaker meeting.
He was given right of way in the church on Sunday morning,
Sunday evening, and Monday evening. A new element was thus
diffused into Quakerdom. He held a meeting in that same
community a few weeks later, in which the Quakers took a leading
part, and which resulted in about a hundred conversions.
The best part of the whole procedure came to light when Newgent
called to pay his landlord the small pittance that was due on rent.
Rev. Mr. Marshall refused to accept even the nominal amount that
had been agreed upon.
“Let me explain,” he said, “I have never told anybody what I am
going to tell thee—not even my wife. Some three months ago I
moved my foreman out of that house, and began to pray for the
Lord to send us a good, live preacher from the North. I had got tired
of these slow-going Southern fellows. But I forgot to tell the Lord to
send a Quaker. So the Lord was free to send whomsoever he
pleased. And the first time I heard thee preach, I said, ‘There is the
answer to my prayer.’ Now, it would not do for me to charge rent of
the man the Lord sent in answer to my prayer, when he is living in
the property I vacated for him when I besought the Lord to send
him. That house is for thee as long as thee wants it.”
When this noble soul was called to heaven some years later, Rev.
Mr. Newgent was called from a distant State to preach his funeral.
Truly, he was a man of God.
When the conference projected a college enterprise at Greenville,
Rev. Mr. Newgent took up his residence at that place so as to give
personal attention and encouragement to the institution. This college
was afterwards moved to White Pine, Newgent being the leading
spirit in the matter of relocation. He served as financial agent and
supervised the construction of the building. Through his personal
efforts the building was erected and paid for.
The evangelistic gift and executive faculty, both of which were
prominent in our subject, peculiarly fitted him for the duties of
Missionary Superintendent amid such conditions as the Tennessee
Conference presented. Much incipient work had to be done. The
routine work of his office required only a small portion of his time,
leaving him free to do the work of an evangelist, to encourage weak
churches and to survey new territory to conquer. This narrative has
already afforded many examples of his constructive work along
these lines. One more characteristic incident may not be out of
place.
Near Limestone, Tennessee, was a church which was so
unpromising that the quarterly conference seriously considered
abandoning it and disposing of the property. It was well located, but
there were strong churches on either side, and the little church,
overshadowed as it was by these older organizations, had never
been able to gain a proper standing.
“Let us give it another chance,” said Newgent, who was presiding
at the meeting. “I will hold a meeting there at the first opportunity,
and we will see if it can be saved.” He held the meeting accordingly
and received ninety-seven members into the church, and the little,
struggling church was lifted to such a position of prestige and
prominence that it overshadowed its rivals, becoming a strong
center of religious influence.
But it was not enough to merely get people converted and
brought into the church. They must be taught in the doctrines of the
church, so as not to get their doctrinal ideas from other sources.
One of the strong churches of this community was of the Dunkard
order, and mainly through its influence a strong immersion sentiment
prevailed. At the close of the revival there were a large number of
applicants for baptism. According to prevailing custom, all expected
to be immersed. It was in order on such occasions for the baptismal
service to be prefaced by a sermon on baptism. Rev. Mr. Newgent
took advantage of the opportunity to make some remarks on the
mode of baptism, which was the one live subject in religious circles.
In his discourse he said:
“We often hear people say, ‘I want to be baptized as Jesus was.’ I
do not share this sentiment. For in one essential respect Jesus’
baptism was different from ours. It was for a different purpose. He
was baptized to fulfill the law; we, because we are sinners, either for
the forgiveness of sins or because they are forgiven.
“But we may be baptized in the same manner in which he was
baptized, and if you wish, I will tell you what that was. Paul said, ‘He
was made a priest like unto his brethren.’ Jesus said, ‘I am come,
not to destroy the law or the prophets, but to fulfill.’ He fulfilled
every jot and tittle of the law. The law required a priest to have the
water of consecration sprinkled upon his head when he was thirty
years of age. Hence, if Christ was made a priest like his brethren, it
is easy to see that his baptism was the same as that of the priests,
his brethren, and that the water was sprinkled upon his head at the
age of thirty; otherwise he would not have fulfilled every jot and
tittle of the law.”
A prominent Dunkard preacher present made a public statement
at the close of the discourse to the effect that, while he had always
believed and taught that Christ was baptized by immersion, he was
now fully convinced that he had been mistaken. When they came to
the baptismal service, all the applicants chose the mode of
sprinkling, though they had come prepared to be immersed.
Under his capable and aggressive leadership the conference
maintained a steady growth. At first its territory was confined to the
eastern part of the State. But in the early nineties he, with some
other ministers, advanced to the central and western parts of the
State on a sort of missionary-evangelistic campaign. They held a
number of meetings and were successful in winning quite a
sprinkling of converts. The work thus accomplished made possible
the organization of what was then known as the Tennessee River
Conference in 1896.
One of the most important events in connection with the
Tennessee Conference, and which was brought about mainly
through his influence, occurred in 1895. It is referred to as follows in
Berger’s History of the United Brethren Church, page 614:
“About two years ago a movement which had been for some time
in process of development, began to take definite form, resulting in
considerable additions both of ministers and laymen to the United
Brethren Church. The greater number of these came from the
Methodist Episcopal Church, some from the M. E. Church, South,
and a few from other denominations. Those coming from the
Methodist churches were attracted chiefly by the milder form of
episcopal government in the United Brethren Church. There was for
them no possible inducement in material or worldly considerations.
They could not look for larger salaries or easier fields of labor or
lighter sacrifices, nor was the prospect of official promotion better
than in the churches from which they came. Nor could they bring
with them any of the church-houses or other property which they
had aided in building. No thought or hope of this kind was
entertained; much less was any effort made to do so. Influenced by
principle alone, and in the face of present loss, they chose to cast in
their lot with us, and they have addressed themselves earnestly to
the work in their new relations. About twenty-five ministers in all,
with a considerable number of members, have thus connected
themselves with the United Brethren. Among the leading ministers of
the movement are: Dr. T. C. Carter, Rev. W. L. Richardson, J. D.
Droke, and others. They have been given a cordial welcome by the
United Brethren Church, not in any spirit of proselytism, for no
proselyting was done, nor from any desire to reap where others
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookball.com