CRC Press, 2022. — 421 p. — ISBN 9781003256861.
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 engineering and scientific calculations, Python basics, and structured programming.
Based on extensive teaching experience, the text uses practical problem solving as a vehicle to teach Python as a programming language. By learning computing fundamentals in an engaging and hands-on manner, it enables the reader to apply engineering and scientific methods with Python, focusing this general language 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 structured 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.
List of Examples
Authors
Engineering and Scientific CalculationsChapter Objectives.
Numerical Quantities
Positional and Scientific Notation
Accuracy and Precision
Significant Figures
Rounding
Mathematical Functions
Absolute Value and Sign Functions
Exponents and Logarithms
Trigonometric Functions
Hyperbolic Functions
Complex Numbers
Engineering Units
Organizing and Planning Solutions to Problems
Problems
Computer-Based CalculationsChapter Objectives.
Numerical Quantities as Stored in the Computer
Integer Numbers
Real Numbers
How the Computer Stores Text
Boolean True/False Information
Computer Storage Evolution and Terminology
Problems
Python BasicsChapter Objectives
The Spyder/IPython Environment
Mathematical Functions
Variables and Assignment
Objects, Attributes, Methods, and Data Types
Boolean Type
Character Type
Collections of Data
Creating Plots
The Spyder Editor
Input and Output
Console Input and Output
File Input and Output
Formatting Output
Obtaining Help
Problems
Structured Programming with PythonChapter Objectives
An Overview of Program Structure
Implementing Decision Structures with Python
Implementing Repetition Structures with Python
The General Loop Structure
The List-Driven and Count-Controlled Loop Structures
The break and Continue Statements with the for Loop
User-Defined Functions in Python
lambda Functions
Function Arguments
Variable Scope
Problems
Graphics—MatplotlibChapter Objectives.
Introduction to Matplotlib
Customizing Line and Scatter Plots
Using Figure Window Objects
Creating Bar Plots Including Histograms
Creating Other Plots of Interest
Contour and Surface Plots
Problems
6 Array and Matrix Operations
Chapter Objectives.
Creating Arrays in Python
Creating Special Arrays
Combining, Stacking, and Splitting Arrays
Reshaping Arrays
Indexing: Array Subscripts
Array Operations
Vector/Matrix Operations
Matrix/Vector Multiplication
Transpose
Matrix Inversion
Problems
Solving Single Algebraic EquationsChapter Objectives
The Nature of Single, Nonlinear Equations in One Unknown
Bracketing Methods—Bisection
Bracketing Methods—False Position
Open Methods—Newton-Raphson
Open Methods—Modified Secant
Circular Methods—Fixed-Point Iteration
Circular Methods—The Wegstein Method
A Hybrid Approach—Brent’s Method
Solving for the Roots of Polynomials
Case Study: Trajectories of Projectiles in Air
Problems
Solving Sets of Algebraic EquationsChapter Objectives.
Systems of Linear Algebraic Equations
Solving Small Numbers of Linear Algebraic Equations
Graphical Method
Determinants and Cramer’s Rule
Determinants
Cramer’s Rule
Elimination of Unknowns
Gaussian Elimination
Naive Gaussian Elimination
Gaussian Elimination Computer Algorithm
Naive Gaussian Elimination Algorithm
Adding Determinant Evaluation
Partial Pivoting
Detecting Singular and Ill-Conditioned Systems
Solving Sets of Linear Equations with the NumPy linalg Module
Solving Sets of Nonlinear Algebraic Equations
Solution of Nonlinear Algebraic Equations by Successive Substitution
The Newton-Raphson Method for Nonlinear Systems of Equations
Use of the root Function from the SciPy optimize Module to Solve Nonlinear Equations
Problems
Solving Differential EquationsChapter Objectives
Describing Differential Equations
Quadrature – Finding the Area under the Curve
Pre-computer Methods
Quadrature for Continuous Functions
The quad Function from SciPy’s integrate Module
Quadrature for Discrete Data
Solving Differential Equations with Initial Conditions
Euler’s Method
Heun’s Method
Systems of Differential Equations
Solving Differential Equations with the solve _ ivp Function from SciPy’s integrate Module
Problems
Working with DataChapter Objectives.
Characterizing Data Sets: Initial Observations and Sample Statistics
General Data Concepts
Sample Statistics: Central Tendency and Dispersion
Central Tendency
Spread or Dispersion
Using Boxplots to Diagnose Outliers
Distributions
Several Important Distributions
Uniform Distribution
Normal Distribution
Weibull Distribution
Python and Distributions
Random Numbers
Making Claims Based on Data
Comparison of Data with a Standard
Comparison between Two Samples
Determining Whether Data Are Normally Distributed
Fitting Mathematical Models to Data
Straight-line Linear Regression
Fitting Polynomials
General Issues and Precautions
Problems
Index of Python Terminology