Lagrange’s equation

By combining the potential energy part and the kinetic energy part, we obtain the resulting Lagrange’s equation:

ml2N1j=0{Nmax(i,j)}dωjdtcos(θiθj)+ml2N1j=0{Nmax(i,j)}ωjωjsin(θiθj)mgl(Ni)cosθi=0i.