Clear[]
L=16;
g=9.81;
(Subscript[y, 0]):=1
(Subscript[v, 0]):=0
λ:=(Sqrt[((2*g)/L)])

A=(Subscript[y, 0]);
B=((Subscript[v, 0])/λ);
ρ=(Sqrt[(A^2)+(B^2)]);
y[t_]=A*Cosh[λ*t]+B*Sinh[t];
u[t_]=y[t];
(OverDot[u])[t_]=(∂_t) u[t];
nu[t_]=(ρ/ρ)*u[t];

a=((L-Pi*1.)/2);
f1=Solve[u[t]==a,t];
f1[[1]];
t1=-t/.f1[[1]];

f2=Solve[u[t]==a+((Pi*1)/2),t];
f2[[1]];
t2=-t/.f2[[1]];

f3=Solve[u[t]==a+Pi*1,t];
f3[[1]];
t3=-t/.f3[[1]];

t3-t1

T=t3+2*(t3-t1)
yl=(15/10)*u[T];
vl=(15/10)*(OverDot[u])[T];
u1[t_]:=Which[t≤t1,y[t],t>t1,a]
u2[t_]:=Which[t<t3,0,t≥t3,y[t]-a-Pi*1]
u3[t_]:=Which[t<t1,0,t1≤t≤t2,y[t]-a,t>t2,y[t2]-a]
u4[t_]:=Which[t<t2,0,t2≤t≤t3,y[t]-a-((Pi*1)/2),t>t3,y[t3]-a-((Pi*1)/2)]
Plot[u[t],{t,0,T},PlotRange->All]
Plot[(OverDot[u])[t],{t,0,T},PlotRange->All]

Sin[u[t2]-u[t1]];
Cos[u[t2]-u[t1]];
Sin[u[t3]-u[t1]];
Cos[u[t3]-u[t1]];
Cos[u4[t2]];
Sin[u4[t2]];

Clear[]
Ground[t_]:=Show[Graphics[{RGBColor[0.7,0.7,0.7],Thickness[0.01],Line[{{-4,-a},{4,-a}}]},PlotRange->{{-4,4},{-13,2}},AspectRatio->Automatic],DisplayFunction->Identity]
w1:=Show[Graphics[{RGBColor[0.7,0.7,0.7],Disk[{0,0},0.7]}],DisplayFunction->Identity]
w2:=Show[Graphics[{RGBColor[0.2,0.2,0.2],Disk[{0,0},1]}],DisplayFunction->Identity]
L1:=Show[Graphics[{RGBColor[0.2,0.2,0.2],Thickness[0.005],Line[{{0,0},{0.9*Sin[nu[t]],0.9*Cos[nu[t]]}}]}],DisplayFunction->Identity]
L2:=Show[Graphics[{RGBColor[0.2,0.2,0.2],Thickness[0.005],Line[{{0,0},{0.9*Sin[nu[t]+((2*Pi)/3)],0.9*Cos[nu[t]+((2*Pi)/3)]}}]}],DisplayFunction->Identity]
L3:=Show[Graphics[{RGBColor[0.2,0.2,0.2],Thickness[0.005],Line[{{0,0},{0.9*Sin[nu[t]+((4*Pi)/3)],0.9*Cos[nu[t]+((4*Pi)/3)]}}]}],DisplayFunction->Identity]
wheel1:=Show[w2,w1,L1,L2,L3,PlotRange->{{-4,4},{-10,2}},AspectRatio->Automatic,DisplayFunction->Identity]
C1[t_]:=Show[Graphics[{RGBColor[0,0,1],Thickness[0.01],Line[{{-1-0.02,-a+u[t]},{-1-0.02,0}}]},PlotRange->{{-4,4},{-10,2}},AspectRatio->Automatic],DisplayFunction->Identity]
C2[t_]:=Show[Graphics[{RGBColor[0,0,1],Thickness[0.01],Line[{{1+0.02,-a-u[t]},{1+0.02,0-u2[t]}}]},PlotRange->{{-4,4},{-10,2}},AspectRatio->Automatic],DisplayFunction->Identity]
M1[t_]:=Show[Graphics[{RGBColor[1,1,1],Polygon[{{-2,0},{-2,-2},{2,-2},{2,0}}]},PlotRange->{{-4,4},{-10,2}},AspectRatio->Automatic],DisplayFunction->Identity]
M2[t_]:=Show[Graphics[{RGBColor[1,1,1],Polygon[{{-2+(2-Cos[u3[t]]),2*Sin[u3[t]]},{-2,0},{0,0},{0,0}}]},PlotRange->{{-4,4},{-10,2}},AspectRatio->Automatic],DisplayFunction->Identity]
M3[t_]:=Show[Graphics[{RGBColor[1,1,1],Polygon[{{0,2},{0,0},{0,0},{0+(2*Sin[u4[t]]),2*Cos[u4[t]]}}]},PlotRange->{{-4,4},{-10,2}},AspectRatio->Automatic],DisplayFunction->Identity]
w3:=Show[Graphics[{RGBColor[0,0,1],Disk[{0,0},1.07]},PlotRange->{{-5,5},{-10,2}},AspectRatio->Automatic],DisplayFunction->Identity]

H1[t_]:=Show[Ground[t],w3,M1[t],wheel1,C1[t],C2[t],DisplayFunction->Identity];
H2[t_]:=Show[Ground[t],w3,M1[t],M2[t],wheel1,C2[t],DisplayFunction->Identity];
H3[t_]:=Show[Ground[t],w3,M1[t],M2[t],M3[t],wheel1,C2[t],DisplayFunction->Identity];
G[t_]:=Which[t≤t1,H1[t],t1<t≤t2,H2[t],t>t2,H3[t]]
Table[G[t],{t,0,T,0.1}];

Clear[]
P1=Plot[u[t],{t,0,T},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]},AspectRatio->0.4,DisplayFunction->Identity];
B1[t_]:=Show[Graphics[{RGBColor[0.2,0,1],PointSize[0.05],Point[{t,u[t]}]}],DisplayFunction->Identity];
G1[t_]:=Show[P1,B1[t],PlotRange->{{0,T},{0,yl}},DisplayFunction->Identity,AxesLabel->{"t","y(t)"}]
Displacement=Table[G1[t],{t,0,T,0.1}];

Clear[]
P2=Plot[(OverDot[u])[t],{t,0,T},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]},AspectRatio->0.4,DisplayFunction->Identity];
B2[t_]:=Show[Graphics[{RGBColor[0.2,0,1],PointSize[0.05],Point[{t,(OverDot[u])[t]}]}],DisplayFunction->Identity];
G2[t_]:=Show[P2,B2[t],PlotRange->{{0,T},{0,vl}},DisplayFunction->Identity,AxesLabel->{"t","v(t)"}]
Velocity=Table[G2[t],{t,0,T,0.1}];

Clear[]
P3=ParametricPlot[{u[t],(OverDot[u])[t]},{t,0,T},PlotStyle->{RGBColor[1,0,0],Thickness[0.01]},AspectRatio->Automatic,DisplayFunction->Identity];
B3[t_]:=Show[Graphics[{RGBColor[0.2,0,1],PointSize[0.05],Point[{u[t],(OverDot[u])[t]}]}],DisplayFunction->Identity];
G3[t_]:=Show[P3,B3[t],PlotRange->{{-yl,yl},{-vl,vl}},DisplayFunction->Identity,AxesLabel->{"y(t)","v(t)"}];
P=Table[G3[t],{t,0,T,0.1}];

Clear[]
GA[t_]:=Show[GraphicsArray[{{G1[t]},{G2[t]}},DisplayFunction->Identity],ImageSize-> {600,600}]
GB[t_]:=Show[GraphicsArray[{{GA[t]},{G3[t]}},DisplayFunction->Identity],ImageSize-> {600,600}]
AV=Table[Show[GraphicsArray[{{G[t],GB[t]}},DisplayFunction->$DisplayFunction], ImageSize-> {500,500}],{t,0,T,0.1}];
Export["roller.avi",AV]

.

Wall[t_]:=Show[Graphics[{RGBColor[0,0,1],Thickness[0.005],Line[{{0,1},{0,10}}]},PlotRange->{{0,25},{0,10}},AspectRatio->Automatic],DisplayFunction->Identity]
Ground[t_]:=Show[Graphics[{RGBColor[0,0,1],Thickness[0.005],Line[{{0,1},{25,1}}]},PlotRange->{{0,25},{0,10}},AspectRatio->Automatic],DisplayFunction->Identity]
M[t_]:=Show[Graphics[{RGBColor[0,1,1],Polygon[{{13+nu[t],8},{13+nu[t],2},{19+nu[t],2},{19+nu[t],8}}]}],DisplayFunction->Identity]
S[t_]:=Show[Graphics[{RGBColor[0,0,1],Thickness[0.005],Line[{{0,5},{2.5,5},{3+(1/10)*nu[t],6},{4+(2/10)*nu[t],4},{5+(3/10)*nu[t],6},{6+(4/10)*nu[t],4},{7+(5/10)*nu[t],6},{8+(6/10)*nu[t],4},{9+(7/10)*nu[t],6},{10+(8/10)*nu[t],4},{11+(9/10)*nu[t],6},{11.5+nu[t],5},{13+nu[t],5}}]},PlotRange->{{0,25},{0,10}},AspectRatio->Automatic],DisplayFunction->Identity]

f=Solve[Abs[u[T1]]-2*a*x==0,x];
f[[1]];
c=x/.f[[1]];
n=IntegerPart[c];
T=T1+n*(Pi/ω);