Consider the problem of finding a curve that connects two points A and B, such that an object rolling down the curve from A to B takes the least amount of time to make the trip
This is called the Brachistochrone problem, a classic problem in the Calculus of Variations.
This repository contains functions which will let you set up your own version of the problem, sketch out your own solution using your mouse, then generate a 3D-printable ramp to roll marbles down in order to test your design.
A static non-interactive version of the notebook can be found here.
Run Ramps.ipynb
using IPython Notebook (with the --pylab=inline argument) to
interactively walk through the process.
The functions of this notebook require:
- repository of source files associated with this notebook
- ipython
- numpy
- scipy
- matplotlib
- solidpython
- OpenCV, with python
cv2
bindings - OpenSCAD
The python libraries can be installed by running pip install -r requirements.txt
within the directory that contains this notebook file.
The computer vision library OpenCV can be installed by following their installation instructions. OpenCV can be tricky to install. I'd recommend using a system package manager like apt-get or homebrew if possible. On Windows, the easiest way to get started with OpenCV and Python is to use either Python(x,y) or the Anaconda Python Distribution
The CAD program OpenSCAD can be downloaded from here. This notebook involves calling OpenSCAD from the command line. To make this work, the path to the OpenSCAD binary will need to be given in the first code cell of the notebook.