This repository is a reproducible Jupyter Notebook project for exploring the brachistochrone (curve of fastest descent):
- derive and numerically validate the classical cycloid trajectory,
- compare classical and relativistic speed models,
- export a shareable static HTML report.
brachistochrone.ipynb: main analysis notebook (derivations, numerical experiments, plots, tables).export_html.sh: one-click notebook-to-HTML export script with MathJax compatibility patching.brachistochrone.html: exported static report page.
Recommended environment:
- Python 3.10+
- Linux / macOS / WSL (Windows users can run equivalent commands in PowerShell/Git Bash)
Main dependencies:
numpypandasmatplotlibscipyjupyter/nbconvert
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install numpy pandas matplotlib scipy notebook nbconvertjupyter notebookOpen brachistochrone.ipynb and run all cells.
export_html.shcalls.venv/bin/jupyterby default, so create.venvfirst.
chmod +x export_html.sh
./export_html.shOptional explicit input/output:
./export_html.sh brachistochrone.ipynb brachistochrone.htmlCompared with calling jupyter nbconvert directly, the script also:
- exports with embedded images (
--embed-images) for easier sharing, - patches MathJax setup to improve formula rendering reliability across browsers.
brachistochrone.html is a static file and can be hosted anywhere.
- Push this repo to GitHub.
- Enable Pages in repository settings.
- Choose a publish source (e.g., branch root or
docs/). - Make sure
brachistochrone.htmlis served (or rename it toindex.html).
sudo mkdir -p /var/www/brachistochrone
sudo cp brachistochrone.html /var/www/brachistochrone/index.htmlMinimal server block:
server {
listen 80;
server_name your-domain.com;
root /var/www/brachistochrone;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}Apply config:
sudo nginx -t
sudo systemctl reload nginxFor team workflows (e.g., GitHub Actions):
- execute the notebook and export HTML on every main branch update,
- publish the generated report automatically (Pages or object storage).
Best practices:
- pin dependency versions,
- fail-fast on notebook/export errors,
- verify HTML artifact existence before deployment.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install notebook nbconvert numpy pandas matplotlib scipyUse ./export_html.sh instead of raw nbconvert to include MathJax patching.
Set a CJK-compatible Matplotlib font in the notebook and install that font on the runtime machine.
.
├── notebooks/
│ └── brachistochrone.ipynb
├── reports/
│ └── brachistochrone.html
├── scripts/
│ └── export_html.sh
├── requirements.txt
└── README.md
# 1) bootstrap
python3 -m venv .venv && source .venv/bin/activate
python -m pip install -U pip
python -m pip install numpy pandas matplotlib scipy notebook nbconvert
# 2) run notebook
jupyter notebook brachistochrone.ipynb
# 3) export report
chmod +x export_html.sh && ./export_html.sh