Doppler Effect

2004/1/16 Takuichi Hirano (Tokyo Institute of Technology)

Eiconal

mach = 0.8;
v = 
        1.0;
c = 
        v/mach;
sizex = 
        1.0;
dt = 
        0.1;
dx = 
        0.075;
n = 
        sizex/dx;
xc[i_] := 
        v*dx*i;
r[i_, t_] := c*(t - xc[i]/v);

gwavefront[t_]:=Module[{},
  
gcirc = {}; 
Do[
If[
                  r[i, t] > 0, 
gcirc = 
                    Append[gcirc, 
{Circle[{xc[i], 0.5}, 
                          r[i, t]]}]], 
{i, 1, 
                  n}]; 
Graphics[{gcirc}]
];

src[t_] := 
          Module[{t0}, 
t0 = 
              Mod[t, (dx/v)]; 
If[
              Abs[t0] < 
                dt/10, 
{Graphics[{Circle[{v*t, 0.5}, 
                      0.02], {RGBColor[1, 0, 0], 
                      Disk[{v*t, 0.5}, 
                        0.02]}}]}, 
Graphics[{Circle[{v*t, 
                      0.5}, 0.02]}]
]
];

Do[
Show[{src[t], 
              gwavefront[t]}, 
ImageSize -> {160, 
                160}, 
AspectRatio -> 
              Automatic, 
PlotRange -> {{0, 
                  sizex}, {0, 
                  sizex}}
];
, {t, 0, 
          sizex/v, dt/10. }
];
Null