Interactive three-dimensional simulations & visualizations

Visualizing the beauty in physics and mathematics


Project maintained by zhendrikse Hosted on GitHub Pages — Theme by mattgraham

Somehow it’s okay for people to chuckle about not being good at math. Yet, if I said “I never learned to read,” they’d say I was an illiterate dolt. — Neil deGrasse Tyson


Mathematics


Dynamic surface and contour plots for $f(x, y) \rightarrow \mathbb{R}$


The application below let’s one render functions in two real variables $x$ and $y$. The color-coding below is associated with the height of the object and is added purely for aesthetical purposes.

Multivariate functions    
Surface plot for $f(x, y) = \sin(\pi x)\cos(\pi y)$.
Complex functions

Contour plot for $f(x, y) = \sin(\sqrt{x^2+y^2})$.

Dynamic surface and contour plots for $f(z) \rightarrow \mathbb{C}$


The colors in the 3D renderings of complex functions represent the phase of the complex function values, hence colors can’t be modified by the user.

Complex functions
Surface plot for $f(z) = \exp(-z^2)$.
Complex functions
Contour plot for $f(z) = log(z)$.

Scalar fields $f(x, y, z) \rightarrow \mathbb{R}$ and vector fields $f(x, y, z) \rightarrow \mathbb{R}^3$


A field is an algebraic structure that is defined as a non-empty collection with two (binary) operations: addition, $a+b$, and multiplication, $a\cdot b$.

These operations are accurately defined by the conditions they must suffice, but roughly speaking they should behave similarly as we know them already from the rational numbers $\mathbb{Q}$ and real numbers $\mathbb{R}$.

The applications below render two such fields, that are abundant in physics, namely scalar fields and vector fields. The former assigns a value (scalar) to every point in space (e.g. the temperature in a room), the latter a vector (e.g. the force and direction of the wind).

Vector field
Rendering of three-dimensional vector field and implied flow.
Divergence and curl
Visualization of divergence and curl.

Scalar field
Rendering a temperature distribution as a 3D scalar field.


Twisted torus
Surface plot of twisted torus. For more surfaces, visit the Math Art Gallery.
Self-intersecting disk
Contour plot of self-intersecting disk. For more surfaces, visit the Math Art Gallery.

Double shapes


Double torus
Double torus surface plot. For more surfaces, visit the Math Art Gallery.
Klein's bottle
Klein's bottle contour plot. For more surfaces, visit the Math Art Gallery.

Polar coordinates & numeric integration


Polar coordinates not only enable us to much more easily solve spherically symmetric problems in both physics and mathematics, they also provide us a way to parameterize complex topological surfaces, such as Klein's bottle.

Polar coordinates
Polar coordinates frequently simplify the tackling of rotationally symmetric problems.
Numeric integration
Illustration of using polar coordinates when numerically integrating spherically symmetric functions.

Cellular automata


Conway's game of life
Conway's game of life.

Mandelbrot & Julia sets


Mandelbrot set
Check out this page and learn about the difference between Mandelbrot and Julia sets!

Fractals


Dragon curve fractal
Generation of two-dimensional fractal shapes.
Vicsek fractal
The Vicsek fractal generated using a chaos game.

Sierpiński's pyramid & Menger's sponge


Sierpinski pyramid
Sierpiński pyramid is a 3D analogue of the Sierpiński triangle
Menger sponge
Menger Sponge is another famous three-dimensional fractal curve.

Lorenz & Rössler attractors


Lorenz attractor
VPython program that renders the Lorenz attractor.
Rössler attractor
VPython program that renders the Rössler attractor.

Fractal terrains


Fractal terrain    
Fractal terrain surface.
Fractal terrain
Fractal terrain contour plot.

Dalton board and harmonograph


Galton board
A Galton board that demonstrates the binomial distribution.
Harmonograph simulator
A three-dimensional harmonograph simulator.

Spherical harmonics


Spherical harmonics
Spherical harmonics play an important role in both physics and mathematics.
Spherical harmonics
Spherical harmonics play an important role in both physics and mathematics.

⇓ Python code snippet for plotting spherical harmonics ⇑ The spherical harmonic function is given by $$\begin{cases} \rho & = 4 \cos^2(2\theta)\sin^2(\phi) \\ \theta & = [0, 2\pi] \\ \phi & = [0, \pi] \end{cases}$$ This can then easily be translated to the graphing software, that can also be seen in the mathematics section on this page:
def sphere_harmonic():
    theta = np.linspace(-1.1 * pi, pi, 100)
    phi = np.linspace(0, pi, 100)
    U, V = np.meshgrid(theta, phi)
R1 = np.cos(U.multiply(2)).multiply(np.cos(U.multiply(2))) R2 = np.sin(V).multiply(np.sin(V)) R = R1.multiply(R2).multiply(4)
X = np.sin(U).multiply(np.cos(V)).multiply(R) Y = np.sin(U).multiply(np.sin(V)).multiply(R) Z = np.cos(U).multiply(R) return X, Y, Z, None, None

Numerical methods


Numerical methods
Comparison between an exact solution and those from various numerical methods, such as Euler method and Runge-Kutta methods (2 and 4).

References


Computational Physics

Mathematics


Share on: