Clear[u1, u2, g, f, r]
ρ := 1
m := 1
k := 1
ξ := 0.2
f[x_] := 
      Sin[x] /; 2  π ≤ x ≤ 
          3  π
f[x_] := 
      0 /; (x > 3  π || x < 2  π)
r[x_] := 
      0 /; 0 ≤ x ≤  
          2  π
r[x_] := (ρ ((E^((((2 π - x) (ξ + ρ))/(2 m)))) (-k + 
                        m) (Sqrt[-4 k m + (((ξ + ρ))^2)]) Cosh[(((2 π - x) (Sqrt[-4 k m + (((ξ + ρ))^2)]))/(2 m))] + (Sqrt[-4 k m + (((ξ + ρ))^2)]) ((k - m) Cos[x] + (ξ + ρ) Sin[
                            x]) + (E^((((2 π - x) (ξ + ρ))/(2 m)))) (k + 
                        m) (ξ + ρ) Sinh[(((2 π - x) (Sqrt[-4 k m + (((ξ + ρ))^2)]))/(2 m))]))/(((((k - m))^2) + (((ξ + ρ))^2)) (Sqrt[-4 k m + (((ξ + ρ))^2)])) /; 2  π < x ≤ 3  π
r[x_] := (ρ (-2 (Cosh[(((3 π - x) (ξ + ρ))/(2 m))] + 
                        Sinh[(((3 π - x) (ξ + ρ))/(2 m))]) ((k - 
                              m) (Sqrt[-4 k m + (((ξ + ρ))^2)]) Cosh[(((-3 π + x) (Sqrt[-4 k m + (((ξ + ρ))^2)]))/(2 m))] + (k + 
                              m) (ξ + ρ) Sinh[(((-3 π + x) (Sqrt[-4 k m + (((ξ + ρ))^2)]))/(2 m))]) - 
                  2 (E^((((2 π - x) (ξ + ρ))/(2 m)))) ((k - 
                              m) (Sqrt[-4 k m + (((ξ + ρ))^2)]) Cosh[(((-2 π + x) (Sqrt[-4 k m + (((ξ + ρ))^2)]))/(2 m))] + (k + 
                              m) (ξ + ρ) Sinh[(((-2 π + x) (Sqrt[-4 k m + (((ξ + ρ))^2)]))/(2 m))])))/(2 ((((k - m))^2) + (((ξ + ρ))^2)) (Sqrt[-4 k m + (((ξ + ρ))^2)])) /; 
        3  π < x
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 -> {{\(-1\), 20}, {\(-5\), 2}}, 
        DisplayFunction -> Identity]\)
b[x_] := 
      Show[Graphics[Disk[{0, r[t]}, 0.2], 
          AspectRatio -> 
            Automatic, 
       PlotRange -> {{-1, 20}, {-5, 2}}], 
        DisplayFunction -> Identity]
L1[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0, r[t]}, {0, -0.5 + r[t]}}]}], 
        DisplayFunction -> Identity]
L2[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.8, -0.5 + r[t]}, {0.8, -0.5 + r[t]}}]}], 
        DisplayFunction -> Identity]
L3[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.25, -0.5 + r[t]}, {-0.25, -1.0 + 
                    r[t]}}]}], 
        DisplayFunction -> Identity]
L4[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.35, -1.0 + r[t]}, {0, -1.2 + 
                    (11/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L5[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0, -1.2 + (11/12)*r[t]}, {-0.5, -1.4 + 
                    (9/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L6[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.5, -1.4 + (9/12)*r[t]}, {0, -1.6 + 
                    (7/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L7[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0, -1.6 + (7/12)*r[t]}, {-0.5, -1.8 + 
                    (5/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L8[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.5, -1.8 + (5/12)*r[t]}, {0, -2.0 + 
                    (3/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L9[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0, -2.0 + (3/12)*r[t]}, {-0.5, -2.2 + 
                    (1/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L10[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.5, -2.2 + 
                    (1/12)*r[t]}, {-0.15, -2.4}}]}], 
        DisplayFunction -> Identity]
L11[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.25, -2.4}, {-0.25, -2.6}}]}], 
        DisplayFunction -> Identity]
L12[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.25, -2.6}, {-0.25, -2.9}}]}], 
        DisplayFunction -> Identity]
L13[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.8, -2.9}, {-0.8, -2.9}}]}], 
        DisplayFunction -> Identity]
c[x_] := 
      Show[L1[t], L2[t], L3[t], L4[t], L5[t], L6[t], L7[t], L8[t], L9[t], 
        L10[t], L11[t], L12[t], L13[t], 
        PlotRange -> {{-3, 3}, {-3, 2}}, 
        DisplayFunction -> Identity]
D1[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.5, -2.9}, {0.5, -0.5 + r[t]}}]}], 
        DisplayFunction -> Identity]
D2[t_] := 
      Show[Graphics[{RGBColor[0, 1, 1], 
            Polygon[{{0.25, -1.5 + r[t]}, {0.75, -1.5 + 
                    r[t]}, {0.75, -2.9}, {0.2, -2.9}}]}], 
        DisplayFunction -> Identity]
D3[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.25, -1.5 + r[t]}, {0.75, -1.5 + r[t]}}]}], 
        DisplayFunction -> Identity]
D4[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.25, -1.0}, {0.25, -2.9}}]}], 
        DisplayFunction -> Identity]
D5[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.25, -2.9}, {0.75, -2.9}}]}], 
        DisplayFunction -> Identity]
D6[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.75, -2.9}, {0.75, -1.0}}]}], 
        DisplayFunction -> Identity]
d[x_] := 
      Show[D1[t], D2[t], D3[t], D4[t], D5[t], D6[t], 
        PlotRange -> {{-3, 3}, {-5, 2}}, 
        DisplayFunction -> Identity]
e[x_] := 
      Show[{a[x], c[x], b[x], d[x]}, 
        DisplayFunction -> $DisplayFunction]
Table[e[x], {t, 0, 30, 0.2}]

Clear[u1, u2, g, f, r]
ρ := 1
m := 100
f[x_] := 
      Sin[x] /; 2  π ≤ x ≤ 
          3  π
f[x_] := 
      0 /; (x > 3  π || x < 2  π)
r[x_] := 
      0 /; 0 ≤ x ≤  
          2  π
r[x_] := ((ρ ((E^((((2 π - x) ρ)/m))) m - m Cos[x] + ρ Sin[x]))/((m^2) + (ρ^2))) /; 
        2  π < x ≤ 3  π
r[x_] := (((E^((((2 π - x) ρ)/m))) (1 + (E^(((π ρ)/m)))) m ρ)/((m^2) + (ρ^2))) /; 3  π < x
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, 15}, 
        AspectRatio -> Automatic, 
	
        PlotStyle -> {RGBColor[1, 0.7, 0], 
            Thickness[0.005]}, 
	
        PlotRange -> {{\(-1\), 15}, {\(-1.5\), 1.5}}, 
        DisplayFunction -> Identity]\)
b[x_] := 
      Show[Graphics[Disk[{0, r[t]}, 0.2], 
          AspectRatio -> 
            Automatic, 
       PlotRange -> {{-1, 15}, {-1.5, 1.5}}], 
        DisplayFunction -> Identity]
c[x_] := 
      Show[{a[x], b[x]}, 
        DisplayFunction -> $DisplayFunction]
mass = Table[c[x], {t, 0, 20, 0.1}]

Clear[u1, u2, g, f, r]
ρ := 1
m := 0.001
f[x_] := 
      Sin[x] /; 2  π ≤ x ≤ 
          3  π
f[x_] := 
      0 /; (x > 3  π || x < 2  π)
r[x_] := 
      0 /; 0 ≤ x ≤  
          2  π
r[x_] := ((ρ ((E^((((2 π - x) ρ)/m))) m - m Cos[x] + ρ Sin[x]))/((m^2) + (ρ^2))) /; 
        2  π < x ≤ 3  π
r[x_] := (((E^((((2 π - x) ρ)/m))) (1 + (E^(((π ρ)/m)))) m ρ)/((m^2) + (ρ^2))) /; 3  π < x
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, 15}, 
        AspectRatio -> Automatic, 
	
        PlotStyle -> {RGBColor[1, 0.7, 0], 
            Thickness[0.005]}, 
	
        PlotRange -> {{\(-1\), 15}, {\(-1.5\), 1.5}}, 
        DisplayFunction -> Identity]\)
b[x_] := 
      Show[Graphics[Disk[{0, r[t]}, 0.2], 
          AspectRatio -> 
            Automatic, 
       PlotRange -> {{-1, 15}, {-1.5, 1.5}}], 
        DisplayFunction -> Identity]
c[x_] := 
      Show[{a[x], b[x]}, 
        DisplayFunction -> $DisplayFunction]
mass = Table[c[x], {t, 0, 20, 0.1}]

g1 = 
      Plot[x, {x, 0, 20}, AspectRatio -> Automatic, 
        PlotStyle -> {RGBColor[0, 0, 1], Thickness[0.01]}, 
        PlotRange -> {{-1, 15}, {-1.1, 15}}, 
        DisplayFunction -> Identity]
g2 = 
      Plot[Sin[x], {x, 2  π, 4  π}, 
        PlotStyle -> {RGBColor[1, 0.7, 0], Thickness[0.01]}, 
        DisplayFunction -> Identity]
g3 = 
      Graphics[Disk[{0, 0}, 0.3], 
        DisplayFunction -> Identity]
g4 = 
      Plot[0, {x, 0.3, 2  π}, 
        PlotStyle -> {RGBColor[1, 0.7, 0], Thickness[0.01]}, 
        PlotRange -> {{-1, 15}, {-1.1, 15}}, 
        DisplayFunction -> Identity]
g5 = 
      Plot[0, {x, 4  π, 6  π}, 
        PlotStyle -> {RGBColor[1, 0.7, 0], Thickness[0.01]}, 
        PlotRange -> {{-1, 15}, {-1.1, 15}}, 
        DisplayFunction -> Identity]
Show[{g1, g2, g3, g4, g5}, 
      DisplayFunction -> $DisplayFunction]