@74849b
2016-10-23T06:03:09.000000Z
字数 2043
阅读 933
在之前的情况中讨论定点发射。仍考虑空气阻力,使用绝热模型,这个运动的方程可表示如下:
对于情况a,代码如下:
import matplotlib.pyplot as plt
import math
theta_proper=[]
#t=0
vx=[]
vy=[]
dt=0.1
v=[]
x=[]
y=[]
v_ini=700
bm=4e-5
T=200
a=6.5e-3
c=2.5
g=9.8
target1=20000
target2_list=[-300,0,4000]
for theta in range(0,90):
v.append(v_ini)
vx.append(v_ini*math.cos(theta*math.pi/180)),vy.append(v_ini*math.sin(theta*math.pi/180))
x.append(0),y.append(0)
while x[-1]<=22000:
vx.append(vx[-1]-bm*dt*v[-1]*vx[-1]*(1-a*y[-1]/T)**c)
vy.append(vy[-1]-g*dt-bm*dt*v[-1]*vy[-1]*(1-a*y[-1]/T)**c)
x.append(x[-1]+vx[-1]*dt)
y.append(y[-1]+vy[-1]*dt)
v.append(math.sqrt(vx[-1]**2+vy[-1]**2))
for i in range(3):
if math.sqrt((x[-1]-target1)**2+(y[-1]-target2_list[i]* *2)<=50:
print"the altitude,the proper theta:",target2_list[i],theta
theta_proper.append(theta)
break
此时我让设计点落在固定点周围50米内,运行结果如图:
可见对于每一个高度,只对应一个角度。调整范围到40米,如图:
可见对于海拔为零的地方,在此精度范围内,没有出射角与之对应。
选取精度为100米,如图:
在此精度下,在某些海拔高度可能对应着多个角度。
可得出结论,精度越高,所对应的出射角越准确。
对于情况b,代码如下:
import matplotlib.pyplot as plt
import math
v_proper=[]
vx=[]
vy=[]
dt=0.1
v=[]
x=[]
y=[]
theta=45
bm=4e-5
T=200
a=6.5e-3
c=2.5
g=9.8
target1=21229.8
target2_list=[2821.8,4498.95,6463.31]
for v_ini in range(640,710):
v.append(v_ini)
vx.append(v_ini*math.cos(theta*math.pi/180))
vy.append(v_ini*math.sin(theta*math.pi/180))
x.append(0),y.append(0)
while x[-1]<=26000:
vx.append(vx[-1]-bm*dt*v[-1]*vx[-1]*(1-a*y[-1]/T)**c)
vy.append(vy[-1]-g*dt-bm*dt*v[-1]*vy[-1]*(1-a*y[-1]/T)**c)
x.append(x[-1]+vx[-1]*dt)
y.append(y[-1]+vy[-1]*dt)
v.append(math.sqrt(vx[-1]**2+vy[-1]**2))
for i in range(3):
if math.sqrt((x[-1]-target1)**2+(y[-1]-target2_list[i])**2)<=50:
print"the altitude,the proper v:",target2_list[i],v_ini
v_proper.append(v_ini)
break
当精度取为50米时,结果如图:
对于每一高度,可对应一定范围内的速度值。
改变50至20,结果如图:
此时可取的速度范围变小,精确度提高
可以用此模型进行定点打击,相对于20000米的打击,精度在50米内可以接受。从结果可看出,当海拔高度变低时,相应的出射速度也变低。
参考13级学长关于确定打击目标的代码