Reza Malek-Madani

Reflection - Transmission

This program shows the evolution of an initial wave packet in
a medium with a discontinuous sound speed. The sound speed
discontinuity occurs at x=0. The program plots the snapshots
of the wave profile at various times when the speed of propagation to the left of x=0 is less than its value to the right.

Case 1: c1 < c2

{a, b, c, d} = {-6, 6, -2, 2};
f[x_]:=If[-6<x<-4,(x+5)^4-2(x+5)^2+1,0]; (* Initial Wave *)
R[x_,c1_,c2_]:=(c2-c1)/(c1+c2)*f[-x]; (* Reflected Part *)
T[x_,c1_,c2_]:=2*c2/(c1+c2)*f[c1/c2*x]; (* Transmitted Part *)
u[x_,t_,c1_,c2_]:=If[x<0,f[x-c1*t]+R[x+c1*t,c1,c2],T[x-c2*t,c1,c2]];
Do[tt=ToString[t]; header=StringJoin["t = ", tt];
Plot[Evaluate[u[x,t,1,2]], {x, a, b}, PlotLabel->header], {t, 0, 7, 0.2}];

[Graphics:trans1gr2.gif][Graphics:trans1gr1.gif][Graphics:trans1gr2.gif][Graphics:trans1gr3.gif][Graphics:trans1gr2.gif][Graphics:trans1gr4.gif][Graphics:trans1gr2.gif][Graphics:trans1gr5.gif][Graphics:trans1gr2.gif][Graphics:trans1gr6.gif][Graphics:trans1gr2.gif][Graphics:trans1gr7.gif][Graphics:trans1gr2.gif][Graphics:trans1gr8.gif][Graphics:trans1gr2.gif][Graphics:trans1gr9.gif][Graphics:trans1gr2.gif][Graphics:trans1gr10.gif][Graphics:trans1gr2.gif][Graphics:trans1gr11.gif][Graphics:trans1gr2.gif][Graphics:trans1gr12.gif][Graphics:trans1gr2.gif][Graphics:trans1gr13.gif][Graphics:trans1gr2.gif][Graphics:trans1gr14.gif][Graphics:trans1gr2.gif][Graphics:trans1gr15.gif][Graphics:trans1gr2.gif][Graphics:trans1gr16.gif][Graphics:trans1gr2.gif][Graphics:trans1gr17.gif][Graphics:trans1gr2.gif][Graphics:trans1gr18.gif][Graphics:trans1gr2.gif][Graphics:trans1gr19.gif][Graphics:trans1gr2.gif][Graphics:trans1gr20.gif][Graphics:trans1gr2.gif][Graphics:trans1gr21.gif][Graphics:trans1gr2.gif][Graphics:trans1gr22.gif][Graphics:trans1gr2.gif][Graphics:trans1gr23.gif][Graphics:trans1gr2.gif][Graphics:trans1gr24.gif][Graphics:trans1gr2.gif][Graphics:trans1gr25.gif][Graphics:trans1gr2.gif][Graphics:trans1gr26.gif][Graphics:trans1gr2.gif][Graphics:trans1gr27.gif][Graphics:trans1gr2.gif][Graphics:trans1gr28.gif][Graphics:trans1gr2.gif][Graphics:trans1gr29.gif][Graphics:trans1gr2.gif][Graphics:trans1gr30.gif][Graphics:trans1gr2.gif][Graphics:trans1gr31.gif][Graphics:trans1gr2.gif][Graphics:trans1gr32.gif][Graphics:trans1gr2.gif][Graphics:trans1gr33.gif][Graphics:trans1gr2.gif][Graphics:trans1gr34.gif][Graphics:trans1gr2.gif][Graphics:trans1gr35.gif][Graphics:trans1gr2.gif][Graphics:trans1gr36.gif][Graphics:trans1gr2.gif][Graphics:trans1gr37.gif]

[Graphics:trans1gr2.gif]












[Graphics:trans1gr38.gif]













Next, all of the above profiles are superimposed.

Plot[Evaluate[Table[u[x,t,1, 2], {t, 0, 7, 0.2}]], {x, a, b}, PlotLabel->"c1 < c2"];

[Graphics:trans1gr2.gif][Graphics:trans1gr39.gif]

Case 2: c1 > c2

Do[tt=ToString[t]; header=StringJoin["t = ", tt];
Plot[Evaluate[u[x,t,2, 1]], {x, a, b}, PlotLabel->header], {t, 0, 5, 0.2}];

[Graphics:trans1gr2.gif][Graphics:trans1gr40.gif][Graphics:trans1gr2.gif][Graphics:trans1gr41.gif][Graphics:trans1gr2.gif][Graphics:trans1gr42.gif][Graphics:trans1gr2.gif][Graphics:trans1gr43.gif][Graphics:trans1gr2.gif][Graphics:trans1gr44.gif][Graphics:trans1gr2.gif][Graphics:trans1gr45.gif][Graphics:trans1gr2.gif][Graphics:trans1gr46.gif][Graphics:trans1gr2.gif][Graphics:trans1gr47.gif][Graphics:trans1gr2.gif][Graphics:trans1gr48.gif][Graphics:trans1gr2.gif][Graphics:trans1gr49.gif][Graphics:trans1gr2.gif][Graphics:trans1gr50.gif][Graphics:trans1gr2.gif][Graphics:trans1gr51.gif][Graphics:trans1gr2.gif][Graphics:trans1gr52.gif][Graphics:trans1gr2.gif][Graphics:trans1gr53.gif][Graphics:trans1gr2.gif][Graphics:trans1gr54.gif][Graphics:trans1gr2.gif][Graphics:trans1gr55.gif][Graphics:trans1gr2.gif][Graphics:trans1gr56.gif][Graphics:trans1gr2.gif][Graphics:trans1gr57.gif][Graphics:trans1gr2.gif][Graphics:trans1gr58.gif][Graphics:trans1gr2.gif][Graphics:trans1gr59.gif][Graphics:trans1gr2.gif][Graphics:trans1gr60.gif][Graphics:trans1gr2.gif][Graphics:trans1gr61.gif][Graphics:trans1gr2.gif][Graphics:trans1gr62.gif][Graphics:trans1gr2.gif][Graphics:trans1gr63.gif][Graphics:trans1gr2.gif][Graphics:trans1gr64.gif][Graphics:trans1gr2.gif][Graphics:trans1gr65.gif]

When we superimpose all of the above profiles in Case 2, we get

Plot[Evaluate[Table[u[x,t,2, 1], {t, 0, 5, 0.2}]], {x, a, b},
PlotLabel->"c1 > c2"];

[Graphics:trans1gr2.gif][Graphics:trans1gr66.gif]
go to Top