计算物理第6次作业

2016-10-23  本文已影响0人  本居小铃

Name: 贺一珺
Student Number: 2014302290002

Problem

Abstract

In last home work, I realized the calculation of the trajectory of the cannon considering the air drug and the density of air in different latitude. I designed the progrem so that one could put in the initial angle and initial velocity of the cannon and the computer would work out the trajectory of the cannon automatically. It was a encouraging result for me, but there are still some withdrawls, the most obvious of which is that if certain object is selected, how can one know the initial angle and the initial velocity of the cannon? After all, we should not throw cannons the same way as someone throw trash, for that there is no "cannon-cleaner" in the world. So I will try to design a progrem which allow you to input the coordinate of the object and work out the minimal initial velocity and the angle automatically to attack the object precisely. Also I will try to consider the effect of wind and the error of initial velocity and angle of cannon and the error of the wind effect.

Background

Tippu's cannon
The trajectory of cannon can be calculated by solving the ordinary differential equations using Euler method. The equations are:

Realization

Homework L1

The realization of homework L1 can be divided in several steps:

  1. Design the frame of the progrem so that one can input the coordinate of the object and the trajectory canbe work out. The key point is to design the circles to work out the minimal initial velocity and the proper initial angle of the cannon.
  2. Design the function to calculate the trajectory using the air drag coefficiency, initial velocity of cannon, initial angle of cannon and wind speed.
  3. Design the frame to allow the result of step1 to be used in step2 directly. (This took me a long time. sad story)
  4. Add the function to show the result in figure.
  5. Do some contrasts.

Homework L2

  1. Design the function to generate rondam number.
  2. Add the number on the initial condition of the function to do the calculate.
  3. Analyze the result.

Plotting

Homework L1

扫角(no wind)

Details of landing point:

扫角放大(no wind)

The process of scanning the proper initial velocity:

扫速度(no wind)

Details of landing point:

扫速度放大(no wind)

The trajectory:

轨迹(no wind) 扫角(-6)

Details of landing point:

扫角放大(-6)

The process of scanning the proper initial velocity:

扫速度(-6)

Details of landing point:

扫速度放大(-6)

The trajectory:

轨迹(-6)

The process of scanning the best initial angle:

扫角(+6)

Details of landing point:


扫角放大(+6)

The process of scanning the proper initial velocity:

扫速度(+6)

Details of landing point:

扫速度放大(+6)

The trajectory:

轨迹(+6) 轨迹

It's hard to see the details in this figure so I blow up it:

轨迹放大

Homework L2

Here is the plotting:

50 cannons

I dropped 50 cannons and did the calculation to get the error first, whose result was 1870860 m^2; i, e,about 1.87 killometer square.

Acknowledge

How to contact me

上一篇 下一篇

猜你喜欢

热点阅读