I would like to simulate a point mass that is moving on a circular rail considering kinetic friction. The mass point starts at the bottom of the rail with an initial velocity v0. for the derivation of the algebraic differential equation system i used standard newtonian mechanics. fn is the normal force, that acts on the mass point and ϕ is the only degree of freedom. My computed solution behaves quite weird, e.g. the point mass never stops or it moves in a strange way (see Animation). Here is my code:
v0 := 14
m := 1
g := 9.81
μ := 0.05
R := 5
ϕ0 := 0
tmax := 50
eqn1[t_] := -fn[t] +m g Cos[ϕ[t]]^2 == -m R ϕ'[t]^2
eqn2[t_] := -μ Abs[fn[t]]*Sign[ϕ'[t]] -m g Sin[ϕ[t]] == m R ϕ''[t]
sol = NDSolve[{eqn1[t],eqn2[t], ϕ[0] == ϕ0, ϕ'[0] ==v0/R},
{ϕ,fn}, {t, 0, tmax}, MaxSteps -> Infinity, MaxStepSize -> 0.001,AccuracyGoal -> 6, PrecisionGoal -> 6,InterpolationOrder -> All][[1]];
Plot[ϕ[t] /. sol, {t, 0, tmax}]
Plot[fn[t] /. sol, {t, 0, tmax}, PlotRange -> All]
Plot[(fn[t] - g Cos[ϕ[t]]^2 - R ϕ'[t]^2) /. sol, {t,0,tmax},PlotRange -> All]
Plot[(-μ Abs[fn[t]]*Sign[ϕ'[t]] - g Sin[ϕ[t]]-R ϕ''[t]) /. sol, {t, 0, tmax}, PlotRange -> All]
phi[t_] := ϕ[t] /. sol
Animate[ParametricPlot[{R*Sin[phi[t]], -R*Cos[phi[t]]}, {t, 0, tmax},Epilog ->{Red, PointSize[Medium], Point[{R*Sin[phi[t]], -R*Cos[phi[t]]}]},PlotRange -> All, PerformanceGoal -> "Quality"], {t, 0,tmax}, AnimationRunning -> False]`
How can I improve the code, so the simulation gets appropriate?