Overdamped bead on a rotating hoop

1-D Nonlinear phase portrait

Clear[x,y,g,r,ω]
t0=0.0;tmax=4;
g=9.8;
r=1.0;
ω=4;(*value used below*)
gamma = ((r (ω^2))/g);
fixedpoints=Quiet[Solve[{Sin[x] (gamma Cos[x]-1)==0,y==0,x≥-Pi,x≤Pi},{x,y}]];
coordinates={x,y}/.fixedpoints;
fixedp=Graphics[{PointSize[0.02],Red,Point[coordinates]}];
pm=Plot[ Sin[x] (gamma Cos[x]-1),{x,- Pi, Pi},PlotRange->All,ImageSize->550,AxesLabel->{ϕ,"(∂_t)ϕ"},PlotLabel-> Style["1-D approximation, phase portrait",19],LabelStyle->17];
Show[pm,fixedp](*derived during the lecture*)

Nonlinear phase portrait of the full second-order system (dimensionless form)

Clear[diffX,diffY,difX,difY,x,y,g,b,r,m,ω]
imagesize=380;maxT=60;
g=9.8;
b=1.0;
r=1.0;
ω=4.0;
gamma = ((r (ω^2))/g);(*dimensionles group*)


Manipulate[
alpha = (((m^2) g)/((b^2) r));(*dimensionles group*)
diffX=y;
diffY=-(1/alpha) y+(1/alpha) Sin[x] (gamma Cos[x]-1);
difX=y[t];
difY=-(1/alpha) y[t]+(1/alpha) Sin[x[t]] (gamma Cos[x[t]]-1);
splot=StreamPlot[{diffX,diffY},{x,-Pi,Pi},{y,-1.9,1.9},FrameLabel->{ϕ[t],"(∂_t)ϕ"},ImageSize->imagesize,PlotLabel->Style["Nonlinear phase portrait",17],LabelStyle->18,StreamStyle->Gray];
fixedpoints=Quiet[Solve[{diffX==0,diffY==0,x≥-Pi,x≤Pi},{x,y}]];
coordinates={x,y}/.fixedpoints;
fixedp=Graphics[{PointSize[0.02],Red,Point[coordinates]}];

integration=NDSolve[{
x'[t]==difX,
y'[t]==difY,
x[0]==point[[1]],y[0]==point[[2]]},
{x,y},{t,0,T}];
firstorderPP=Plot[ Sin[x] (gamma Cos[x]-1),{x,-Pi, Pi},PlotStyle->{Thick,Black}];
trajectory=ParametricPlot[
Evaluate[{x[t],y[t]}/.integration],
{t,0,T},PlotStyle->Red];
solx=Plot[
Evaluate[x[t]/.integration],
{t,0,T},PlotStyle->Red,PlotRange-> All,AxesLabel-> {t,ϕ[t]},PlotLabel->Style["Angle ϕ",18],ImageSize->imagesize,LabelStyle->18];
soly=Plot[
Evaluate[y[t]/.integration],
{t,0,T},PlotStyle->Red,PlotRange-> All,AxesLabel-> {t,"(∂_t)ϕ"},PlotLabel->Style["Change in ϕ (tangential to the hoop)",18],ImageSize->imagesize,LabelStyle->18];
Grid[{{Show[splot,trajectory,firstorderPP,fixedp],soly},{solx}},Frame->All],
{{T,0.2 maxT,"Integration time, t"},1,maxT,Appearance->"Labeled"},{{m,(Sqrt[(((b^2) r)/g)]),"Mass, m"},(Sqrt[(((b^2) r)/g)])-0.99 (Sqrt[(((b^2) r)/g)]),(Sqrt[(((b^2) r)/g)])+2.0 (Sqrt[(((b^2) r)/g)]),Appearance->"Labeled"},{{point,{-2,-1.99}},Locator}, SaveDefinitions->True,TrackedSymbols:>{T,m,point}]

Creation of this notebook was supported by IT Academy program of Information Technology Foundation for Education (HITSA).