Exercise_05 A Discussion of Cannon

Abstract

Generalize the program developed for the previous problem so that it can deal with the situations in which the target is at different altitude than the cannon. Consider cases in which the target is higher and lower than the cannon.Also investigate how the minimum firing velocity required to hit the target varies as the altitude of the target is varied.

Background

This is the more advanced edition of last paper.
In this pepar, I will discuss the influence cause by the differences of the angle, the velocity and the air drag.

Analysis

Accoding to the result in last paper, we have

5.1
5.2
5.3
5.4

And

5.5

We assume that the distance of the target is s. To hit the target, we must calulate the initial velocity and initial angle. We use v0 and θ to stand for them. And we use θ=45°, for example, to discuss the differences of initial velcoty, initial angle and the air drag.
As

5.6
5.7
5.8

We use these new quantities to represent the old quantities and we use random number to produce these differences.

5.9
5.10
5.11

Code

Exercise_05 A Discussion of Cannon_第1张图片
5.12

Result

The results of ten rnnings are

5.13
The code still have some problems. But this level is what I can do.

你可能感兴趣的:(Exercise_05 A Discussion of Cannon)