HW0: Newtonian Mechanics
CS
482/681, Dr. Lawlor
In this homework, use the
Simple Object example
to simulate the Newtonian mechanics of a particle moving under
gravity:
Position P
Velocity V = dP/dt
Acceleration A = dV/dt = gravitational acceleration of
9.8 meters/sec^2 in the downward (negative z) direction
It will probably be helpful to review the Integrating Differential
Equations lecture note.
You may assume all the mechanics are happening in the z direction,
and ignore x and y.
When your particle reaches the floor, P.z<=0, make it bounce by
flipping the sign of the velocity.
681 students: make your simulation conserve energy, including when
it bounces off the floor, for example by using Leapfrog
or Verlet
time integration.
To save your PixAnvil simulation, hit the "Save" tab, select all the
text, and save it to a .html file using a plain text editor such as
Notepad. Turn in your updated .html simulation on Blackboard (you'll need to log in first) by the due date of Wednesday, January 21.