0% found this document useful (0 votes)
2 views

Introduction To Engineering And Scientific Computing With Python 1st Edition David E Clough instant download

The document is an introduction to the book 'Introduction to Engineering and Scientific Computing with Python' by David E. Clough and Steven C. Chapra, aimed at first-year engineering students. It covers essential Python programming concepts, engineering calculations, and structured programming, while providing practical problem-solving examples. The book is designed to be accessible for students at all levels and relevant for professionals seeking to enhance their programming skills in engineering contexts.

Uploaded by

boinobisen20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Introduction To Engineering And Scientific Computing With Python 1st Edition David E Clough instant download

The document is an introduction to the book 'Introduction to Engineering and Scientific Computing with Python' by David E. Clough and Steven C. Chapra, aimed at first-year engineering students. It covers essential Python programming concepts, engineering calculations, and structured programming, while providing practical problem-solving examples. The book is designed to be accessible for students at all levels and relevant for professionals seeking to enhance their programming skills in engineering contexts.

Uploaded by

boinobisen20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 90

Introduction To Engineering And Scientific

Computing With Python 1st Edition David E Clough


download

https://ebookbell.com/product/introduction-to-engineering-and-
scientific-computing-with-python-1st-edition-david-e-
clough-44145116

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Introduction To Engineering And Scientific Computing With Python David


E Clough Steven C Chapra

https://ebookbell.com/product/introduction-to-engineering-and-
scientific-computing-with-python-david-e-clough-steven-c-
chapra-44123852

Introduction To Computational Engineering With Matlab Chapman Hallcrc


Numerical Analysis And Scientific Computing Series 1st Edition Timothy
Bower

https://ebookbell.com/product/introduction-to-computational-
engineering-with-matlab-chapman-hallcrc-numerical-analysis-and-
scientific-computing-series-1st-edition-timothy-bower-44614572

Introduction To Phase Diagrams In Materials Science And Engineering


Hiroyasu Saka

https://ebookbell.com/product/introduction-to-phase-diagrams-in-
materials-science-and-engineering-hiroyasu-saka-10920704

An Introduction To Metabolic And Cellular Engineering 1st S Cortassa

https://ebookbell.com/product/an-introduction-to-metabolic-and-
cellular-engineering-1st-s-cortassa-2015856
Nanoengineering In Science And Technology An Introduction To The World
Of Nanodesign Series On The Foundations Of Natural Science And
Technology Michael Rieth

https://ebookbell.com/product/nanoengineering-in-science-and-
technology-an-introduction-to-the-world-of-nanodesign-series-on-the-
foundations-of-natural-science-and-technology-michael-rieth-1296448

Introduction To Engineering And The Environment 1st Edition Edward S


Rubin Cliff I Davidson

https://ebookbell.com/product/introduction-to-engineering-and-the-
environment-1st-edition-edward-s-rubin-cliff-i-davidson-10887630

Exploring Engineering An Introduction To Engineering And Design 3rd


Edition 3rd Edition Philip Kosky

https://ebookbell.com/product/exploring-engineering-an-introduction-
to-engineering-and-design-3rd-edition-3rd-edition-philip-
kosky-10941948

Exploring Engineering An Introduction To Engineering And Design 5th


Philip Kosky

https://ebookbell.com/product/exploring-engineering-an-introduction-
to-engineering-and-design-5th-philip-kosky-11132740

Exploring Engineering An Introduction To Engineering And Design 5th


Edition 5th Edition Philip Kosky

https://ebookbell.com/product/exploring-engineering-an-introduction-
to-engineering-and-design-5th-edition-5th-edition-philip-
kosky-22629554
Introduction to
Engineering and Scientific
Computing with Python
As more and more engineering departments and companies choose to use Python,
this book provides an essential introduction to this open-source, free-to-use language.
Expressly designed to support first-year engineering students, this book covers engi-
neering and scientific calculations, Python basics, and structured programming.
Based on extensive teaching experience, the text uses practical problem s­ olving
as a vehicle to teach Python as a programming language. By learning comput-
ing fundamentals in an engaging and hands-on manner, it enables the reader to
apply engineering and scientific methods with Python, focusing this general lan-
guage to the needs of engineers and the problems they are required to solve on
a daily basis. Rather than inundating students with complex terminology, this
book is designed with a leveling approach in mind, enabling students at all levels
to gain experience and understanding of Python. It covers such topics as struc-
tured programming, graphics, matrix operations, algebraic equations, differential
equations, and applied statistics. A comprehensive chapter on working with data
brings this book to a close.
This book is an essential guide to Python, which will be relevant to all
­engineers, particularly undergraduate students in their first year. It will also be of
interest to professionals and graduate students looking to hone their programming
skills, and apply Python to engineering and scientific contexts.
Introduction to
Engineering and Scientific
Computing with Python

David E. Clough
Steven C. Chapra
MATLAB® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks
does not warrant the accuracy of the text or exercises in this book. This book’s use or discussion
of MATLAB® software or related products does not constitute endorsement or sponsorship by
The MathWorks of a particular pedagogical approach or particular use of the MATLAB® software.

First edition published 2023


by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742
and by CRC Press
4 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN
CRC Press is an imprint of Taylor & Francis Group, LLC
© 2023 David E. Clough and Steven C. Chapra
Reasonable efforts have been made to publish reliable data and information, but the author and
publisher cannot assume responsibility for the validity of all materials or the consequences of
their use. The authors and publishers have attempted to trace the copyright holders of all m
­ aterial
reproduced in this publication and apologize to copyright holders if permission to ­publish in this
form has not been obtained. If any copyright material has not been acknowledged, please write
and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted,
­reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means,
now known or hereafter invented, including photocopying, microfilming, and recording, or in
any ­information storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.­
copyright.com or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive,
Danvers, MA 01923, 978-750-8400. For works that are not available on CCC please contact
­[email protected]
Trademark notice: Product or corporate names may be trademarks or registered trademarks and
are used only for identification and explanation without intent to infringe.
Library of Congress Cataloging‑in‑Publication Data
Names: Clough, David E., author. | Chapra, Steven C., author.
Title: Introduction to engineering and scientific computing with Python / David
E. Clough, Steven C. Chapra.
Description: First edition. | Boca Raton : CRC Press, 2023. |
Includes bibliographical references and index.
Identifiers: LCCN 2022012776 (print) | LCCN 2022012777 (ebook) |
ISBN 9781032188942 (hardback) | ISBN 9781032188973 (paperback) |
ISBN 9781003256861 (ebook)
Subjects: LCSH: Engineering mathematics—Data processing. |
Science—Mathematics—Data processing. | Python (Computer program language)
Classification: LCC TA345 .C584 2023 (print) | LCC TA345 (ebook) |
DDC 620.001/51—dc23/eng/20220706
LC record available at https://lccn.loc.gov/2022012776
LC ebook record available at https://lccn.loc.gov/2022012777
ISBN: 9781032188942 (hbk)
ISBN: 9781032188973 (pbk)
ISBN: 9781003256861 (ebk)
DOI: 10.1201/9781003256861

Typeset in Times
by codeMantra
This book is dedicated to the thousands of our former students
at the University of Colorado, Tufts University, and Texas A&M
University. Go Buffs, Go Jumbos, and Gig ‘Em Aggies!
Contents
List of Examples.................................................................................................xiii
Preface................................................................................................................. xv
Acknowledgments...............................................................................................xxi
Authors..............................................................................................................xxiii

Chapter 1 Engineering and Scientific Calculations.......................................... 1


Chapter Objectives........................................................................... 1
1.1 Numerical Quantities............................................................. 3
1.1.1  Positional and Scientific Notation............................ 3
1.1.2  Accuracy and Precision............................................ 4
1.1.3  Significant Figures................................................... 5
1.1.4  Rounding.................................................................. 6
1.2  Mathematical Functions........................................................ 9
1.2.1  Absolute Value and Sign Functions........................ 10
1.2.2  Exponents and Logarithms.................................... 10
1.2.3  Trigonometric Functions........................................ 14
1.2.4  Hyperbolic Functions............................................. 20
1.3  Complex Numbers............................................................... 22
1.4  Engineering Units................................................................ 24
1.5  Organizing and Planning Solutions to Problems................ 28
Problems......................................................................................... 36

Chapter 2 Computer-Based Calculations........................................................ 41


Chapter Objectives......................................................................... 41
2.1  Numerical Quantities as Stored in the Computer................ 43
2.1.1  Integer Numbers..................................................... 43
2.1.2  Real Numbers......................................................... 46
2.2  How the Computer Stores Text............................................ 49
2.3  Boolean True/False Information......................................... 49
2.4  Computer Storage Evolution and Terminology................... 51
Problems......................................................................................... 51

Chapter 3 Python Basics................................................................................. 55


Chapter Objectives......................................................................... 55
3.1  The Spyder/IPython Environment....................................... 56
3.2  Mathematical Functions...................................................... 61
3.3  Variables and Assignment................................................... 64
3.4  Objects, Attributes, Methods, and Data Types.................... 67

vii
viii Contents

3.4.1  Boolean Type.......................................................... 69


3.4.2  Character Type....................................................... 71
3.5  Collections of Data.............................................................. 72
3.6  Creating Plots...................................................................... 76
3.7  The Spyder Editor................................................................ 82
3.8  Input and Output.................................................................. 87
3.8.1  Console Input and Output...................................... 88
3.8.2  File Input and Output............................................. 89
3.8.3  Formatting Output.................................................. 91
3.9  Obtaining Help.................................................................... 93
Problems......................................................................................... 97

Chapter 4 Structured Programming with Python..........................................101


Chapter Objectives........................................................................101
4.1  An Overview of Program Structure.................................. 102
4.2  Implementing Decision Structures with Python............... 104
4.3  Implementing Repetition Structures with Python..............110
4.3.1  The General Loop Structure.................................110
4.3.2  The List-Driven and Count-Controlled
Loop Structures����������������������������������������������������112
4.3.3  The break and Continue Statements with
the for Loop��������������������������������������������������������116
4.4  User-Defined Functions in Python.....................................118
4.4.1  lambda Functions................................................ 120
4.4.2  Function Arguments............................................. 121
4.4.3  Variable Scope...................................................... 127
Problems....................................................................................... 129

Chapter 5 Graphics—Matplotlib.................................................................. 137


Chapter Objectives....................................................................... 137
5.1  Introduction to Matplotlib................................................. 137
5.2  Customizing Line and Scatter Plots.................................. 140
5.3  Using Figure Window Objects.......................................... 151
5.4  Creating Bar Plots Including Histograms......................... 154
5.5  Creating Other Plots of Interest......................................... 158
5.6  Contour and Surface Plots................................................. 164
Problems........................................................................................170

Chapter 6 Array and Matrix Operations........................................................175


Chapter Objectives........................................................................175
6.1  Creating Arrays in Python..................................................176
6.1.1  Creating Special Arrays........................................178
Contents ix

6.1.2  Combining, Stacking, and Splitting Arrays......... 179


6.1.3  Reshaping Arrays................................................. 180
6.2  Indexing: Array Subscripts.................................................181
6.3  Array Operations............................................................... 184
6.4  Vector/Matrix Operations................................................. 189
6.4.1  Matrix/Vector Multiplication............................... 190
6.4.2  Transpose............................................................. 193
6.4.3  Matrix Inversion................................................... 193
Problems....................................................................................... 196

Chapter 7 Solving Single Algebraic Equations............................................. 199


Chapter Objectives....................................................................... 199
7.1  The Nature of Single, Nonlinear Equations in
One Unknown������������������������������������������������������������������� 200
7.2  Bracketing Methods—Bisection....................................... 202
7.3  Bracketing Methods—False Position................................ 207
7.4  Open Methods—Newton-­Raphson................................... 212
7.5  Open Methods—Modified Secant......................................219
7.6  Circular Methods—Fixed-­Point Iteration......................... 221
7.7  Circular Methods—The Wegstein Method....................... 227
7.8  A Hybrid Approach—Brent’s Method.............................. 230
7.9  Solving for the Roots of Polynomials................................ 233
7.10 Case Study: Trajectories of Projectiles in Air................... 237
Problems....................................................................................... 242

Chapter 8 Solving Sets of Algebraic Equations............................................ 249


Chapter Objectives....................................................................... 249
8.1  Systems of Linear Algebraic Equations............................ 250
8.2  Solving Small Numbers of Linear Algebraic Equations......252
8.2.1  Graphical Method................................................ 252
8.2.2  Determinants and Cramer’s Rule......................... 254
8.2.2.1  Determinants........................................ 254
8.2.2.2  Cramer’s Rule....................................... 256
8.2.3  Elimination of Unknowns.................................... 258
8.3  Gaussian Elimination........................................................ 260
8.3.1  Naive Gaussian Elimination................................. 261
8.3.2  Gaussian Elimination Computer Algorithm........ 265
8.3.2.1  Naive Gaussian Elimination
Algorithm�������������������������������������������� 265
8.3.2.2  Adding Determinant Evaluation���������� 267
8.3.2.3  Partial Pivoting..................................... 268
8.3.2.4  Detecting Singular and
Ill-Conditioned Systems���������������������� 270
x Contents

8.4  Solving Sets of Linear Equations with the NumPy


linalg Module���������������������������������������������������������������� 273
8.5  Solving Sets of Nonlinear Algebraic Equations................ 274
8.5.1  Solution of Nonlinear Algebraic Equations
by Successive Substitution���������������������������������� 275
8.5.2  The Newton-Raphson Method for Nonlinear
Systems of Equations������������������������������������������ 278
8.6  Use of the root Function from the SciPy optimize
Module to Solve Nonlinear Equations����������������������������� 285
Problems....................................................................................... 286

Chapter 9 Solving Differential Equations..................................................... 293


Chapter Objectives....................................................................... 293
9.1  Describing Differential Equations..................................... 294
9.2  Quadrature – Finding the Area under the Curve.............. 298
9.2.1  Pre-computer Methods......................................... 298
9.2.2  Quadrature for Continuous Functions.................. 300
9.2.3  The quad Function from SciPy’s
integrate Module�������������������������������������������� 304
9.2.4  Quadrature for Discrete Data............................... 305
9.3  Solving Differential Equations with Initial Conditions..... 307
9.3.1  Euler’s Method..................................................... 307
9.3.2  Heun’s Method......................................................311
9.3.3  Systems of Differential Equations.........................313
9.4  Solving Differential Equations with the solve _ ivp
Function from SciPy’s integrate Module����������������������319
Problems....................................................................................... 323

Chapter 10 Working with Data....................................................................... 329


Chapter Objectives....................................................................... 329
10.1 Characterizing Data Sets: Initial Observations and
Sample Statistics��������������������������������������������������������������� 330
10.1.1 General Data Concepts......................................... 330
10.1.2 Sample Statistics: Central Tendency and
Dispersion������������������������������������������������������������ 333
10.1.2.1  Central Tendency.................................. 334
10.1.2.2  Spread or Dispersion............................. 336
10.1.3 Using Boxplots to Diagnose Outliers................... 339
10.2 Distributions...................................................................... 342
10.2.1 Several Important Distributions........................... 345
10.2.1.1  Uniform Distribution............................ 345
10.2.1.2  Normal Distribution.............................. 346
10.2.1.3  Weibull Distribution............................. 347
Contents xi

10.2.2  Python and Distributions...................................... 347


10.2.3  Random Numbers................................................. 348
10.3 Making Claims Based on Data.......................................... 352
10.3.1  Comparison of Data with a Standard................... 353
10.3.2  Comparison between Two Samples..................... 356
10.3.3  Determining Whether Data Are Normally
Distributed����������������������������������������������������������� 358
10.4 Fitting Mathematical Models to Data................................ 363
10.4.1  Straight-line Linear Regression............................ 364
10.4.2  Fitting Polynomials.............................................. 368
10.4.3  General Issues and Precautions............................ 370
Problems....................................................................................... 379

References�������������������������������������������������������������������������������������������������������� 385
Index����������������������������������������������������������������������������������������������������������������� 387
Index of Python Terminology������������������������������������������������������������������������ 393
List of Examples
Chapter 1 Engineering and Scientific Calculations
1.1 What is the Volume of the Earth?��������������������������������������������������������������� 1
1.2 Catenary Cable........................................................................................... 21
1.3 Engineering Units in Calculations............................................................. 27
1.4 Engineering and Scientific Problem Solving............................................. 29

Chapter 2 Computer-Based Calculations


2.1 What is the Radius of the Earth—Expressed in Binary?........................... 41
2.2 IEEE 754 Representation of π.................................................................... 48

Chapter 3 Python Basics


3.1 Calculating the Great Circle Distance between Two Points on the Earth........ 62
3.2 Using Variable Names with the Great Circle Formula.............................. 66
3.3 Creating a Script for the Great Circle Calculation..................................... 85

Chapter 4 Structured Programming with Python


4.1 Converting Thermocouple Millivolt Readings to Temperature............... 107
4.2 Using the while Structure for Input Validation......................................111
4.3 Using a for Loop to Limit Iterations.......................................................113
4.4 Using a for Loop to Vary Subscripts of an Array...................................114
4.5 Carrying Out a Set of Calculations Based on a Sequence of Values........115

Chapter 5 Graphics—Matplotlib
5.1 Freezing Point of Aqueous Ethylene Glycol Solutions............................ 138
5.2 Sunspot Observations............................................................................... 139
5.3 Plotting the Densities of Salt and Mag Chloride Solutions...................... 145
5.4 Plotting Weather Data—Temperature and Relative Humidity................. 148
5.5 Worldwide Wind Power Generation......................................................... 156
5.6 Plotting the Vapor Pressure of Water versus Temperature....................... 160
5.7 Creating a Pie Chart for World Energy Production by Source................ 163
5.8 Contour Plot from Data of Salt Solution Density..................................... 167

Chapter 6 Array and Matrix Operations


6.1 Using Arrays in a Case Study.................................................................. 186
6.2 Solving a Set of Linear Equations with Vector/Matrix Operations......... 195

Chapter 7 Solving Single Algebraic Equations


7.1 Finding the Depth of Liquid in a Spherical Tank Given the Volume...... 205
7.2 Calibrating the Depth/Volume Relationship of Liquid in a Spherical Tank......217
7.3 Solving the van der Waals Equation for Volume with Brent’s Method..... 232

xiii
xiv List of Examples

Chapter 8 Solving Sets of Algebraic Equations


8.1 Linear Equations and Engineering/Science Problem Solving................. 250
8.2 Determinants............................................................................................ 255
8.3 Cramer’s Rule........................................................................................... 256
8.4 Elimination of Unknowns........................................................................ 259
8.5 Naive Gaussian Elimination..................................................................... 261
8.6 Construction Materials: A Blending Problem with Linear Equations..... 272
8.7 Equilibrium between Water Liquid and Vapor in a Boiler Vessel........... 283

Chapter 9 Solving Differential Equations


9.1 Computing Probability for the Gaussian Distribution............................. 303
9.2 Trajectory of a Projectile with Air Resistance..........................................316

Chapter 10 Working with Data


10.1 Simulating a Noisy Signal with Random Number Generation................ 350
10.2 Fitting a Straight Line to U.S. CO2 Emissions from Fossil Fuels............ 366
10.3 
Fitting a Polynomial to Data on the Density of Water versus
Temperature.............................................................................................. 374
Preface
The primary purpose of this text is to provide background and experience in
numerical problem solving by computing with the Python language. It is intended
for first-year students in the engineering and science disciplines, but it may find
utility for students at other levels such as advanced students at the pre-college
level, students in pre-engineering programs in 2-year colleges, students transfer-
ring into engineering and science disciplines, and professionals seeking a review
of numerical problem solving and wishing to learn the Python language for this
purpose. We intend that this text provides the tools and knowledge that students
can use in subsequent academic courses as the need for computer-based numeri-
cal problem solving arises.
This text is not designed to provide a broad, in-depth education in the Python
programming language. Python has many capabilities that fall outside our focus
on numerical problem solving. We do recommend, however, that students comple-
ment the learning from this text with further study of Python, if that suits their
educational goals and interests. It is our intention that this book serve as an oft-
utilized reference as students proceed through their academic careers and beyond.
For instructors considering this text for their students, we would like to address
the question: Why this book? First, there is a growing audience that wants to use
Python as their computing language, and few texts address this topic from an
engineering and science perspective. Second, the authors have a decades long
track record teaching introductory computing to thousands of students and have
incorporated their experience in writing the text. Third, we have written the text
keeping the students and their diverse backgrounds in mind. We believe the text
is approachable by students. We have intently included basic explanations and
examples along with elements that will challenge students.
The next question is Why Python? First, Python is a computing language that
has gained a great deal of interest over the past few years. Second, from a practical
stance, Python is available at no cost to the student, including down the road when
access to institution-licensed software may not be available. Although Python is
a broad-based, object-oriented computing language, there is a question whether it
is well suited to the numerical problem solving commonly faced by engineers and
scientists. By approaching Python with some care, and by not overwhelming the
students with aspects of the language not needed in problem solving, we believe
we have answered this concern in the affirmative. We chose the Spyder integrated
development environment (IDE) because it is well suited to engineering comput-
ing and presents an interface similar to other dedicated software packages such
as MATLABâ. Spyder’s tools for developing and debugging Python scripts are
excellent and of great aid to the student.
By illustrating how students can find information and answer questions about
the use of Python, often via the Internet, we intend to equip students with the abil-
ity to extend their Python capabilities on their own. We illustrate this frequently

xv
xvi Preface

in the text. We also encourage students to expand their general knowledge of


Python, but outside the scope of the text and course they might be taking.
You might wonder what experience we the authors bring to the writing of this
text. Together, in 1986 at the University of Colorado, we introduced the course,
Introduction to Engineering Computing, and together, or subsequently on our
own at different institutions, we taught the course over three decades. This course
is still taught at the University of Colorado and Tufts. Of course, over the years,
the computing tools used in the course have changed, but the general content and
learning goals have not. For the first 15 years, the course was taught utilizing the
Fortran and BASIC computer languages. Since then, the computing vehicles have
included Excel, Excel VBA, Mathcad, MATLAB, and now Python. As a conse-
quence of these years of experience, we have learned what works and is pertinent
for students early in their academic careers (and what doesn’t!). This background
has brought us to the writing of this text.
For more than a decade, we taught as a team and learned from each other.
Additionally, we have taught numerical methods to students later in their aca-
demic careers. Our collaboration has yielded a recent text in numerical meth-
ods with Python (Chapra & Clough, 2022), and teaching the implementation of
numerical methods with Python has provided us with a comfort level of experi-
ence to be able to write this text for students earlier in their academic careers.
Our pedagogical approach tends to be more inductive rather than deductive.
We like to present examples frequently and then generalize those to provide
broader, extensible knowledge. This book uses what we call a “crawl-walk-run”
approach. We illustrate methods using Python in the chapters and encourage stu-
dents to replicate those on their own. Then we provide end-of-chapter problems
to challenge the students and encourage independent work. It is our intention that
students will be well equipped to handle numerical problem-solving scenarios
they encounter after studying this text. Among the problems we include with
each chapter are those which illustrate practical applications in the engineering
disciplines, as well as from the sciences. The organization of the problems at the
end of each chapter follows two strategies. First, the problems tend to follow the
organization of the chapter chronologically. Second, the problems become more
challenging toward the end.
As far as mathematical background required of the student, we do include con-
tent involving algebra, transcendental functions, and elementary calculus (deriva-
tives and integrals). The text could still be used by instructors who have students
with little to no background in calculus, if approached with some care. We do
provide review material in the first chapter, and our use of examples should help
those students with little or meager knowledge of calculus.
The arrangement of the material in the text is designed to provide a well-
structured course curriculum. As depicted in Table P1, the first two chapters on
numerical and computer-based calculations are general and not dependent on the
use of computers or Python. The intent of these chapters is to level the playing
field for a group of students with diverse backgrounds. Also, many students may
have seen similar material in the past but will benefit from a review. It has been
Preface xvii

TABLE P1
Organization of This Book
Vector/Matrix
Numerical & Computer- Calculations & Rate Equations
Based Calculations Introduction to Python Equation Solving & Data
Chapter 1. Engineering Chapter 3. Python Chapter 6. Array Chapter 9. Solving
and Scientific Basics and Matrix Differential
Calculations Operations Equations
Chapter 2. Computer- Chapter 4. Structured Chapter 7. Solving Chapter 10.
Based Calculations Programming with Single Algebraic Working with
Python Equations Data
Chapter 5. Graphics— Chapter 8. Solving
Matplotlib Sets of Algebraic
Equations

our experience that students often have gaps in their learning when it comes to the
content of these two chapters.
Chapters 3–5 introduce the Python language. The first of these presents the
rudiments of the language and the Spyder IDE. Instructors wishing to use another
IDE would have to substitute their own orientation here. Chapter 4 deals with
algorithm structure and completes the coverage of Python required for subsequent
chapters. Chapter 5 focuses on plotting with the Matplotlib module. Plotting is
common in problem-solving applications encountered in later chapters.
The remaining chapters are focused on applications with the Python tools put in
place in Chapter 3–5. Chapter 6 introduces arrays and vector/matrix calculations.
Chapter 7 is all about solving single, nonlinear, algebraic, and transcendental equa-
tions with common closed and open methods. Then, there is a natural transition
to Chapter 8 where systems of linear and nonlinear algebraic equations are stud-
ied. Chapter 9, which deals with solving rate equations (i.e., differential equations),
employs a simple approach using elementary methods of quadrature and integration.
The final Chapter 10 is devoted to the study of data and introduces concepts
and methods of applied statistics in what could be described as a “statistics light”
manner. This last chapter provides students with knowledge and skills that will
be relevant to their laboratory courses, both early and later on in their academic
careers. We also encourage, and strongly advocate, that all students should obtain
more in-depth education in applied statistics via a course later in their academic
career or otherwise.
In introducing concepts and methods in Chapters 6–10, we first illustrate with
basic Python scripts and then invoke built-in capabilities from the NumPy and
SciPy modules. Having students see the methods in their own code first helps
understanding of the concepts and removes some of the mystery behind the
­built-in functions. Also, we illustrate that the methods can often be programmed
with very few statements.
xviii Preface

TABLE P2
Instructional Plans
Semester Plan Quarter Plan Python Module
Week Chapters Week Chapters Week Chapters
1 1&2 1 1&2 1 3, 4 & 5
2 2 2
3 3, 4 & 5 3 3, 4 & 5 3
4 4 4 6
5 5 5 7 or 10
6 6 6 6 6
7 7 7 7
8 8
9 8 9 8, 9, or 10
10 10
11 9 11
12 12 Review
13 10
14
15 Review

We have designed the text so that instructors might adapt it to different


a­ cademic terms and course designs. Table P2 suggests plans for a 15-week
semester, 12-week quarter, and a shorter 6-week Python module that might be
part of a computing course that would have other element(s) such as a module
on spreadsheets or one on MATLAB. Of course, there would be other schedule
requirements, such as more intensive summer courses, and we believe the text can
accommodate a variety of these structures.
As this text is employed in instruction and learning, we anticipate there will be
valuable impressions, opinions, and recognitions of occasional errors. Although
we hope the latter will be minimal, we know that they are inevitable. We encour-
age instructors, students, and other readers to provide feedback to us (see the
email addresses below). We will respond and endeavor to improve the text in its
second edition, and your criticisms and ideas will be valuable to us. We have thick
skins and small egos, so bring it on!
Although our primary intent is to empower and inspire students, we have
the ancillary objective of making this introduction exciting and pleasurable. We
believe that motivated students who enjoy coding will ultimately make better
professionals. If this book fosters enthusiasm and appreciation for these subjects,
we will consider our efforts a success.
Preface xix

MATLAB® is a registered trademark of The MathWorks, Inc. For product


information, please contact:
The MathWorks, Inc.
3 Apple Hill Drive
Natick, MA 01760-2098 USA
Tel: 508-647-7000
Fax: 508-647-7001
E-mail: [email protected]
Web: www.mathworks.com
Acknowledgments
Both authors, David E. Clough and Steven C. Chapra, have lengthy careers and
have benefited from many contributions and influences over the decades. David
E. Clough had a high school math teacher, Miss Edith Benjamin, who introduced
him to vectors, matrices and sets, and took him, along with two other students,
down to Illinois Institute of Technology on Chicago’s South Side, in the eve-
nings, to learn how to program in Fortran. When he arrived at the then Case
Institute of Technology in Cleveland, Ohio, in 1964, he was told that Fortran
was passé and was taught the language of the future, Algol. Along the way, he
learned other “languages of the future” like GE timesharing BASIC, Pascal, and
APL. He learned machine and assembly language programming for use with real-
time computer systems. Thirty years later, Fortran finally faded, and he learned
C/C++, MATLABâ, Excel’s VBA, and on to Python. It seems that the more
computing tools change, the more that fundamentals stay the same. It is worth
mentioning that, for Clough, none of this would have been possible without the
guidance and facilitation of many individuals, beginning with Miss Benjamin at
Arlington High School in Arlington Heights, Illinois.
Steve C. Chapra has never taken a formal course in computer programming.
As a freshman at Manhattan College back in the Pleistocene (1966), such courses
had yet to be taught. But the college did have a room-sized mainframe computer
to manage its scheduling and accounting. He connected with some very bright
and generous older physics majors who commandeered a classroom in the eve-
ning where they taught Steve and a few other younger students how to code in one
of the early versions of IBM Fortran. They also urged him to volunteer to work at
the computer center where he swept the floor, replaced vacuum tubes, and learned
assembly language. But the coolest part was that he got a key to the computer
center so that he and his mates could surreptitiously sneak in late at night to write
numerically oriented programs on punch cards. From that point forward, his edu-
cation and career have been dominated by computing as applied to his research
area: environmental modeling. To paraphrase the Saturday Night Live character,
Chico Escuela: “Computing has been berry, berry good to me!”
Both authors acknowledge the thousands of students they have taught at vari-
ous institutions and in the professions. Students have kept us on our toes and have
exposed any approaches to teaching/learning that are faulty. As we have aged, in
many ways, they have and continue to keep our outlooks young.
We sincerely appreciate the willingness of CRC Press, Taylor & Francis Group,
to take on this publishing project. Our collaboration with Editor Nicola Sharpe
and Editorial Assistant Nishant Bhagat has been supportive and productive and
has certainly contributed greatly to the quality of the publication.

xxi
Authors
David E. Clough is Professor Emeritus at the University of Colorado. He has
experience in a wide array of programming languages and computing tools and
has applied his expertise through his teaching, research, and industrial applica-
tions. Over his career, Clough has taught hundreds of short courses to practicing
professionals on applied computing and problem solving.

Steven C. Chapra is the Emeritus Professor and Louis Berger Chair in Civil and
Environmental Engineering at Tufts University. Before joining Tufts, he worked
for the U.S. Environmental Protection Agency and the National Oceanic and
Atmospheric Administration, and taught at Texas A&M University, the University
of Colorado, and Imperial College London. He is a Fellow and Distinguished
Member of the American Society of Civil Engineering (ASCE) and has received
several awards for his scholarly and academic contributions, including the
Rudolph Hering Medal (ASCE), and the Meriam-Wiley Distinguished Author
Award (American Society for Engineering Education). As a strong proponent of
continuing education, he has taught more than 90 workshops around the world
for professionals on numerical methods, computer programming, and environ-
mental modeling.

Authors’ email addresses:


[email protected]
[email protected]

xxiii
1 Engineering and
Scientific Calculations

CHAPTER OBJECTIVES
• Review numerical calculations, including significant figures, positional
and scientific notation.
• Understand the typical functions used in engineering and scientific com-
putations, including absolute value, sign, logarithmic, exponential, trigo-
nometric, and hyperbolic relations.
• Review operations with complex numbers, including rectangular and
polar representation.
• Carry out conversions of units common to engineering and scientific
calculations.
• Develop strategies for engineering and scientific problem solving.

Engineers and scientists carry out numerical calculations as a routine, day-to-


day activity. Through years of experience, they have become accustomed to good
practices that promote reliability in their results. The objective of this chapter is
to review these practices and promote standards that will assist you in becom-
ing functional members of STEM1 professions. The rest of society plays fast and
loose with numerical quantities and their interpretation. Engineers and scientists
do not. Their work is examined closely and will be disregarded if it doesn’t mea-
sure up. If numerical issues are not detected, they can sometimes lead to big
problems in the products they create.
We will consider here numerical quantities, calculations involving them and
the units associated with them. Also, approaches to problem solving will be
considered.

Example 1.1 What is the Volume of the Earth?

Our Earth is known to be an oblate spheroid, a ball squashed a bit between the
north and south poles. The radius from the center to the Equator is estimated to
be 6,378 km. The common formula for the volume of a sphere is

4 3
V= πr (1.1)
3

1 Science, Technology, Engineering, and Mathematics

DOI: 10.1201/9781003256861-1 1
2 Introduction to Engineering and Scientific Computing with Python

If we carry out this calculation using a calculator, or perhaps a computer pro-


gram like a spreadsheet, we can obtain this result:

1.0867813 × 1012 km 3

Since this number is so big, it is convenient to represent it in exponential or


scientific notation. However, there are questions. By reporting the radius to be
6,378 km, we are assuming that it is not 6,377 or 6,379. In other words, our
use of these four digits or figures carries with it the understanding of a level of
precision in the measurement. If we were really unsure about the final digit,
8, it might be better to report the radius as 6,380, only claiming three digits of
significance. The point here is that the number of digits reported carries with it
the claim of precision to that extent.
This raises an important issue in carrying out and reporting the results of
calculations. If we accept four digits of significance in the radius, why are we
reporting eight digits in our volume result? The answer is simple—we shouldn’t
do so! Our answer should be reported to a similar number of significant figures
as in

1.087 × 1012 km 3

Now, we face another problem. The radius of the Earth at the poles is reported
to be 6,357 km. The Earth is squashed by 42 km. Using this radius instead, we
come up with a volume of

1.076 × 1012 km 3

a difference of 1.070 × 1010 km3. Do we think that discrepancy matters? Maybe


yes, maybe no. It’s a lot of volume!
We move on to find a better result. It is reasonable to conclude that the true
volume is somewhere between our two results, but where? So, as an engineer
or scientist, we look to refine our method and obtain a formula for an oblate
spheroid,
4
V= π ab 2 (1.2)
3

where a is the major radius (or formally called semiaxis) at the Equator and b is
the minor radius at the poles. Now, our result is, as expected, the intermediate
value

1.080 × 1012 km 3

As an engineer or scientist, we learn to be never quite satisfied with our results


(and ever skeptical of them), always looking for ways to improve them and to
evaluate the significance of improvement. Consequently, we might investigate
variations in the radial distance because of changes in the surface of the Earth,
for example Mount Everest (elevation about 8.48 km) to Dead Sea (elevation
– 0.414 km). We won’t do that here, but rather leave this example at this point.
Engineering and Scientific Calculations 3

1.1 NUMERICAL QUANTITIES
We all grow up using decimal, base-10 numbers. As you will see in Chapter 2,
this is not the number system used internally in computers. In fact, we are so
accustomed to decimal numbers that we forget about the basics of their structure.
It is also important to review this structure because, when we move internally to
computers, that number base is going to change from 10 to 2.

1.1.1 Positional and Scientific Notation


Positional notation is a good place to start. A number like
1234.56
uses the digits available in the decimal numbering system, 0 1 2 3 4 5 6 7 8 9. The
positions of the digits indicate a contribution to the overall number by powers of the
base of the number system, 10. If we index the positions according to Figure 1.1, then
the contributions of the digits are represented as shown in Table 1.1.
Of course, the various contributions sum to the original number. This leads to
the way of describing large and small decimal numbers that is common in engi-
neering and science, positional notation, also commonly called scientific nota-
tion. Our example number 1234.56 expressed in typical positional notation is

1.23456 × 103

FIGURE 1.1 Positional notation.

TABLE 1.1
Contribution of Digits
Index Digit Contribution
3 1 1 × 103 = 1,000
2 2 2 × 102 = 200
1 3 3 × 101 = 30
0 4 4 × 100 = 4
-1 5 5 × 10¯1 = 0.5
-2 6 6 × 10¯2 = 0.06
4 Introduction to Engineering and Scientific Computing with Python

The 1.23456 part is called the significand or mantissa,2 and the power 3 is
called the characteristic or exponent. It would have also been possible to express
the number as
123456. × 10¯2

but this is less common. In typical scientific notation, the number is normalized
with only one digit to the left of the decimal point. Scientific notation gives us
the ability to represent very large and small numbers conveniently. For example,

Avogadro’s number: 6.022 × 1023


Planck’s constant: 6.626 × 10¯34

1.1.2 Accuracy and Precision


The arithmetical operations of addition, subtraction, multiplication, and division
are the basis of all numerical calculations. We carry out these operations daily
with or without the use of a calculator or computer, without much thought, and
perhaps with the occasional error. It is not our purpose here to reteach you arith-
metic; rather we would like to highlight a few features of these operations that
raise issues in engineering and scientific calculations.
First, we need to introduce the concepts of precision, significant figures and
rounding, since they govern how we report the results of these calculations. It
is important to distinguish the terms precision and accuracy. Accuracy refers to
measurements and their comparison with accepted standards. Ultimately, these
standards are traceable to those maintained by national organizations, such as the
National Institute of Standards and Technology (NIST) in the U.S. and Association
Française de Normalisation (AFNOR) in France. These are members of the
International Organization for Standardization (ISO). Precision has to do with the
resolution with which a number is expressed. For example, if a measured tempera-
ture is 24°C, it is precise to 1°; whereas, 24.1°C is precise to 0.1°C. The second
temperature is more precise than the first; yet, a common misconception is that it
is more accurate than the first. When a measurement is written as 24°C ± 1°C, that
usually implies the accuracy of the measurement, that is the true value of the tem-
perature is somewhere between 23°C and 25°C; however, even this type of descrip-
tion must be understood clearly because in other contexts the ± interval may relate
to the random error associated with making the measurement. Be careful with the
terms accuracy and precision. In fact, precision is so misused to imply accuracy that
it is preferable to use resolution instead of precision in scientific writing.
Compare the following:

65°F 18.3333°C

2 The use of the term mantissa is common among computer scientists but has been discouraged by
some because of confusion with the description of logarithms.
Engineering and Scientific Calculations 5

The second temperature is closely equivalent to the first, since it was converted
using the formula3

°F − 32
°C =
1.8

However, there is a significant difference in the way these two quantities are repre-
sented. By writing 65°F, we understand that the temperature is certainly in the 60s,
and it is closer to 65°F than to 64 or 66. By writing 18.3333°C, we imply that the
temperature is exact to 18.333 and closer to 18.3333 than to 18.3332 or 18.3334. Of
course, it is impractical to make a temperature measurement to such precision, and
the precision implied by the two quantities is entirely different. You can see that
we should report the converted temperature as 18°C, implying a similar precision
to that of 65°F. As described next, this leads us to the concept of significant figures.

1.1.3 Significant Figures

The significant figures are the digits in the number that are reliable and
necessary to indicate the confidence or precision with which an engineer or
scientist states a quantity. Operationally, the significant figures of a number
are the digits from the first nonzero digit on the left to either

(a) the last digit on the right, zero or nonzero if there is a decimal point
expressed, or
(b) the last nonzero digit of the number if there is no decimal point
expressed.

Significant figures are almost always expressed as the “number” of significant fig-
ures; that is, the total number of digits that satisfy the definitions. Let’s elaborate
with several examples.

65°F 2 significant figures by rule (b)


18.3333°C 6 significant figures by rule (a)
0.00471 3 significant figures by rule (a)
43,500 3 significant figures by rule (b)
43,500. 5 significant figures by rule (a)

3 The U.S. is one of the few countries in the world where the Fahrenheit temperature scale is still
used widely, so Americans, stubborn to change, and visitors to the U.S. are often faced with
­conversions to and from the Celsius scale. As a shortcut assist, it is useful to learn the counts from
32 in steps of 18°F (-4, -14, 32, 50, 68, 86, 104, 122) because they are equivalent to steps of 10°C
from 0 (-20, -10, 0, 10, 20, 30, 40, 50). Then, intermediate steps of 9°F are steps of 5°C, e.g., 59°F
= 15°C. If you live in cold regions, it is “comforting” to know that -40 is the same in both scales.
By the way, the only other countries where °F is used are Liberia and the Cayman Islands!
6 Introduction to Engineering and Scientific Computing with Python

The last two examples raise an important point. What if the number is known
exactly for the digits 4 3 5, and it is also known that the next 0 is closer than one
digit above or below it? In other words, we have four significant digits, and the
rules (a) and (b) don’t cover that possibility. What to do? As a matter of fact, even
the difference between 43,500 and 43,500. is easy to miss. The answer lies in
using scientific notation. There is no ambiguity in the following three numbers:

4.35 × 104 3 significant figures


4.350 × 104 4 significant figures
4.3500 × 105 5 significant figures

and rule (a) applies to all of them. Consequently, we suggest using scientific nota-
tion whenever there could be ambiguity in the number of significant figures.
One additional point related to clarity: When expressing a decimal fraction in
written work (hand-written or printed), it is important to include a leading zero
before the decimal point. That is,

0.471 rather than .471

because the leading decimal point in the latter is so easily missed by the reader.

1.1.4 Rounding
The concept of significant figures carries over to numerical calculations and
introduces the need to round numbers to a given digit position. With simple addi-
tion, forming the sum

12.3
14.36
26.66

is easy. But note that the sum as expressed implies that the first number is known
as 12.30. Since we don’t know that number to such resolution (to the one-hun-
dredths place), it would be better to round the second number to the precision of
the first, 14.4, and carry out the sum as

12.3
14.4
26.7

or at least round the former result, 26.66, to the 26.7 below. The same goes for
subtraction.
The standard rules for rounding are:
Engineering and Scientific Calculations 7

When a number is to be rounded to the digit in the nth place,

a. add one to the digit in the nth place if the digit in the (n-1)th place is
greater than 5, or
b. leave the digit in the nth place as is if the digit in the (n-1)th place is
less than 5, or
c. if the digit in the (n-1)th place is equal to 5, and if there are following
non-zero digits, apply Rule a; otherwise round either up or down
to make the digit in the nth place even.

Rule (c) provides that the 5’s will be rounded up about half the time and down
about half the time. Study the examples in Table 1.2.
There may be a temptation in the fourth example to round first to 0.055 and
then round again 0.06. Don’t get caught in this trap—round only once!
There are specific rules that govern the management of significant figures in
calculations:

a. For addition and subtraction:


The positions of the last significant figure of each number should be com-
pared. Of these positions, the one farthest to the left is the position of the
last permissible significant figure of the sum or difference.
b. For multiplication and division:
The number of significant figures retained in the result should equal the lowest
number of significant figures of any of the multiplicands, divisors, or dividends.

TABLE 1.2
Rounding Examples
Round to
Original Number Placea Result Rule Applied
43,500 1,000 44,000 (c)
42,500 1,000 42,000 (c)
18.3333 0.1 18.3 (b)
0.05493 0.01 0.05 (b)
7.86 × 103 0.1 7.9 × 103 (a)

a Place in the significand, excluding the exponent.


8 Introduction to Engineering and Scientific Computing with Python

When we carry out an addition or subtraction with numbers in scientific nota-


tion, it is necessary to change the positional notation of at least one of the numbers
so that the exponents are the same. For example, to add

1.046 × 1011
7.64 × 1010

It should be converted to one of the following two forms


1.046 × 1011 10.46 × 1010
0.764 × 1011 7.64 × 1010
1.810 × 1011 18.10 × 1010

The result of the second form can be normalized to give the same result as the
first form.
When two numbers are multiplied, the number of digits required to represent
the product can be as many as the sum of the number of digits in each quantity.
For example,

12.3×
14.36
.738
3.69
49.2
123. _ _ _
176.628

There are six digits in the product, but there could be as many as seven or more.
However, by applying the rule of significant figures for multiplication, the least
number of significant figures is three (from 12.3); therefore, only three signif-
icant figures should be retained in the answer That is, the answer should be
expressed as 177.
Rounding for long division deserves a closer look. Note that, if the divisor goes
evenly into the dividend, the number of digits in the quotient can be no more than
the difference between the number of digits in the dividend minus the number of
digits in the divisor. Turning the above example around,
Engineering and Scientific Calculations 9

And, this quotient should be expressed as 14.4 to reflect the limiting number
of significant figures in the divisor, 12.3. When the division does not come out
even, it can be carried out as far as desired but will always have a remainder. The
remainder is expressed as a fraction. Modifying the last example slightly,

So the quotient for this case would be expressed as 14.3 + 0.71/12.3.


As you can see from this example, it is best to carry out the division at least
one place more than the eventual number of significant figures to make sure the
correct rounding takes place.
When two numbers expressed in scientific notation are multiplied, the signifi-
cands can be multiplied and the exponents added. It is convenient to normalize
the resulting product, and it should be expressed with the correct number of sig-
nificant figures, the least of the two multiplicands. For example,

6.022 × 1023
× 6.63 × 10–34
39.92586 × 10–11 → 3.99 × 10-10

Not only is the product normalized on the right, it is expressed with the same
limiting precision of the multiplicands.
In division, the divisor’s significand can be divided into the dividend’s signifi-
cand, and the divisor’s exponent subtracted from that of the dividend. Here is an
example:

0.1369 × 101
7.65 × 10 10
)
1.046 × 1011 or 1.37 × 100

Again, the quotient has been carried out an additional place and rounded down to
the appropriate three significant figures.

1.2 MATHEMATICAL FUNCTIONS
In carrying out engineering and scientific calculations, it is frequently necessary
to use a variety of mathematical functions, commonly including

• absolute value and sign functions,


• exponents and logarithms,
10 Introduction to Engineering and Scientific Computing with Python

• trigonometric functions and


• hyperbolic functions.

In this section, we will review certain aspects of calculating these functions that
are prone to cause errors in results. It is not our intention to repeat the exhaustive
treatment that can be found in good books and videos on college algebra and pre-
calculus mathematics. Such books and videos should be consulted if you need a
more in-depth review.

1.2.1 Absolute Value and Sign Functions


Calculating the absolute value of a number is easy. If the number is negative,
change it to positive; otherwise, leave the number alone. The familiar symbol
for the absolute value function is to surround the quantity with vertical bars,
for example |x|. The absolute value function can be used in some creative ways
though. For example, let’s say that you wanted to have a method of squaring a
quantity yet preserving the quantity’s sign in the result. Applying this rule to -3
would yield -9, and applying it to 3 would yield 9. Consider the following formula,
and you will see that it accomplishes this:

x x

Another related function is the sign (also called signum) function, abbreviated
sgn. It can be expressed in terms of the absolute value function by the formula

x
sgn ( x ) = (1.3)
x
When x is positive, sgn(x) = 1, and, when x is negative, sgn(x) = -1. This formula
gets into trouble when x = 0, yielding an indeterminate form 0/0; so, for that case,
sgn(0) is just defined to be 0.
Note that the prior example, preserving the sign with the square, can be restated
in terms of the sgn function,

x x = sgn ( x ) x 2 (1.4)

1.2.2 Exponents and Logarithms


Exponents and logarithms are dreaded by some students. That’s too bad because
they are an essential part of scientific and engineering formulas and ­calculations.
The key relationship that defines the exponent and its inverse function, the
­logarithm, is

log x ( x y ) = y (1.5)
Engineering and Scientific Calculations 11

The term xy means x raised to the power y, which you probably understand. For
integer powers, raising to a power can be handled by repeated multiplication, and
perhaps division, for example

1.54 = 1.5 × 1.5 × 1.5 × 1.5 = 5.0625 ⇒ 5.1

1 1
1.5−3 = = = 0.296 ⇒ 0.30
1.53 1.5 × 1.5 × 1.5

( −1.5)3 = ( −1.5) × ( −1.5) × ( −1.5) = −3.375 ⇒ −3.4

Notice how the significant figures rule for multiplication/division is applied above.
However, calculating xy when y is a real number with a fractional part is not so
straightforward. Consider the following examples:

1.54.1 1.5−0.41 ( −1.5)1.4

The scheme for computing when the power has a fractional part comes from the
use of logarithms. Before doing that, it is useful to consider some specific types of
logarithmic functions. The common (or base-10) logarithm is given by4

log10 (10 y ) = y

So, if log10(2) = 0.301…, that means that

10 0.301 = 2

To explain this in words, the common logarithm of a number is the power to


which 10 is raised to give that number.
Likewise, the natural (or Napierian) logarithm has the base e, where e is
defined by the infinite series

1 1 1
e = 1+ + + +  ≅ 2.718281828…
1! 2! 3!

and

log e ( e y ) = ln ( e y ) = y

4 It is common in the print literature and on calculator buttons to use just log to represent log10,
but we warn you that the log function in most computer programming languages is the natural or
Napierian log (base-e), and there is a separate log10 function built in.
12 Introduction to Engineering and Scientific Computing with Python

Therefore, if ln(2) = 0.693…, then e0.693… = 2. The Napierian base arises frequently
in calculus and differential equations, and the natural logarithm can be repre-
sented by another infinite series,

 x − 1 1  x − 1 3 1  x − 1 5 
ln ( x ) = 2 ⋅  + ⋅  + ⋅   +  for x > 0 only (1.6)

 x +1 3 x +1 5 x +1 

We can compute the natural logarithm to a given resolution by evaluating this


series to the number of terms required to give convergence to that resolution.
Notice that the logarithm is only defined for positive values of x.
Now, how do we use this ability to calculate the natural logarithm? Consider
loga ( x ) equal to some y. That means ay = x. If we take the natural logarithm of
both sides of this equation, ln(ay) = ln(x), or y⋅ln(a) = ln(x), the result is

ln ( x )
log a ( x ) = y =
ln ( a ) (1.7)

This useful formula provides a way to and calculate the logarithm for any other
base. For example
ln (100 ) 4.60517...
log10 (100 ) = = =2
ln (10 ) 2.30259...
Let’s get back to that x y where y is a real number with a fractional part. Represent
the result of the calculation as z, so

z = xy

and taking the natural logarithm of both sides of the equation, we get

ln ( z ) = y ln ( x )

Taking e to the power of each side of this equation gives

e ( )=z=e ( )
ln z y ln x

y ln( x )
Thus, x = e
y x
. Since there is also an infinite series for e ,

x2 x3
ex = 1 + x + + +
2! 3! (1.8)

We now can compute, from first principles, xy, by calculating ln(x) approximately
y⋅ln( x )
using the infinite series for the natural logarithm, then calculating e from the
infinite series given above. You should notice that this won’t work for x less than
or equal to zero. The one example cited above
Engineering and Scientific Calculations 13

( −1.5)1.4

can’t be done; in fact, it doesn’t make any sense.


You will probably never calculate logarithms and exponents by hand using
the series approximations – usually you’ll just press the appropriate buttons on a
calculator or use the corresponding built-in functions in a computer software, but
it is useful to have some background on how these calculations are made and why
certain limitations come into play. Reviewing our examples from above,

1.54.1 = e 4.1 In(1.5) = e 4.1⋅0.405 = e1.662 ≅ 5.3

1.5−0.41 = e −0.41 In(1.5) = e −0.166 ≅ 0.85

( −1.5)1.4 Can't be done because − 1.5 is less than 0

Appropriate significant figures are shown for each of these examples, although
more precision is carried through in the intermediate calculations. Like we wrote
above, calculating x y, when y is a real number with a fractional part, is not that
straightforward. This bears repeating.
Reviewing the key relationships from above,

log x ( x y ) = y

log a ( x y ) = y log a ( x )
(1.9)
ln ( x )
log a ( x ) =
ln ( a )

x y = e y ln( x )
Other useful relationships involving exponents and logarithms are

log a ( x y ) = log a ( x ) + log a ( y )

 x
log a   = log a ( x ) − log a ( y )
 y (1.10)
x y+ z = x y x z

ax y = (ax )
y

We provided you with specific rules regarding significant figures and the arith-
metic operations of addition, subtraction, multiplication, and division. Matters
aren’t so easily defined when using logarithms, exponentials, and other nonlinear
14 Introduction to Engineering and Scientific Computing with Python

functions, such as trigonometric and hyperbolic functions. Let’s illustrate this


with a prior example:

1.54.1

There are evidently two significant figures in both quantities, 1.5 and 4.1. How
many significant figures should be represented in the result? Let’s take a numeri-
cal approach to this called sensitivity analysis. (This can also be approached with
calculus and partial derivatives.) We will determine the effect on the result of
changing each of the two numbers by one unit in their respective least significant
digits. Table 1.3 gives us the answers to three significant digits.
Observe the dramatic effect of changing the 1.5 quantity by ±0.1! For a given
exponent value, the answer changes by about ±1.5. The effect of changing the
exponent 4.1 by ±0.1 is much milder, about ±0.2. So, if the resolution of the
1.5 value is as stated, we cannot really report the result to any more than one
significant figure, that is, 5. This demonstrates that one must be very careful in
reporting values that are results of calculations using nonlinear functions like
exponentiation.

1.2.3 Trigonometric Functions
The various trigonometric functions occur all the time in scientific and engineer-
ing calculations. One problem that students encounter frequently in calculating
formulas that include trigonometric functions is that most of these expect the
angles to be in radians, not degrees. It seems that many students are accustomed
to degrees from their previous math courses, especially those in high school. We
will start by reviewing the basis of the three common “trig” functions and use this
to understand the difference between degrees and radians.
The trigonometric functions relate the angles in a right triangle to its sides and
hypotenuse. They are often conveniently represented on a two-dimensional graph
using a unit circle, that is, a circle with a radius of 1. Compare the definitions in
Equation 1.11 to the diagram in Figure 1.2.

TABLE 1.3
Sensitivity Analysis
4.0 4.1 4.2
1.4 3.84 3.97 4.11
1.5 5.06 5.27 5.49
1.6 6.55 6.87 7.20
Engineering and Scientific Calculations 15

FIGURE 1.2 Trigonometric relationships on the unit circle.

sin (θ ) = b

cos (θ ) = a (1.11)

b
tan (θ ) =
a

The right triangle of reference has sides of length a and b and a hypotenuse of
length 1, given by the radius of the unit circle. Note that the x-axis coordinate a
is the length of the right triangle side adjacent to the angle θ, and the y-axis coor-
dinate is the side opposite the angle θ. This gives rise to the right-triangle-based
definitions:

opposite side
sin (θ ) =
hypotenuse
adjacent side
cos (θ ) = (1.12)
hypotenuse
opposite side
tan (θ ) =
adjacent side

and their reciprocal functions


16 Introduction to Engineering and Scientific Computing with Python

1
cosecant : csc (θ ) =
sin (θ )
1
secant : sec (θ ) = (1.13)
cos (θ )
1
cotangent : cot (θ ) =
tan (θ )

There are two common ways to express the angle θ.5 By dividing the circle into
360 angular increments, we get degrees. If we consider an arc of length one on
the unit circle, the angle included by that arc is defined as a radian. Since the
circumference of the unit circle is 2π, and that includes 2π radians and 360°, we
have the equivalencies

2π radians = 360 degrees

180
1 radian = degrees ≅ 57.3°
π
π
= 1 degrees ≅ 0.0175 radians
180

As with the exponential function and natural logarithm, the trigonometric func-
tions are defined in terms of infinite series, and these can be used to approximate
numerical results. For example,

x3 x5
sin ( x ) = x − + − (1.14)
3! 5!

This requires that x be expressed in radians, not degrees. Often you may use a
calculator to compute trigonometric results, and you must be very aware whether
the calculator expects the angles to be input in radians or degrees. Many calcula-
tors have a default setting for degrees and require a special action to switch them
over to radians mode.
Here are some common trigonometric facts that many engineers and scientists
have committed to memory:

5 There is another, less frequently used unit for the angle called a grad. It is defined by dividing the
right angle (90°) into 100 increments.
Engineering and Scientific Calculations 17

π π
sin ( 30° ) = sin   = 0.5 cos ( 60° ) = cos   = 0.5
 6  3

π 3 π
cos ( 30° ) = cos   = = 0.866... tan ( 45° ) = tan   = 1
 6 2  4

π π 3
tan ( 60° ) = tan   = 3 = 1.732... tan ( 30° ) = tan   = = 0.577...
 3  6 3

The inverse or “arc” trigonometric functions are used frequently in scientific


formulas. Their mathematical definition is straightforward. For example,

y = sin ( x ) ⇒ sin −1 ( y ) = x

Instead of sin–1(x), the terminology arcsin(x) is sometimes used. Notice that the
result of the inverse sine formula is an angle, typically in radians. One way to think
of the inverse sine formula above (this implies a method for obtaining it) is: “Given
a value of y, what angle x will yield the sine of y?” To do that with a calculator, you
might guess an x, compute the sine function, compare the result to y and guess new
x’s until your answer is close to y. Of course, many modern calculators have the
inverse trigonometric functions built in, and, behind the scenes, they use a similar
strategy.
There are some tricky aspects to the calculation of inverse trigonometric func-
tions. You should appreciate this with the following example.
Consider the angle described on the unit-circle diagram in Figure 1.3.

FIGURE 1.3 Unit circle diagram with quadrants.


18 Introduction to Engineering and Scientific Computing with Python

The angle is clearly greater than π (180°) and less than 3π/2 (270°). Notice that
the coordinate values of a and b are both negative. By our definition,

b
tan (θ ) =
a

and, if we chose a value of θ and computed the tangent, the result would certainly
be equal to the ratio of b to a. But consider the inverse tangent function for a
moment. Say we knew b and a and wanted to compute θ (very common in engi-
neering calculations). By definition again,

b
θ = tan −1  
 a

but when we carry out the calculation, taking the ratio of the negative values of b
and a yields a positive result, and the inverse tangent result is an angle between 0
and π/2 (90°). You will notice that the quadrants of the unit circle are numbered with
Roman numerals in Figure 1.3. By computing the ratio of b to a and losing the sense
of their negative signs, we have failed to recognize that the answer should be an angle
in quadrant III. To get the correct answer, we have to look at the values of a and b,
recognize they are both negative and add π (180°) to the calculated result. There are
similar considerations in distinguishing calculations in quadrants II and IV.
So, you can see that just punching the buttons of a calculator without under-
standing the nature of the functions you are using can get you into trouble.
Computer software typically provides two inverse tangent functions, one return-
ing angles in quadrants I and IV only, and another that returns the correct angles
in all four quadrants.
A useful property involving the inverse trig functions comes from the common
fact noted above,

π
tan   = 1
 4

By applying the inverse tangent function to both sides of the equation, we get

π
= tan −1 (1) or π = 4 ⋅ tan −1 (1)
4

If we have a convenient way of computing the inverse tangent, this last formula
gives us a way of getting a value for π to as many significant digits carried by your
calculator or computer.
There are many practical scenarios where trigonometric functions arise. One
of these is in conjunction with quantities that vary periodically, like sine waves.
Application areas include:
Engineering and Scientific Calculations 19

• electronic circuits
• electrical power distribution
• communications and signal processing
• mechanical and structural vibrations
• automation and control systems

Consider the sinusoidal signal shown in Figure 1.4, which is produced by graph-
ing the function

1.47 sin ( 0.89 t + 0.32 ) (1.15)

The amplitude of the sine wave is 1.47, and you can see in the graph that the
peaks are ±1.47. The frequency of the sine wave is 0.89 radians/second, and, by
comparing with the graph, you can confirm that the period of the sine wave is, as
determined below,

radians
for ω = 0.89
second

ω cycles
and f = ≅ 0.14 or Hertz ( Hz )
2π second

1
then P = ≅ 7.1 seconds
f

FIGURE 1.4 Example sinusoidal signal.


20 Introduction to Engineering and Scientific Computing with Python

The phase shift of the sine wave is 0.32 radians (or 18°). A sine function without
phase shift would have a value of zero at time = 0, ± π ω , ± 2π ω , … You can see
from the graph that the wave starts early; in fact, at time = − 0.32 π the value is
zero. The sine wave has been advanced in time by the phase shift. Of course, the
phase shift could be negative, and the sine wave would be delayed.
By employing the “sum of angles” trigonometric identity,

sin (α + β ) = sin (α ) cos ( β ) + cos (α ) sin ( β ) (1.16)

our sine wave formula can be written in the equivalent form

1.47 sin ( 0.89 t + 0.32 ) = 1.47 cos ( 0.32 ) sin ( 0.89 t ) + 1.47 sin ( 0.32 ) cos ( 0.89 t )

≅ 1.40 sin ( 0.89 t ) + 0.462 cos ( 0.89 t )

You can see then that a sine function with a phase shift (or cosine function with
a phase shift) can be written as a sum of sine and cosine functions of the same
frequency but differing amplitudes.

1.2.4 Hyperbolic Functions
In deriving many engineering formulas, another family of functions arises: the
hyperbolic functions. These are actually defined in terms of exponential func-
tions; so, knowing how to calculate e x gives us the capability to calculate the
hyperbolics. Many calculators have e x built in, but not the hyperbolic functions.
A variety of software products used by engineers and scientists do have these
functions available. Their definitions are

e x − e− x
hyperbolic sine : sinh ( x ) =
2
e x + e− x
hyperbolic cosine : cosh ( x ) =
2
e x − e− x
hyperbolic tangent : tanh ( x ) = (1.17)
e x + e− x
The hyperbolic functions can be derived from the angles formed between the
origin and the coordinates of a rectangular hyperbola.6 We won’t get into that
here, but you should know how to calculate the hyperbolics should they arise in
formulas.

6 A hyperbola for which the asymptotes are perpendicular. Hyperbola. https://en.wikipedia.org/wiki/


Hyperbola. (Last edited date June 23, 2022.)
Engineering and Scientific Calculations 21

Example 1.2 Catenary Cable

A catenary7 is the curve that a hanging chain or cable assumes under its own
weight when supported only at its ends. Figure 1.5 depicts such a catenary
cable suspended between two points, {-1, 3} and {3, 6}, with the lowest point
at x = 0.
The general equation describing the curve of the cable is

y = a cosh   − b
x
(1.18)
 a

where the parameters a and b can be determined with the relationships,

x
y1 = a cosh  1  − b
x
and y2 = a cosh  2  − b
 a  a

and the length of the cable is given by

 x x 
L = a sinh  2  − sinh  1   (1.19)
  a   a 

For the specific case in the graph,


a ≅ 1.7418 b ≅ 0.9674 L ≅ 5.775
This illustrates how hyperbolic functions are involved in an engineering
calculation.

FIGURE 1.5 Suspended cable profile.

7 The name derives from the Latin word for chain: “catenaria.”
22 Introduction to Engineering and Scientific Computing with Python

1.3 COMPLEX NUMBERS
Complex numbers arise in many engineering applications, perhaps most fre-
quently in electrical engineering. You are undoubtedly familiar with them through
the solution of the quadratic equation, ax2 + bx + c = 0, by the quadratic formula

−b ± b2 − 4 a c
x=
2a (1.20)

In evaluating the quadratic formula, the term b2–4ac is called the discriminant
because, depending on its sign, very different solutions arise. When the discrimi-
nant is positive, two distinct real roots result. When it is zero, there are two equal
real roots. When b2–4ac < 0, we are faced with the awkward situation of finding
the square root of a negative number. This is handled by defining a symbol, j, to
represent the square root of −1 as

j  −1

then

b2 − 4 a c = ( −1)( 4 a c − b 2 ) = j 4 a c − b 2

which gives rise to two complex roots, each one having a real part and an imagi-
nary part with coefficient j. These are called a complex, conjugate pair because
the real parts are equal and the imaginary parts are equal but opposite in sign.

b 4 a c − b2
x=− ±j
2a 2a (1.21)

A complex number is, in fact, a pair of numbers generally represented in the form

a+ jb

where j is understood to be −1, and is called the imaginary unit.8 You can see by
its definition that j2 = -1. The quantity a is called the real part, and b is called the
imaginary part. It is convenient to represent a complex number by graphing it in

8 For obvious reasons, the imaginary unit was originally represented by the letter i. However, in
certain contexts, where the use of the letter i is problematic, the letter j is often used instead.
For example, in electrical engineering, the imaginary unit is normally denoted by j instead of i,
because i is commonly used to represent electric current. We will utilize j in this text, for a variety
of reasons. For example, the symbols i, j, and k are employed for unit vectors in the directions of
the x, y, and z axes, respectively. The use of j for distance along the y axis is more consistent with
its sense in the real plane.
Engineering and Scientific Calculations 23

FIGURE 1.6 Number on the complex plane.

a plane with the horizontal axis used for the real part and the vertical axis for the
imaginary part, as shown in Figure 1.6.
It is then possible to represent the number by polar coordinates instead of rect-
angular, Cartesian, coordinates (Figure 1.7) where r = a 2 + b 2 and θ = tan–1(b/a).9
From trigonometry, we also have that

a = r cos (θ ) and b = r sin (θ )

Therefore, the original representation of the complex number, a + jb, can also be
written

a + j b = r ( cos (θ ) + j sin (θ )) (1.22)

Euler proposed the following identity:

e j θ ≡ cos (θ ) + j sin (θ ) (1.23)

which leads to

a + j b = r e jθ (1.24)

The expression on the right, r e jθ, is called the polar form on the complex number.
This also leads to the following identities for the trigonometric functions:

9 Be aware of the four-quadrant arctangent.


24 Introduction to Engineering and Scientific Computing with Python

FIGURE 1.7 Number on the complex plane using polar coordinates.

e jθ − e − jθ e jθ + e − jθ
sin (θ ) ≡ cos (θ ) ≡
2j 2 (1.25)

1.4 ENGINEERING UNITS10
One of the more confusing aspects of making engineering and scientific calcula-
tions is units of measurement. Table 1.4 illustrates that for common units of mea-
surement for pressure as related to an SI standard unit, kPa:
Given this table, suppose you are faced with a pressure measurement in Hg
(typical units used for barometric pressure in the U.S.), and you are asked to
report the measurement in atmospheres. This shows how to make that conversion
using the table:

TABLE 1.4
Common Units for Pressure (kPa)
Atmosphere 101.325
in Hg 3.37685 kPa
in H2O 0.24884 kPa
torr (mm Hg) 0.133322 kPa
psi 6.894757 kPa
bar 100 kPa
kgf/cm2 98.0665 kPa

10 The units of measurement used by engineers are, of course, also used by scientists. So, it is a slight
to scientists to call them engineering units, but that is the common terminology. Apology due to
scientists.
Engineering and Scientific Calculations 25

TABLE 1.5
Basic Units of the SI System
Time Second s
Length Meter m
Mass Kilogram kg
Current Ampere A
Temperature Kelvin K
Amount Mole mol
Luminous intensity Candela cd

3.37683 kPa 1 atm


29.48 in Hg ⋅ ⋅ ≅ 0.9825 atm
1 in Hg 101.325 kPa

Of course, you could look for a conversion factor from in Hg to atm directly;
however, with so many pressure units in common use, just having the relationship
with a standard SI unit, kPa, is a convenient way to create the conversion.
The international standard units of measurement are those defined by the SI
system (Système internationale d’unités), which is a modern form of the metric
system. The basic SI units of measurement are given in Table 1.5.
Commonly derived quantities encountered in engineering and scientific calcu-
lations are shown in Table 1.6.
For each of these quantities, you will encounter different units used. For exam-
ple, civil engineers in the U.S. will encounter cubic feet per second (ft3/s or cfs)
used for volumetric flow rate, and U.S. chemical engineers may encounter gallons
per minute (gpm).
Scaled units are commonly used in describing quantities. For example, milli-
meters (mm) or micrometers (μm) may be used to measure dimensions of smaller
particles. There are standard prefixes for scaling units, and these are presented
in Table 1.7.

TABLE 1.6
Derived Quantities and SI Units
Area m2
Volume m3
Volumetric flow rate m3/s
Density kg/m3
Force N kg·m/s2
Pressure Pa N/m2
Energy J N·m
Power W J/s
Viscosity Pa·s N·s/m2
Another Random Document on
Scribd Without Any Related Topics
have been sold by one of the officers of the garrison. Out of
this the Opposition intend to make capital, by charging your
father with neglect, even connivance at the traitorous
dealings with France, and thereby hounding him from
office.”

“But it is unjust!” cried the girl wildly. “It is disgraceful! If


the spies of France have been successful, it is surely not my
father’s fault, but the fault of the officer who prepared and
sold them. What is his name?”

“I hear it is Solaro.”

“Solaro!” she gasped hoarsely. “Not Captain Felice Solaro, of


the Alpine Regiment?”

“Yes, signorina, that was the name.”

She stood staring at him, utterly amazed and mystified.


Felice Solaro!—a traitor!

“But it is impossible!” she declared quickly. “There must


surely be some mistake!”

“I heard it on the very best authority,” was the young


Frenchman’s calm answer. “A court-martial has, it seems,
been held with closed doors, and as a result the man Solaro
has been dismissed and sentenced to imprisonment for a
term of fifteen years.”

“Dismissed the army!” she exclaimed blankly. “Then the


court-martial found him guilty?”

“Certainly. But did you know the man?”

She hesitated a moment, then faltered—


“Yes, I knew him once. But what you tell me seems utterly
impossible. He was the very last man to betray Italy.”

“They say that a woman induced him to prepare the plans,”


remarked the Frenchman. “But how far that is true I have
no idea.”

Mary’s face was paler than before. Her brows were


contracted, and in her dark, luminous eyes was a look of
quick determination.

“Is my father aware of all this?” she demanded.

“Undoubtedly. He, of course, must have signed the decree


dismissing Solaro from the army. I believe the matter is
being kept as quiet as possible, but unfortunately the
Socialists have somehow obtained knowledge of the true
facts, and will go to the country with the cry that Italy,
under the present Cabinet, is in danger.” Then, after a slight
pause, he went on, “I look upon your father as my friend,
you know, signorina, therefore I think he ought to know the
plot being formed against him. They intend to make certain
distinct charges against him, of bribery, of receiving money
from contractors who have supplied inferior goods, and of
being directly responsible for the recent reverses in
Abyssinia. If they do—” Pausing, he elevated his shoulders
without concluding the sentence.

“But it is impossible, Count Dubard, that the man you name


could have sold our military secrets?”

“You know him sufficiently well, then, to be aware of his


loyalty?” sniffed her companion suspiciously.

“I know that he would never be guilty of an act of treason,”


she answered quickly. “Therefore if he really has been
convicted of such an offence, he must be the victim himself
of some conspiracy.”

The count regarded her heated declaration as the


involuntary demonstration of a bond of friendship, and
looked into her eyes in undisguised wonder. She stood
facing him, her white hand upon the broken marble of an
ancient vase, yellow and worn smooth by time.

“You appear to repose the utmost confidence in him,” he


remarked, surprised. “Why?”

“Because I am certain that he has fallen the victim of a


plot,” she declared, her face hard set and desperate. “If
those enemies of my father’s are endeavouring so cleverly
to oust him from office, is it not quite feasible that they
have laid the blame purposely upon Captain Solaro?”

“Why purposely?”

She paused, and again his eyes met hers.

“Because they knew that if Captain Solaro were accused,”


she said slowly, “my father, as Minister, would show him no
clemency.”

“Why?”

“There is a reason,” she responded hoarsely, adding, “I


know that he is innocent—he must be innocent.”

“But he has been tried by a competent court-martial, and


found guilty,” remarked her companion.

“With closed doors?”


“And is not that the usual procedure in cases of grave
offence? It would never do for the public to learn that the
loyalty of Italy’s officers had been found wanting. That
would shake the confidence of the country.”

“And yet my father’s enemies are preparing to strike a


crushing blow at him by making capital out of it?” she
exclaimed. “Ah yes. I see—I see it all!” she cried. “It is a
vile, despicable conspiracy which has sent to prison in
disgrace an innocent man—a second case of Dreyfus!”

The Frenchman shrugged his shoulders but made no reply.

“You said that a woman’s name had been mentioned in


connection with the affair,” she went on. “Was her name
Nodari—Filoména Nodari—and does she not live in
Bologna?”

Her companion’s lips pressed themselves together, but so


slightly that she did not notice the almost imperceptible
expression of annoyance upon his face.

“I do not know,” he declared. “I merely heard that there


was a woman in the case, and that she had given certain
evidence before the military court that left no doubt of the
guilt of the accused. But,” he added, half apologetically, “I
had no idea, signorina, that Solaro was a friend of yours.”

“Oh, he is not a friend, only an acquaintance,” she


protested.

“Then why are you so intensely interested in his welfare?”


he inquired.

“Because I have certain reasons. An injustice has been


done, and I shall at once ask my father to have the most
searching inquiry made. He will do so, if it is my wish,” she
added confidently.

“Then you intend to champion the cause of the man who is


accused of being a traitor to Italy?” remarked the wily
Parisian, regarding her furtively as he spoke. “I fear,
signorina, if you adopt any such course you will only place
in the hands of your father’s enemies a further weapon
against him. No; if you desire to assist His Excellency at this
very critical moment, you must refrain from taking any
action which they could construe into your own desire, or
your father’s intention, to liberate the man who is convicted
of having sold his country to its enemy.”

“But it is unjust! He is innocent.”

“Be that how it may, your duty surely is to help your father,
not to act in a manner which would convince the public that
he had connived at the sale of the military secrets of
Tresenta.”

Her dark eyes fixed themselves upon the distant towers and
cupolas of Florence, down where the grey mists were now
rising. They were filled with tears, and her chest beneath
her laces heaved slowly and then fell again.

And the man lounging at her side with studied grace


laughed within himself, triumphant at his own clever
diplomacy.
Chapter Fourteen.
In the Silence of Night.

Dinner at the Villa San Donato was always a stately meal,


served in that huge, lofty sala di pranzo, or dining-room,
with its marble floor, its high prison-like windows closely
barred with iron, its antique frescoed walls, and old low
settees covered with dark green damask running right
round the apartment.

In that enormous echoing room nothing had been touched


for two hundred years. The old oak furniture had been well-
preserved, the great high-backed chairs, covered with
leather and studded with big brass nails, the fine carved
buffet, and the graven shield over the door bearing the
arms of the princely house that had once owned the place,
all spoke of a brilliant magnificence of days bygone when
those huge halls had echoed to the tread of armed men,
and the lord of San Donato entertained his retainers and
bravoes with princely generosity. The villa was so huge that
the guest easily lost himself in its ramifications, its long
corridors and huge salons each leading from one to the
other. Like all the fortified villas of the cinquecento, every
window on the ground floor was closely barred, and this,
combined with the bareness of the rooms, gave to them an
aspect of austerity. Over the whole place was a comfortless
air, like that of most Italian houses, save in Madame
Morini’s rose boudoir, and the little sitting-room which Mary
had arranged in English style, and called her own.

In the great dining-room there was sitting accommodation


for two hundred, and yet on that evening the party only
numbered six: Her Excellency, Mary, Jules Dubard, an
English schoolfellow of Mary’s named Violet Walters, the
fair-haired daughter of an eminent KC, and two sisters,
named Anna and Eva Fry, daughters of an English merchant
at Genoa whom Her Excellency had invited up for the
vintage.

The voices of the little party echoed strangely in that


enormous old apartment, and from time to time a peal of
laughter came back from the corners of the place with weird
and startling repetition. The party had that day made an
excursion over to another estate which the Minister
possessed above the Arno, at Empoli, where the vintage
was in full swing. The trip had been delightful, and the
peasantry had received them with that deep homage and
generous hospitality which the Tuscan contadini extend to
their lord.

All were in good spirits except Mary, who, in a gown of pale


carnation pink, sat conversing mechanically in English with
her friend Violet, a pretty girl, about a year her senior, but
within herself reflecting deeply upon what the man sitting
opposite her had told her when out upon the terrace an
hour before.

Her father was in peril; it was her duty to warn him. Felice
Solaro had fallen a victim of some dastardly plot, but for
what reason and how was an utter mystery.

She longed to explain to her father all that the count had
told her, but in reply to a question, her mother had said that
she did not expect him to leave Rome for at least a
fortnight. Therefore she remained thoughtful, apprehensive,
and undecided how to act. At first she had contemplated
explaining everything to her mother, but on reflection she
saw that there were certain reasons why her anxiety should
not be aroused. Her Excellency was in very delicate health,
and while in London had consulted a physician, who had
told her that she must have as little mental worry as
possible. For that reason Mary resolved to hide the serious
truth from her.

Dubard, with his studied elegance of manner, was


entertaining the ladies with droll stories, for he was
something of a humourist, and essentially a ladies’ man.
Once or twice as Mary’s eyes met his he saw in them an
expression of deep anxiety, and of course knew well the
reason.

The Fry girls were particularly interested in the young


Frenchman, of whom they had heard as a new star in the
social firmament in Rome during the previous season, but,
being provincials, they had not met him. Both were dark
and fairly good-looking; Eva aged about twenty-one, and
Anna two years her senior. Their father, Henry Fry, was an
exporter of marble and of olive oil, who, like his father
before him, carried on business in Genoa, and had amassed
a considerable fortune; but Mrs Fry’s death three years
previously had left the girls to shift for themselves in the
social world, and their mother having long been an intimate
friend of Her Excellency, the latter each year invited the
girls up to San Donato as company for Mary.

Dinner ended at last, and the little party passed through the
three great salons lit by the thousand wax candles in their
antique sconces, into the minor drawing-room beyond,
which was always used of an evening because it was cosier
and small enough to be carpeted.

The Fry girls were clever mandolinists, and taking up their


instruments at Madame Morini’s invitation, played and sang
that sweet old Tuscan serenade—
“Io ti amerò finchè le Rondinelle
Avranno fatto il nido dell’ amore;
Io ti amero fin che nel Cielo stelle
Vi saran sempre a illuminarmi il cora.
Io ti amerò,
Io ti amerò,
Fin che avrò vita
Mio bel tesor!”

As they sang, Dubard stood beside Mary and looked into her
dark eyes for some responding glance.

But there was none. She was not thinking of him, but of
that unfortunate man convicted of treason, disgraced and
languishing in gaol—and of Filoména Nodari, the woman
who had foully betrayed him.

“You are sad to-night,” he managed to whisper to her as


they turned together from the singers.

She nodded, but no response escaped her lips.

Her feelings towards Jules Dubard were mixed ones. She


found him a very pleasant and entertaining companion,
always courteous, elegant of manner, and excessively polite
—the kind of man who at once attracted a woman. And yet
somehow, when she came to calmly analyse her regard for
him, she found it to be based merely upon his attractive
personality; or, in other words, it was little more than a
mere flirtation, which may be forgiven of every woman who
is courted and flattered as she was.

True, he had, in a kind of joking manner, more than once


declared his love for her. But she had always affected to
treat his words as empty and meaningless, and to assume
that they were good friends and nothing more. At heart,
however, she knew that both her parents would be pleased
to see her marry this man; for not only would she be the
wife of a wealthy landowner, but would also obtain the
ancient and honoured title of Comtesse Dubard.

Sometimes, in the secrecy of her room, she sat and


reflected upon the whole situation, but on each occasion
she arrived at the same distinct and unalterable conclusion.
She admired Jules; she was fond of his society, and he was,
even though his Gallic elegance of manner was a trifle
forced, nevertheless a perfect gentleman. But surely there
was a great breach between admiration and actual
affection.

What he had told her out on the terrace in the sundown,


however, showed plainly that he was really her father’s
friend. And yet, strangely enough, he did not wish her to
alarm her father unduly. Why? she wondered. If that grave
peril actually existed he should surely be forewarned!

“What I told you this evening has, I fear, upset you,


signorina,” Dubard said in a low, sympathetic voice. “But do
not be disquieted. I will assist your father in thwarting this
conspiracy against him. Do not tell Her Excellency a word. It
would be harmful for her, you know.”

“I shall say nothing,” was her reply. “But,” she added, “I


cannot help feeling anxious, especially as you suggest that I
shall not write to my father and warn him.”

“Oh, write if you wish,” he exclaimed quickly. “Only recollect


all that I have told you is only hearsay. Therefore, I think it
unwise to arouse your father’s apprehensions if the rumour
of the conspiracy is baseless. No?” he went on. “Remain
patient, and leave everything to me.”

She sighed, without replying; then, in order to reassure her,


he whispered, at the same time looking into her eyes
intensely—

“You know, Mary, that I will do my very best—for your sake.


You know me sufficiently well for that.”

He would have continued his protestations of affection had


not the singers at that moment ceased, and they were both
compelled to rejoin the little group, much to Mary’s relief,
for at that moment she had no thought beyond her father’s
peril. She did not exactly mistrust the count, yet some
strange intuition told her that his solicitude for her father’s
safety was feigned. What made her think so she knew not,
but she experienced that evening a strange, unaccountable
presage of evil.

He asked her to sing, and then, being pressed by the


others, she responded, chanting one of those old stornelli of
the countryfolk which she was so fond of collecting and
writing in a book, the weird love-chants that have been
handed down from the Middle Ages. It was one she had
taken down from the lips of a contadino at Castellina a few
days previously—

“Giovanottino dal cappel di paglia,


Non ti voglio amar più, non n’ho più voglia...
Voglio piuttosto vincer la battaglia!”

And while she sang, Violet Walters, standing with Dubard,


looked at him with an expression which told him that he
had created a favourable impression upon her. Thus the
evening passed quietly, until the bell over the private chapel
of the castle tolled eleven, and the guests rose and parted
to their rooms, being conducted through the long ghostly
corridors by the domestics with candles.

Mary allowed her Italian maid Teresa to brush her long


brown tresses before the mirror, as was her habit, but the
faithful servant remarked in surprise upon the signorina’s
preoccupied look.

“I’m very tired, that’s all,” Mary replied, and as quickly as


possible dismissed the girl and locked her door.

Her room she had furnished in English style with furniture


she had chosen in London. It was a delightful little place,
bright with clean chintzes and a carpet of pastel blue. Upon
the toilet-table was a handsome set of silver-mounted
bottles and brushes, a birthday gift from her devoted father,
and around the bed, suspended like a canopy from the
ceiling, were the long white mosquito curtains.

For a long time she sat before the glass in her pale blue
dressing-gown, her pointed chin sunk upon her breast in
thought. Ruin was before her father—and if so, it meant
ruin for them all!

Should she disregard the count’s suggestion and write to


him, urging him to come from Rome and see her; or if not,
to allow her to travel alone to Rome? Should she write in
secret?

How long she remained pondering, she had no idea. Twice


the clock struck solemnly over the deep dark valley that
spread beneath her window, until presently, with her mind
made up, she rose and crossed to her little writing-table on
the opposite side of the apartment, but was dismayed to
find the stationery rack empty of notepaper.

If she wrote, it was necessary to do so at once in order to


give the letter to Teresa when she came with the coffee in
the morning, for the young peasant who took the postbag
each day left at eight in the morning, so as to catch the
midday mail from Pistoja. There was paper in the library at
the farther end of the mansion, therefore she resolved to go
and obtain some.

Wrapping a white shawl about her shoulders, she took her


candle, and opening her door noiselessly, crept down the
long marble corridor past her mother’s door, and then,
turning at right angles, proceeded to the door at the end
which gave entrance to the splendid book-lined room full of
priceless editions.

As she crept along in her little felt-soled slippers she


suddenly halted, fancying that she heard an unusual noise.
The peasantry entertained an absurd belief that at night
supernatural noises were heard in the place, but of course
she did not believe in them. In fact, she believed that the
story had been invented by the agent, and circulated among
the superstitious folk in order to give the house better
protection against thieves.

She listened intently, her ears strained to catch every


sound.

Yes, someone was moving in the library!

Her first thought was of burglars, but holding her breath


and determined to first make certain before raising the
alarm, she advanced cautiously to the door, placed her
candle upon the floor, and peered through the keyhole.

She was not mistaken.

A light shone within. The great green door of her father’s


safe stood open before her, revealing the nest of iron
drawers within, while someone was moving at the writing-
table a little distance away, beyond her range of vision.

Her heart beat quickly as her eye was glued to the keyhole.
The thieves, whoever they were, had opened the safe with
a key and were calmly rifling it!

She heard a noise as of crisp papers being turned over


slowly, and then a few seconds later a dark figure crossed
to the safe and took a further packet from one of the
drawers.

As the man turned towards her his face became revealed in


the dim light. Sight of it staggered her.

The man who had opened the safe, and who was
methodically examining her father’s confidential papers in
secret, was none other than Jules Dubard!
Chapter Fifteen.
The Peril of a Nation.

The revelation of the truth that Jules Dubard was making a


methodical examination of her father’s private papers held
Mary spellbound.

From where she bent her eye at the big old-fashioned


keyhole, she saw that the ponderous steel door had been
opened by a key, for it was still in the shining lock. Within
that safe her father kept a number of important state
papers relating to the army, and quantities of
correspondence had, from time to time, been brought up
from Rome by official secretaries and he had placed them
there for safety.

Once, while she had been helping him to arrange a quantity


of technical documents and tie them in bundles with pink
tape, he had remarked—

“These are safer here than in Rome, my dear. There are


thousands who long to get sight of them, but they would
never think of looking here.”

But there had been a still further curious incident, one


which she recalled vividly at that moment as she watched
the man intently examining the documents by the light of
his candle. It had happened back in April, when some
matters connected with the estate called His Excellency
from Rome, and he had brought Mary with him up to San
Donato, where they had remained only two days. The
country was delightful in the bright springtime, and Mary
had desired to remain longer, but it was impossible, for her
father’s official duties took him back to the Eternal City—
and besides, to live in the country in spring is not
considered fashionable.

On the second night, while they were at the villa, he being


alone, she sat with him in the library after dinner watching
him rearrange a series of papers in the safe. It was eleven
o’clock when he concluded and locked the great green door,
then, carrying the key in his hand, he crossed to where she
sat, and said in a calm, earnest voice—

“Mary, I know that you will keep a secret if I reveal one to


you, won’t you?”

“Most certainly, father,” was her answer, not without some


surprise.

“Then put on your cloak and a shawl around your head, my


dear. I want to take you out.”

Her curiosity was increased, for although it was moonlight it


was late to walk in the country. Nevertheless she obeyed,
and together they passed down the steep, narrow bypath
through the dark pine woods, deeper and deeper, until
before them in the silence the Arno spread shimmering in
the moonbeams.

At the river’s edge His Excellency suddenly halted, saying—

“Mary, I wish you to bear witness to my action, so that if


you are ever questioned you may be able to tell the truth.
Recollect that to-night is the ninth of April—is it not?”

“Yes; why?” she inquired, more puzzled than ever.

“Because I have decided that that safe in the library shall


never again be reopened while I live. See! Here is the key!”
and he gave it into her hand, urging her to examine it,
which she did under the bright moonbeams.

Then he took it from her hand, and with a sudden


movement tossed it as far as he could towards the centre of
the deep stream, where it fell with a splash.

He sighed, as though a great weight had been lifted from


his mind, and as they turned to re-ascend the hill he said
with a grim laugh—

“If anyone wishes to open it now, he’ll have a good deal of


difficulty, I think.”

That was all. She had never questioned him further. She
had been witness of the wilful concealment of the key, but
the reason she knew not. There were state secrets, she
supposed, and she always regarded them as mysterious and
inexplicable.

Yet the safe had been reopened—if not by the actual key
flung into the river, then by a copy.

But what motive had Dubard in coming there on a visit


during the Minister’s absence, and making careful
examination of the documents which had been so zealously
hidden?

Out on the terrace that evening Dubard had, by giving her


that warning, shown himself to be her father’s friend. Yet
surely this secret prying was no act of friendship?

And this was the man who had courted and flattered her—
the man whom more than once she had believed that she
could love!
Her heart beat quickly, for she scarce dared to breathe, lest
she should betray her presence. The silence was unbroken
save that within the room was the rustle of papers as the
man carefully glanced over folio after folio.

The writing-table stood a little to the left, beyond the range


of her sight, therefore he was for a long time invisible to
her. Yet in the dead silence she could distinctly hear the
scratching of a pen, as though he were making some
extracts or memoranda. He had evidently lit the lamp upon
the table, for his candle still stood on the floor before the
open safe.

As she listened she heard him laugh lightly to himself, a


harsh, low, mocking laugh, which echoed through the big
old room, and then he rose and carried back the bundle of
documents carefully retied, and placed them in their drawer,
afterwards taking out another, and looking at the docket
upon it.

From the latter he saw it was of no interest to him,


therefore he tossed it back, as he did a second and a third.
He seemed to be searching for something he could not find,
and his failure caused him considerable chagrin.

His actions held her utterly dumbfounded. Although she had


been attracted by his personality and his courtesy, she had,
with that curious intuition which women possess, regarded
him with some vague distrust. What she now discovered
made it plain that she had not been mistaken. Her father
had welcomed him to his house, had entertained him, and
had regarded him as a man of sterling worth,
notwithstanding his Parisian elegance of manner and
foppishness of attire.
In their family circle her father had, indeed, more than once
expressed admiration of the count’s high qualities, which
showed how completely the man had insinuated himself into
the Minister’s confidence. But the truth was now revealed,
and he was unmasked.

Her natural indignation that he, a comparative stranger,


should seek to inquire into her father’s most carefully
guarded private affairs, prompted her to burst in upon him
and demand the reason of his duplicity; but as she watched,
she recognised that the most judicious course would be to
remain silent, and to describe to her father all that she had
witnessed.

Therefore she remained motionless with strained eyes, set


teeth, and quickly beating heart, gazing upon the man who
had accepted her mother’s hospitality only to make an
examination of her father’s secrets.

An hour passed. The deep-toned clock struck the hour of


four, followed by the far-distant bell of Florence. She was
cramped, chilled, and in darkness, for she had extinguished
her light in order that he should not be attracted by it
shining beneath the door.

Presently, however, she saw from his dark, heavy


countenance, lit by the uncertain light of the candle, that he
was deeply disappointed. He had searched, but had
evidently failed to find what he expected. Therefore he
commenced busily to rearrange the packets in the steel
drawers, just as he had found them, preparatory to
relocking the safe and retiring to his room.

She recognised that he had concluded his search—for that


night, at any rate—for there still remained four or five
drawers full of papers unexamined. Servants rise early in
Italy, and he feared, perhaps, that he might be discovered.
The remaining papers he reserved for the following night.

She watched him close the safe door and place the key in
his pocket, then she rose, caught up her candle, and sped
along the corridors back to her own room.

She relit her candle, and as she did so caught the reflection
of her own face in the long mirror, and was startled to see
how ghastly pale it was.

The discovery amazed her. She realised that the man who
courted her so assiduously and who flattered her so
constantly was in search of something which he believed to
be in her father’s possession. How he had recovered that
key which had been thrown deep into the Arno at that
lonely reach of the river beneath the tall cypresses, was an
utter mystery.

Should she go to her mother and tell her of all she had
seen? Her first impulse was to reveal everything, and seek
her mother’s counsel; yet on reflection she deemed it wiser
to tell her father all she knew. The natural impulse of a
daughter was, of course, to take her mother into her
confidence, but one fact alone prevented this—only a few
days previously her mother had been so loud in praise of
the count, in order, it seemed, to recommend him to her
daughter. Madame Morini was, with her husband, equally
eager to see a formal engagement between the pair, and
was surprised and disappointed to notice the cold,
imperturbable manner in which Mary always treated him.
Mary had realised this long ago, and for that reason now
hesitated to tell her mother the truth.

Next morning, while she was puzzling over what excuse she
could make to go to Rome, her mother came to her with an
open letter in her hand, saying that her father had been
called to Naples to be present at an official reception of King
Humbert by that city, and would not return to the Ministry
for three days. This news caused Mary’s heart to sink within
her, for she saw the uselessness of going to Rome until he
returned.

That day she avoided Dubard, making an excuse that she


had a headache, and spending most of the time alone in her
little boudoir. The Frenchman took the other girls for an
excursion through the woods, and during his absence she
entered the great old library and carefully examined the
lock of the safe.

It showed no sign of having been tampered with, having


evidently been opened with its proper key—or an exact copy
of it. The waste-paper basket was empty, the maid having
taken it away that morning; but the blotting-pad caught her
eye, and she held it before the long old empire mirror and
tried to read the impressions of the words he had copied.
But in vain. One or two disjointed words in French she made
out, but they told her absolutely nothing. He had evidently
made memoranda of the documents in French, or else the
documents themselves had been written in French.

She knew, by his actions on the previous night, that he


intended to return and conclude his investigations, and a
sudden idea occurred to her to thwart his plans. The real
object of his search he had apparently not discovered,
therefore it was her duty to prevent him from obtaining it,
and yet at the same time remain secret and appear to
possess no knowledge of his attempt. She reflected for
some time how best to accomplish this, when at last a
mode essentially feminine suggested itself—one which she
hoped would be effective.
Again she crossed to that huge green-painted safe let into
the wall, which contained her father’s secrets—and many of
the military secrets of the kingdom of Italy—and taking a
hairpin from her tightly bound tresses—always the most
handy feminine object—she broke off a piece of the wire
about an inch long, which she carefully inserted in the
keyhole, poking it well in by means of the other portion of
the pin until she heard it fall with a click into the delicate
mechanism of the lock.

Then, smiling to herself, she withdrew, knowing that


whatever attempt Dubard now made to reopen that door
would be without avail. There was nothing to show that
anyone had interfered with the mechanism, therefore he
would be entirely unsuspecting, and would attribute the
non-working to some defect in the lock itself, or in the key.

That night she sat next him at dinner, bearing herself as


bravely bright and vivacious as ever, and determined that
his suspicions should not be aroused; while he, on his part,
thought her more charming than ever.

The evening passed as usual in the small drawing-room


with music and gossip, and later, after all had retired and
one o’clock had struck, Mary crept out in the darkness to
the library, where, sure enough, she saw, on peering
through the keyhole, the man who was so cleverly courting
her actively trying to open the safe door.

The key would only half turn, and in French he muttered


some low words of chagrin and despair. He tried and tried,
and tried again, but all to no purpose. He withdrew the key,
blew into the barrel, examined it in the light, and then tried
once more.
But the lock had become jammed, and neither by force nor
by light manoeuvring could he turn the key sufficiently to
shoot back the huge shining bolts that held the door on
every side.

Mary’s effort had been successful. By that tiny piece of wire


her father’s secrets were held in safety.
Chapter Sixteen.
Father and Daughter.

“My dear child, you really must have been dreaming,


walking in your sleep!” declared Camillo Morini, looking at
his daughter and laughing forcedly.

“I was not, father!” she declared very seriously. “I saw the


man take out those bundles of papers I helped you to tie
up.”

“But the key! There was only one made, and you know
where it is. You saw me do away with it.”

“He has a duplicate.”

The Minister of War shook his head dubiously. What his


daughter had told him about Jules Dubard was utterly
inconceivable. He could not believe her. Truth to tell, he half
believed that she had invented the story as an excuse
against her engagement to him. Though so clever and far-
seeing as a politician he was often unsuspicious of his
enemies. Good-nature was his fault. He believed ill of
nobody, and more especially of a man like Dubard, who had
already shown himself a friend in several ways, and had
rendered him a number of important services.

“And you say that you put a piece of your hairpin in the
lock, and that prevented him reopening it on the second
night?”

“Yes. Had it not been for that he would have made a


complete examination of everything,” she said. “If he had
done so, would he have discovered much of importance?”
His Excellency hesitated, and his grey brows contracted.

“Yes, Mary,” he answered, after a brief pause. “He would.


There are secrets there—secrets which if revealed might
imperil the safety of Italy.”

“And they are in your keeping?”

“They are in my keeping as Minister of War.”

“And some of them affect you—personally? Tell me the


truth,” she urged, her gloved hand laid upon the edge of the
table.

“They affect me both as Minister and as a loyal subject of


His Majesty,” was His Excellency’s response, his face
growing a trifle paler.

If the truths contained within that safe really leaked out,


the result, he knew, would be irretrievable ruin. Even the
contemplation of such a catastrophe caused him to hold his
breath.

“Then I assure you, father, that nearly half the documents


within have been carefully and methodically examined by
this man who poses as your friend.”

“And to tell you the truth, dear, I cannot credit it. He can
have no key that would open the door, unless he recovered
it from the Arno—which is not likely. They never dredge that
part, for it is too deep. Besides, that portion of the river is
my own property, and before it could be dredged they
would have to give me notice.”

“But a duplicate—could he not possess one?”


“Impossible. That safe was specially manufactured in
London for me, and is one of the strongest ever
constructed. I had it made specially of treble strength which
will resist any drill or wedge—even dynamite would only
break the lock and leave the bolts shot. The only manner it
could be forced without the key would be to place it in a
furnace or apply electrical heat, which would cause the steel
to give. The makers specially designed it so that no second
key could ever be fitted.”

“Then you disbelieve me?” she said, looking into her father’s
face.

“No, I don’t actually disbelieve you, my dear,” he


responded, placing his hand tenderly upon hers; “only the
whole affair seems so absolutely incredible.”

“Everything is credible in the present situation,” she said,


and then went on to relate what Dubard had told her
regarding the conspiracy of the Socialists, who intended to
hound the Ministry from office.

She was seated in her father’s private cabinet at the


Ministry of War, in the large leather-covered chair opposite
his big littered table, the chair in which sat so many high
officials day after day discussing the military matters of the
Italian nation. The double doors were closed, as they always
were, against eavesdroppers.

She had, at her own request, managed to have a telegram


sent her by him, and with Teresa had arrived in Rome only
an hour ago. She had driven straight to the Ministry, and on
her arrival Morini had quickly dismissed the general
commanding in Sicily, to whom at that moment he was
giving audience.
The story his daughter had related seemed utterly
incredible. He knew from Ricci of the deep plot against him,
but that the safe should really have been opened, and by
Dubard of all men, staggered belief. That was why, in his
astonishment, he declared that she must have been
dreaming.

But in a few moments he became convinced, by her


manner, that it was no dream, but an actual fact. Dubard,
who had shown himself a friend, had actually pried into
what was hidden from all. Why?

What had he discovered? That was the question.

Mary told him of the memoranda, and of the impressions


upon the blotting-pad, whereupon he exclaimed quickly—

“I’ll send someone up to San Donato to-night to bring the


blotting-pad here. Granati, the handwriting expert, shall
examine it.” Then after a brief pause, he bent towards her,
saying, “You do not believe that he really discovered what
he was in search of?”

“No; he seemed disappointed.”

His Excellency heaved a sigh of relief. If Jules Dubard really


had opened the safe, then he feared too well the reason—
the motive of the search was plain enough to him.

His teeth set themselves hard, his face blanched at thought


of it; and he brushed the scanty grey hair from his forehead
with his hand.

And yet it seemed impossible—utterly impossible—that the


safe could really have been opened and its contents
examined.
“I can’t understand Count Dubard’s reason for accepting our
hospitality and then acting as a thief during your absence,
father,” the girl remarked, looking him full in the face. “I’ve
told mother nothing, as I preferred to come straight to you.
That is why I asked you to call me here by telegraph.”

“Quite right, my dear; quite right,” he said. “It would upset


your mother unnecessarily.”

“But there is another matter about which I want to talk,”


she said, after some hesitation; “something that the count
has told me in confidence.”

“Oh! What’s that?” he asked quickly.

“It concerns yourself, father. He says that there is a deep


political plot against you—to secure the downfall of the
Cabinet and to bring certain unfounded charges against you
personally.”

Her father smiled quite calmly.

“That news, my dear, is scarcely fresh,” he replied. “For


twenty-five years my political enemies have been seeking to
oust me from every office I’ve ever held. Therefore that
they should be doing so now is only natural.”

“I know! I know!” she said, with earnest apprehension. “But


he says that the plot is so formed that its result will reflect
upon you personally,” and then she went on to describe
exactly what Dubard had told her.

His Excellency, nervously toying with the quill, listened, and


as he did so reflected upon what Ricci had already told him.

How was it, he wondered, that the Frenchman, who was


outside the inner ring of Italian politics, knew all this? He
must have some secret source of knowledge. That was
plain.

Morini looked into his daughter’s great brown eyes, and


read the deep anxiety there. Within his own heart he was
full of apprehension for the future lest the Socialists might
defeat the Government; yet, with the tact of the old political
hand, he betrayed no concern before her. What she told
him, however, revealed certain things that he had not
hitherto suspected, and rendered the outlook far blacker
than he had before regarded it.

“The count has also told me that there is a charge of


treason against Captain Solaro.”

Instantly her father’s face changed.

“Well?” he snapped.

“The captain is innocent,” she declared. “He must be. He


would never betray the military secrets of his country.”

“That is a matter which does not concern you, Mary,” he


exclaimed quickly. “He has been tried by court-martial and
been dismissed the army.”

“But you surely will not allow an innocent man to suffer,


father!” she urged in a voice of quick reproach.

“It is not a matter that concerns either of us, my dear,” he


answered in a hard tone. “He has been found guilty—that is
sufficient.”

She was silent, for suddenly she recollected what the count
had said, namely, that any effort on her part to prove poor
Solaro’s innocence must reflect upon her father, whose
enemies would use the fact to prove that Italy had been
betrayed with the connivance of the Minister of War.

She sighed. She had suspicions—grave ones; but she knew


that at least Felice Solaro had been made the scapegoat of
some cunning plot, and that his sentence was unjust. Yet
what could she do in such circumstances? She was
powerless. She could only remain patient and wait—wait,
perhaps, for the final blow to fall upon her father and her
house! A silence fell, broken only by the low ticking of the
marble clock and the measured tramp of the sentry down in
the sun-baked courtyard.

Her father sighed, rose from his chair, and with his hands
behind his back paced anxiously up and down the room.

“Mary!” he exclaimed suddenly, in a changed voice, hoarsely


in earnest, “if the secrets hidden in that safe have actually
fallen into the hands of my enemies, then I must resign
from office?” His face was now blanched to the lips, for all
his self-possession seemed to have deserted him in an
instant as the ghastly truth became revealed. “I know—I
know too well—how cleverly the conspiracy has been
formed, but I never dreamed that that safe could be
opened, and the truth known. No,” he said in a low voice of
despair, his chin sunk upon his breast; “it would be better to
resign, and fly from Italy.”

His daughter looked at him in silence and surprise. She had


never seen him plunged in such despair. A bond of
sympathy had always existed between father and daughter
ever since her infancy.

“Then you dare not face your enemies if they are actually in
possession of what is contained in the safe?” she said
slowly, rising and placing her hand tenderly upon her
father’s shoulder. She realised for the first time that her
father, the man whom she had trusted so implicitly since
her childhood, held some guilty secret.

“No, my dear, I dare not,” was his reply, placing his


trembling hand upon her arm.

“But you are unaware of how much knowledge Count


Dubard has obtained,” she pointed out.

“Sufficient in any case to cause my ruin,” replied the grey-


haired Minister of War. “That is, of course, if he is not after
all my friend.”

“But he is your friend, father,” she was compelled to


exclaim, in order to give him courage, for she had never in
her life seen him so overcome.

“Those midnight investigations are, as you have said, a


curious way of demonstrating friendship,” he remarked
blankly. “No,” he added in a dry, hard tone. “To-day is the
beginning of the end. These are my last days of office,
Mary. The vote may be taken in the Chamber any day, and
then—” and his eyes wandered involuntarily to that drawer
in his writing-table wherein reposed his revolver, which,
alas! more than once of late he had handled so fondly.

“And after that—what?” his daughter asked anxiously.

But only a deep sigh ran through the lofty room, and then
she realised that her father’s kindly eyes were filled with
tears.
Chapter Seventeen.
The Sazarac Affair.

The great gilded ballroom of the French Embassy in Rome


was thronged by a brilliant crowd, even though it was out of
the season and the majority of the official and diplomatic
world were still absent from the Eternal City, in the
mountains or at the baths.

The bright uniforms, the glittering stars and coloured


ribbons worn by the men, and the magnificent toilettes of
the women, combined to form a perfect phantasmagoria of
colour beneath the huge crystal electroliers.

The orchestra was playing a waltz, and many of the guests


were dancing; for the floor at the Farnese Palace was the
best in Rome. Camillo Morini, though in no mood for gaiety
and obliged to attend, was wandering aimlessly through the
rooms, exchanging salutes with the men he knew and now
and then bowing low over a woman’s hand. In his brilliant
uniform as Minister of War, with the cerise and white ribbon
of the Order of the Crown of Italy and a number of minor
decorations, he presented a strikingly handsome figure, tall,
erect, and distinguished-looking, as he strode through the
huge painted salons dazzling with their heavy gilt mirrors
and giant palms, a man of power in that complex nation,
modern Italy.

After Mary had sought him and revealed the amazing fact of
Dubard’s secret investigations, she had gone on home to
the palace with her maid Teresa, where he had joined her
about six o’clock.
Father and daughter had dined alone in the long, high, old
frescoed room. Few words they exchanged, for both felt
that a crisis was imminent, and that if the blow fell the
catastrophe must be overwhelming and complete. A true
bond of deepest sympathy had always existed between
them, for, as an only child, he had lavished upon her all his
affection, while she, in turn, regarded him with a strong
affection unusual in these decadent days. More than once
since she had returned from the Broadstairs school she had
been his assistant and adviser in the hours when she had
found him alone and agitated as he so often was. More than
once, indeed, he had confided in her, telling her of affairs
which he withheld even from his wife for fear of unduly
disturbing her in her delicate state of health. Often he had,
of his own accord, sought his daughter’s counsel. Hence she
was in possession of many confidential facts concerning
persons and politics in Rome, and with her woman’s keen
perception had already in consequence become a trained
diplomat.

In the long and painful silence during dinner he urged her to


accompany him to the French Ambassador’s reception,
adding with a sigh, “I would rather remain at home with
you, my dear; but I must go. It will not do for me to betray
any sign of fear.”

“Go, certainly. It is your duty, father. But I am really too


tired after my journey.”

And so she excused herself from accompanying him, and


went off early to her room.

His Excellency had been chatting with the Prince Demidoff,


the Russian Ambassador, and was passing into the great
ballroom, where the gaiety was then at its height, when he
came face to face with Angelo Borselli, gorgeous in his
brilliant general’s uniform.

“Ah, my dear Camillo!” exclaimed the latter. “I only returned


from Paris to-day, and called upon you on my way here. I
must see you at once—privately.”

The Minister, who had not met the Under-Secretary since


the adventurer Ricci had revealed to him the truth
regarding the Socialist conspiracy, controlled his feelings
with marvellous calmness, and greeted his friend effusively.

“Why?” asked His Excellency under his breath. “Has


anything happened?”

“A good deal. But here the very walls have ears,” was the
answer. “I have come in search of you.”

“Well?” asked the Minister of War in abrupt surprise,


recollecting the warning Ricci had already given him.

“Come with me. I know my way about this place,” Borselli


said. “There is an anteroom at the end of the south corridor
where we can talk without risk of eavesdroppers.”

Their host, Baron Riboulet, the French Ambassador, a tall,


handsome, brown-bearded man, stopped and greeted the
pair at that moment, while several other personages well-
known in Roman society came up to pay their respects to
His Excellency the Minister. Then at last the Under-
Secretary managed to whisper—

“Let’s get away. I must see you without further delay.


Come.”

And together they strolled through the magnificent salons


with their brilliant crowds and presently entered a small,
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like