Clear[u1, u2, g, f, r]
ρ := 1
m := 1
k := 1
f[x_] := 
      Sin[x] /; 2  π ≤ x ≤ 
          3  π
f[x_] := 
      0 /; (x > 3  π || x < 2  π)
r[x_] := 
      0 /; 0 ≤ x ≤  
          2  π
r[x_] := (1/(((((k - m))^2) + (ρ^2)) (Sqrt[-4 k m + (ρ^2)]))) ((E^(-(((-2 π + x) ρ)/(2 m)))) ρ ((-k + 
                        m) (Sqrt[-4 k m + (ρ^2)]) Cosh[(((-2 π + x) (Sqrt[-4 k m + (ρ^2)]))/(2 m))] + (E^((((-2 π + x) ρ)/(2 m)))) (Sqrt[-4 k m + (ρ^2)]) ((k - m) Cos[x] + ρ Sin[
                            x]) - (k + 
                        m) ρ Sinh[(((-2 π + x) (Sqrt[-4 k m + (ρ^2)]))/(2 m))])) /; 
        2  π < x ≤ 3  π
r[x_] := -(1/(((((k - m))^2) + (ρ^2)) (Sqrt[-4 k m + (ρ^2)]))) ((E^((((5 π - 2 x) ρ)/(2 m)))) ρ (-(E^((((-2 π + x) ρ)/(2 m)))) (-k + 
                        m) (Sqrt[-4 k m + (ρ^2)]) Cosh[(((-3 π + x) (Sqrt[-4 k m + (ρ^2)]))/(2 m))] - (E^((((-3 π + x) ρ)/(2 m)))) (-k + m) (Sqrt[-4 k m + (ρ^2)]) Cosh[(((-2 π + x) (Sqrt[-4 k m + (ρ^2)]))/(2 m))] + (k + 
                        m) ρ ((E^((((-2 π + x) ρ)/(2 m)))) Sinh[(((-3 π + x) (Sqrt[-4 k m + (ρ^2)]))/(2 m))] + (E^((((-3 π + x) ρ)/(2 m)))) Sinh[(((-2 π + x) (Sqrt[-4 k m + (ρ^2)]))/(2 m))]))) /; 
        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}, {\(-2\), 2}}, 
        DisplayFunction -> Identity]\)
b[x_] := 
      Show[Graphics[Disk[{0, r[t]}, 0.2], 
          AspectRatio -> 
            Automatic, 
       PlotRange -> {{-1, 20}, {-2, 2}}], 
        DisplayFunction -> Identity]
L1[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0, r[t]}, {0, -0.1 + r[t]}}]}], 
        DisplayFunction -> Identity]
L2[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0, -0.1 + r[t]}, {0.5, -0.3 + (11/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L3[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.5, -0.3 + (11/12)*r[t]}, {-0.5, -0.5 + 
                    (9/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L4[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.5, -0.5 + (9/12)*r[t]}, {0.5, -0.7 + 
                    (7/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L5[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.5, -0.7 + (7/12)*r[t]}, {-0.5, -0.9 + 
                    (5/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L6[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.5, -0.9 + (5/12)*r[t]}, {0.5, -1.1 + 
                    (3/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L7[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.5, -1.1 + (3/12)*r[t]}, {-0.5, -1.3 + 
                    (1/12)*r[t]}}]}], 
        DisplayFunction -> Identity]
L8[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{-0.5, -1.3 + (1/12)*r[t]}, {0.5, -1.4}}]}], 
        DisplayFunction -> Identity]
L9[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.5, -1.4}, {0, -1.5}}]}], 
        DisplayFunction -> Identity]
L10[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0, -1.5}, {0, -1.7}}]}], 
        DisplayFunction -> Identity]
L11[t_] := 
      Show[Graphics[{RGBColor[0, 0, 1], Thickness[0.005], 
            Line[{{0.5, -1.7}, {-0.5, -1.7}}]}], 
        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], PlotRange -> {{-3, 3}, {-2, 2}}, 
        DisplayFunction -> Identity]
d[x_] := 
      Show[{a[x], c[x], b[x]}, 
        DisplayFunction -> $DisplayFunction]
mass = Table[d[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]