9
$\begingroup$

I have only recently discovered Mathematica so I am quite weak with it, posting here as it seems to be the most comprehensive forum online.

My question is entirely based off a previous very high quality post namely

Circular membrane vibration simulation

I decided to make a new post for this since that post is nearly 6 years old now.

In the answers user 'Jens' describes the code for constructing the traditional Chladni Patterns for a circular membrane as the follows.

fXY[n_, k_][x_?NumericQ, y_?NumericQ] := 
 BesselJ[n, k Sqrt[x^2 + y^2]] Cos[n ArcTan[y, x]]

wavePattern[n_, j_] := 
 Module[{k0 = N[BesselJZero[n, j]]}, 
  DensityPlot[fXY[n, k0][x, y], {x, -1.1, 1.1}, {y, -1.2, 1.1}, 
   RegionFunction -> Function[{x, y}, x^2 + y^2 < 1], 
   ColorFunction -> 
    Function[{x}, 
     Blend[{White, Darker@Brown, White}, 2 ArcTan[10 x]/Pi + .5]], 
   ColorFunctionScaling -> False, PlotPoints -> 100, 
   MaxRecursion -> 0, 
   Epilog -> 
    Inset[Grid[{{"n", n}, {"j", j}}, Frame -> All], {-.9, .9}], 
   BaseStyle -> {FontFamily -> "Arial"}]]

Show[GraphicsGrid@Table[wavePattern[m, n], {m, 0, 2}, {n, 1, 3}], 
 ImageSize -> 700]

which outputs the following

enter image description here

I want to know how I can be able to superimpose (by adding) the values of say wavePattern[2, 2] and wavePattern[3, 0]. And plot the values that occur, in a similar way. Which will displays the Chladni Pattern when both the modes are occurring simultaneously.

The reason I'm asking this question (not relevant to the question) : I recently saw a video lecture that claimed the seemingly non traditional (complex) Chladni patterns that are observed by modern experiments that use tone generators are actually the result of the superimposition of the basic modes that are predicted by the theoretical formula. This has me highly intrigued as I had seen nearly all experiments show the formation of Chladni patterns that don't match the "basic" modes. This seems to be a ingeniously simple solution which I seem to have missed and couldn't find anywhere else online. I want to verify it by using Mathematica, and since there already exists some great code I'm hoping someone here can help me tinker it in the form I am looking to do.

$\endgroup$
8
$\begingroup$

Something like that (adding two patterns)?

fXY[n_, k_][x_?NumericQ, y_?NumericQ] := 
 BesselJ[n, k Sqrt[x^2 + y^2]] Cos[n ArcTan[y, x]]

addPattern[n1_, j1_, n2_, j2_] := 
 Module[{k1 = N[BesselJZero[n1, j1]], k2 = N[BesselJZero[n2, j2]]}, 
  DensityPlot[
   fXY[n1, k1][x, y] + fXY[n2, k2][x, y], {x, -1.1, 1.1}, {y, -1.2, 
    1.1}, RegionFunction -> Function[{x, y}, x^2 + y^2 < 1], 
   ColorFunction -> 
    Function[{x}, 
     Blend[{White, Darker@Brown, White}, 2 ArcTan[10 x]/Pi + .5]], 
   ColorFunctionScaling -> False, PlotPoints -> 100, 
   MaxRecursion -> 0, 
   Epilog -> 
    Inset[Grid[{{"n", n1, n2}, {"j", j1, j2}}, 
      Frame -> All], {-.9, .9}], 
   BaseStyle -> {FontFamily -> "Arial"}]]

Example 1:

Show[addPattern[2, 2, 0, 3], ImageSize -> 250]

enter image description here

Example 2:

Show[addPattern[2, 2, 1, 3], ImageSize -> 250]

enter image description here

$\endgroup$
1
  • $\begingroup$ Wow that's great I think this is exactly what I was looking for, plus its really easy to just add a third argument and make it add 3 instances at once too. Thanks a lot! $\endgroup$ Dec 11 '20 at 1:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.