How to read this page. Each topic has a looping pixel-art animation that illustrates the physics, a one-line summary, links to the notebook or script, and a collapsed 📈 See the plot panel with the real output. Click a GIF to open its source file.
🚀 Quick start
git clone https://github.com/aimanamri/mechanicalEngineering.git -b main
cd mechanicalEngineering
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt jupyter
jupyter lab
Open any .ipynb and choose Run All. Standalone scripts run directly: python3 mohr_circle.py.
📋 Requirements and libraries
Python 3.12 or later. requirements.txt is pinned to NumPy 2.x / SciPy 1.18, which need Python ≥ 3.12 (tested on 3.13). A virtual environment keeps those pins away from your other projects.
| Library |
Used for |
numpy, scipy |
arrays, interpolation, integration, linear algebra, ODE solving |
matplotlib |
every plot: SFD/BMD, Mohr’s circle, stress-strain curves, T-s and p-h diagrams |
japanize_matplotlib |
renders the Japanese (日本語) labels and titles |
pandas, openpyxl |
reading and processing practice.xlsx in the tensile-test notebook |
pyromat |
steam and R-134a properties for the cycle notebooks, set to SI-derived units (MPa, K, kJ/kg) instead of its bar default |
rich |
formatted result tables printed in the thermodynamics notebooks |
setuptools |
supplies the distutils shim japanize_matplotlib needs on Python 3.12+ |
Other ways to run them
🏗️ Solid mechanics
|
Mohr’s Circle
モールの応力円
A 2D stress state (σx, σy, τxy) drawn as Mohr’s circle.

📈 See the plot
|
|
Shear Force and Bending Moment Diagrams
せん断力図・曲げモーメント図 (SFD / BMD)
Shear force and bending moment along a loaded beam.

📈 See the plot
|
|
Tensile Test
引張試験
Measured test data from practice.xlsx in, stress-strain diagram out.

📈 See the plot
|
|
von Mises Failure Theory
Where a ductile material stops being safe: the yield envelope plotted against the principal stresses.

📈 See the plot
|
♨️ Thermodynamics
|
Ideal Rankine Cycle
理想ランキンサイクルの熱効率
Heat efficiency η of the basic steam cycle, with steam properties from pyromat.

|
|
Rankine Reheat Cycle
再熱ランキンサイクル
The same cycle with steam reheated between turbine stages, including turbine exit steam quality.

|
|
Ideal Refrigeration Cycle
冷凍サイクルの成績係数 / 動作係数 (COP)
Coefficient of performance of an R-134a vapour-compression cycle, on the p-h diagram.

|
🎯 Dynamics & vibration
|
Projectile Motion
斜方投射
Trajectory, range and peak height for any launch angle and speed.

📈 See the plot
|
|
Damped Vibration
不足減衰 (under-damped) · 過減衰 (over-damped)
Under-damped and over-damped response of a vibrating system, side by side.

|
|
Numerical Force, Velocity & Acceleration
数値解析による力・速度・加速度の計算
Euler’s method, the trapezoidal rule and Simpson’s rule applied to motion data.

|
🧮 Engineering math
|
Every calculation lives in a single notebook.

- Interpolation (線形補間)
- Numerical integration with the trapezoidal rule and Simpson’s rule (台形公式とシンプソン則)
- Matrix addition, subtraction and multiplication (行列の足し算・引き算・掛け算)
- Eigenvalues and eigenvectors (固有値・固有ベクトル)
|
✅ Status

All topics listed above are complete.
🎨 Credits
The pixel-art animations are made with Pixelbolt (MIT licence, copy in assets/pixelbolt/LICENSE). They are illustrations of each topic, not output from the notebooks. The banner at the top is a new scene composed from Pixelbolt’s boiling pot and steam vent with a gear train added.
Code and notebooks are released under the repository LICENSE.
评论