# NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

## Easy Java Simulations (2001- ) => Examples for beginner who want to learn EJS => Topic started by: Fu-Kwun Hwang on August 18, 2006, 02:44:00 pm

 Title: Vertical Spring Post by: Fu-Kwun Hwang on August 18, 2006, 02:44:00 pm This is an applet related to a spring sibject to gravitation force. Title: Re: Vertical Spring Post by: lookang on July 03, 2007, 07:50:12 am hihi, great stuff u made prof hwang.i think this page didn't load well, the ejs button is missing :) It is not the same as the rest of ejs downable *.xml files. Title: Re: Vertical Spring Post by: Fu-Kwun Hwang on July 10, 2007, 06:27:06 am It is fixed now. Title: Re: Vertical Spring Post by: rahmaniah on June 09, 2008, 01:53:40 pm Dear Mr. Hwang,I am Nia, I had been studying in Institute of Technology Sepuluh November (ITS) Surabaya, Indonesia, majoring in Physics. First of all, I’m sorry to disturb you again. And thanks for your reply during this time. I use Ejs version 3.46. This is my source program with name circular spring.xml. Continuing my last questions at my email ;•   How is the analytically equation, kinetic and potential energy from spring system as seen on the picture above with the particle amount of 8?•   How can we know the analytical solution to get the acceleration equation?If I run this system by choosing n = 5,  why the values from y6 (n=6) until  y8 (n=8) are still calculated from numerical data?At last but not least, thanks for all your helps.Trully yours,Nia Title: Re: Vertical Spring Post by: Fu-Kwun Hwang on June 09, 2008, 02:13:45 pm 1. You can get velocity,height and mass for each particle in the simulation, so that you can calculate their kinetic energy and potential energy individually. And the sum of those will be the energy for the whole system.2. EJS help you calculate the integration numerically. It would not obtain analytic equation for you. 3. If array were used in the evolution equation, for example  Code:d x[i]/dt =v[i], then the whole array x[n] will be evaluated.If you do not want some of the value changed, you need to set their derivate value to zero. For example: Code:for (int i=5;i