# Algorithm for Cannon Range

#### Mikomi

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

Related Other Physics Topics News on Phys.org

#### NullSpaceMan

How much detail are you looking at simulating?

#### jtbell

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:

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving