Wolfram Research

Function Repository Resource:

ChladniFigure

Source Notebook

Compute Chladni figures

Contributed by: Enrique Zeleny

ResourceFunction["ChladniFigure"][x,y,L,m,n]

gives Chladni figures.

Details and Options

Chladni figures are wavy lines produced by scattered salt or sand on an elastic material of a given shape, possibly constrained at the edges or at a point in the center, and forced to vibrate with a violin bow. The modes of vibration can be identified because these small particles end up in the places of zero vibration, which happens at those parts of the surface that are stationary, namely at the nodes of vibration, where n harmonics cancel.
For the 2D solution, the condition cos(n π x/L) cos(m π y/L)-cos(m π x/L) cos(n π y/L)=0 holds, for integer values m and n. The solution is uninteresting for n=m, and for gcd(n1,m2) = gcd(n2,m1), the plots are the same.

Examples

Basic Examples

Compute a value at a point:

In[1]:=
ResourceFunction["ChladniFigure"][.5, .75, 1., 2, 1]
Out[1]=

Plot only contours:

In[2]:=
ContourPlot[
 Evaluate[ResourceFunction["ChladniFigure"][x, y, 1., 2., 1.] == 0], {x, -1., 1.}, {y, -1., 1.}]
Out[2]=

With full color:

In[3]:=
ContourPlot[
 Evaluate[ResourceFunction["ChladniFigure"][x, y, 1., 1., 2.]], {x, -1., 1.}, {y, -1., 1.}, ColorFunction -> "Rainbow"]
Out[3]=

Make a 3Dplot:

In[4]:=
Plot3D[Evaluate[
  ResourceFunction["ChladniFigure"][x, y, 1., 1., 2.]], {x, -1., 1.}, {y, -1., 1.}, ColorFunction -> "Rainbow", MeshFunctions -> {#3 &}]
Out[4]=

Get a higher resolution:

In[5]:=
ContourPlot[
 Evaluate[ResourceFunction["ChladniFigure"][x, y, 1., 2., 3.]], {x, -2., 2.}, {y, -2., 2.}, ColorFunction -> "Rainbow", Contours -> 5, MaxRecursion -> 3]
Out[5]=

Possible Issues

For m=n:

In[6]:=
Module[{L = 1., m = 1., n = 1.}, ContourPlot[
  Evaluate[ResourceFunction["ChladniFigure"][x, y, L, m, n]], {x, -1.,
    1.}, {y, -1., 1.}, ColorFunction -> "Rainbow"]]
Out[6]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information