1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Algorithm for Cannon Range

  1. Oct 11, 2007 #1
    I've been assigned a relatively funky physics project, and the process of writing the algorithm for said project has completely stumped me.

    I have chosen to research the Oerlikon 20 mm auto-cannon, and have done all of my research and am at the point where I am supposed to write an algorithm.

    Per the worksheet: "Develop an algorithm to calculate the range of the cannon based on variables you, as the cannoneer, control. Show all work for your derivation of the algorithm."

    If anybody could send me in a general direction, I would be much obliged. Thanks so much! :3
  2. jcsd
  3. Oct 12, 2007 #2
    How much detail are you looking at simulating?
  4. Oct 12, 2007 #3


    User Avatar

    Staff: Mentor

    If it were me, I would start with the differential equation for projectile motion including air resistance, and use something like the fourth order Runge-Kutta algorithm to solve it numerically for a given launch angle, speed, and drag coefficient. Then calculate the trajectories for various combinations of launch angle and speed, and construct a table.

    Of course, I have no idea whether this would be appropriate for you to try, because I don't know if you've studied differential equations or even basic calculus, or how much physics you've studied. And for the Runge-Kutta algorithm you need to know some computer programming or at least how to use a spreadsheet for complex numerical calculations.

    So maybe you'd better give us some idea of what level school you're in, and where you're starting from as far as math and physics knowledge is concerned.
    Last edited: Oct 13, 2007
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook