The physical model is
. Var. = t Increment = dt
alpha[i]= omega[i]
omega[i]= -g/l*Math.sin(alpha[i])-k*l*omega[i]

All ejs models in this forum are open sourced.
Try to use ejs to read the codes.

Good luck!