Jacqueline Xu and Asim Kapparova
This program is a simulation of the Law of Conservation of Energy through the typical “roller coaster problem,” using a skater in a skate park. This project idea was inspired by PhET Simulations Energy Skate Park . In this simulation, the skater will follow a track at a velocity based on its translational kinetic energy. As with most basic conservation of energy simulations, rotational kinetic energy (kinetic energy from rotating objects) is ignored.
The physics behind the program is pretty simple to understand. The total energy in a system will always remain the same. This total energy is comprised of potential energy (based on object height), kinetic energy (based on object velocity), and thermal energy (based on object angle of motion and total distance traveled). The simulation stores the total energy of the system before the object moves. From then on, it figures out the potential energy (based on object height) and the thermal energy based on the object's angle of motion and distance traveled (found by approximating using the object's previous position and current position). The simulation uses this information to determine the object's kinetic energy, and from that, its velocity. This velocity and the equation of the track is used to determine the object's future position.
The user can manually:
- choose a skate track
- edit the mass of the skater
- edit the acceleration by gravity
- edit the coefficient of friction
- pause/play the simulation
- reset the simulation
The simulation will:
- determine the skater's velocity based on its energy
- determine the skater's position
- display bar graphs of the skater energy levels in real time
- display the object's properties/variables in real time
- sometimes the GUI misplaces the components for no reason, the user just has to close and re-run the program
- the user also should not be able change tracks after the skater has started moving. We tried to remedy this by putting the buttons where Java will repaint it, so it "disappears," but the user technically still can press the buttons
- if there is friction present, the skater will hit 0 velocity before it reaches the ground level. We couldn't figure this out because thermal energy has to be scaled perfectly so that it equals the total energy when potential and kinetic energy equals zero. Unfortunately, this requires a level of calculus thtat we could not figure out. So at a certain point, the skater will disappear because it has an undefined value for velocity.
- after the user presses "Reset," all the values are set back to their defaults, and they can't be unchanged.
- We couldn't get the error messages to show up for some reason.
In Terminal, type the following:
- javac Sim.java
- java Sim
- Choose a track
- Set your variables
- Mass must be > 0, Gravity must be > 0, and Coefficient must be > 0 and < 1
- Press Go
- Change your variables however you like while the code is running
- Press Stop to pause
- Press Reset to reset GUI