Build a Java, C or C++ program that implements the required algorithm, then compile and run it on a machine, put the deliverables into the form specified below and turn the package in.
Implement the following calculations in a loop which takes t from 0.00 to 5.00 in increments of 0.1.
Equations:
Initialize:
dt = 0.10 (it is constant)
t0 = 0.00
dx0 = 0.10 (it is constant)
x0 = 0.00
ddy = 1.00 (it is constant)
dy0 = 0.00
y0 = 1.00
Repeat the following steps while ti <= 5.0
dxi = dx(i - 1)
xi = x(i - 1) + dxi * dt
dyi = dy(i - 1) - ddy * dt2
yi = y(i - 1) + dyi * dt
if y goes negative "bounce" by removing some velocity and
recalculating
y = -y
dy = -dy * 0.70;
ti = t(i - 1) + dt
Print out the values of t, (x, y), and (dx, dy) for each step.
The files to be turned in for this programming assignment are as follows:
These are to be placed in a single jar or tar file and e-mailed as an attachment to jholten@nmt.edu
Have the program generate a graphical presentation of the x-y positions of the point locations for this system by using character plots. The time increments are the successive rows. (A sample character plot, time on the vertical axis)
Base Solution:
Extra Credit, uses P1_Model from above