Examples

The examples folder holds Python runscripts that each solve a particular physics or math problem.

cherenkov.py

Simulates a supersonic (or superluminal) point source moving through a medium at a speed greater than c.

_images/cherenkov.png

diffractionGrating.py

Simulates the transmission of an acoustic wave through a diffraction grating.

_images/diffraction.png

doubleSlit.py

Simulates a double slit experiment.

_images/doubleSlit.gif

imageToStringArt.py

Creates the instructions for (and previews) an image made from strings stretched across a wheel with a chosen number of pins.

_images/sa.png

phase_coupling.py

Simulates harmonic oscillators coupled via a Kuramoto coupling parameter. This example is 10,000 oscillators (100x100) initialized with a random phase and coupling strength of 20%.

_images/phase.gif

plinko.py

Simulates the Plinko game.

_images/plinko.gif

reactionDiffusion.py

Simulates the destruction of chemical mixtures in a rock-paper-scissors-like reaction setup, where A->B->C->A. In this case, A is blue, B is green, and C is red.

_images/rps.gif

tsunami.py

Simulates a tsunami generated by a point source off the San Francisco Bay.

_images/waves.png

voronoi_diag.py

Originally a test of the Voronoi mesh generator, this script shows how to use it to generate a Voronoi diagram.

_images/voronoi.png

This particular example is the Voronoi mesh for a glass distribution generated by GlassNodeGenerator2d.

waveLogo.py

Simulates acoustic waves inside a region with Dirichlet boundary conditions arranged in a unique fashion.

_images/logo_test.png

Simple Test Cases

Many of the Python scripts inside the tests folder stress single components of Yggdrasil, or a small subset of them. For instance, waveBox.py tests the acoustic wave solver with a single oscillatory source in the center of a box with two openings on either end (using Dirichlet boundaries to create the box).