Trying to simulate an angular spring similar to the one in this image:
I need a way of calculating the change in angle, $\Delta\theta$ between discrete time steps of length $\Delta t$ seconds due to the torque $\tau$ from the spring and damping. I have the following equations:
$\tau = I\alpha \implies \alpha=\frac{\tau}{I}$ (where $\alpha$ is the angular acceleration)
$\tau=(k_s(\theta_t-\theta_0)-k_d(\omega_t-\omega_0))*\hat{h}$
Where $k_s$ and $k_d$ are the spring and damping constants, $\theta_t$ is the angle at the current time step, and $\omega_t$ is angular velocity and the current time step, and $\hat{h}$ is the axis to rotate around.
Using implicit Euler integration (first update the angular velocity, then update the angle):
$\Delta\omega=\Delta t*\alpha$
$\omega_{t+1}=\omega_t+\Delta\omega$
$\Delta\theta=\Delta t*\omega$
$\theta_{t+1}=\theta_t+\Delta\theta$
The problem that I'm running into is the torque $\tau$ is a vector, and $\alpha$, $\omega$, and $\theta$ are scalars. So I think the equation $\alpha=\frac{\tau}{I}$ is missing something.
So how do I apply the torque $\tau$ to calculate the angular acceleration $\alpha$?