100% found this document useful (8 votes)
94 views

2011PDF Introduction to Modeling and Simulation with MATLAB and Python 1st Edition Steven I. Gordon download

Gordon

Uploaded by

calcokytlee9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (8 votes)
94 views

2011PDF Introduction to Modeling and Simulation with MATLAB and Python 1st Edition Steven I. Gordon download

Gordon

Uploaded by

calcokytlee9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

Download the full version of the ebook at

https://ebookfinal.com

Introduction to Modeling and Simulation with


MATLAB and Python 1st Edition Steven I.
Gordon

https://ebookfinal.com/download/introduction-to-
modeling-and-simulation-with-matlab-and-
python-1st-edition-steven-i-gordon/

Explore and download more ebook at https://ebookfinal.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Modeling and Simulation in Ecotoxicology with Applications


in MATLAB and Simulink Kenneth R. Dixon

https://ebookfinal.com/download/modeling-and-simulation-in-
ecotoxicology-with-applications-in-matlab-and-simulink-kenneth-r-
dixon/
ebookfinal.com

Signals and Systems with MATLAB Computing and Simulink


Modeling 3rd Edition Steven T. Karris

https://ebookfinal.com/download/signals-and-systems-with-matlab-
computing-and-simulink-modeling-3rd-edition-steven-t-karris/

ebookfinal.com

Electronically Scanned Arrays MATLAB Modeling and


Simulation 1st Edition Arik D. Brown

https://ebookfinal.com/download/electronically-scanned-arrays-matlab-
modeling-and-simulation-1st-edition-arik-d-brown/

ebookfinal.com

System Simulation Techniques with MATLAB and Simulink 1st


Edition Dingyü Xue

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

Computational Nanotechnology Modeling and Applications


with MATLAB R Sarhan M Musa

https://ebookfinal.com/download/computational-nanotechnology-modeling-
and-applications-with-matlab-r-sarhan-m-musa/

ebookfinal.com

Signals and Systems with MATLAB Applications 2nd Edition


Steven T. Karris

https://ebookfinal.com/download/signals-and-systems-with-matlab-
applications-2nd-edition-steven-t-karris/

ebookfinal.com

Agent based modeling and simulation with Swarm 1-st


Edition Hitoshi Iba

https://ebookfinal.com/download/agent-based-modeling-and-simulation-
with-swarm-1-st-edition-hitoshi-iba/

ebookfinal.com

Introduction to Computation and Programming Using Python


with Application to Understanding Data 2nd edition Edition
Guttag
https://ebookfinal.com/download/introduction-to-computation-and-
programming-using-python-with-application-to-understanding-data-2nd-
edition-edition-guttag/
ebookfinal.com
Introduction to Modeling and Simulation with MATLAB
and Python 1st Edition Steven I. Gordon Digital Instant
Download
Author(s): Steven I. Gordon, Brian Guilfoos
ISBN(s): 9781498773874, 1498773877
Edition: 1
File Details: PDF, 3.37 MB
Year: 2017
Language: english
Introduction to Modeling
and Simulation with
MATLAB and Python

Steven I. Gordon
Brian Guilfoos
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742

© 2017 by Taylor & Francis Group, LLC


CRC Press is an imprint of Taylor & Francis Group, an Informa business

International Standard Book Number-13: 978-1-4987-7387-4 (Hardback)

Visit the Taylor & Francis Web site at


http://www.taylorandfrancis.com

and the CRC Press Web site at


http://www.crcpress.com
Contents

Preface, xiii
Authors, xvii

Chapter 1 ◾ Introduction to Computational Modeling 1


1.1 THE IMPORTANCE OF COMPUTATIONAL SCIENCE 1
1.2 HOW MODELING HAS CONTRIBUTED
TO ADVANCES IN SCIENCE AND ENGINEERING 3
1.2.1 Some Contemporary Examples 8
1.3 THE MODELING PROCESS 9
1.3.1 Steps in the Modeling Process 11
1.3.2 Mathematical Modeling Terminology and
Approaches to Simulation 14
1.3.3 Modeling and Simulation Terminology 14
1.3.4 Example Applications of Modeling and Simulation 15
EXERCISES 17
REFERENCES 18

Chapter 2 ◾ Introduction to Programming Environments 21


2.1 THE MATLAB® PROGRAMMING ENVIRONMENT 21
2.1.1 The MATLAB® Interface 21
2.1.2 Basic Syntax 23
2.1.2.1 Variables and Operators 23
2.1.2.2 Keywords 25
2.1.2.3 Lists and Arrays 26
2.1.3 Common Functions 28
2.1.4 Program Execution 28
2.1.5 Creating Repeatable Code 29
2.1.6 Debugging 30
2.2 THE PYTHON ENVIRONMENT 30
2.2.1 Recommendations and Installation 30
2.2.2 The Spyder Interface 31
2.2.3 Basic Syntax 32
2.2.3.1 Variables and Operators 32
2.2.3.2 Keywords 34
2.2.3.3 Lists and Arrays 35
2.2.4 Loading Libraries 38
2.2.5 Common Functions 39
2.2.6 Program Execution 40
2.2.7 Creating Repeatable Code 40
2.2.8 Debugging 41
EXERCISES 42

Chapter 3 ◾ Deterministic Linear Models 45


3.1 SELECTING A MATHEMATICAL REPRESENTATION
FOR A MODEL 45
3.2 LINEAR MODELS AND LINEAR EQUATIONS 46
3.3 LINEAR INTERPOLATION 49
3.4 SYSTEMS OF LINEAR EQUATIONS 51
3.5 LIMITATIONS OF LINEAR MODELS 51
EXERCISES 52
REFERENCES 53

Chapter 4 ◾ Array Mathematics in MATLAB® and Python 55


4.1 INTRODUCTION TO ARRAYS AND MATRICES 55
4.2 BRIEF OVERVIEW OF MATRIX MATHEMATICS 56
4.3 MATRIX OPERATIONS IN MATLAB® 58
4.4 MATRIX OPERATIONS IN PYTHON 59
EXERCISES 60
Chapter 5 ◾ Plotting 61
5.1 PLOTTING IN MATLAB® 61
5.2 PLOTTING IN PYTHON 68
EXERCISES 76

Chapter 6 ◾ Problem Solving 79


6.1 OVERVIEW 79
6.2 BOTTLE FILLING EXAMPLE 80
6.3 TOOLS FOR PROGRAM DEVELOPMENT 81
6.3.1 Pseudocode 82
6.3.2 Top–Down Design 82
6.3.3 Flowcharts 83
6.4 BOTTLE FILLING EXAMPLE CONTINUED 84
EXERCISES 85

Chapter 7 ◾ Conditional Statements 87


7.1 RELATIONAL OPERATORS 87
7.2 LOGICAL OPERATORS 88
7.3 CONDITIONAL STATEMENTS 89
7.3.1 MATLAB ® 89
7.3.2 Python 92
EXERCISES 95

Chapter 8 ◾ Iteration and Loops 97


8.1 FOR LOOPS 97
8.1.1 MATLAB Loops
® 97
8.1.2 Python Loops 98
8.2 WHILE LOOPS 99
8.2.1 MATLAB® While Loops 99
8.2.2 Python While Loops 99
8.3 CONTROL STATEMENTS 100
8.3.1 Continue 100
8.3.2 Break 100
EXERCISES 100
Chapter 9 ◾ Nonlinear and Dynamic Models 101
9.1 MODELING COMPLEX SYSTEMS 101
9.2 SYSTEMS DYNAMICS 101
9.2.1 Components of a System 102
9.2.2 Unconstrained Growth and Decay 104
9.2.2.1 Unconstrained Growth Exercises 106
9.2.3 Constrained Growth 108
9.2.3.1 Constrained Growth Exercise 110
9.3 MODELING PHYSICAL AND SOCIAL PHENOMENA 111
9.3.1 Simple Model of Tossed Ball 112
9.3.2 Extending the Model 113
9.3.2.1 Ball Toss Exercise 114
REFERENCES 115

Chapter 10 ◾ Estimating Models from Empirical Data 117


10.1 USING DATA TO BUILD FORECASTING MODELS 117
10.1.1 Limitations of Empirical Models 118
10.2 FITTING A MATHEMATICAL FUNCTION TO DATA 120
10.2.1 Fitting a Linear Model 122
10.2.2 Linear Models with Multiple Predictors 125
10.2.3 Nonlinear Model Estimation 126
10.2.3.1 Limitations with Linear
Transformation 130
10.2.3.2 Nonlinear Fitting and Regression 130
10.2.3.3 Segmentation 131
EXERCISES 131
FURTHER READINGS 132
REFERENCES 132

Chapter 11 ◾ Stochastic Models 133


11.1 INTRODUCTION 133
11.2 CREATING A STOCHASTIC MODEL 134
11.3 RANDOM NUMBER GENERATORS IN
MATLAB® AND PYTHON 136
11.4 A SIMPLE CODE EXAMPLE 137
11.5 EXAMPLES OF LARGER SCALE STOCHASTIC
MODELS 139
EXERCISES 142
FURTHER READINGS 143
REFERENCES 143

Chapter 12 ◾ Functions 145


12.1 ®
MATLAB FUNCTIONS 145
12.2 PYTHON FUNCTIONS 147
12.2.1 Functions Syntax in Python 147
12.2.2 Python Modules 148
EXERCISES 149

Chapter 13 ◾ Verification, Validation, and Errors 151


13.1 INTRODUCTION 151
13.2 ERRORS 152
13.2.1 Absolute and Relative Error 152
13.2.2 Precision 153
13.2.3 Truncation and Rounding Error 153
13.2.4 Violating Numeric Associative and
Distributive Properties 155
13.2.5 Algorithms and Errors 155
13.2.5.1 Euler’s Method 156
13.2.5.2 Runge–Kutta Method 158
13.2.6 ODE Modules in MATLAB ®

and Python 159


13.3 VERIFICATION AND VALIDATION 159
13.3.1 History and Definitions 160
13.3.2 Verification Guidelines 162
13.3.3 Validation Guidelines 163
13.3.3.1 Quantitative and Statistical
Validation Measures 164
13.3.3.2 Graphical Methods 166
EXERCISES 166
REFERENCES 167

Chapter 14 ◾ Capstone Projects 169


14.1 INTRODUCTION 169
14.2 PROJECT GOALS 170
14.3 PROJECT DESCRIPTIONS 171
14.3.1 Drug Dosage Model 171
14.3.2 Malaria Model 172
14.3.3 Population Dynamics Model 174
14.3.4 Skydiver Project 176
14.3.5 Sewage Project 178
14.3.6 Empirical Model of Heart Disease Risk Factors 180
14.3.7 Stochastic Model of Traffic 180
14.3.8 Other Project Options 181
REFERENCE 181

INDEX, 183
Preface

M odeling and simulation using computation or computational


science has become an essential part of the research and develop-
ment process in the physical, biological, and social sciences and engi-
neering. It allows the exploration of physical and biological systems at
the micro- and molecular level that increase our understanding of their
function and the discovery of new materials and new drugs. It allows us
to understand the interactions of components in complex systems from
those we engineer and build to our ecosystems and climate. In recent
years, computational science has produced enormous advances in almost
all fields of scientific and technological inquiry, including DNA sequenc-
ing, behavioral modeling, global climatic predictions, drug design, finan-
cial systems, and medical visualization. At the same time, it has become
critical in the design, testing, and manufacturing of new products and
services, saving millions of dollars in development costs and getting new
products to market more rapidly.
Scientists, social scientists, and engineers must have an understand-
ing of both modeling and computer programming principles so that
they appropriately apply those techniques in their practice. Several sets
of knowledge and skills are required to achieve that understanding. How
do we translate the relationships within a system being modeled into a
set of mathematical functions that accurately portray the behavior of
that system? How are the mathematics translated into computer code
that correctly simulates those relationships? What is the nature of errors
introduced by simplifying the depiction of the system, introduced by
the computer algorithm used to solve the equations, and limited by our
knowledge of the system behavior? How accurate is the model? How do
we know the model is logically correct and follows from the physical and
mathematical laws used to create it (verification)? How do we demonstrate
that the model correctly predicts the phenomena modeled (validation)?
These are the underlying questions that are the focus of this book.
The book is intended for students and professionals in science, social
science, and engineering who wish to learn the principles of computer
modeling as well as basic programming skills. For many students in these
fields, with the exception of computer science students and some engineer-
ing students, enrollment in an introductory programming course may be
impractical or difficult. At many institutions, these courses are focused
primarily on computer science majors and use a programming language
such as Java that is not readily applicable to science and engineering prob-
lems. We have found that teaching programming as a just-in-time tool
used to solve real problems more deeply engages those students to master
the programming concepts. Combining that effort with learning the prin-
ciples of modeling and simulation provides the link between program-
ming and problem solving while also fitting more readily into a crowded
curriculum.
For students from all fields, learning the basic principles of modeling
and simulation prepares them for understanding and using computer
modeling techniques that are being applied to a myriad of problems. The
knowledge of the modeling process should provide the basis for under-
standing and evaluating models in their own subject domain. The book
content focuses on meeting a set of basic modeling and simulation compe-
tencies that were developed as part of several National Science Foundation
grants (see http://hpcuniversity.org/educators/undergradCompetencies/).
Even though computer science students are much more expert program-
mers, they are not often given the opportunity to see how those skills are
being applied to solve complex science and engineering problems, and may
also not be aware of the libraries used by scientists to create those models.
We have chosen to use MATLAB® and Python for several reasons. First,
both offer interfaces that the intended audience should find intuitive. Both
interfaces provide instant feedback on syntax errors and extensive help
documents and tutorials that are important for novice programmers.
Although MATLAB is a commercially licensed program, whereas Python
is open source, many campuses currently have a site license for MATLAB.
Students can also purchase the student version of MATLAB relatively
cheaply.
Perhaps most importantly, both programs are extensively used by the
science and engineering community for model development and test-
ing. Even though neither program scales as efficiently as C, Fortran,
or other languages for large-scale modeling on current parallel comput-
ing architectures, they do offer a stepping stone to those environments.
Both have extensive toolkits and scientific and mathematical libraries that
can be invoked to reduce the amount of coding required to undertake
many modeling projects. Although we use these programming environ-
ments to teach rudimentary programming techniques without applying
a large number of these tools, they are available to students for develop-
ing capstone projects or for use in more advanced courses later in their
curriculum.

ORGANIZATION OF THE BOOK


The book interleaves chapters on modeling concepts and related exercises
with programming concepts and exercises. We start out with an introduc-
tion to modeling and its importance to current practices in the sciences
and engineering. We then introduce each of the programming environ-
ments and the syntax used to represent variables and compute math-
ematical equations and functions. As students gain more programming
expertise, we go back to modeling concepts, providing starting code for a
variety of exercises where students add additional code to solve the prob-
lem and provide an analysis of the outcomes. In this way, we build both
modeling and programming expertise with a “just-in-time” approach so
that by the end of the book, students can take on relatively simple model-
ing example on their own.
Each chapter is supplemented with references to additional read-
ing, tutorials, and exercises that guide students to additional help and
allow them to practice both their programming and analytical modeling
skills. The companion website at http://www.intromodeling.com provides
updates to instructions when there are substantial changes in software
versions as well as electronic copies of exercises and the related code.
Solutions to the computer exercises are available to instructors on the
publisher’s website.
Each of the programming-related chapters is divided into two parts—
one for MATLAB and one for Python. We assume that most instructors
will choose one or the other so that students can focus only on the lan-
guage associated with their course. In these chapters, we also refer to addi-
tional online tutorials that students can use if they are having difficulty
with any of the topics.
The book culminates with a set of final project exercise suggestions that
incorporate both the modeling and the programming skills provided in
the rest of the volume. These projects could be undertaken by individuals
or small groups of students. They generally involve research into a par-
ticular modeling problem with suggested background reading from the
literature. Each exercise has a set of starting code providing a very simplis-
tic view of the system and suggestions for extending the model by adding
additional components to relax some of the assumptions. Students then
complete the program code and use the model to answer a number of
questions about the system, complete model verification and validation
where possible, and present a report in written and oral form.
The website also offers a space where people can suggest additional
projects they are willing to share as well as comments on the existing proj-
ects and exercises throughout the book. We hope that the combination of
materials contributes to the success of those interested in gaining model-
ing and simulation expertise.
Chapter 1

Introduction to
Computational Modeling

1.1 THE IMPORTANCE OF COMPUTATIONAL SCIENCE


Advances in science and engineering have come traditionally from the
application of the scientific method using theory and experimentation
to pose and test our ideas about the nature of our world from multiple
perspectives. Through experimentation and observation, scientists develop
theories that are then tested with additional experimentation. The cause and
effect relationships associated with those discoveries can then be represented
by mathematical expressions that approximate the behavior of the system
being studied.
With the rapid development of computers, scientists and engineers
translated those mathematical expressions into computer codes that
allowed them to imitate the operation of the system over time. This pro-
cess is called simulation. Early computers did not have the capability of
solving many of the complex system simulations of interest to scientists
and engineers. This led to the development of supercomputers, comput-
ers with higher level capacity for computation compared to the general-
purpose computers of the time. In 1982, a panel of scientists provided
a report to the U.S. Department of Defense and the National Science
Foundation urging the government to aid in the development of super-
computers (Lax, 1982). They indicated that “the primacy of the U.S. in sci-
ence, engineering, and computing technology could be threatened relative
to that of other countries with national efforts in supercomputer access
2 ◾ Modeling and Simulation with MATLAB® and Python

and development.” They recommended both investments in research and


development and in the training of personnel in science and engineering
computing.
The capability of the computer chips in your cell phone today far
exceeds that of the supercomputers of the 1980s. The Cray-1 super-
computer released in 1975 had a raw computing power of 80 million
floating-point operations per second (FLOPS). The iPhone 5s has a graph-
ics processor capable of 76.8 Gigaflops, nearly one thousand times more
powerful (Nick, 2014). With that growth in capability, there has been a
dramatic expansion in the use of simulation for engineering design and
research in science, engineering, social science, and the humanities. Over
the years, that has led to many efforts to integrate computational science
into the curriculum, to calls for development of a workforce prepared
to apply computing to both academic and commercial pursuits, and to
investments in the computer and networking infrastructure required
to meet the demands of those applications. For example, in 2001 the
Society for Industrial and Applied Mathematics (SIAM) provided a
review of the graduate education programs in science and engineering
(SIAM, 2001). They defined computational science and engineering as a
multidisciplinary field requiring expertise in computer science, applied
mathematics, and a subject field of science and engineering. They pro-
vided examples of emerging research, an outline of a curriculum, and
curriculum examples from both North America and Europe.
Yasar and Landau (2001) provided a similar overview of the interdisci-
plinary nature of the field. They also describe the possible scope of programs
at the both the undergraduate and graduate levels and provide a survey of
existing programs and their content. More recently, Gordon et al. (2008)
described the creation of a competency-based undergraduate minor pro-
gram in computational science that was put into place at several institutions
in Ohio. The competencies were developed by an interdisciplinary group of
faculty and reviewed by an industry advisory committee from the perspective
of the skills that prospective employers are looking for in students entering
the job market. The competencies have guided the creation of several other
undergraduate programs. They have also been updated and augmented
with graduate-level computational science competencies and competencies
for data-driven science. The most recent version of those competencies can
be found on the HPC University website (HPC University, 2016).
More recently, there have been a number of national studies and
panels emphasizing the need for the infrastructure and workforce
Introduction to Computational Modeling ◾ 3

required to undertake large-scale modeling and simulation (Council on


Competitiveness, 2004; Joseph et al., 2004; Reed, 2005; SBES, 2006). This book
provides an introduction to computational science relevant to students across
the spectrum of science and engineering. In this chapter, we begin with a
brief review of the history or computational modeling and its contributions
to the advancement of science. We then provide an overview of the modeling
process and the terminology associated with modeling and simulation.
As we progress through the book, we guide students through basic
programming principles using two of the widely used simulation
environments—MATLAB® and Python. Each chapter introduces either
a new set of programming principles or applies them to the solution of
one class of models. Each chapter is accompanied by exercises that help
to build both basic modeling and programming skills that will provide a
background for more advanced modeling courses.

1.2 HOW MODELING HAS CONTRIBUTED


TO ADVANCES IN SCIENCE AND ENGINEERING
There are a myriad of examples documenting how modeling and simulation
has contributed to research and to the design and manufacture of new prod-
ucts. Here, we trace the history of computation and modeling to illustrate
how the combination of advances in computing hardware, software, and
scientific knowledge has led to the integration of computational modeling
techniques throughout the sciences and engineering. We then provide a few,
more recent examples of advances to further illustrate the state-of-the-art.
One exercise at the end of the chapter provides an opportunity for students
to examine additional examples and share them with their classmates.
The first electronic programmable computer was the ENIAC built for
the army toward the end of World War II as a way to quickly calculate
artillery trajectories. Herman Goldstine (1990), the project leader, and
two professors from the University of Pennsylvania, J. Presper Eckert,
and John Mauchly sold the idea to the army in 1942 (McCartney, 1999).
As the machine was being built and tested, a large team of engineers and
mathematicians was assembled to learn how to use it. That included six
women mathematicians who were recruited from colleges across the
country. As the machine was completed in 1945, the war was near an end.
ENIAC was used extensively by the mathematician John von Neumann
not only to undertake its original purposes for the army but also to create
the first weather model in 1950. That machine was capable of 400 floating-
point operations per second and needed 24 hours to calculate the simple
4 ◾ Modeling and Simulation with MATLAB® and Python

daily weather model for North America. To provide a contrast to the


power of current processors, Peter and Owen Lynch (2008) created a
version of the model that ran on a Nokia 6300 mobile phone in less than
one second!
It is impossible to document all of the changes in computational
power and its relationship to the advancements in science that have
occurred since this first computer. Tables 1.1 and 1.2 show a timeline

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

TABLE 1.2 (Continued) Timeline of Advances in Computer Power and Scientific


Modeling (Part 2)
Date Theoretical Chemistry Aeronautics and Structures Software and Algorithms
1979 Basic Linear Algebra
Subprograms (BLAS)
library launched
1980s Journal of Computational 800,000 mesh cells
Chemistry first published around a wing, FLO107
1984 MATLAB created
1985 Design of Boeing 767,777 GNU project launched
(free Software
foundation)
1991 Linux launched
1993 Message passing
interface (MPI)
specification
1994 Python created
1995 First successful
computer-based drug
design (Kubinyi)
1997 Open multiprocessing
(OpenMP)
specification
2000 Discontinuous finite
element methods;
turbulent flow; design
of airbus
2007 CUDA launched
2014 Open accelerator
(OpenACC)
specification
Sources: Bartlett, B.N., The contributions of J.H. Wilkinson to numerical analysis. In S.G. Nash,
(Ed.), A History of Scientific Computing, ACM Press, New York, pp. 17–30, 1990.
Computer History Museum, Timeline of computer history, software and languages,
2017, http://www.computerhistory.org/timeline/software-languages/ (accessed January
2, 2017).
Dorzolamide, 2016, https://en.wikipedia.org/wiki/Dorzolamide (accessed December
15, 2016).
Jameson, A., Computational fluid dynamics, past, present, and future, 2016, http://
aero-comlab.stanford.edu/Papers/NASA_Presentation_20121030.pdf (accessed
December 15, 2016).
Prat-Resina, X., A brief history of theoretical chemistry, 2016, https://sites.google.
com/a/r.umn.edu/prat-resina/divertimenti/a-brief-history-of-theoretical-chemistry
(accessed December 15, 2016).
Vassberg, J.C., A brief history of FLO22, http://dept.ku.edu/~cfdku/JRV/Vassberg.
pdf (accessed December 15, 2016).
Introduction to Computational Modeling ◾ 7

of the development of selected major hardware advances, software and


algorithm development, and scientific applications from a few fields.
Looking at the first column in Table 1.1, one can see the tremendous
growth in the power of the computers used in large-scale scientific
computation. Advances in electronics and computer design have brought
us from the ENIAC with 400 flops to Blue Waters with 13.34 petaflops,
an increase in the maximum number of floating-point operations per
second of more than 1015!
Tracing weather and climate modeling from von Neumann’s first model
on ENIAC, we can see that the computational power has allowed scien-
tists to make rapid progress in the representation of weather and climate.
In 1959, Lorenz laid the foundation for the mathematics behind weather
events. By 1965, further advances in computing power and scientific
knowledge provided the basis for the first global climate models. These
have grown in scope to the present day to earth system models that cou-
ple atmospheric and ocean circulation that provide for the basis for the
climate change forecasts of the international community.
Table 1.2 documents similar developments in computational chem-
istry, aeronautics and structures, and selected achievements in software
and algorithms. The scientific advances were made possible not only by
improvements in the hardware but also by the invention of program-
ming languages, compilers, and the algorithms that are used to make
the mathematical calculations underlying the models. As with weather
modeling, one can trace the advancement of computational chemis-
try from the first simulation of molecules to the screening of drugs by
modeling their binding to biomolecules. In aeronautics, the simulation
of airflow over a wing in two dimensions has advanced to the three-
dimensional simulation of a full airplane to create a final design. Similar
timelines could be developed for every field of science and engineering
from various aspects of physics and astronomy to earth and environ-
mental science, to every aspect of engineering, and to economics and
sociological modeling.
For those just getting introduced to these concepts, the terminology
is daunting. The lesson at this point is to understand that computation
has become an essential part of the design and discovery process across
a wide range of scientific fields. Thus, it is essential that everyone under-
stands the basic principles used in modeling and simulation, the mathe-
matics underlying modeling efforts, and the tools of modeling along with
their pitfalls.
8 ◾ Modeling and Simulation with MATLAB® and Python

1.2.1 Some Contemporary Examples


Although this book will not involve the use of large-scale models on
supercomputers, some contemporary examples of large-scale simulations
may provide insights into the need for the computational power described
in Table 1.1. We provide four such examples.
Vogelsberger et al. created a model of galaxy formation comprised of
12 billion resolution elements showing the evolution of the universe from
12 million years after the Big Bang evolving over a period of 13.8 billion
years (Vogelsberger et al., 2014). The simulation produced a large variety of
galaxy shapes, luminosities, sizes, and colors that are similar to observed
population. The simulation provided insights into the processes associated
with galaxy formation. This example also illustrates how computation can
be applied to a subject where experimentation is impossible but where
simulation results can be compared with scientific observations.
Drug screening provides an example of how computer modeling can
shorten the time to discovery. The drug screening pipeline requires a
model of a target protein or macromolecular structure that is associated
with a specific disease mechanism. A list of potential candidate com-
pounds is then tested to see which have the highest affinity to bind to that
protein, potentially inhibiting the medical problem. Biesiada et al. (2012)
provide an excellent overview of the workflow associated with this process
and the publically available software for accomplishing those tasks. The
use of these tools allows researchers to screen thousands of compounds
for their potential use as drugs. The candidate list can then be pared down
to only a few compounds where expensive experimental testing is used.
The reports on global warming use comprehensive models of the
earth’s climate including components on the atmosphere and hydro-
sphere (ocean circulation and temperature, rainfall, polar ice caps) to
forecast the long-term impacts on our climate and ecosystems (Pachauri
and Meyer, 2014). The models:

reproduce observed continental-scale surface temperature patterns


and trends over many decades, including the more rapid warming
since the mid-20th century and the cooling immediately following
large volcanic eruptions (very high confidence) (IPC, 2013, p. 15).

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.

1.3 THE MODELING PROCESS


Based on the examples discussed earlier, it should be clear that a model
is an abstraction or simplification of a real-world object or phenomenon
that helps us gain insights into the state or behavior of a complex sys-
tem. Each of us creates informal, mental models all the time as an aid to
making decisions. One example may be deciding on a travel route that
gets us to several shopping locations faster or with the fewest traffic head-
aches. To do this, we analyze information from previous trips to make an
informed decision about where there may be heavy traffic, construction,
or other impediments to our trip.
Some of our first formal models were physical models. Those include sim-
plified prototypes of objects used to evaluate their characteristics and behav-
iors. For example, auto manufacturers built clay models of new car designs
to evaluate the styling and to test the design in wind-tunnel experiments.
10 ◾ Modeling and Simulation with MATLAB® and Python

Mississippi Basin Model


Vertical scale - 1:100; horizontal scale - 1:2000. Looking upstream on the Ohio River from Evansville. Indiana,
Tennessee, and Cumberland Rivers are in the foreground showing the site of the Kentucky and Barkley Dams.
Tradewater and Green Rivers are shown center. File No. 1270–4

FIGURE 1.1 Photo of portion of Mississippi River Basin model.

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

1.3.1 Steps in the Modeling Process


A great deal of work must be done before one can build a mathemati-
cal model on a computer. Figure 1.2 illustrates the steps in the modeling
process. The first step is to analyze the problem and define the objec-
tives of the model. This step should include a review of the literature to
uncover previous research on the topic, experimental or field-measured
data showing various states of the system and the measured outcomes,
mathematical representations of the system derived from theories, and
previous modeling efforts.
As that information is being gathered, it is also important to define
the objectives of the modeling effort. There are several questions that
should be addressed while considering the model objectives: What are
the outcomes that we would like the model to predict? Are we interested
in every possible outcome or is there a subset of conditions that would
satisfy our model objectives? For example, we could be interested in just

Analyze the Create a


problem and conceptual Make simplifying
define objectives model of the assumptions
for model system

Choose variables
Interpret results Implement the Define relationships
Verify and refine computer Define equations
model model and functions

Validate the Analysis and


model reporting

Draw conclusions
Maintain and refine
the model

FIGURE 1.2 Major steps in the modeling process.


12 ◾ Modeling and Simulation with MATLAB® and Python

the average or normal state of affairs associated with a phenomenon or


potential extreme events may be critical for our analysis. What level of
accuracy is required for the predicted outcomes? This will impact the
nature of the simplifying assumptions, input data, and computing algo-
rithms that are required to build the model.
The second step in the process is to create a conceptual model of the
system based on the analysis in the first step. A conceptual model will
begin to specify all of the cause and effect relationships in the system,
information on the data required and available to implement a model, and
references to documents that were found in the initial analysis. The con-
ceptual model should include a concept map showing the cause and effect
relationships associated with the model and tables showing the different
variables, data sources, and references. This can be done on a whiteboard,
pencil and paper, or using a formal flowcharting or concept-mapping tool.
There are several free tools for concept mapping. Cmap provides a free
concept-mapping tool developed by the Florida Institute for Human and
Machine Cognition. It creates nodes representing major components of a
concept and labels the links between nodes with their relationships (Cmap,
2016). Mind Map Maker is a free mind-mapping tool provided as an app
for Google Chrome users (Mindmapmaker, 2016). This tool allows one to
create links between associated items. There are also a number of com-
mercial packages in both categories.
Figures 1.3 and 1.4 are examples of a partially completed concept map
and mind map showing the components of a model of the time it takes to
make a car trip between two points.

Time to traverse road segment

Dictates

Average speed

Greater means faster Slow


Slow
Width and travel lanes Traffic control devices
Parked cars

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

Traffic control devices Higher speed limit

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

results is sometimes as much an art as a science. Confidence in that judg-


ment is a function of the experience of the modeler and the breadth and
depth of the previous research about the system under study. Of course
the best validation of modeling results comes from comparisons with real
data gathered from observations or experiments.

1.3.2 Mathematical Modeling Terminology


and Approaches to Simulation
Similar to all scientific disciplines, mathematical modeling has its own
unique vocabulary. Modeling novices may believe that the language used
just creates a smoke screen that hides any problems associated with a
model’s development and use. Unfortunately, sometimes there is truth in
that belief. Nevertheless, it is important to learn that language to enable
a critical understanding of the modeling literature. We will begin with
some basic definitions of modeling terms in this section.
It is also important to begin to understand the variety of approaches to
modeling different types of systems. We will use some of the terminology
we introduce to provide a few examples of different modeling approaches to
simulate a variety of situations. We will then conclude this chapter with some
exercises that let you delve deeper into the world of modeling and simulation.

1.3.3 Modeling and Simulation Terminology


By now, you should have your own concept of what constitutes a math-
ematical or computer model. A more formal definition is provided here.

A mathematical model is a representation of a phenomenon or system that


is used to provide insights and predictions about system behavior.

Simulation is the application of a model to imitate the behavior of the


system under a variety of circumstances.

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.

A steady-state model is a model that has gone through a transient state


such as a start-up or warm-up period and arrived at an observed behavior
that remains constant.

An example of the steady-state model is the flow of fluid through a pipe. In


the initial, transient state period, the pipe is empty and will fill with fluid
under pressure until the capacity of the pipe is reached. This will be its
steady-state condition. In economics, a steady-state economy is one that
has reached a relatively stable size.
Perhaps making things more confusing, a dynamic model can have
deterministic components. Such a model would track the state of a system
over time and/or space. Given a current state, a deterministic function
may be used to predict the future state of the system. Alternatively, the
future state may be stochastic, which is impacted by random events.
Finally, dynamic models may be characterized as being discrete or
continuous. A continuous model would represent time as a continuous
function, whereas a discrete model divides time into small increments and
calculates its state for each time period. In computer modeling, most (all?)
dynamic models divide time into discrete increments to facilitate rapid
calculations that mimic continuous systems.

1.3.4 Example Applications of Modeling and Simulation


In order to gain insights into system behavior, simulations are used to ask
what if questions about how the system changes under different circum-
stances. How these questions are addressed depends in part on the type
16 ◾ Modeling and Simulation with MATLAB® and Python

of model and its underlying mathematical structure. Solving those math-


ematical equations on a computer also leads to differences in program-
ming logic or the algorithms that are used to calculate the most accurate
answer most efficiently. We will discuss some of those algorithms as we go
through the rest of this book. For now, it may help to provide some exam-
ples of different simulation approaches as they relate to various model
types.
Deterministic models consist of one or more equations that character-
ize the behavior of a system. Most such models simplify the system by
assuming that one or more causal variables or parameters are constant for
a single calculation of the model outcomes.
For example, models of people’s car trip behavior assume that the will-
ingness to make a trip is inversely proportional to the trip distance. That
is, people are more likely to make a trip from home to get to a destination
that is closer than the one that is far away. Empirical studies have shown
that this friction of distance changes depending on the nature of the trip.
People are much more willing to make a longer trip to get to work than
they are to do a convenience shopping trip. To simplify the system, these
models assume a constant value of this friction of distance factor for each
type of trip. When such a model is applied to a new urban area, there is
some uncertainty that the constants found in previous studies in different
places match the area where the model is being applied. Thus, a study is
done where the model is run with different but reasonable variations in the
constants to ascertain the impact of those changes on the predicted trips.
Those can then be compared with a sample of real data to calibrate and
validate the model.
Other examples of parametric studies include models of structures
where different environmental conditions will alter system behavior, air
and water pollution models where assumptions are made about the rate of
dispersion of contaminants, and models of drug absorption into the blood
stream where assumptions are made about absorption rates and excretion
rates of the drug within the body. Many models include components that
are both stochastic and deterministic where parametric studies are done
on the deterministic components.
For dynamic models, the focus is on the behavior of the system over
time and sometimes over space. For one group of such models called
systems dynamics models, the state of the system at any time period
Introduction to Computational Modeling ◾ 17

is dependent, in part, on the state of the system at the previous time


period. Simulations calculate the changes in the state of the system over
time. An example is a model of ball being dropped from a bridge. As
it is dropped the ball accelerates due to the force of gravity. At each
time increment, the model will calculate the velocity of the ball and its
position in space. That position will depend on where it was in the previ-
ous time period and how far it was dropped related to its velocity during
that time period. The model will then predict when the ball will hit the
water and at what velocity.
Stochastic models typically will have characteristics in common with
dynamic models. The difference is that one or more of the governing
parameters are probabilistic or could happen by random chance. One
example is a model of the spread of a disease that is passed by human
contact. A susceptible person may make contact with an infected person
but will not necessarily become infected. There is a probability of being
infected that is related to the virility of the disease, the state of health of
the susceptible person, and the nature of the contact. A model of this
system would simulate those probabilities to project the potential spread
of a disease outbreak.
As we go through the rest of this book, we will describe the mathemati-
cal representation of each of these types of models and the programming
steps needed to implement them on the computer. Exercises will involve
the completion of example programs, the use of the model to make pre-
dictions, the analysis of model outcomes, and, in some cases, validation
of model results. The exercises for this chapter focus on the modeling
process and examples of how models have been used to solve research and
production problems.

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

3. Read the executive summary of one of the following reports and be


prepared to discuss it in class:
a. PITAC report to the president
b. Simulation-based engineering science report
c. World Technology Evaluations Center
4. Using the student website for the book at http://www.intromodeling.
com, choose an example model project in the document example
models for discovery and design as assigned by your instructor. Read
through the available material and then write a brief summary of the
modeling effort and its characteristics using the summary template
provided.

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

Fatherree, B. H. 2006. U.S. Army corps of engineers, Chapter 5 hydraulics research


giant, 1949–1963, Part I: River modeling, potamology, and hydraulic
structures. In The First 75 Years: History of Hydraulics Engineering at the
Waterways Experiment Station, http://chl.erdc.usace.army.mil/Media/8/5/5/
Chap5.htm. Vicksburg, MS: U.S. Army Engineer Research and Development
Center (accessed October 15, 2016).
Goldstine, H. 1990. Remembrance of things past. In A History of Scientific
Computing, ed. S. G. Nash, pp. 5–16. New York: ACM Press.
Gordon, S. I., K. Carey, and I. Vakalis. 2008. A shared, interinstitutional under-
graduate minor program in computational science. Computing in Science
and Engineering, 10(5): 12–16.
HPC University website. http://hpcuniversity.org/educators/competencies/ (accessed
January 15, 2016).
International Panel on Climate Change. 2013. Climate change 2013—The physi-
cal science basis contribution of working Group I to the fifth assessment
report of the IPCC, New York: Cambridge University Press. http://www.
climatechange2013.org/images/report/WG1AR5_ALL_FINAL.pdf (accessed
December 15, 2016).
Jameson, A. 2016. Computational fluid dynamics, past, present, and future. http://
aero-comlab.stanford.edu/Papers/NASA_Presentation_20121030.pdf
(accessed December 15, 2016).
Joseph, E., A. Snell, and C. Willard. 2004. Study of U.S. industrial HPC users.
Council on Competitiveness. http://www.compete.org/publications/all/394
(accessed December 15, 2016).
Lax, P. D. 1982. Report of the panel on large scale computing in science and
engineering. Report prepared under the sponsorship of the Department of
Defense and the National Science Foundation. Washington, D.C.: National
Science Foundation.
Lynch, P. and O. Lynch. 2008. Forecasts by PHONIAC. Weather, 63(11): 324–326.
Mayne, E. Automakers trade mules for computers, Detroit News, January 30, 2005,
http://www.jamaicans.com/forums/showthread.php?1877-Automakers-
Trade-Mules-For-Computers (accessed January 25, 2016).
McCartney, S. 1999. ENIAC. New York: Walker and Company.
Mindmapmaker website. http://mindmapmaker.org/ (accessed February 22, 2016).
National Science Foundation. 2006. Simulation-based engineering science: Report
of the NSF blue ribbon panel on simulation-based engineering science.
http://www.nsf.gov/pubs/reports/sbes_final_report.pdf.
Nick, T. 2014. A modern smartphone or a vintage supercomputer: Which is more
powerful? http://www.phonearena.com/news/A-modern-smartphone-or-a-
vintage-supercomputer-which-is-more-powerful_id57149 (accessed January
15, 2016).
Pachauri, R. K. and L. A. Meyer (ed.). 2014. Climate change 2014: Synthesis report.
Contribution of working groups I, II and III to the fifth assessment report of
the intergovernmental panel on climate change. http://www.ipcc.ch/report/
ar5/syr/.
20 ◾ Modeling and Simulation with MATLAB® and Python

Prat-Resina, X. 2016. A brief history of theoretical chemistry. https://sites.google.


com/a/r.umn.edu/prat-resina/divertimenti/a-brief-history-of-theoretical-
chemistry (accessed December 15, 2016).
Reed, D. 2005. Computational science: America’s competitive challenge. President’s
information technology advisory committee subcommittee on computational
science. http://www.itrd.gov/pitac/meetings/2005/20050414/20050414_
reed.pdf.
Society of Industrial and Applied Mathematics (SIAM). 2001. Graduate education
in computational science and engineering. SIAM Review, 43(1): 163–177.
Vassberg, J. C. A brief history of FLO22. http://dept.ku.edu/~cfdku/JRV/
Vassberg.pdf (accessed December 15, 2016).
Vogelsberger, M., S. Genel, V. Springel, et al. 2014. Properties of galaxies repro-
duced by a hydrodynamic simulation. Nature, 509(8): 177–182. doi:10.1038
/nature13316.
Yasar, O. and R. H. Landau. 2001. Elements of computational science and engi-
neering education. SIAM Review, 45(4): 787–805.
Chapter 2

Introduction to
Programming
Environments

2.1 THE MATLAB® PROGRAMMING ENVIRONMENT


MATLAB® (short for matrix laboratory) is a popular software package in
many different science and engineering disciplines. It has a number of fea-
tures that make it a good package for modeling and simulation. There are
a large number of toolboxes available for license, as well as a number of
community-provided toolboxes to solve common problems. In addition,
as a fourth-generation programming language focused on numerical com-
puting the language has built-in features that make it easy to work with
vectors and matrices, allowing modelers to concentrate on their models,
and not on implementing the details of a matrix operation.

2.1.1 The MATLAB® Interface


We will be using MATLAB R2016a in this book, as it is the most recent
version available at the time of writing. The MathWorks has typically not
made large changes to the user interface very frequently.
Once installed, when you launch MATLAB you will see the default
interface as shown in Figure 2.1. Across the top is a ribbon toolbar with
clearly marked functions, and tabs for Home, Plots, and Apps. We will
return to few functions on the Home ribbon later in this chapter.
22 ◾ Modeling and Simulation with MATLAB® and Python

FIGURE 2.1 Default MATLAB® interface.

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

2.1.2 Basic Syntax


MATLAB (the application shares a name with its programming language)
is a relatively flexible language that uses certain characters for flow control
such as “{” and “}”. Also, unlike a language like C, which requires a special
termination character at the end of every line (a semicolon), that charac-
ter is optional in MATLAB. However, the decision to include it or not is
important. Including a semicolon at the end of a line will suppress the dis-
play of output related to the execution of that line. Omitting the semicolon
will tell the interpreter to display the result of that command. We will see
examples of this later. We will introduce various concepts in a just-in-
time basis as we work through the course materials. As we go through a
number of the syntax examples later, we suggest you to try them out in the
Command Window, Workspace, or Editor, as appropriate.

2.1.2.1 Variables and Operators


All programming languages provide variables—a method to store and
manipulate data that may be different from one run of the program to the
next—and ways to manipulate those variables. We will introduce some
basics here and will leave some of the more advanced tools until later
chapters.
In the most basic sense, a variable is just a name that we use to refer
to a value that may change over time. In MATLAB, we can simply create
variables as they are needed, without having to declare a variable type
(as is required in many other languages). For example:

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

The second is to go to the Workspace window, right-click on the variable


you wish to delete, and select Delete from the pop-up menu.
You will also note that the Workspace gives you tools such as rename
and edit, which will be useful.
In computational science, we call variables that hold a single value a
scalar. This is slightly different than the mathematical definition of scalar.
MATLAB supports a number of arithmetic operations (Table 2.1).
You can try some of these calculations in the Command Window by
typing in the left side of the equation. That will be defined as input, and
the results will emerge as output.
Please note that, in MATLAB, some of these operators are also used for
matrix operations, and MATLAB will return an error (or do something
you may not be expecting) if you are using matrices. You can explicitly
tell the interpreter that you want to do scalar operations by prepending
the operators with a period (“.”). For example, to conduct a scalar multi-
plication instead of a matrix multiplication, use “.*”. This can be a concern

TABLE 2.1 MATLAB® Mathematical Operators


Symbol Operation Example
+ Addition 2+2=4
− Subtraction 4–1=3
/ Division 9/3 = 3
* Multiplication 8 * 6 = 48
^ Exponential 3^2=9
Introduction to Programming Environments ◾ 25

TABLE 2.2 Order of Execution for


Mathematical Operations in MATLAB®
() Items enclosed in parentheses
^ Exponentiation
*, / Multiplication, division
+, − Addition and subtraction
= Assignment

when doing multiplication, division, and exponentiation. You can include


the “.” safely at any time you want to perform the scalar operation.
MATLAB follows the normally expected order of operations: exponents
and roots, followed by multiplication and division, followed by addition and
subtraction. Specifically, operations should be carried out in the following
order, and for operations at the same level from left to right as shown in
Table 2.2.
For example,

(3 * 2) ** 3 + 6

What happens if we execute this command without the parentheses?


Please note that we have not included all operators. Comparison and
logical operators will be discussed later.

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.

TABLE 2.3 MATLAB® Reserved Keywords


break case
catch classdef
continue else
elseif end
for function
global if
otherwise parfor
persistent return
spmd switch
try while
26 ◾ Modeling and Simulation with MATLAB® and Python

An additional word of warning: It is possible to overwrite a function name


(but not a keyword) with a variable name (and vice versa). Use care when
selecting variable names, or you might experience unexpected errors
when executing code.

2.1.2.3 Lists and Arrays


In programming, we often have a group of homogeneous variables that
represent multiple values of either inputs or outputs from a model. For
example, as inputs we might have traffic counts for a particular location for
different hours and/or different days, multiple values of an environmental
indicator such as air pollution for different times, or a sequence of values of
a model parameter we will use to test its impacts on the model outcomes.
We then would want to store these results in a similar group.
One way to represent such a group of variables in MATLAB is called
an array. Interestingly, in MATLAB everything is an array, including the
scalar values we were working with before. An array is defined to include
places in memory for multiple items indexed by a sequence number. It can
be declared in several ways:

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

A one-dimensional array is often called a vector, whereas a two-


dimensional array is called a matrix. Arrays can use matrix mathematics
to operate on the entire array in specific ways we will introduce later.
We have already seen the basic interface for creating vectors and matrices.

x=[1, 2, 3, 4];
y=[1, 2; 3, 4];

Note that we created a 1 × 4 vector and a 2 × 2 matrix with the previous


commands. Examine how these variables are characterized in the Workspace
and how they are shown in the Command Window when you query for the
contents of x and y.
There are several special functions to create certain types of arrays.
An array with all zeros can be created with the “zeros()” function, as we saw
earlier, whereas an array of ones can be created with the “ones()” function. An
identity array can be created with the “eye()” function. Try these functions:

x=zeros(6)
y=ones(8)

To create an evenly spaced array, MATLAB provides a function called


“colon()”, which also has shorthand using the “:” operator. To create an array
that goes from 0 to 5 (inclusive—so 6 elements), you can type “0:5”. For an
array that starts with 2 and ends with 8, you can type “2:8” or “colon(2,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)

We can access (and modify) individual elements in arrays in MATLAB.


Use the linspace() example above to create the array “myarray”. We can
28 ◾ Modeling and Simulation with MATLAB® and Python

look at the second element of myarray by typing “myarray(2)” in the


Command Window. We can change the value of the second element in
“myarray” simply by using it on the left side of an assignment expression.

myarray(2) = 2

This will turn “myarray” into [3 2 3.4 3.6 3.8 4].


We can also extract portions of arrays called slices. For example, we could
create a slice of “myarray” containing the second and third elements with
the command “myarray(2:3).” The argument is in the form “start:step:stop”
(the same as the “colon()” function). The step argument is optional (and
assumed to be 1 unless specified), and stop can use the keyword end to
mean go to the end of the list. “myarray(1:3)” will return [3 2 3.4], whereas
“myarray(4:end)” will return [3.6 3.8 4]. “myarray(1:2:end)” will select
every other element in the array: [3 3.4 3.8].

2.1.3 Common Functions


We could not possibly exhaustively list every function included in
MATLAB here, much less everything available in the numerous toolboxes.
Throughout the book, we will introduce additional functions as needed,
but Table 2.4 shows a few important ones available in the base MATLAB
program. To use these functions, enclose the target variable inside the
parentheses.

2.1.4 Program Execution


One of the things that makes MATLAB a powerful tool is that you can
both work interactively in the Command Window, and you can also write

TABLE 2.4 Example Built-in Functions for MATLAB®


abs() Absolute value.
mod() Take two noncomplex numbers and return their remainder when using long
division.
whos() Returns the variables in the current Workspace. “whos GLOBAL” returns the
globally scoped variables.
size() Returns the size of the array, meaning the number of items in each dimension.
max() Returns the largest item in the array.
min() Returns the smallest item in the array.
open() Opens a file. We will talk about file input/output in more detail later.
disp() Prints arrays to the display, while not showing the variable name. Useful for
interacting with users of your programs.
Random documents with unrelated
content Scribd suggests to you:
stone specus, like the old aqueduct, but after it reaches the level
ground it is carried in cast-iron pipes on the other side of the river
Anio, and passes under it by a great syphon. This was to avoid
repeating the great circuit made by the old aqueduct, and was also
done to escape the necessity of crossing the mouths of the number
of small streams that fall into the river Anio and drain the
Campagna; these are often flooded in the wet season, and would
have been likely to injure the bridges of the aqueducts where they
crossed the stream; the iron pipes avoid them by being on the other
side of the river.

MAP OF THE AQUEDUCTS


ON THE
WESTERN SIDE OF ROME[253].
Map of the Aqueducts on the Western Side of Rome

Whiteman & Bass, Photo-Litho’ to the Queen, 236, Holborn


The account given of the map of the eastern side of Rome applies
almost equally to this, but the difficulty to be surmounted was here
greater. Neither Dr. Gori, nor Signor De Mauro, nor the author knew
the ground; we had only Frontinus and Fabretti to help us, and the
course is much more subterranean on this side than on the other.
There are none of the great arcades to carry the specus for five or
six miles; the only portion where they are carried on an arcade for
any distance is on the side and upon the wall of the garden of the
villa Pamphili-Doria, and there the arcade as seen is the work of
Pope Paul V. (Borghese), who restored them to use in the sixteenth
century, making use of the old subterranean specus and the ruins of
the old arches, which can be seen against the wall of that garden.
From this point they are mostly subterranean, we traced them to the
three lakes which served as reservoirs for them. The first specus on
this side of the Lacus Alsietinus has been kept separate from the one
on the other side. In the time of Augustus the water came from the
two upper lakes, but it was brought at a very low level, and the
water from these being always muddy and bad, Frontinus, under
Trajan, rejected it, and brought the water only from the Sabatina;
Pope Paul returned to the use of the upper lake, Alsietina.
This map is also reduced by photography from one on a much
larger scale, though not so large as the one for the eastern side, as
that was found inconveniently large, and on this side there was less
complication to examine and explain. Great credit is due to Signor de
Mauro for the tact with which he traced the subterranean lines. He
found that there are wells and air-holes at intervals, not always
regular, but nearly so, and that when they are in grass-land or
barren land, shrubs have always grown over the top of each well on
account of the moisture that remained in it, and by means of these
shrubs he was able to follow the line.
These aqueducts, which supplied the fountains in the Trastevere,
all come from the lakes on the hills. The Alsietina of Augustus comes
from the lake of that name (now called Martignano), between the
Via Claudia and the Via Aurelia, but not very near to either, being
6½ miles from the Via Claudia at the fourteenth milestone, as
Frontinus states. This was made to supply the Naumachia of
Augustus, which were near the present monastery of S. Cosimato in
Trastevere; the water was very abundant, but not fit for drinking. It
entered Rome at a lower level than any of the other aqueducts,
because the Naumachia were very little above the level of the Tiber.
At the small town called the Cariæ (near the present Osteria Nuova),
about fifteen miles from Rome, it received an additional supply of
water from the Lacus Sabatinus. Trajan restored to use that part
which came from the latter lake; this is better water than the
Alsietina. Pope Paul III., a.d. 1540, again restored this to use, and it
is now called Aqua Paola. His engineers brought the water from
three lakes, the two before mentioned, and a smaller one above the
Alsietina, called Stracciacappe. The object of bringing the water from
this very high level, 500 ft. above Rome, was to supply the splendid
fountains in front of S. Peter’s, the water of which rises to a great
height. This lake was drained in 1870, and at the same time the
water in the Alsietina was also much lowered, by which means the
three specus were brought to light on the bank, and the sites are
shewn on this map. The Aqueduct of Trajan was carried at a much
higher level than that of Augustus, and entered Rome on the top of
the Janiculum. Procopius, in the sixth century, admired the profuse
supply of water at that point; and the water was then, as it is now,
used for a series of mills on the slope of the hill. The engineers of
Pope Paul made use of the water of all the three lakes, and a most
abundant supply still flows into Rome through the Fountain, above
the Church of S. Pietro in Montorio. How far the old specus was used
it is difficult to tell, but most probably that of Trajan was used for a
large part of the distance; it is almost entirely underground until the
last mile into Rome, where it was carried on an arcade of the time of
Trajan. The Aqua Paola is there also carried on an arcade, parallel to
it and near to it, but not the same.
FOOTNOTES
[1] During the first season that I was resident in Rome, it was
my habit to go with my friend Mr. William Long, of Balliol College,
Oxford, then resident in Rome, into the Catacombs every Monday
morning, and along the line of the Aqueducts also once or twice
a-week, when the weather permitted. We procured all the best
maps of the Campagna that were to be had, but could find none
that would enable us to trace the course of the Aqueducts.
Moltke’s map is the best as far as it goes; but, being intended as
a military map only, he paid no attention to the antiquities. The
one known in England by the name of Gell, and in Rome by the
name of Nibby, is made especially for the Antiquities; but it is on
a small scale, and we found it impossible to trace the Aqueducts
upon it. Eventually I have had one made on a large scale, to
make it clear, have added the other Antiquities, and then had it
reduced by photography to two smaller sizes: one very small, to
give the general lines only; the other on a size convenient for the
pocket; and, by using the portion near Rome separately, it makes
a good and convenient map for the purpose.
[2] Frontinus is usually said to have died a.d. 106.
[3] See notably Plutarch, Vita Anci Marcii; Dionys., Hal. Ant.
Rom., lib. iii. c. 679, sect. 9; Strabo, lib. v.; Cassiodorus, lib. vii.
cap. 6, &c.
[4] These wells may have included the cisterns for holding rain-
water, one of which exists on the Palatine.
[5] In the best text, that of the MS. at Monte Cassino, and in
the best printed edition of the text, that of Buecheler (Lipsiæ,
1858), the passage runs “Salubritatem enim ægris corporibus
afferre creduntur, sicut Camænarum, et Apollinis, et Juturnæ.”
The spring of the Camænæ or Muses referred to, is that which
existed in the grove outside the Porta Capena, and beneath the
western slope of the Cœlian. There was an Area Apollinis in the
same Regio, and possibly there was a spring there; but no writer
refers to it. A stream, now subterranean, still exists, and is very
copious, running into and through the Cloaca Maxima; it may be
seen in the excavations of the Forum Romanum. This
subterranean stream comes from three different springs; the
source of one is near the Arch of Titus, or more immediately in
front of the usual entrance to the Palatine;—a second has its
source near the foot of that part of the Quirinal Hill on which the
Torre de’ Conti and the Torre delle Milizie are situated; it now
emerges in a cellar under a shop behind the church of S.
Hadriana;—a third comes from the prison of S. Peter, at the foot
of the Capitol. These streams meet near the church of S. Maria
Liberatrice and the celebrated three columns of the temple of
Castor and Pollux; by their union they formed the lake usually
called after Curtius, but by Ovid the Lacus Juturnæ (Ovid. Fasti, l.
i. ver. 708). This is not the same as the stream so called on Nolli’s
Map. The lake was between that part of the Velabrum of the
Palatine on which the church of S. Maria Liberatrice and S.
Teodoro are situated, which formed the southern side of the lake,
and the Forum Romanum the northern side.
The Aqua Juturnæ, marked 1056 in Nolli’s Map, is the stream
that gushes out in great volume from the rock at the foot of the
Palatine in the Lupercal of Augustus, which is now in a very
ruinous state, the cave being used as a mill-head to a modern
mill, between that point and the Cloaca Maxima. This cave is
close to the Carceres of the Circus Maximus. The authority for the
name of this stream is doubtful; it is now usually called Aqua
Argentina, and falls into the Cloaca Maxima, near the church of S.
Giorgio in Velabro and the arch erected by the silver-smiths in
honour of Septimius Severus.
[6] The Augustan is a name applied also to a branch of the
Marcian close to its source, as well as to one supplementary to
the Appian within the city.
[7] Frontinus, c. 5.
[8] Ibid.
[9] “Jungitur ei ad Spem [Specum] veterem in confinio
hortorum Torquatianorum et Pallantianorum ramus Augustæ, ab
Augusto in supplementum ejus additus, ... loco nomen
respondenti Gemellarum.” (Ibid.)
[10] “Incipit distribui [Aqua] Appia imo Publicii clivo ad portam
Trigeminam.” (Ibid.)
And again: “Rivus Appiæ, sub Cœlio monte et Aventino actus,
emergit, ut diximus, infra clivum Publicii.” (Ibid., c. 22.) The cave
reservoir which formed the mouth of this stream, where it was
distributed, has been found near the Marmorata, or marble-wharf.
The Porta Trigemina was between that and the Salaria, or salt-
wharf. Both of the wharves are still in use. Some good antiquaries
consider that the Porta Trigemina consisted of three double gates,
at intervals along the narrow strip of ground between the
Aventine and the Tiber, and that the one of which remains have
been found near the Sublician bridge was the middle one of the
three: if so, this cave would be literally in the Porta Trigemina. In
any case, it must have been close to it.
[11] That is, in the reservoir, or castellum aquæ, through which
the conduit or specus passed. This reservoir exists, or rather
considerable remains of it, just within the Porta Maggiore,
between that and the church of S. Croce, and just outside the
agger of the Sessorium, on which the road from S. Croce to this
gate now runs.
[12] “... Cujus aquæ ad caput inveniri mensura non potuit,
quoniam ex duobus rivis constat. Ad Gemellos tamen, qui locus
est infra Spem (Specum) veterem, ubi jungitur cum ramo
Augustæ, inveni altitudinem aquæ pedum quinque, latitudinem
pedis unius, dodrantis: fiunt areæ pedes octo, dodrans: ... quas
esse ex eo adparet quod in plerisque urbis partibus perdita aqua
observatur, id est quæ ex ea manat, sed et quasdam fistulas intra
urbem illicitas deprehendimus, extra urbem autem propter
pressuram libræ, quam vidi infra terram ad caput pedibus
quinquaginta, nullam accipit injuriam.” (Frontinus, c. 65.)
[13] There is good reason to believe that such tombs were not
exclusively Etruscan, but were also used by the Latins and other
nations at the same period, and this one may very well be early
Roman.
[14] The modern carriage-road, so called, was called Via
Gabina in the time of Frontinus. The old Via Prænestina is now a
bridle-road only for the first three miles out of Rome, to the Torre
de’ Scavi; it is then a cart-road, called Via Collatina, with a branch
road into it from the present carriage-road.
[15] In the Map of Gell and Nibby, along the Via Prænestina will
be seen the name Pupinia. The spot is just north of this, and not
far off from the piece of road marked in the same map as the Via
Collatina.
[16] Frontinus, c. 22.
[17] In the Bullettino dell’ Instituto Archeologico, and the Civiltà
Cattolica, for the year 1861, it is stated that for the works of the
iron railroad between the Via Labicana and the Via Gabina the
specus of the Aqua Appia was found, 450 yards (metres) from the
Porta Maggiore. It was constructed of square stone of tufa, and
was incrusted with tartar, had an acute vault, which was 5 ft. 9
in. high, and 2½ ft. wide.
[18] This is on the line of the wall of Servius Tullius. It appears
that Trajan made a reservoir here over the old one. The specus of
the Appia passes through the present gardener’s house
lengthwise, from east to west. This specus was found again in
another excavation to the west of it, by the side of the present
road.
[19] “Substitit ad veteres arcus madidamque Capenam.”
(Juvenal, sat. iii. ver. 11.) “Capena grandi porta qua pluit gutta.”
(Martial, lib. iii. epigr. 47.) The distance from the foot of the
Cœlian to the Marrana is just a hundred yards along the line of
the wall of Servius Tullius, across this part of the valley or great
primitive foss. The ground on the side of the wall is all made
earth and rubbish, and two aqueducts are carried on arcades
against the wall, one on either side. These arcades have not been
traced beyond the Marrana, the ground there being higher. At the
Piscina Publica, where another pit was dug 20 ft. deep, the wall is
built against the tufa rock, and there is a third specus in a tunnel
in the rock under the wall.
[20] Or perhaps the road was a deep foss-way, and the specus
passed over the arch of the gate at this point, where four roads
meet.
[21] In the spring of the year 1870, another excavation was
made close to this point, and a way was found into another old
subterranean stone-quarry long out of use. Through this cave, or
quarry, the specus of five different aqueducts pass on their way
to the Tiber. Some of these come down at a steep decline, and
the water of the whole seems to have been carried into the
lowest one, the Appia, at this point. This specus must have been
carried over the deep foss-way upon or under the arch of the
gate of the old wall of the city, where four roads meet. It is also
visible again in another old subterranean stone-quarry on the
other side of the road, nearly under S. Prisca, and from thence it
must have gone to the old cave, used as a reservoir near the
Marmorata, and the Porta Trigemina, immediately under the
monastery of S. Maria del Trinita di Malta, where the specus is
again visible, and where the wells of other aqueducts run into the
same cave reservoir at the mouth of the aqueducts in this part of
Rome. One of these runs down a vertical pipe from the reservoir
nearly over this cave, but under S. Sabina on the hill above,
excavated in 1865, and described by M. Descemet (Sect. xi.)
There is another large reservoir in the interior of the hill, still full
of water, supplied by a spring rising there; the water from this still
passes through the same passage to the Tiber. This is also said to
have been called the cave of Faunus by the poets. It is probably
also the same as that of Cacus, being a large natural cave, with a
spring of water, and a natural reservoir of considerable size in it
about knee-deep, the entrance to which is by a narrow passage
made into the specus of the aqueduct. Such a cave might very
well have been used to drive cattle into for concealment, and a
resolute, well-armed man standing at the entrance might defend
it against any number. Solinus (i. 7) says that the cave of Cacus
was at the Porta Trigemina, and that he dwelt in the Salinæ,
which are close by this spot. “Qui Cacus habitavit locum cui
Salinæ nomen est, ubi Trigemina porta.”
[22] On the wall of the smaller reservoir, the fragment of an
inscription, relating to the Thermæ of S. Helena, now in the
Vatican Museum, is said to have been found:—
d. n. helena ... ven. ... avg. mat.
avia ... beatis ...
therma ... si ... estrv ...

[23] Frontinus says, c. 5, at the sixth milestone on the Via


Prænestina, about nine hundred and eighty paces off to the left,
and near the Via Collatina, this stream has its source. The sources
both of the Aqua Appia and of the Augusta were traced by Signor
Fabio Gori and Mr. J. H. Parker, in March, 1868, and were
afterwards shewn to the British Archæological Society of Rome.
[24] The source of the Appia was 780 paces off the road,
between the 7th and 8th milestone. That of the Augustan 880
paces off, and by the 6th milestone. The former was measured to
its termination, giving 11⅛ miles. The latter went only to the
“Specus Vetus” (which is two miles less) and gave 6⅓ miles. Two
miles is the distance from the Porta Maggiore to the Porta
Trigemina and the Salaria. In all probability the Augustan branch
was carried for the six miles into Rome along the bank of the Via
Prænestina, here a deep foss-way between two high banks; and
at a later period the Aqua Virgo was carried over it at a higher
level, till within about half a mile of Rome, where it arrives at the
outer bank of the great foss, and is carried at a sharp angle to
the north to the Pincian. The Appia, being much deeper, was
carried straight on at the bottom of the great foss into Rome, and
entered at the extreme eastern corner, under the line afterwards
taken by the Claudian arcade, to the two great reservoirs or
gemelli before mentioned; the main line running here parallel to
it, a little to the south, till it reached the Piscina of S. Helena, the
two lines converging at the gemelli.
[25] There are considerable remains of two large reservoirs in a
garden just outside of the boundary-wall of the Sessorium, which
wall is of the time of S. Helena, on its western side. Some
excavations made in them in 1869 under my direction shewed
that they went to a great depth, the workmen being stopped by
water. These two great reservoirs, so close together in the line of
the Aqua Appia, seem to have been the Gemelli mentioned by
Frontinus. From this point the specus can be traced along the
Cœlian, and the reservoirs are below the level of that specus
(infra specum veterem).—F. ii. 65.
[26] If the “Plautian” be the better reading, they may have
been the gardens of Plautius Lateranus, which were near those of
the Sessorian Palace.
[27] Frontinus, cap. 19: “Marcia autem partem sui post hortos
Pallantianos in rivum qui vocatur Herculaneus, dejicit.” Cap. 20:
“Finiuntur arcus earum (Anionis Novi, et Claudiæ), post hortos
Pallantianos.” Cap. 69: “Præterea (Julia) accepit prope urbem,
post hortos Pallantianos.” In the Notitia and the Curiosum Urbis
the “Horti Pallantiani” are given as being in the Regio V. or the
“Esquiliæ.”
[28] Remains of these thermæ were accidentally brought to
light in 1871, during some excavations made by a building
company, who had bought the ground on speculation. They are of
great extent, and on both sides of the present road from S. Maria
Maggiore to S. Croce in Gerusalemme, which was made in the
sixteenth century by Sixtus V.
[29] “Exquiliæ locus in quo sepeliebantur corpora extra portam
illam in qua est Sessorium.” (Acron ad Horat., lib. i. Sat. viii.)
“Eodem tempore fecit Constantinus Augustus basilicam in
palatio Sessoriano, ubi etiam de ligno S. crucis D. N. Jesu Christi
posuit.” (Anastasius in vita S. Silvestri papæ, xxxiv. § 41.)
[30] Frontinus, c. 6. Pyrrhus was king of Epirus, and came to
the aid of the Samnites against the Romans; he was conquered c.
b.c. 272.

[31] The passage is corrupt, as will be explained. The following


is the reading, as given by Buecheler, whose text is an exact copy
of the best manuscript, that of Monte Cassino:—“Anio Vetus citra
quartum milliarium infra Novum, qui a via Latina in Lavicanam
inter arcus trajicit, et ibi piscinam habet. Inde intra secundum
milliarium partem dat in specum, qui vocatur Octavianus, et
pervenit in regionem viæ Novæ ad hortos Asinianos, unde per
illum tractum distribuitur. Rectus vero ductus, secundum Spem
(Specum) veniens intra portam Exquilinam, in altos rivos per
urbem deducitur.” (Frontin., c. 21.) Infra Novum, therefore,
signifies within the fourth mile on the Via Nova, the New Road of
the time of Frontinus, the Via Appia Nova (?).
[32] Frontin., c. 18.
[33] Signor F. Gori, who is a native of Subiaco, and has
followed the line of the aqueducts on foot from Subiaco to Rome,
says that he has found the source of the Anio Vetus in the river
Anio, at three miles from Subiaco, on the Via Sublacensis vetus,
twenty miles from the old gate of Tibur or Tivoli, in the district
called Le Connotta, where he finds two specus, the higher one
the Anio Novus, the lower one the Anio Vetus. He traces the same
specus near Marano, a village thirty-eight miles from Rome, on
the Via Sublacensis Neroniana, near Vico-varo; and again near
Tivoli, on the bank of the Valle degli Arci. “Delle vere Sorgenti
dell’ Acqua Marcia e delle altre acque allacciate dai Romani presso
le Vie Valeria e Sublacense,” per F. Gori. Roma, 1866, 8vo., pp.
53, 54.
[34] The local patois for Albergo or Auberge.
imp. caesar
divi. f. avgvst. ex . s.c.
dclix. p. ccxl.
imp. caesar .
divi. f. avgvst. ex. s.c.
dclxix. p. ccxl.
[35] By the side of a plan of Rome in the first volume of his
magnificent work (pl. xxxviii.), Piranesi gives a section of the
relative heights of the Aqueducts, as compared with each other.
The figures refer to the base of each specus above that of the
Appian, and the following is the result, according to his
measurements, reduced to English feet:—

Above Specus of Appian. Palmi. Feet.


Anio Novus 173.8 127
Claudian 163.2 119
Julian 145.1 106
Tepulan 138.7 101
½
Marcian 128.7 92½
Anio Vetus 75.4 55½
½
Virgo 9.3 7
Appian — —
At a lower level than Specus of the Appian.
Alsietina in the Trastevere 37.6 27½
½

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

[43] “Descrizione del luogo denominato anticamente Speranza


Vecchia, del monumento delle Acque Claudia ed Aniene Nuova, e
del Sepolcro di Marco Virgilio Eurisace, dell’ architetto cav. Luigi
Canina.” 8vo., Roma, 1839, with six Plates; extracted from the
Annali dell’ Instituto Archeologico.
[44] There are two other temples known to have been
dedicated to Spes, and the one near the Porta Carmentalis is thus
entered in the Notitia and Curiosum Urbis: “Fortunæ et Spei
Templa Nova.” We know that there had been a great fire here,
and that these temples were rebuilt, and therefore the Nova has
reference only to the new structure. Besides, to be analogous, it
should have been “Spes Nova,” or “Templum Spei Novæ.”
According to Dionysius, another Temple of Spes was a mile or
eight stadia from the City. (Dion. Hal., ix. 24.) “Having in the first
battle, which was fought at the distance of eight stadia from the
City, near the temple of Hope, overcome the enemy and beaten
them out of the field, and after that fought them again near the
gate called Collina,” &c. The Porta Maggiore, in the outer wall of
enceinte, is just a mile from the Porta Esquilina, in the inner wall
of the City, and the Arch of Gallienus. On the other hand, the line
of the specus, with the foss-way by the side of it, must have been
important ground for a battle. The modern theory that the whole
of the eastern side of Rome was called after Spes, has no ancient
authority. Another instance is on all accounts very puzzling. It is a
passage in Lampridius, in the life of Heliogabalus: “Ipse secessit
ad hortos Spei Veteris, quasi contra novum juvenem.”
(Lampridius, Antoninus Heliogabalus, 13.) It would almost appear
that there were some gardens called by the name of Spes, unless
indeed in transcribing some such error should have been made as
in the case of the transcriber of Frontinus, and “Spei” written for
“Specus,” by a scribe to whom the former word was familiar but
the latter not, who had mistaken Spc̄ for Spē. It is a strong
passage in favour of the temple theory; but still there is strong
evidence on the other side. This garden was that of the
Sessorium, one side of which was enclosed by the arcade carrying
the specus of the Claudian aqueduct.
[45] The seven places where the abbreviation of spem or
specum occurs in Frontinus are given in another page, with
tracings of these passages from the best manuscript.
[46] Polenus and Buecheler have demonstrated that the Codex
Cassinensis is the earliest and best. It was discovered at Monte
Cassino by Poggio in the fourteenth century. The Codex Vaticanus
is a copy of the above; but the Codex Urbinas, though of later
date, is not a copy from that manuscript. Probably both are
copies from an earlier one, not now extant. Some of the various
readings in the Codex Urbinas are better than those of the Codex
Cassinensis. See the edition of Frontinus by Polenus,
Prolegomena, p. 20. Patavii, 1722, 4to.
[47] Other excavations, made in 1871 in the large vineyard
near the Porta Maggiore, near the building called Minerva Medica,
shewed the aqueducts very distinctly passing through the higher
ground and going along the line of the wall towards the Porta di
S. Lorenzo.
[48] Frontinus, c. 87.
[49] Piranesi, Le Antichità Romane, vol. i. pl. x.
[50] I am indebted to the kindness of the abbot of the
monastery at Monte Cassino, for the tracings of these passages
here reproduced by the process of photo-engraving.
[51] The manuscript called Codex Urbinas reads, jungitur ei ad
anionem veterem. In the present instance, the true reading is
evidently specum. Frontinus is describing the Aqua Appia, the
oldest of the aqueducts, and the junction of the Augusta with the
old specus. This could have nothing to do with the Anio Vetus.
[52] ascus (?): Buecheler reads this ad spem.
[53] The Torquatian Gardens were near the Porta Maggiore,
and probably the same as those of the Sessorium, now those of
Santa Croce in Gerusalemme.
[54] Canina published a volume on what he considered to be
the Temple of Spes, by the side of the Porta Maggiore (as before
mentioned); but a few years afterwards those ruins were pulled
down to make room for a modern guard-house. In doing so, the
inscription of the dedication to Hercules was found by the
architect, Felice Cicconetti, and sent to the Vatican Museum. This
statement was made to me some years since by Signor Cicconetti
himself, and was confirmed by his friend, Signor Simelli, the
photographer, who said he had seen it.
The fact is now denied by the Roman archæologists, and when
challenged by the Cavaliere Visconti to shew him the inscription in
the Vatican Museum, they say they cannot now remember
anything about it; and the stone with the inscription upon it has
not been found. It is printed by Dr. Henzen in his collection of
Inscriptions as then in the warehouse of the Vatican Museum; but
he considers it to have belonged to a wayside altar only, not to a
temple.
The twin reservoirs are very near the same spot; but the place
where the Aqua Appia enters Rome is in the gardens of the
Sessorium, some distance from the gate, to the east of it. An old
specus certainly runs along the Cœlian Hill, nearly under the
Neronian Arcade, and part of it is now used for the Aqua Felice. I
have been along it for more than a quarter of a mile, from near
the Porta Maggiore to the Lateran. The Aqua Felice is carried
down a sharp incline into that old specus, and the metal pipes on
the slope are still supported on brickwork of the first century,
probably part of the Marcian Arcade, when rebuilt in that part by
Frontinus. The old specus runs on (or ran on, it is said to be now
interrupted,) to the reservoir on the Cœlian Hill, at the Arch of
Dolabella.
That a part of the eastern side of Rome went by the name of
Spes Vetus, is said to be proved by a curious graffito upon the
bottom of an amphora, found in 1871 in the excavations in the
Exquiliæ, near the Porta Maggiore, of a cobbler’s stall, in that
district:—
tychici
svtoris
a. spem ve
tere.

This piece of terra-cotta is of the first century of the Roman


Empire; but at what period the name and address of the cobbler
was scratched upon it, is a question not so easily answered.
[55] The Aqua Claudia and Anio Novus enter Rome at the
extreme eastern point on a lofty arcade, which formed the
northern boundary of the Sessorian gardens, and was
incorporated in the Wall of Aurelian. This extends for about a
quarter of a mile; it then turns at a sharp angle to the north, and
passes over the Porta Maggiore, to its final reservoir in a tower at
an angle to the north of that gate. But part of the water of the
Claudia and the Anio Novus united, was carried straight on along
the bank on which the arches of Nero stand, to the Cœlian Hill
and the reservoirs at the west end of it. The temple, called by
Canina Spes, stood near the angle where the water was divided
into two distinct channels, between that point and the Porta
Maggiore.
[56] The name of Porta Esquilina is here given to the Porta
Maggiore, the outer gate on the road to the Esquiline. The same
name was also given to the inner gate in the agger of Servius
Tullius; but there must always have been an outer gate also in
the outer mœnia, or bank and wall for enclosure, which was a
necessary part of every fortified city. (The same name, Porta
Angelica, is still given to both the inner and the outer gate of the
Leonine City, near the Vatican.) The high streams were carried on
this bank to the Porta Viminalis of Frontinus, now called the Porta
di S. Lorenzo. The remains of these three aqueducts can be
plainly seen on entering through the city wall close to the Porta
Maggiore, on the north side, and going along on this bank to the
Porta di S. Lorenzo. The specus is visible at both ends, carried on
arches. In the middle the ground is higher, and the specus pass
through it underground, and then emerge and are carried again
upon arches, exactly as described by Frontinus. The Aqua Felice
is carried over the three aqueducts of the Marcian arcade; it is on
arches twenty feet from the ground at each end, and in the
middle, where these three are underground. The lower part of
the specus of the Aqua Felice almost touches the ground, while
the other three are underground.
[57] The gemelli are, in all probability, the large twin reservoirs
just outside the western wall of the Sessorium, now in a large
vineyard near the Porta Maggiore, through which the Neronian
arches pass. These reservoirs are below the level of the specus of
the Anio Vetus, as was shewn by some excavations made in them
under my direction in 1869.
[58] Some of the water had been thrown into the old specus at
the junction of the Claudian with the Neronian arches.
[59] There are remains of more than one specus crossing the
valley from the Cœlian to the Aventine upon the agger of Servius
Tullius, and passing over the Porta Capena at the foot of the
Cœlian. One of these was the Marcia, from the reservoir over the
Arch of Dolabella, which is near the site of the Claudium and
Temple of Claudius. There were great reservoirs for the
aqueducts at this point on different levels; one of them
underground is still in use, the remains of the others are among
the most picturesque objects in Rome. This passage cannot apply
to the temple of Hope, which is full a mile away from the
Aventine.
[60] “Quum hæc accepta clades esset, jam C. Horatius et T.
Menenius consules erant. Menenius adversus Tuscos, victoria
elatos, confestim missus. Tum quoque male pugnatum est, et
Janiculum hostes occupavere: obsessaque urbs foret, super
bellum annona premente, (transierant enim Etrusci Tiberim) ni
Horatius consul e Volscis esset revocatus: adeoque id bellum ipsis
institit mœnibus, ut primo pugnatum ad Spei sit æquo Marte,
iterum ad Portam Collinam. Ibi quanquam parvo momento
superior Romana res fuit, meliorem tamen militem, recepto
pristino animo, in futura prœlia id certamen fecit.” (Livii Hist., lib.
ii. c. 51.)
[61] “Romæ fœdum incendium per duas noctes ac diem unum
tenuit: solo æquata omnia inter Salinas ac Portam Carmentalem
cum Æquimælio Jugarioque vico. In templo Fortunæ ac matris
Matutæ et Spei extra portam late vagans ignis, sacra profanaque
multa absumpsit.” (Ibid., lib. xxiv. c. 47.)
[62] “Comitia deinde a prætore urbano de senatus sententia
plebisque scito sunt habita: quibus creati sunt quinqueviri muris
turribusque reficiendis: et triumviri bini; uni sacris conquirendis
donisque persignandis; alteri reficiendis ædibus Fortunæ et matris
Matutæ intra Portam Carmentalem, sed et Spei extra portam,
quæ priore anno incendio consumptæ fuerant.” (Livii Hist., lib.
xxv. c. 7.)
[63] “Theatrum et proscenium ad Apollinis, ædem Jovis in
Capitolio, columnasque circa poliendas albo locavit: et ab his
columnis, quæ incommode opposita videbantur, signa amovit:
clipeaque de columnis, et signa militaria affixa omnis generis
dempsit. M. Fulvius plura et majoris locavit usus: portum et pilas
pontis in Tiberim; quibus pilis fornices post aliquot annos P. Scipio
Africanus et L. Mummius censores locaverunt imponendos;
basilicam post argentarias novas et forum piscatorium,
circumdatis tabernis, quas vendidit in privatum; et forum, et
porticum extra Portam Trigeminam, et aliam post navalia, et ad
fanum Herculis, et post Spei ad Tiberim ædem Apollinis Medici.”
(Ibid., lib. xl. c. 51.)
[64] “Sive autem medii montes erunt inter mœnia et caput
fontis, sic erit faciendum, uti specus fodiantur sub terra
librenturque ad fastigium,” &c. (Vitruv., De Architectura, lib. viii. c.
6. § 3.)
[65] “Alexandria est fere tota suffossa, specusque habet ad
Nilum pertinentes, quibus aqua in privatas domos inducitur.”
(Aulus Hirtius, De Bello Cæsaris Alexandrino, cap. 4.)
[66] Frontinus, lib. i. c. 7. He also quotes from Fenestella
concerning the delays which occurred, and speaks of the
Decemvirs consulting the Sybilline books, and being supposed to
have found that it was not the Marcian but rather the Anio which
should be brought into the Capitol: (“Invenisse dicuntur, non esse
aquam Marciam, sed potius Anionem in Capitolium
perducendam.”) Eventually, however, Marcius prevailed, and his
plan was carried out.
Pliny also refers to the work of Marcius: “Sed dicantur vera
æstimatione invicta miracula; Q. Marcius Rex jussus a senatu
aquarum Appiæ, Anienis, Tepulæ ductus reficere, novam a
nomine suo appellatam cuniculis per montes actis intra præturæ
suæ tempus adduxit.” (Nat. Hist., lib. xxxvi. c. 121; see also
further details in Plin., xxxi. 41, and ibid.)
[67] “Qui lapide quadrato ampliores ductus excitavit, perque
illos aquam quam acquisiverit rei publicæ commodo, trium
millium opera fabrorum duxit cui ab auctore,” &c. These words
are wanting in the best manuscript, that of Monte Cassino. In
place of them we have “( ... priores ductus restituit et tertiam
illam aquarum in urbem perduxit) cui ab auctore,” &c. This does
not agree with the opinion of the learned, that the Urbinas
Manuscript is a copy of the one at Monte Cassino, unless great
liberties were taken with it. The fact that the arcade with the
specus of the aqueduct is always built of large squared stones, is
strongly in favour of the Codex Urbinas. It is also certain from the
nature of the work, that a large number of men must have been
employed upon it. This passage seems to have been omitted in
the Codex Cassinensis, which is a proof that the Codex Urbinas is
not a copy from it. Dederich, p. 15, suggests after “commodo,”
the words “trium millium opera fabrorum.”
[68] Frontinus, lib. i. c. 7.
Frontinus states in another chapter (c. 12) that Augustus
brought underground another stream, which should be
supplementary to the Marcian whenever the dryness of the
season rendered extra supply necessary. It was called from the
name of the contriver, Augusta, and had its rise above the spring
of the Marcian. This additional ductus, or Specus Augusta, was
800 paces long.
[69] Frontinus, c. 18.
[70] “Salientibus aquis instruxit urbem.” Ibid., c. 9.
[71] Ibid., c. 87.
[72] Ibid., c. 8.
[73] Ibid.
[74] Ibid., c. 9.
[75] Ibid.
[76] Frontinus, c. 19.
[77] ‘The three aqueducts’ in this passage may mean either the
Anio Vetus, the Marcia, and the Claudia, all of which come from
the neighbourhood of Subiaco, and follow the same line on the
bank of the river Anio, and the cliffs above it as far as Tivoli, but
diverge considerably between Tivoli and the Piscinæ; or it may
mean that the Tepula and the Julia coming from near Marino, and
the Marcia coming from Tivoli, meet at this point—both are true.
The piscinæ of the Claudia, the Anio Novus, the Marcia, the
Tepula, the Julia, are all within half-a-mile of each other.
[78] Dr. F. Gori says that the lake of S. Lucia, in the territory of
Arsoli, near Subiaco, is not the source of the Aqua Marcia, but of
the Aqua Claudia only, and that the sources of the Aqua Marcia
are nearer to Subiaco, and are called by the people Acque
Serene. He also considers that the branch of the Aqua Augusta
added to the Marcian by Augustus, now called Le Rosoline, comes
from near the village of Agosta, and that the spring, now called
La Fonte (Fons novus Antoninianus), added to the Marcian by
Antoninus Caracalla, is under the same village of Agosta. One of
the inscriptions on the Porta S. Lorenzo records this. See Delle
varie Sorgenti dell’ Acqua Marcia, &c., pp. 56, 57.
[79] The new company had at first proposed to draw their chief
supply of water from the small lake called the Lago di S. Lucia,
which is nearer to Rome, and which they had been misinformed
was the Aqua Marcia. Dr. Fabio Gori, from his great local
knowledge and his archæological researches, was able to shew
that this was a mistake, and wrote to that effect a letter in the
Roman newspaper called the Osservatore Romano. This letter at
first gave great offence, and a very warm controversy was carried
on for some time on that subject. Eventually, however, a new
engineer of the company thought it better to examine the ground
himself, and the result was to establish that Gori’s views were
perfectly correct. He then became a warm advocate for the
company, which he thinks entitled to great praise for the
admirable manner in which its works in the valley of the Anio
have been carried out as far as Tivoli. Their works almost equal
those of the time of the Empire, and are carried out on the same
principles; but from Tivoli to Rome the water is carried in metal
pipes, and not in a stone specus as it is above Tivoli. This enables
the company to carry it in a more direct line.
[80] See the Appendix to this Section.
[81] A great deal too much importance has been attached to
this Cyclopean Masonry, Opus Cyclopæum. See the Chapter on
the Construction of Walls.
[82] It is probably the case that part of this supply was brought
in metal pipes only, from the evidence of this inscription. A stone
specus passes under the wall on the bank round three sides of
the camp on the exterior of the walls, and is plainly visible at the
north-east corner; but this agrees with the general character of
the Anio Vetus, and was probably a branch from that aqueduct.
The inscription is as follows:—
imp. caes. m. opelli . severi . macrini
. avg
m. opelli . severi . diadvmeniani .
caes. princ. iv
castris . praetori
terentivs . cassander . fecit

[83] “[Honorius, Papa III.] Ecclesiam Sanctæ Bibianæ juxta


formas aquæ Martiæ cum Monasterio Monialium restituit.”
(Ciaconi, Vitæ Pontif. Roman., &c., vol. ii. col. 46, C.)
[84] An inscription recording repairs by Agrippa is said by
Ligorio to have been found on a cippus of travertine at the third
mile on the Via Latina. The genuineness of this is doubted by
Fabretti, because the number of miles does not agree; but it
seems more probable that this was an error in transcribing, than
that the inscription should be forged without any motive for doing
so:—
aqvae . ivliae . tepvlae.
imp. caes. divi . ivli . f.
avgvstvs . pontif.
max. cos. x̅ i̅ i̅ . trib. pot.
x̅ i̅ x̅ . imp. x̅ i̅ i̅ i̅ . cvrante
m. vipsan . agrippa .
aedil . cvrvl . l. c. c.
p. mill. x.

Another inscription, also recording repairs of the time of


Augustus, was found by Fabretti himself, in the Vinea
Bartholomæi Virginii, two miles from the Porta Maggiore, between
the ruins of the arcades of the Marcian and Claudian, and was
preserved in a private museum:
ivl. tep. mar.
imp. caesar.
divi . f.
avgvstvs.
ex. s. c.
lxiii.
p. ccxi.

[85] Marrana is a general name for a running stream in the


Campagna round Rome, probably a provincial word; but it is also
the special name of this particular stream coming from Marino.
[86] “Tepula concipitur via Latina ad decimum milliarium,
diverticulo euntibus ab Roma dextrorsus millium passuum duum
... inde suo rivo in urbem perducebatur.” (Frontinus, c. 8.)
[87] It is the building pointed out in guide-books as “The House
of Cicero,” although there does not appear to be any historical
ground for this name.
[88] “... ad milliarium ab urbe duo-decimum via Latina,
diverticulo euntibus ab Roma dextrorsus millium passuum duum
alterius aquæ proprias vires collegit et Tepulæ rivum intercepit.
Acquisitæ aquæ ab inventore nomen Juliæ datum est, ita tamen
divisa erogatione, ut maneret Tepulæ appellatio.”—(Frontinus, c.
9.)
[89] “Præter caput Juliæ transfluit aqua quæ vocatur Crabra.
Hanc Agrippa omisit.”—(Frontinus, c. 9.)
[90] Pag. clxxxii. 8, “In tubulo plumbeo reperto ad portam S.
Laurentii,”—
p. cornelio . dolabella . c . ivn . silano . cos—aqva . mar

[91] Gruter, pag. clxxxiii. 4,—


q. aqvillio . sabino . ii.
sex . avr . anvllino
castr . præt . l. vrbis . off . ped .
cos . ccclxxxiii.
aqva . marc

[92]
hac rivi aqvar
trivm evnt cippi
positi ivssv
a. didi. galli
t. rvbri. nepotis
m. corneli firmi
cvratorvm aqvar

[93] Frontinus, c. 10.


[94] “Concipitur Virgo via Collatia ad milliarium octavum
palustribus locis, signino circumjecto continendarum scaturiginum
causâ.” Signinum is the particular kind of cement to hold water,
always used to line the walls of the Aqueducts. It was not used
after the time of the Empire, and the art of making it is said to be
lost. It is the usual characteristic of the remains of an aqueduct.
[95] Frontinus, c. 10.
[96] Ibid., c. 22.
[97] This water is now usually called Acqua di Trevi, because its
terminus is at the great fountain of Trevi. The sources are in the
estate of Salone, as above described. It is still in use, and was
long considered as the best water brought into Rome. The line
now used is the one repaired and restored by the Popes; but,
near Rome, it has been altered, probably after it had been
damaged by the Goths or the Lombards. The old specus passed
through the Catacomb of S. Priscilla, in the Via Salaria, where it
may be seen. This is demonstrated by the cippus of the aqueduct
of Virgo, discovered in the Via Salaria, and so recorded by
Muratori, Thes. Vet. Inscr., ccccxlii. 7, “Romæ in Via Salaria:”—
virg.
ti . cæsar . avg.
pontif . maxim.
trib. pot. xxxviii.
cos . v̅ . imp. v̅ i̅ i̅ i̅ .
i.
p. cxl.

This inscription is a.d. 36.


It was then brought to the bank or mœnia on which the wall of
Aurelian was afterwards built near the Porta Salaria, and may be
traced upon or in that bank under the present wall of Rome for
about a mile. For a short distance, where this ground is low, it
was carried on an arcade, of which there are remains under the
wall built upon it. After this it goes on as far as the garden of the
Villa Borghese and the French Academy, under which it now
passes through the Pincian Hill.
[98]
ti . . drvsi . f. avg. german. pont.
clavdivs
max. tribvnic. pot. v. imp. ix. p.p. cos. iii.
desig. iiii. arcvs . dvctvs . aqvæ . virgi
nis . distvrbatos . per . c. cæsarem . a. fvn
damentis . novos . fecit . ac . restitvit

This inscription was erected a.d. 46.


[99] There are remains of the Septa in the cellars under the
houses on the west side of the Corso, in its lower part. These
remains of the arcade are now chiefly underground, owing to the
filling up of the great foss, called in this part Via Lata, because
the wide foss under part of the Quirinal and of the Capitol had at
one time been made into a wide street or place, on the eastern
side of which is situated the Church of the “SS. Apostoli in Via
Lata” and that of S. Maria in Via Lata on the western side, at the
north-west corner. The great public building called the Septa went
down the western side of this wide place from S. Maria to the
Venetian Palace, with an arcade towards the street or place, of
which many of the arches remain in the cellars. These arches
under the church of S. Maria are absurdly called the house of S.
Paul. They are visible also under the Palazzo Doria to the south of
that church, and in other cellars.
[100] “Idem et Virginem adduxit ab octavi lapidis diverticulo
duobus millibus pass. Prænestina Via.
“Juxta est Herculaneus rivus quem refugiens Virginis nomen
obtinuit.” (Plinii Nat. Hist., lib. xxxi. c. iii. § 25.)
[101] Of this stream and its introduction into Rome in the
twelfth century, an account will be found in the second part of
this chapter.
Frontinus, c. 15 and 19.
[102] Frontinus, c. 11.
[103] Ibid., c. 18.
[104] Ibid., c. 71.
[105] The draining of the lakes in the hills round Rome is a
great mistake, and very injurious to the health of the city. Such
lakes are a wise provision of nature for collecting some of the
surplus water in the rainy season, and preserving it for use in the
hot and dry season, when the evaporation from the lakes helps to
cool the air. The water also drawn from these lakes was most
useful for the irrigation of the country round Rome, and watering
the gardens in Rome itself, thereby promoting vegetation, which
is essential for health in a hot and dry climate. It is well known
that the leaves of plants and trees (more especially of deciduous
trees) absorb nitrogen, which is the part injurious to human life,
and give out oxygen, that portion which is beneficial to, and
necessary for, human life. Where there is no vegetation,
therefore, the climate cannot be healthy, and without water there
can be no vegetation; for water is the necessary food of plants.
[106] The line of this subterranean aqueduct can also be traced
by the wells descending into the specus, in the same manner as
the Aqua Appia was traced in 1870, that is, by the bushes
growing at the top of each of the wells, and generally enclosed by
a wooden railing to prevent animals from falling into them.
[107] The rock in which the tunnel is cut is a sort of peperino,
hard and rough, covered with a bed of clay.
[108] This lake, called Sabatina in the time of Frontinus, was
called Anguillara in the Middle Ages, and is now called Bracciano,
in both cases from the names of the proprietors. The great family
of Anguillara had their origin from this village, of which they were
the proprietors, and where they had a castle on the bank of the
lake. The present proprietors are the Dukes of Bracciano. The
lake produces a great abundance of fish, especially a small fish
much resembling the white-bait of London, at least when cooked.
[109] There is a small construction over this flood-gate, and at
the back of it is this inscription:—
acqva paola
alla presa dell’ acqva
alseatina

[110] There are interesting remains of the Necropolis of this


ancient city close to the fountain before mentioned, on each side
of a deep ravine. On one side, there are nine chambers cut out of
the rock on the edge of the cliff, the entrance being in the central
chamber, with four others on either side of it. All are full of small
square columbaria, of very early character. On the opposite side
of the ravine, is a similar series of tombs, but in a less perfect
state.
[111] There is Opus Reticulatum of rude and early character
(more like the Opus Incertum of the Emporium than the
mausoleum of Augustus) at the entrance of this passage, which is
mentioned by Nibby. There is a stone-quarry also at the entrance,
of the hard, dark-coloured stone used for making roads, and
excellent for that purpose. This is the same stone that is called
selce or silex in Rome, and seems to be similar to the hard lava
under which Herculaneum is buried, and of which there are
quarries near the tomb of Cecilia Metella.
[112] The persons employed by Mr. Parker went down to the
bottom of this steep tunnel-passage to ascertain this.
[113] Nibby, Analisi storico-topografico-antiquaria della carta
de’ Dintorni di Roma, tom. i. Roma, 1837, 8vo. art. Alsietina.
[114] Cassio, Corso delle Acque, vol. i. p. 147.
[115] Nibby considers this a mistake, and is of opinion that the
water was the Sabatina, not the Alsietina; but the mistake is
made by Nibby himself, not by the engineers of Pope Paul, who
certainly brought the water from the Lacus Alsietina and the other
small lake above it (as mentioned on p. 50). By the draining of
these lakes, the aqueduct is now made to depend on the Lacus
Alsietina only. The sources of the Alsietina are very different from
those of the Sabatina. The former was taken by Augustus from
the lake Alsietinus, now called Lago di Martignano, and the latter
by Trajan from the sources between the lake Sabatinus and the
villages of Vicarello, Bassano, and Oriolo. The Alsietina was at the
lowest level of all the aqueducts, and the Sabatina at the highest.
The first specus was for the most part subterranean, and the
other was carried upon arcades for part of its course.
[116] By the more usually received computation, the second
year of Caligula would be a.u.c. 791; and the year of the
consulship of Sulla and Titian, a.u.c. 805.
[117] It surpassed all the others in quantity, and being the
highest, was used to supply the others when the water fell short;
but the water was not so good for drinking.
[118] Frontinus, c. 13.
[119] That is, higher than any other aqueduct.
[120] Frontinus, c. 20.
[121] The road to Subiaco.
[122] Frontinus, c. 14.
[123] Ibid.
[124] Ibid.
[125] Ibid., c. 18.
[126] In Subruino is the reading given in the text by Dederich.
In suo rivo is the reading adopted by Polenus, Jocundus, and
other editors. A third reading has been suggested, “In Simbrivio,”
or in Simbruino, that is, referring to the Simbruine hills. This is
the reading of Buecheler (1868), who follows verbatim the
manuscript of Monte Cassino. The reading, however, bears little
upon the evidence.
[127] Herculaneus Rivus. This is not the same Herculaneus
Rivus as the one mentioned by Frontinus in connection with the
Anio Vetus, in ch. 19. The same name is given in these places to
different streams, all strong and rapid.
[128] Frontinus, c. 15.
[129] Ibid., c. 93.
[130] Ibid., c. 91.
[131] Frontinus, c. 76.
[132] “At ex alia parte Anio in monte Trebanorum ortus lacus
tres amœnitate nobiles, qui nomen dedere Sublaqueo defert in
Tiberim.” (Plinii Nat. Hist., iii. 109.)
[133] The inhabitants of Filettino probably belonged to the
tribe of the Trebani, or of Trebula, who were located in the
neighbourhood of Trevi, where was a Roman colony and
principality. Inscriptions giving the names and titles of Augustus,
Septimius Severus, and Commodus, were found here, and are
published by Signor Gori in his Trattato dell’ Acqua Marcia, &c.,
12mo., 1866, p. 37. Another inscription at Anagni, on the front of
the Governor’s palace, gives the name of Publius Vecellius,
curator of the Republic of the Trebani.
Martial mentions the Treba Augusta of Frontinus, under the
name of Trebula:
“Trebula nos genuit, commendat gratia duplex Sive levi flamma,
sive domamur aqua.” (Lib. v. epigr. 65, and lib. xiii. epigr. 33.)
Livy also mentions it: “Eodem anno Arpinatibus Trebulanisque
civitas data.” (Livii Hist., x. 1.)
[134] imp caesaris nervae traia(ni) ... op(t)imi avg germanic dacici.

[135] “Lacus monasterii ad nihilum redactus, quia duo monachi


levaverunt duo lapides, qui fuerunt firmati cum aliis petris; et sic
aqua destruxit.” (Chronicon Sublacense, apud Muratori, Rer. Ital.
Script., tom. xxiv. col. 962, D.) The author of this Chronicle was
living in the year 1390.
[136] Gruter, Inscriptiones, p. clv. 4.
[137] Probably the text of Frontinus here is corrupt, because
the Piscina Limaria and the specus of Claudius are at the forty-
sixth mile on the Via Sublacensis, “ad milliarium quadragesimum
secundum,” for “Ad milliarium quadragesimum sextum.”
[138] Dr. Fabio Gori, who is a native of Subiaco, claims the
credit of being the first person to point out what this great work
of Trajan really was. He also states that the Rivus Herculaneus,
rising at thirty-eight miles on the Via Sublacensis, must have been
a clear stream, which he finds on the left side of the river,
opposite to the lake of S. Lucia and to this source of the aqueduct
of the Claudia, called Acqua dell’ Arco, or water of the aqueduct.
[139] Frontinus, c. 72.
[140] The piscina made in one of the towers in the wall at the
point where it enters Rome, has the four chambers visible, the
inner wall of the tower having been destroyed.
[141] Inscriptions on the Porta Maggiore:—
ti . clavdivs drvsi f. caisar avgvstvs
germanicvs pontif maxim
tribvnicia potestate x̅ i̅ i̅ . cos. v.
imperator x̅ x̅ v̅ i̅ i̅ . pater patriæ
aqvas . clavdiam ex fontibvs . qvi
vocabantvr caervlevs et cvrtivs
. a milliario x̅ x̅ x̅ x̅ v̅ .

item anienem novam a. milliario


l̅ x̅ i̅ i̅ . sva impensa in vrbem perdvcendas
cvravit.

imp . caesar . vespasianvs avgvst .


pontif . max . trib. pot. i̅ i̅ . imp.
v̅ i̅ . cos. i̅ i̅ i̅ . desig. i̅ i̅ i̅ i̅ . p.p

aqvas cvrtiam et caervleam perdvctas


a divo clavdio . et postea
intermissas dilapsasqve

per annos novem . sva impensa


vrbi restitvit.

imp . t. caesar divi f. vespasianvs


avgvstvs pontifex maximvs . tribvnic

potestate x. imperator x̅ v̅ i̅ i̅ . pater


patriae . censor . cos . v̅ i̅ i̅ i̅ .

aqvas cvrtiam et caervleam perdvctas


a divo clavdio et postea

a divo vespasiano patre svo vrbi


restitvtas . cvm a capite aqvarvm
a solo vetvstate dilapsae
essent . nova forma redvcendas
sva impensa cvarvit. (Orelli, vol.
i. p. 77, Nos. 54-56.)
These inscriptions shew that considerable repairs were made
by Vespasian and Titus to the Claudian aqueducts; and these
repairs were continued by their successors, Nerva, Trajan, and
Hadrian. Many parts and branches belong to the time of these
Emperors.
[142] Vide “Delle vere Sorgenti dell’ Acqua Marcia,” &c.,
“trattato di Fabio Gori.” Roma, 1866. An admirable map shewing
the sources and the line of each of the Aqueducts, has been
made for me under the direction of the author.
[143] Frontinus (c. 15) gives the length of the specus of the
Anio Novus as 58 miles and 700 passus; add to this the length of
the Piscina Limaria and of the three lakes, and we have the
distance of 62 miles from Rome for this aqueduct.
[144] “Qui colles, (mons Cœlius et Aventinus,) priusquam
Claudia perduceretur, utebantur Marcia et Julia. Sed postquam
Nero Imperator Claudiam, opere arcuato altius exceptam, usque
ad templum Divi Claudii perduxit, ut inde distribueretur, priores
non ampliatæ, sed omissæ sunt: nulla enim castella adjecit, sed
iisdem usus est, quorum, quamvis mutata aqua, vetus appellatio
permansit.” (Frontinus, c. 76)
[145] The large square part of the Cœlian Hill, with scarped
cliffs round three sides of it and part of the fourth, which had
probably been originally the arx or citadel of the Cœlian when
that was a separate fortress, and on which Claudius erected some
great public building with a temple, is marked on the modern
maps of Rome as a castellum aquæ: this is an exaggeration. A
specus runs along the western side opposite to the Palatine in the
wall, and goes straight towards the Colosseum, and there are
remains of a piscina of the first century at the north-west corner
of the Claudium, near the Colosseum, and the Meta Sudans; but
this is at a low level, and does not agree with there being a large
reservoir under the whole of that space.
[146] Frontinus did not live to see this completed.
[147] Cap. 86, 91, 92, and 105.
[148] These are at present almost hid by modern houses built
up against them, but it is expected that these modern erections
will shortly be removed. The remains of the bridge project at a
right angle from the palace of Domitian. It had the aqueduct at
the top at a very high level, and a road for horses by the side of it
at a lower level, as at the Ponte Lupo, Ponte S. Antonio, and
other bridges of the aqueducts.
[149] These imperial “Edicts” or “Decrees,” or Laws and
Constitutions, have been published in various works. The later
ones relating to this subject are published by Polenus, in the
Appendix to his edition of Frontinus, 4to. Pataviæ, 1722; and by
Rondelet, as a supplement to Frontinus, who had published those
issued up to his time. See Commentaire de Frontin sur les
aqueducs de Rome, 2 parts, 4to. and atlas folio, Paris, 1802; and
Rondelet, Opere, 6 vols. 4to. Mantova, 1841, tom. vi. p. 117, &c.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like