In the spring of 2010, I worked with another student to find a solution to a boundary value Ordinary Differential Equation (ODE) problem modeling the trajectory of a projectile with air resistance. Air resistance ruled-out simple, exact solutions to what would otherwise be a parabolic trajectory. This model enabled an automated canon to track and hit incoming missiles within a certain range. In addition to being able to hit missiles coming at the canon from all directions (including from below), the time taken to aim and hit the missiles was minimized. Our code took an average of 364 milliseconds (ms) to accurately determine the location of a randomized target.
The image above shows a flow chart of our approach to solving the boundary value problem.
This image shows an example of our program converging on two targets in the first quadrant (the axes are distance and altitude in units of meters). Our program was tested with randomly generated missile target positions. Success was defined as destroying 15 consecutive targets. We were competing with other students to see who could destroy the missiles in the shortest amount of time, e.g. who had written the most efficient code. Although we were ranked only 25th out of 56 teams, we were within 300 ms of the fastest team and within 50-100 ms of teams in the top 30. The bottom 26 teams took as long as 1-10 seconds to locate a target... if it didn't destroy them first.