Monday 11 April 2011

Kinetic energy implementation

As of now the program now has the depression of the surface effected by a mix of kinetic, potential energy, hooke's law and tension of a string. The way the equation is set up is that the basic equation of kinetic energy and potential energy are added together from the depression to find the total energy of the depression:

velocity = 1/2*mass*speed^2 + mass*gravity*height

with the total energy found the equation now needs to find the tension of the surface. To do this the surface is set up like a array of strings with its own set of strings having tension working against the energy placed on the surface. With this the equation becomes:

1/2*mass*velocity^2 = 1/2*mass*speed^2 - mass*gravity*height + ((2*tension)/(2*length))(2*sqrt(height^2 + (length/2)^2) - 2*tension)^2

This equation will find the velocity of the object been pushed upon the surface. The problem with this equation is that the program already has the velocity of the object hitting the surface. Instead what is necessary is the speed as of the time of the object which was hitting the surface. With that in mind the equation needs to be changed to get out a wanted result:

speed = velocity + sqrt(2*gravity*height) - 2*(sqrt(((2*tension)/(2*length))*(2*sqrt(height^2 + (length/2)^2) - 2*tension)^2)/mass

With this the speed of which the depression goes at can be found. After this is found the value of speed is added to the overall height to find the depth of the depression.

There was only a few problems with the implementation all really mainly based around the values of the constants used for the equation needing to be change so that the deformation had a more of a realistic look or more depth to its depression. The main problem with the height of the depression usually ended up to large for real use. this was attempt to be sorted by dividing the value found by 100 but this cause the depression to continue without stopping due to the value just continuously being added together to make the depression much larger. This was by making the value used to change the surface and the height used in the equation separate values with the the surface height just the height value divided by 100 thus not effecting the end result or the next result from the equation in ways which did not produce unwanted results.

With these values effectively placed in i plan to after this try and get multiple depressions happening at the same time as my next marker to aim for for my project and after that if there is still enough times to implement actually have objects falling onto the surface and have them effect the depression of the object

Note to self: in dissertation increase explanation of the tension of the string and the energy placed onto the surface and explain each of the values used in the equations. Include visual representation.

No comments:

Post a Comment