Use the Easy Java Simulations Modeling and Authoring Tool to edit and to explore the source code for the Simple Pendulum JS Model.
i also recreated this based on the following reference:
http://weelookang.blogspot.sg/2014/02/ejss-pendulum-model.html
http://academics.eckerd.edu/physics/EJS/Physical_Sci/Energy/ejss_model_pendulum_energy.zip by Anne Cox.
Create a new relation