The accompanying source code is at:<p><a href="https://github.com/colgreen/cartpole-physics" rel="nofollow">https://github.com/colgreen/cartpole-physics</a><p>Note that the equations being used in the 'wild' are generally wrong in some way; see the article appendices for detailed info.