I am trying to model the following in a computer simulation:

The Acrobot
However I am struggling to understand which variables stand for which. In particular, the variables not defined are:

Another problem is which order are these calculated in to update the system? d1 and d2 first (as the angular acceleration relies on these).