2011PDF Introduction to Modeling and Simulation with MATLAB and Python 1st Edition Steven I. Gordon download
2011PDF Introduction to Modeling and Simulation with MATLAB and Python 1st Edition Steven I. Gordon download
https://ebookfinal.com
https://ebookfinal.com/download/introduction-to-
modeling-and-simulation-with-matlab-and-
python-1st-edition-steven-i-gordon/
https://ebookfinal.com/download/modeling-and-simulation-in-
ecotoxicology-with-applications-in-matlab-and-simulink-kenneth-r-
dixon/
ebookfinal.com
https://ebookfinal.com/download/signals-and-systems-with-matlab-
computing-and-simulink-modeling-3rd-edition-steven-t-karris/
ebookfinal.com
https://ebookfinal.com/download/electronically-scanned-arrays-matlab-
modeling-and-simulation-1st-edition-arik-d-brown/
ebookfinal.com
https://ebookfinal.com/download/system-simulation-techniques-with-
matlab-and-simulink-1st-edition-dingyu-xue/
ebookfinal.com
Modeling and Simulation of Systems Using MATLAB and
Simulink 1 Har/Cdr Edition Devendra K. Chaturvedi
https://ebookfinal.com/download/modeling-and-simulation-of-systems-
using-matlab-and-simulink-1-har-cdr-edition-devendra-k-chaturvedi/
ebookfinal.com
https://ebookfinal.com/download/computational-nanotechnology-modeling-
and-applications-with-matlab-r-sarhan-m-musa/
ebookfinal.com
https://ebookfinal.com/download/signals-and-systems-with-matlab-
applications-2nd-edition-steven-t-karris/
ebookfinal.com
https://ebookfinal.com/download/agent-based-modeling-and-simulation-
with-swarm-1-st-edition-hitoshi-iba/
ebookfinal.com
Steven I. Gordon
Brian Guilfoos
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
Preface, xiii
Authors, xvii
INDEX, 183
Preface
Introduction to
Computational Modeling
TABLE 1.1 Timeline of Advances in Computer Power and Scientific Modeling (Part 1)
Example Hardware Max. Speed Date Weather and Climate Modeling
ENIAC 400 Flops 1945
1950 First automatic weather forecasts
UNIVAC 1951
IBM 704 12 KFLOP 1956
1959 Ed Lorenz discovers the chaotic
behavior of meteorological processes
IBM7030 Stretch; 500-500 KFLOP ~1960
UNIVAC LARC
1965 Global climate modeling underway
CDC6600 1 Megaflop 1966
CDC7600 10 MFLOP 1975
CRAY1 100 MFLOP 1976
CRAY-X-MP 400 MFLOP
1979 Jule Charney report to NAS
CRAY Y-MP 2.67 GFLOP
1988 Intergovernmental Panel on Climate
Change
1992 UNFCCC in Rio
IBM SP2 10 Gigaflop 1994
ASCII Red 2.15 TFLOP 1995 Coupled Model Intercomparison
Project (CMIP)
2005 Earth system models
Blue Waters 13.34 PFLOP 2014
Sources: Bell, G., Supercomputers: The amazing race (a history of supercomputing, 1960–2020),
2015, http://research.microsoft.com/en-us/um/people/gbell/MSR-TR-2015-2_
Supercomputers-The_Amazing_Race_Bell.pdf (accessed December 15, 2016).
Bell, T., Supercomputer timeline, 2016, https://mason.gmu.edu/~tbell5/page2.html
(accessed December 15, 2016).
Esterbrook, S., Timeline of climate modeling, 2015, https://prezi.com/pakaaiek3nol/
timeline-of-climate-modeling/ (accessed December 15, 2016).
Introduction to Computational Modeling ◾ 5
TABLE 1.2 Timeline of Advances in Computer Power and Scientific Modeling (Part 2)
Date Theoretical Chemistry Aeronautics and Structures Software and Algorithms
1950 Electronic wave functions
1951 Molecular orbital theory
(Roothan)
1953 One of the first
molecular simulations
(Metropolis et al.)
1954 Vector processing
directives
1956 First calculation of
multiple electronic
states of a molecule on
EDSAC (Boys)
1957 FORTRAN created
1965 Creation of ab initio
molecular modeling
(People)
1966 2D Navier-Stokes
simulations; FLO22;
transonic flow over a
swept wing
1969 UNIX created
1970 2D Inviscid Flow Models;
design of regional jet
1971 Nastran (NASA
Structural Analysis)
1972 C programming
language created
1973 Matrix computations
and errors
(Wilkinson)
1975 3D Inviscid Flow Models;
complete airplane
solution
1976 First calculation of a DYNA3D which became
chemical reaction LS-DYNA (mid-70s)
(Warshel)
1977 First molecular dynamics Boeing design of 737-500
of proteins (Karplus)
First calculation of a
reaction transition state
(Chandler)
(Continued)
6 ◾ Modeling and Simulation with MATLAB® and Python
Modeling and simulation has also become a key part of the process and
designing, testing, and producing products and services. Where the build-
ing of physical prototypes or the completion of laboratory experiments
Introduction to Computational Modeling ◾ 9
may take weeks or months and cost millions of dollars, industry is instead
creating virtual experiments that can be completed in a short time at
greatly reduced costs. Proctor and Gamble uses computer modeling to
improve many of its products. One example is the use of molecular mod-
eling to test the interactions among surfactants in their cleaning products
with a goal of producing products that are environmentally friendly and
continue to perform as desired (Council on Competiveness, 2009).
Automobile manufacturers have substituted modeling for the building
of physical prototypes of their cars to save time and money. The build-
ing of physical prototypes called mules is expensive, costing approxi-
mately $500,000 for each vehicle with 60 prototypes required before
going into production (Mayne, 2005). The design of the 2005 Toyota
Avalon required no mules at all—using computer modeling to design and
test the car. Similarly, all of the automobile manufacturers are using mod-
eling to reduce costs and get new products to market faster (Mayne, 2005).
These examples should illustrate the benefits of using modeling and
simulation as part of the research, development, and design processes for
scientists and engineers. Of course, students new to modeling and simula-
tion cannot be expected to effectively use complex, large-scale simulation
models on supercomputers at the outset of their modeling efforts. They
must first understand the basic principles for creating, testing, and using
models as well as some of the approaches to approximating physical real-
ity in computer code. We begin to define those principles in Section 1.3
and continue through subsequent chapters.
One of the most ambitious physical models ever built was a costly 200 acre
model of the Mississippi River Basin used to simulate flooding in the
watershed (U.S. Army Corps of Engineers, 2006). A photo of a portion
of this model is shown in Figure 1.1. It included replicas of urban areas,
the (Fatherree, 2006) stream bed, the underlying topography, levees, and
other physical characteristics. Special materials were used to allow flood
simulations to be tested and instrumented.
Through theory and experimentation, scientists and engineers also
developed mathematical models representing aspects of physical behaviors.
These became the basis of computer models by translating the mathemat-
ics into computer codes. Over time, mathematical models that started
as very simplistic representations of complex systems have evolved into
systems of equations that more closely approximate real-world phenomena
such as the large-scale models discussed earlier in this chapter.
Creating, testing, and applying mathematical models using computa-
tion require an iterative process. The process starts with an initial set of
simplifying assumptions and is followed by testing, alteration, and applica-
tion of the model. Those steps are discussed in Section 1.3.1.
Introduction to Computational Modeling ◾ 11
Choose variables
Interpret results Implement the Define relationships
Verify and refine computer Define equations
model model and functions
Draw conclusions
Maintain and refine
the model
Dictates
Average speed
FIGURE 1.3 Partial concept map of model to calculate travel time using Cmap.
Introduction to Computational Modeling ◾ 13
Time to traverse
road segment
More lanes
Parked cars Average speed
Faster
Slower Wider lanes
FIGURE 1.4 Partial mind map of model to calculate travel time using mind
map maker.
The average speed across a road segment is slowed by parked cars and
traffic control devices while wider lanes and higher speed limits take
less time. The total time for a trip would need to add the average times
associated with traversing each road segment. Thus, data on each seg-
ment will be needed as input to the model. Simple versions of such esti-
mates are provided by global positioning satellite (GPS) equipment or
the Internet mapping services that are available online. There are many
other conditions that would impact this system. Modeling traffic condi-
tions are a topic of one of the exercises at the end of the chapter.
Going back to Figure 1.2, one must choose which simplifying assump-
tions can be made in a model. This, in turn, leads to a selection of the
data that would be needed, the variables that will drive the model, and the
equations and mathematical functions that will comprise the model.
Once these items have been defined, a computer version of the model
can be created and tested. The results must be verified to ascertain that the
code is working properly. If the model is giving unexpected results with
the code working properly, there may be a need to reexamine the simplify-
ing assumptions and to reformulate the model. Thus, one may go through
several iterations until the model is providing sufficiently accurate results.
This can be validated against available experimental or field data to pro-
vide a quantitative assessment of model accuracy. Finally, the model can
be used to undertake more detailed analysis and the results reported.
As time goes on, the model must be maintained and may be improved
by relaxing more of the assumptions and/or improving the input data. It
should be noted that the judgment of whether a model is giving reasonable
14 ◾ Modeling and Simulation with MATLAB® and Python
There are several different ways to classify models. Models can be deter-
ministic or probabilistic. Another term for probabilistic is stochastic mean-
ing a random process or a process, which occurs by chance. A probabilistic
model includes one or more elements that might occur by chance or at ran-
dom while a deterministic model does not. A deterministic model applies a
set of inputs or initial conditions and uses one or more equations to produce
Introduction to Computational Modeling ◾ 15
model outputs. The outputs of a deterministic model will be the same for
each execution of the computer code with the same inputs. A probabilistic
model will exhibit random effects that will produce different outputs for
each model run.
Models can also be characterized as static or dynamic. A dynamic
model considers the state of a system over time while a static model does
not. For example, one could have a model of a material like a steel beam
that considered its ability to bear weight without bending under a set of
standard environmental conditions. This would be considered to be a
static model of that system. A dynamic model of the same structure would
simulate how the bearing strength and possible deformation of the beam
would change under stresses over time such as under high temperatures,
vibration, and chemical corrosion.
EXERCISES
1. Using a graphics program or one of the free concept-mapping or
mind-mapping tools, create a complete conceptual map of the traffic
model introduced earlier in the chapter. You should include all of
the other factors you can think of that would contribute either to the
increase or decrease in the traffic speed that might occur in a real
situation.
2. Insert another concept mapping example here.
18 ◾ Modeling and Simulation with MATLAB® and Python
REFERENCES
Bartlett, B. N. 1990. The contributions of J.H. Wilkinson to numerical analysis.
In A History of Scientific Computing, ed. S. G. Nash, pp. 17–30. New York:
ACM Press.
Bell, G. 2015. Supercomputers: The amazing race. (A History of Supercomputing,
1960–2020). http://research.microsoft.com/en-us/um/people/gbell/MSR-TR-
2015-2_Supercomputers-The_Amazing_Race_Bell.pdf (accessed December 15,
2016).
Bell, T. 2016. Supercomputer timeline, 2016. https://mason.gmu.edu/~tbell5/
page2.html (accessed December 15, 2016).
Biesiada, J., A. Porollo, and J. Meller. 2012. On setting up and assessing docking
simulations for virtual screening. In Rational Drug Design: Methods and
Protocols, Methods in Molecular Biology, ed. Yi Zheng, pp. 1–16. New York:
Springer Science and Business Media.
Cmap website. http://cmap.ihmc.us/ (accessed February 22, 2016).
Computer History Museum. 2017. Timeline of computer history, software and
languages. http://www.computerhistory.org/timeline/software-languages/
(accessed January 2, 2017).
Council on Competitiveness. 2004. First Annual High Performance Computing
Users Conference. http://www.compete.org/storage/images/uploads/File/PDF%
20Files/2004%20HPC%2004%20Users%20Conference%20Final.pdf.
Council on Competitiveness. 2009. Procter & gamble’s story of suds, soaps, simu-
lations and supercomputers. http://www.compete.org/publications/all/1279
(accessed January 2, 2017).
Dorzolamide. 2016. https://en.wikipedia.org/wiki/Dorzolamide (accessed December
15, 2016).
Esterbrook, S. 2015. Timeline of climate modeling. https://prezi.com/pakaaiek3nol/
timeline-of-climate-modeling/ (accessed December 15, 2016).
Introduction to Computational Modeling ◾ 19
Introduction to
Programming
Environments
The large pane in the middle is the Command Window. This pane pro-
vides an interpreter and allows you to type MATLAB commands and see
the results immediately.
The leftmost pane displays the current working directory’s contents.
You can browse through your directory tree using the widget directly
above the three main panes. The current working directory is the first
location where MATLAB will look for files when attempting to execute,
open, or close files. There should be a helloworld.m file; if you double-
click it the Editor will open, showing you the contents of the file and
making it possible to edit and save the updated file. The Editor provides
some rich tools, including syntax coloring, debugging, and more. When
the Editor is open, a context-appropriate menu ribbon appears at the
top, which includes debugging controls. We will return to those later
in this chapter.
The pane to the far right is the Workspace, which displays the variables
currently being used by MATLAB, and their value. Double-clicking on
a variable in this list will open the Variables pane, which allows fuller
inspection and editing of variables, including large matrices. Returning
to the menu ribbon at the top of the window, you should notice Import
Data and Save Workspace, which allow you to quickly import and export
datasets to and from your Workspace.
Introduction to Programming Environments ◾ 23
x = 2
five = 5
z = 3.14159
my_string = 'Hello World!'
Type these commands into the console. Once a variable is declared, it can
be recalled and used in an appropriate calculation. As an example enter this:
y=x*five;
You will note that we included a semicolon, which suppressed the output
of the command, unlike the previous examples. To see the result, type:
y
24 ◾ Modeling and Simulation with MATLAB® and Python
Now that you have some variable in memory, you can look at the
Workspace to see the list of variables and their current values.
Variables have something called scope, which defines where they
are visible. For example, variables defined in the Command Window are
global; they can be referenced, used, and modified from any other piece
of code. For example, if we define “x” in the Command Window, and then
in my_script.m if we add the command “x”, when we run that program,
it will print the value of “x”.
However, variables defined within a function are only visible within
that function. These are called local variables. We will come back to this
idea later when you begin to create full programs.
You can delete variables in two ways. The first is the clear command:
clear x
(3 * 2) ** 3 + 6
2.1.2.2 Keywords
MATLAB reserves certain words, called keywords, which cannot be used
as variable names. Note that these words will be colored in blue when they
are typed in the Editor or Command Window. They are listed in Table 2.3.
traffic=[200,150,350,235,450];
nox = zeros(1,365);
If you type in the first example, you will see that a traffic variable is created
with five items with the values indicated. In the second example (our first
use of a function), an array is created with 365 items initially set to a value
of 0. This could be, for example, space to hold the average daily nitrogen
oxide content in the air. Notice how they are represented in the Workspace.
We can use the index to operate on each of the items in the list in turn
or can operate on any individual item by using its index number. To see a
single value, we use the variable name with the index in parentheses. Try
this and see what happens:
traffic(2)
You should get the value 150. This is because MATLAB starts all lists and
arrays with the index number 1. So if you put traffic(1) in the console, you
should get 200. What happens if you put this in:
traffic
Introduction to Programming Environments ◾ 27
x=[1, 2, 3, 4];
y=[1, 2; 3, 4];
x=zeros(6)
y=ones(8)
z=2:8
You can also specify a custom step size, instead of being restricted to “1” as
the default, by adding a third parameter, located between the start and stop
points. For example, 3:.2:4 will return an array containing [3 3.2 3.4 3.6 3.8 4].
Another useful function for creating vectors containing regularly
spaced values is “linspace()”. Rather than specifying the size of the step,
you specify the number of elements you want in your array. For example,
linspace(3,4,6) will return an array containing [3. 3.2 3.4 3.6 3.8 4].
myarray=linspace(3,4,6)
myarray(2) = 2
He gives as the total full range, i.e. from the specus of the
Alsietina (the lowest), to that of the Anio Novus (the highest), as
211.2½ palmi, or 154½ English feet. The height of the Appian,
he shews by his diagram to be about 24 English feet above the
Quay of the Tiber. The points at which Piranesi obtained his
measurements, and the mode employed, are not recorded. It
seems hardly possible that the Appia is 55 ft. under the Anio
Vetus in Rome.
[36] See ante. Frontinus, cap. 21.
[37] The passage, as it stands in the Codex Cassinensis, is,
“Anio Vetus citra quartum miliarium infra novum qui a Via Latina
in Lavicanam inter arcus trajicit, et ipse piscinam habet.” This
piscina is visible at the third modern milestone on the Via
d’Albano, and at the fourth on the Via Latina. The Codex
Vaticanus is an inferior copy of the Codex Cassinensis; but the
Codex Urbinas, now also in the Vatican Library, is distinct. No
other MS. is of any authority.
[38] Remains of the tombs on the Via Latina are distinctly
visible and rather prominent objects, close to the Torre Fiscale.
The Marrana, or Almo, the small stream that received the surplus
water of the aqueducts, also washes the foot of the tower.
[39] This castellum aquæ is exactly two miles from the Porta
Maggiore, another proof that the entrance to Rome (though not
to the City) was considered by Frontinus to have been at that
gate. All the aqueducts on the eastern side of Rome are
measured by him from this gate, and the inscriptions put over
that gate as the entrance into Rome indicate the same thing. The
level of this castellum above the sea is about 153 ft.; at the Porta
Maggiore, where the Anio Vetus enters Rome, it is about 146 ft.,
allowing a descent of about 3 ft. 4 in. for the two miles, which is
natural. The Via Appia Nova, in the part near Rome, was made
out of the old Via Asinaria. Frontinus says that this branch “was
conveyed to the Asinian gardens,” which were between the
Lateran and the Sessorium, and to which the Porta Asinaria (or
gate of the Asinii) was the entrance. Between that gate and the
Amphitheatrum Castrense are remains of an ancient reservoir or
castellum aquæ, cut in the rock at the foot of the wall and half
underground, as was very usual with the Anio Vetus. The branch
that goes along the Via Latina appears to have gone from the
same reservoir, but to be distinct from the one mentioned by
Frontinus, and to have been made after his time. This last branch
seems to be the same as the Aqua Antoniniana of the Regionary
Catalogue, having been made in the third century to supply the
great Thermæ of the Antonines. In the Middle Ages, this was
considered to have been a branch of the Aqua Marcia; but if this
had been the case, there must have been some remains of the
arcade for it across the valley.
[40] This branch is believed to have been called Aqua
Antoniniana, as it conveyed water to supply the great Thermæ of
the Antonines, called after Antoninus Caracalla. But it seems
doubtful whether it may not be the Severiana, which conveyed
water to the Thermæ of Septimius Severus. There appear to have
been two aqueducts along this point of the Via Latina at different
levels, and the higher one, passing over the Arch of Drusus, is
said to have been a branch from the Marcia.
[41] Frontinus, c. 21. On the subject of the word Spes (?) or
Specus (?), see the Appendix to this Chapter.
[42]
anio
imp . caesar
divI . f . avgvsT . ex . sc
vii pccxl
imp . caesar
divI . f. avgvsT . ex . sc
vii pccxl
c
[92]
hac rivi aqvar
trivm evnt cippi
positi ivssv
a. didi. galli
t. rvbri. nepotis
m. corneli firmi
cvratorvm aqvar
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com