Course #3 (Revised Unabridged Edition) • Automate the Boring Engineering Work

Fundamental Python for Mechanical Engineers

A complete, self-contained 14-week (28-lesson) computational curriculum written in an approachable Automate the Boring Stuff with Python style for undergraduate and first-time coding Mechanical Engineering students. Zero dry textbook dependency: every concept features step-by-step mental models, common bug alerts, 28 Manim animations, executed plots, and real CSV telemetry integrated directly with ME 200 & ME 300 Thermodynamics, Fluid Mechanics, Heat & Mass Transfer, Solar Thermal Engineering, Solids & Vibrations, and First-Principles Machine Learning.

$$\mathbf{K}\mathbf{u} = \mathbf{f}, \qquad m\ddot{x} + c\dot{x} + kx = F_0\cos(\omega t), \qquad \frac{1}{\sqrt{f}} = -2.0\log_{10}\left(\frac{\varepsilon/D}{3.7} + \frac{2.51}{\text{Re}\sqrt{f}}\right), \qquad \eta_{\text{th}} = 1 - \frac{q_{\text{out}}}{q_{\text{in}}}$$
🌐 Open Unabridged Web Book (28 Lessons + 28 Manim Videos + 14 CSVs) 📑 Complete Blank Lecture Slides (Modules 00–10, 110 Slides PDF) 🚀 Integrated Capstone Projects
Detailed 14-Week Syllabus

Module-by-Module Curriculum & Mechanical Engineering Integration

Modules 00–09 follow the shared 70/30 foundation defined in Coursebooks_project, while Modules 10–12 specialize in mechanical design automation, predictive maintenance, and deep learning. All materials are maintained in 0-engineering/0-mechEng/3-Fundamental_python-for-ME.

Launch All 28 Notebooks →
Module / Week Python & Computational Topic Integrated Math, Physics & Mechanical Engineering Concept Interactive Lessons & .ipynb
Module 00
Week 1 (Shared)
Environment Setup, Anaconda/Miniconda, JupyterLab Workflow, Markdown & LaTeX Equations Thermodynamics & Mechanics Intro: Ideal gas law ($PV = mRT$), rotational shaft power ($P = T\omega$), and reproducible engineering calculation sheets. Lesson 01 (.ipynb) 📑 Slides
Module 01
Week 2 (Shared)
Variables, Numeric Types (`int`, `float`), String Manipulation, `f`-String Engineering Reports & Units Statics & Solid Mechanics: Uniaxial normal stress ($\sigma = F/A$), thin-walled cylindrical pressure vessels ($\sigma_{\text{hoop}} = Pr/t$), and thermal expansion ($\delta_T = \alpha L \Delta T$). Lesson 02 Lesson 03 📑 Slides
Module 02
Week 3 (Shared)
Control Flow: `if-elif-else` Conditionals, `for` Parametric Sweeps, `while` Convergence & Newton-Raphson Fluid Mechanics & Machine Design: von Mises safety factor ($N_y = S_y/\sigma'$), Reynolds laminar/turbulent transition ($\text{Re} = \rho VD/\mu$), iterative Colebrook friction factor $f$, and heat exchanger LMTD convergence. Lesson 04 Lesson 05 Lesson 06 📑 Slides
Module 03
Week 4 (Shared)
Modular Functions (`def`), Positional/Keyword Arguments, Multi-Value Returns, Docstrings & Custom Libraries Thermodynamics & Heat Transfer: Reusable calculators for Otto/Brayton thermal efficiency ($\eta = 1 - r^{1-k}$), Darcy-Weisbach pipe pressure drop ($\Delta P$), and extended-surface fin efficiency ($\eta_f = \tanh(mL)/(mL)$). Lesson 07 Lesson 08 📑 Slides
Module 04
Week 5 (Shared)
Data Structures: Lists, 1D/2D Arrays, Immutable Tuples, Sets, and Nested Material Property Dictionaries Statics & Materials Selection: 3D force/moment equilibrium ($\sum\vec{F}=\vec{0}, \sum\vec{M}=\vec{0}$), Ashby material selection lookup dictionaries ($E, \sigma_y, \rho, k$ for AISI 4140, Al 7075, Ti-6Al-4V). Lesson 09 📑 Slides
Module 05
Week 6 (Shared)
NumPy Numerical Computing: Vectorized Array Math, Broadcasting, Matrix Inversion & Eigenvalue Problems Finite Element Truss Statics & 2D Conduction: Direct stiffness matrix assembly ($\mathbf{K}\mathbf{u} = \mathbf{f}$), principal Cauchy stress tensor eigenvalues ($\det(\boldsymbol{\sigma} - \lambda\mathbf{I})=0$), and 2D steady heat conduction laplacian grids. Lesson 10 Lesson 11 Lesson 12 📑 Slides
Module 06
Week 7 (Shared)
Matplotlib Engineering Visualization: Multi-Panel Subplots, Contour/3D Surface Plots & Annotations Thermodynamic & Solid Mechanics Diagrams: Automated $P\text{-}v$ and $T\text{-}s$ vapor power cycle diagrams, tensile stress-strain ($\sigma\text{-}\varepsilon$) curves with $0.2\%$ offset yield line, and shear/bending moment ($V\text{-}M$) diagrams. Lesson 13 Lesson 14 Lesson 15 📑 Slides
Module 07
Week 8 (Shared)
File I/O & Experimental Data Processing: Reading `.txt`, `.csv`, `.xlsx`, Sensor Filtering & Cleaning Experimental Mechanics & Thermal Lab Telemetry: Parsing Instron universal testing machine logs, K-type thermocouple transient arrays, wind-tunnel Pitot-static traverses, and NIST thermophysical tables. Lesson 16 Lesson 17 Lesson 18 📑 Slides
Module 08
Week 9 (Shared)
SciPy Scientific Computing: Constrained Optimization (`minimize`), ODE Integration (`solve_ivp`) & Spline Fitting Dynamics, Vibrations & Thermal Optimization: Single/Multi-DOF damped forced vibration ($m\ddot{x}+c\dot{x}+kx=F_0\cos\omega t$), transient lumped-capacitance cooling, and minimum-mass pressure vessel / fin optimization. Lesson 19 Lesson 20 Lesson 21 📑 Slides
Module 09
Week 10 (Shared)
SymPy Symbolic Mathematics: Symbolic Algebra, Differentiation, Integration, ODEs & Analytical Derivations Analytical Mechanics & Elasticity: Symbolic integration of Euler-Bernoulli beam deflection ($EI\,w'''' = q(x)$), symbolic Jacobian derivation for robotic linkages, and analytical Carnot/Rankine work ratios. Lesson 22 Lesson 23 Lesson 24 📑 Slides
Modules 10–12
Weeks 11–14 (ME Specialized)
Integrated Mechanical System Simulation & Applied Machine Learning (`Scikit-Learn`, `TensorFlow`, `Torchvision`, `Torchtext`) Capstone Mechanical Design & ML Surrogates: Full Rankine cycle analyzer, cantilever/simply-supported beam solver, shell-and-tube heat exchanger sizing, FFT vibration modal analyzer, and ML predictive maintenance capstones. Lesson 25 Lesson 26 Lesson 27 Lesson 28 📑 Slides
Deliverable 4 • Applied Capstone Specs

Data-Driven Mechanical Engineering Capstone Projects

Three applied capstone projects combining physical mechanical engineering governing equations with real datasets from Kaggle, UCI, OpenML, Hugging Face, and Papers With Code.

Capstone 1 • Turbomachinery & Power

Turbofan Remaining Useful Life (RUL) & Combined-Cycle Power Surrogate

Engineering Physics: Brayton-Rankine combined-cycle first/second law efficiency ($\eta_{\text{CC}} = \eta_B + \eta_R - \eta_B\eta_R$) and compressor/turbine isentropic degradation ($\eta_c, \eta_t$).

Datasets:

  • Kaggle: NASA CMAPSS Jet Engine Simulated Data (`FD001–FD004`).
  • UCI ML Repository: Combined Cycle Power Plant (`CCPP`, 9,568 hourly points of $T_{\text{amb}}, P_{\text{atm}}, \text{RH}, P_{\text{vac}} \to \dot{W}_{\text{net}}$).
  • OpenML: Naval Propulsion Compressor Decay (`ID: 40966`).
Python ML Stack: Scikit-Learn (`RandomForestRegressor`, `GradientBoostingRegressor`, `PCA` sensor denoising) + TensorFlow (`Keras` LSTM sequence-to-RUL predictor).

Capstone 2 • Solid Mechanics & Vision

Automated Steel Surface Defect Inspection & Maintenance Log NLP

Engineering Physics: Fracture mechanics stress intensity factor ($K_I = Y\sigma\sqrt{\pi a}$), fatigue crack initiation at surface inclusions/scratches, and reliability-centered maintenance.

Datasets:

  • Papers With Code / Kaggle: NEU Surface Defect Database (1,800 hot-rolled steel micrographs across 6 defect classes: crazing, inclusion, patches, pitted, rolled-in scale, scratches).
  • Hugging Face / UCI: AI4I 2020 Predictive Maintenance & annotated factory operator work-order text logs.
Python ML Stack: Torchvision (transfer-learned `ResNet-18` defect classifier + bounding-box transforms) + Torchtext (maintenance log severity classifier).

Capstone 3 • Heat Transfer & Aero-Acoustics

Physics-Informed Heat Exchanger Surrogate & Airfoil Aero-Vibration

Engineering Physics: 2D steady/transient heat conduction ($\nabla^2 T = \frac{1}{\alpha}\frac{\partial T}{\partial t}$), $\varepsilon\text{-NTU}$ heat exchanger rating, and turbulent boundary-layer trailing-edge vortex shedding.

Datasets:

  • OpenML / UCI: NASA Airfoil Self-Noise Dataset (`OpenML ID: 43999`, angle of attack $\alpha$, chord $c$, $U_\infty$, displacement thickness $\delta^* \to \text{SPL}$ dB).
  • Government Portals & Google Dataset Search: NREL Wind Turbine Drivetrain Vibration & NIST Heat Exchanger Fouling Benchmarks.
Python ML Stack: TensorFlow (Physics-Informed Neural Network enforcing PDE residual in custom loss) + Scikit-Learn (`GaussianProcessRegressor`).