CS190N/CS290N -- Assignment 2: Retracing the Path of a Bullet
Your assignment is to investigate how much error their might be in the
solution Charlie gives for finding
of the first sniper we see in "Sniper Zero." After all, the sniper
instructor makes it pretty clear that Charlie's estimate might need error bars
(even though Charlie seems put out by the notion). Your investigation will
comprise two parts.
Part A
You should implement four different ways of computing the height from which
the bullet was fired given the range, impact angle, initial muzzle velocity,
air density, bullet caliber, bullet ballistic coefficient, and
bullet weight. The four methods, respectively, compute the initial height
- if the shooter and target exist in a vacuum,
- if there is an atmosphere and the drag force is proportional to the
velocity,
- if there is an atmosphere and the drag force is proportional to the square
of the velocity using the Eulerian method of numerical integration, and
- if there is an atmosphere and the drag force is proportional to the square
of the velocity using Runge-Kutta-4 for numerical integration.
For all four methods, you should use the following set of given parameters:
- range (horizontal distance): 900 feet
- impact angle: 3 degrees
- air density: 1.221 grams/liter
- muzzle velocity: 2500 ft/s
- bullet caliber: 270
- ballistic coefficient: 0.392
- bullet weight: 130 grains
For the linear-drag case, these parameters the constant drag factor equates to
0.778.
In addition, you should also compute the initial height using each method
for a different bullet and gun combination having the
following characteristics:
- muzzle velocity: 2900 ft/s
- bullet caliber: 8.5 mm
- ballistic coefficient: 0.565
- bullet weight: 250 grain
which results in a constant drag factor of 0.44. You should also use a
step size of 0.0001 and you should run your converging algorithms until
the tolerance is under 0.001. You should also assume that the
coefficient of drag is a linear function of bullet speed. For a standard "G1"
bullet, the function you should use is Cd = 0.8365 -
0.0001094*s where s is the speed.
Part 2
In Charlie's "mind's eye" we see him attaching probabilities to the different
possible locations from where the sniper might have fired.
Assume that for each parameter, Charlie's value differs from the true value by
an error term that is well-modeled by a normal distribution having a zero mean
and a standard deviation that is 5% of the value Charlie chooses. Assume that
all error probabilities are independent (e.g. Charlie's error in estimating the
bullet weight is independent of the error he makes in estimating the muzzle
velocity). Please provide an approximation to the 87% confidence interval for
each of the 8 values you generated in Part A and justify your answer.
What to Turn In
You should turn in your code and the makefile needed to build it, the output
you generated in answering Parts A and 2, a short written justification for
your method of approximating the confidence interval, and a README file that
explains any and all details necessary for the TA to be able to reproduce your
results, and to test your code with a different set of parameters. As is the
case for all assignments in this class, the TA must be able to build
your program(s) using the default environment in the CSIL and
to operate your program(s) in a way that blindingly straight forward.
Bonus Question -- What is Charlie's Processing Speed?
Charlie seems to make his estimates very quickly. If the time he takes to
to calculate the 87%
confidence interval for each possible location is one
second, and he has to perform the same number of floating point
computations as your program does,
what is his processing rate (in megaflops per second) for the RK4 solution
you provided in Part 2?
For the Graduate Student
If we had a handle on the final velocity of the bullet at impact, we could
have solved the problem for both the range and height. Assume the the sniper
used the first bullet configuration described in Part A and that the final
speed is 2000 ft/s. Solve the system for both y0
and xf.