Real Time Physics Simualtor
Real Time Physics Simulator (RTPS) was a semester long project that I
worked on for one of my physics classes at Red Rocks
Community College.
Project Proposal (pdf)
Presentation (OpenOffice.org Impress)
My original goal was to write a physics engine and leave it at that. Then
I started talking with one of the other groups, and their project was to
model tuned mass dampeners in buildings with K'NEX. Something went off in
my brain and instantly I knew that these two projects were somehow
complimentary to eachother. The focus then changed slightly and I
decided to try and match the movements of their K'NEX skyscraper with my
simulator. Although the simulations looked good, they were extremely
diffucult to tune to the physical model. It was almost impossible to get
the simulation to line up with the model for any significant duration
of time, but the proof of concept was there.
Something that came up during development was the question of whether or
not this program was actually a "real time" simulator, and to this day
there are two conflicting opinions. I had the idea that because the
simulator adjusts each new time step for the amout of time that the last
step took, one second in the program would be one second of real time.
The other opinion, was that of my uncle Chris Roeder, who has an MS in Computer Science
and works for IBM. His srgument was that nothing in Java can ever be real
time because of garbage collection. Once it starts, your program has
to wait, and there really is no controlling when it starts because
it has a mind of its own. Its too bad because I feel the name is so
catchy.
One of the failures of this project was its ability to conserve energy.
Somewhere there was a roundoff error or something similar (collision
detection maybe?) that constantly adds energy to the system, making it
unstable over long periods of time. Unfortunately I'm not entirely sure
how to fix this problem.
In retrospect, another failure of this project was proper documentation.
When I was writing code for this project, I didn't really think about
using javadoc to my advantage, and now that I haven't touched the code in
about a year re-learning all of the intricacies of it takes more time than
necessary. One of my plans is to someday extend this to three dimensions
after I've learned OpenGL, and re-write it in C++, and make RTPS into a
true real time simulator.
Download (src, bin)
Copyright © Jon Roelofs, December 2007.
|