Clear[u1, u2, g, f, r]
ρ := 1
μ := 1.5
f[x_] := 
      Sin[x] /; 2  π ≤ x ≤ 
          3  π
f[x_] := 
      0 /; (x > 3  π || x < 2  π)
r[t_] := 
      If[t ≥ 1, ((ρ*f[t])/(ρ + μ)), 
        0]
u1[x_] := 
      If[(0 ≤ x && 
            x - t ≥ 0), (1/2) (f[x + t] + f[x - t]), 
        0]
u2[x_] := 
      If[(0 ≤ x && 
            x - t ≤ 
              0), (1/2) (f[x + t] - f[-x + t]) + r[t - x], 
        0]
g[x_] := u1[x] + u2[x]
\(a[x_] := 
      Plot[g[x], {x, 0, 20}, 
        AspectRatio -> Automatic, 
	
        PlotStyle -> {RGBColor[1, 0.7, 0], 
            Thickness[0.005]}, 
	
        PlotRange -> {{\(-2\), 20}, {\(-7\), 3}}, 
        DisplayFunction -> Identity]\)
L1[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{0, -6.5}, {0, r[t]}}]}], 
        DisplayFunction -> Identity]
L2[t_] := 
      Show[Graphics[{RGBColor[0, 1, 1], 
            Polygon[{{-0.5, -4.8 + r[t]}, {0.5, -4.8 + 
                    r[t]}, {0.5, -5.9}, {-0.5, -5.9}}]}], 
        DisplayFunction -> Identity]
L3[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{-0.5, -4.8 + r[t]}, {0.5, -4.8 + r[t]}}]}], 
        DisplayFunction -> Identity]
L4 = 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{-0.5, -2.3}, {-0.5, -5.9}}]}], 
        DisplayFunction -> Identity]
L5 = 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{-0.5, -5.9}, {0.5, -5.9}}]}], 
        DisplayFunction -> Identity]
L6 := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{0.5, -5.9}, {0.5, -2.3}}]}], 
        DisplayFunction -> Identity]
c[x_] := 
      Show[L1[t], L2[t], L3[t], L4, L5, L6, 
        PlotRange -> {{-3, 3}, {-6.5, 3}}, 
        DisplayFunction -> Identity]
d[x_] := 
      Show[{a[x], c[x]}, 
        DisplayFunction -> $DisplayFunction]
Table[d[x], {t, 0, 30, 0.2}]

Clear[u1, u2, g, f, r]
ρ := 1
μ := 1000
f[x_] := 
      Sin[x] /; 2  π ≤ x ≤ 
          3  π
f[x_] := 
      0 /; (x > 3  π || x < 2  π)
r[t_] := 
      If[t ≥ 1, ((ρ*f[t])/(ρ + μ)), 
        0]
u1[x_] := 
      If[(0 ≤ x && 
            x - t ≥ 0), (1/2) (f[x + t] + f[x - t]), 
        0]
u2[x_] := 
      If[(0 ≤ x && 
            x - t ≤ 
              0), (1/2) (f[x + t] - f[-x + t]) + r[t - x], 
        0]
g[x_] := u1[x] + u2[x]
\(a[x_] := 
      Plot[g[x], {x, 0, 20}, 
        AspectRatio -> Automatic, 
	
        PlotStyle -> {RGBColor[1, 0.7, 0], 
            Thickness[0.005]}, 
	
        PlotRange -> {{\(-2\), 20}, {\(-7\), 3}}, 
        DisplayFunction -> Identity]\)
L1[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{0, -6.5}, {0, r[t]}}]}], 
        DisplayFunction -> Identity]
L2[t_] := 
      Show[Graphics[{RGBColor[0, 1, 1], 
            Polygon[{{-0.5, -4.8 + r[t]}, {0.5, -4.8 + 
                    r[t]}, {0.5, -5.9}, {-0.5, -5.9}}]}], 
        DisplayFunction -> Identity]
L3[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{-0.5, -4.8 + r[t]}, {0.5, -4.8 + r[t]}}]}], 
        DisplayFunction -> Identity]
L4 = 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{-0.5, -2.3}, {-0.5, -5.9}}]}], 
        DisplayFunction -> Identity]
L5 = 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{-0.5, -5.9}, {0.5, -5.9}}]}], 
        DisplayFunction -> Identity]
L6 := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{0.5, -5.9}, {0.5, -2.3}}]}], 
        DisplayFunction -> Identity]
c[x_] := 
      Show[L1[t], L2[t], L3[t], L4, L5, L6, 
        PlotRange -> {{-3, 3}, {-6.5, 3}}, 
        DisplayFunction -> Identity]
d[x_] := 
      Show[{a[x], c[x]}, 
        DisplayFunction -> $DisplayFunction]
Table[d[x], {t, 0, 30, 0.2}]

Clear[u1, u2, g, f, r]
ρ := 1
μ := 0.0001
f[x_] := 
      Sin[x] /; 2  π ≤ x ≤ 
          3  π
f[x_] := 
      0 /; (x > 3  π || x < 2  π)
r[t_] := 
      If[t ≥ 1, ((ρ*f[t])/(ρ + μ)), 
        0]
u1[x_] := 
      If[(0 ≤ x && 
            x - t ≥ 0), (1/2) (f[x + t] + f[x - t]), 
        0]
u2[x_] := 
      If[(0 ≤ x && 
            x - t ≤ 
              0), (1/2) (f[x + t] - f[-x + t]) + r[t - x], 
        0]
g[x_] := u1[x] + u2[x]
\(a[x_] := 
      Plot[g[x], {x, 0, 20}, 
        AspectRatio -> Automatic, 
	
        PlotStyle -> {RGBColor[1, 0.7, 0], 
            Thickness[0.005]}, 
	
        PlotRange -> {{\(-2\), 20}, {\(-7\), 3}}, 
        DisplayFunction -> Identity]\)
L1[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{0, -6.5}, {0, r[t]}}]}], 
        DisplayFunction -> Identity]
L2[t_] := 
      Show[Graphics[{RGBColor[0, 1, 1], 
            Polygon[{{-0.5, -4.8 + r[t]}, {0.5, -4.8 + 
                    r[t]}, {0.5, -5.9}, {-0.5, -5.9}}]}], 
        DisplayFunction -> Identity]
L3[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{-0.5, -4.8 + r[t]}, {0.5, -4.8 + r[t]}}]}], 
        DisplayFunction -> Identity]
L4 = 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{-0.5, -2.3}, {-0.5, -5.9}}]}], 
        DisplayFunction -> Identity]
L5 = 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{-0.5, -5.9}, {0.5, -5.9}}]}], 
        DisplayFunction -> Identity]
L6 := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.007], 
            Line[{{0.5, -5.9}, {0.5, -2.3}}]}], 
        DisplayFunction -> Identity]
c[x_] := 
      Show[L1[t], L2[t], L3[t], L4, L5, L6, 
        PlotRange -> {{-3, 3}, {-6.5, 3}}, 
        DisplayFunction -> Identity]
d[x_] := 
      Show[{a[x], c[x]}, 
        DisplayFunction -> $DisplayFunction]
Table[d[x], {t, 0, 30, 0.2}]