Sonic Wave

Takuichi Hirano

n = 30;
radius = (1. /n)/5;
λ = 0.25;
k = ((2*π)/λ);
f = 1. ;
ω = 2*π*f;
a = (1. /n);
Particle[t_, i_, j_] := 
        Module[{}, 
xc = (1. /n)*
              i; 
yc = (1. /n)*
              j; 
r = (Sqrt[(((xc - 1/2))^2) + (((yc - 1/2))^2)]); 
If[
            r == 0, 
dx = 0; 
dy = 
              0;
, 
NVecR = {xc - 1/2, 
                  yc - 1/2}/
                r; 
dx = (a/(Sqrt[r/(1. /n)]))*
                Sin[ω*t - k*r]*
                NVecR[[1]]; 
dy = (a/(Sqrt[r/(1. /n)]))*Sin[ω*t - k*r]*
                NVecR[[2]];
]; 
x = 
            xc + dx; 
y = 
            yc + dy; 
Disk[{x, y}, 
            radius]
];
\(\(Do[
GParticles = 
          Graphics[{
RGBColor[1, 0, 
                1], 
Table[
                Particle[t, i, j], {i, 0, n}, {j, 0, 
                  n}], 
{RGBColor[0, 0, 
                  0], 
Text[
                  StyleForm["T. Hirano", FontSize -> 14, 
                    FontWeight -> "Bold"], {1, 0}, {1, \(-1\)}, {1, 
                    0}]}
}
]; 
Show[
          GParticles, 
PlotRange -> {{0, 1}, {0, 
                1}}, 
AspectRatio -> 
            Automatic]
, {t, 0, 1.  - 1. /100, 
          1. /8}
];\)\)