Lets say a damped pendulum takes 10 seconds to slow down and stop. In that time it might swing past vertical perhaps 25 times or so.
We have an accurate clock that measures absolute time reliably. We are given very accurate speed and direction data (+/- radians per second for instance) for the pendulum in real-time. But we don't know what absolute angle the pendulum started at.
Is it possible to accurately determine which direction is "down" (e.g. gravity's local direction) by observing the motion of a swinging damped pendulum before it has stopped swinging?
Background:
Please bear with me since I'm not well versed in mathematics, I realise that this question isn't rigorously defined. This problem is based in a real situation I'm facing with some electromechanical apparatus. A pendulum suffers from friction in its motion which generally prevents it from finding vertical once it finally comes to rest (usually it's a degree or two to the left or right, somewhat randomly). If it is possible to find "down" mathematically from the dynamic properties of a pendulum before it stops, then this would be a tremendous help.
We know how fast the pendulum is swinging at any time $t$, call this velocity $v(t)$. As was stated in the problem, this can be assumed to be measured in rad/s although any other velocity works after a transformation. At the apogee of the swings, this velocity will obviously be $0$. The pendulum is also losing energy to friction between the fulcrum and whatever it is attached to. Crucially, the energy lost to friction can represented by $\Delta \theta K$ for some constant $K$ and positive change in pendulum angle $\Delta \theta$.
Now, to solve this problem we need two swings in total (not counting the initial swing where we don't know the starting point). For reference, call the first apogee $A$, the second $B$, and the third $C$. We can get the $\Delta \theta _{AB}$ with
$$\Delta \theta _{AB}=\int_{T_A}^{T_B}|v(t)|dt$$
where $T_{A}$ is the time when the pendulum is at $A$ and $T_B$ is the time when the pendulum is at $B$. In a similar manner
$$\Delta \theta _{BC}=\int_{T_B}^{T_C}|v(t)|dt$$
We can also find the arc length of $AB$ and $BC$ using $\Delta \theta l$ where $l$ is the pendulum length:
$$L_{AB}=\Delta \theta_{AB}l$$
$$L_{BC}=\Delta \theta_{BC}l$$
Next, we have to talk about the 'heights' of the pendulum at $A$, $B$, and $C$. What heights, you might ask since we are trying to find which direction down is? Well... it actually doesn't matter which direction down is initially since we only need a reference point.
For example, let point $P$ be the distance halfway in-between $B$ and $C$. Call this direction 'down'. We can calculate the change in 'heights' of the apogees by
$$\Delta z_{AB}=\left|l\cos\left(\pi \frac{L_{AB}-\frac{L_{BC}}{2}}{2\pi l}\right)-l\cos\left(\pi \frac{\frac{L_{BC}}{2}}{2\pi l}\right)\right|$$
Here
$$L_{AB}-\frac{L_{BC}}{2}$$
is the distance along the pendulum arc of $A$ to $P$ and $\frac{L_{BC}}{2}$ is the distance along the arc of $B$ to $P$. In a similar manner
$$\Delta z_{BC}=\left|l\cos\left(\pi \frac{\frac{L_{BC}}{2}}{2\pi l}\right)-l\cos\left(\pi \frac{\frac{L_{BC}}{2}}{2\pi l}\right)\right|$$
Of course, this is $0$ which follows since we chose the point in-between $B$ and $C$ as our reference point.
However, there was nothing special about choosing $P$ to be halfway in-between $B$ and $C$. Let $\phi(t)=t:[0,1]\to [0,L_{BC}]$ be the distance along the arc (starting $B$ and ending at $C$) between points $B$ and $C$ that we choose 'down'. Then the above equations (after simplifying) become
$$\Delta z_{AB}(t)=l\left|\cos\left( \frac{L_{AB}-tL_{BC}}{2 l}\right)-\cos\left( \frac{(1-t)L_{BC}}{2 l}\right)\right|$$
$$\Delta z_{BC}(t)=l\left|\cos\left( \frac{tL_{BC}}{2 l}\right)-\cos\left( \frac{(1-t)L_{BC}}{2 l}\right)\right|$$
Crucially, we now can vary what we call 'down' and get different changes in energy. These changes in energy must match the losses in energy from friction. That is
$$\Delta z_{AB}(t)mg=\Delta \theta _{AB}K$$
$$\Delta z_{BC}(t)mg=\Delta \theta _{BC}K$$
With these two equation, we can cancel $K$ and $mg$ to get
$$0=\frac{\Delta z_{BC}(t)}{\Delta \theta _{BC}}-\frac{\Delta z_{AB}(t)}{\Delta \theta _{AB}}$$
This equation can be numerically solved for the root $t_0$. As experimental inputs it requires $v(t)$, $T_A$, $T_B$, and $T_C$ (the $l$ parameter will actually drop out since the arc length is a constant times $l$). This $t_0$ is the percent distance from $B$ to $C$ that true 'down' lies.