Let original length of pendulum be
Hence the velocity vector is
And the acceleration is
But
And
Substituting (2,3) into (1) gives the acceleration of the bob in frame
To obtain
Therefore the equation of motion is
Or, by equating each vector component
Or
Let initial conditions be
We can now solve for
The solution will give
The following is plot of the solution using
The following is a quick animation of the above
The following is the code used
(*Nasser M. Abbasi, Jan 25, 2025*) SetDirectory[NotebookDirectory[]] L = 1; k = .99; m = .09; g = 9.81; ode1 = x''[t] == z'[t]^2*(L + x[t]) + g*Cos[z[t]] - k/m*x[t]; ode2 = z''[t] == -2 z'[t]*x'[t]/(L + x[t]) - g*Sin[z[t]]/(L + x[t]); IC = {x[0] == .1, x'[0] == 0, z[0] == 20 Degree, z'[0] == .1}; sol = NDSolve[{ode1, ode2, IC}, {x, z}, {t, 0, 100}] Manipulate[ Module[{currentX, currentY}, currentX = (L + Evaluate[x[t0] /. sol])*Sin[Evaluate[z[t0] /. sol]]; currentY = (L + Evaluate[x[t0] /. sol])*Cos[Evaluate[z[t0] /. sol]]; Grid[{ {Graphics[{ Line[{{0, 0}, {First@currentX, -First@currentY}}], {Blue, Disk[{First@currentX, -First@currentY}, .1]} }, PlotRange -> {{-2, 2}, {-4, 1}}, GridLines -> Automatic, GridLinesStyle -> LightGray ]}}] ], {{t0, 0, "time"}, 0, 10, .01}, TrackedSymbols :> {t0} ]