美文网首页
超级辅助精确打击系统

超级辅助精确打击系统

作者: RicardoZiTseng | 来源:发表于2016-10-23 17:05 被阅读0次
  • 这次是上次炮弹射击的升级版,要求考虑发射角度误差,速度误差和迎面风阻误差
  • 发射角度误差为正负2度,速度误差为正负5%,迎面风阻误差为正负10%
  • 如果要精确打击到指定点,我的想法是应当先设置好炮弹射击的初始参数,即初始速度

公式推演

1

![](http://latex.codecogs.com/png.latex?v_{x,i+1}=v_{x,i}-\frac{\rho}{\rho_{0}}\cdot\frac{B_2}{m}\cdot|\vec{v}-v_wind|\cdot(v_{x,i}-v_{wind})\cdot\Delta t \ \approx v_{x,i}-\frac{\rho}{\rho_0}\cdot\frac{B_2}{m}\Delta v\cdot v_{x,i}\cdot \Delta t)
![](http://latex.codecogs.com/png.latex?v_{y,i+1}=v_{y,i}-g\Delta t-\frac{\rho}{\rho_0}\cdot\frac{B_2}{m}\cdot\Delta v\cdot v_{y,i}\cdot\Delta t)

2

![](http://latex.codecogs.com/png.latex?v_{x,i+1}\approx v_{x,i}-\frac{\rho}{\rho_0}\cdot\frac{B_2}{m}\cdot\Delta v\cdot v_{x,0}\cdot \Delta t=v_{x,i}-k_x\Delta t)
其中
![](http://latex.codecogs.com/png.latex?k_x=\frac{\rho}{\rho_0}\cdot\frac{B_2}{m}\cdot\Delta v\cdot v_{x,0})
![](http://latex.codecogs.com/png.latex?v_{y,i+1}\approx v_{y,i}-(g+\frac{\rho}{\rho_0}\cdot\frac{B_2}{m}\cdot\Delta v\cdot v_{y,0})\cdot\Delta t=v_{y,i}-k_y\Delta t)

3

设定发射距离为dis和时间t,则有:


解得:

且:

解得:

但考虑到k_x里有参数v_x0,k_y里有参数v_y0
则有:
![](http://latex.codecogs.com/png.latex?v_{x,0}=\frac{dis}{(1-\frac{\rho}{2\rho0}\frac{B_2}{m}\Delta vt)t})
![](http://latex.codecogs.com/png.latex?v_{y,0}=\frac{gt}{2-\frac{\rho}{\rho_0}\frac{B_2}{m}\Delta vt})
但由于:
![](http://latex.codecogs.com/png.latex?\Delta v=|\vec{v}-\vec{v_{wind}}| \
|\vec v|=\sqrt{(v_{x,0}2+v_{y,0}2)})
这个参数不太好弄,所以我令:
![](http://latex.codecogs.com/png.latex?\frac{\rho}{\rho_0}=1,\Delta v=1)
任性=_=

code(python 2.7)

import numpy
import math
import random
import matplotlib.pyplot as pl
class cannon_shell:
    def __init__(self,time_step=0.001,resis_coeff=4e-5,total_time=30,gravity=9.8,initial_dis=0):
        print("enter the distance what you want to get ->")
        self.distance=float(input())
        print("enter the time to get ->")
        self.t=float(input())
        print("enter the velocity of wind ->")
        print("1.v_wind > 0 means tailwind")
        print("2.v_wind < 0 means headwind")
        self.v_wind=float(input())
        self.B2_m=resis_coeff
        self.g=gravity
        self.dt=time_step
        self.rho=1
        self.ini_vx=self.distance/((1-0.5*self.rho*self.B2_m*self.t)*self.t)
        self.ini_vy=(self.g*self.t)/(2-self.rho*self.B2_m*self.t)
        self.v_x=[self.ini_vx]
        self.v_y=[self.ini_vy]
        self.v=(pow(self.v_x[-1],2)+pow(self.v_y[-1],2))**0.5
        self.sin=self.v_y[-1]/self.v
        self.theta=float((180*math.asin(self.sin))/math.pi)
        self.x=[0]
        self.y=[0]
    def re_init(self):
        self.v_x=[self.ini_vx]
        self.v_y=[self.ini_vy]
        self.v=(pow(self.v_x[-1],2)+pow(self.v_y[-1],2))**0.5
        self.sin=self.v_y[-1]/self.v
        self.theta=float((180*math.asin(self.sin))/math.pi)
        self.x=[0]
        self.y=[0]
    def run(self):
        vran=self.v
        thetaran=self.theta
        self.v=random.uniform(vran*0.95,vran*1.05)
        self.theta=random.uniform(thetaran-2,thetaran+2)
        self.v_x=[self.v*math.cos((self.theta/180)*math.pi)]
        self.v_y=[self.v*math.sin((self.theta/180)*math.pi)]
        while(self.y[-1]>=0):
            self.rho=(1-(2.257e-5)*self.y[-1])**2.5
            self.v=(pow(self.v_x[-1],2)+pow(self.v_y[-1],2))**0.5
            self.deltaV=(pow(self.v,2)-2*self.v*self.v_wind+pow(self.v_wind,2))**0.5
            self.x.append(self.x[-1]+self.v_x[-1]*self.dt)
            self.y.append(self.y[-1]+self.v_y[-1]*self.dt)
            self.v_x.append(self.v_x[-1]-self.rho*self.B2_m*self.deltaV*\
            (self.v_x[-1]-self.v_wind)*self.dt)
            self.v_y.append(self.v_y[-1]-self.g*self.dt-\
            self.rho*self.B2_m*self.deltaV*self.v_y[-1]*self.dt)
            '''labeltext=str(self.rad)'''
    def show_result(self):
        labeltext="shoot point="+str(self.x[-1])+\
        "  "+"velocity="+str((pow(self.v_x[0],2)+pow(self.v_y[0],2))**0.5)
        pl.plot(self.x,self.y,label=labeltext)
        pl.title('connon shell with air resistance')
        pl.xlabel('x/m')
        pl.ylabel('y/m')
        pl.ylim(0.0)
        pl.legend(loc='upper left')
        pl.show()
def calTrajectory():
    Delta_x=[]
    a=cannon_shell()
    for i in range(200):
        a.run()
        Delta_x.append(a.x[-1]-a.distance)
        a.re_init()
    AverDelta=sum(Delta_x)/200
    a.ini_vx=a.ini_vx-AverDelta/a.t
    a.re_init()
    a.run()
    a.show_result()
calTrajectory()

结果

误差还是蛮大的,我不想上台比试U_U

  • 能力有限,就只能做到这里了2333
  • 还没有考虑迎面风阻误差
  • 心累

相关文章

  • 超级辅助精确打击系统

    这次是上次炮弹射击的升级版,要求考虑发射角度误差,速度误差和迎面风阻误差 发射角度误差为正负2度,速度误差为正负5...

  • S320,S350,S400奔驰改装通风座椅升级23P驾驶辅助

    驾驶辅助升级通风座椅案例 23P驾驶辅助系统 主动式盲点辅助系统 主动式车道保持辅助系统 车尾碰撞警告和保护系统 ...

  • 关于容器云的思考

    最近一直在想Google走容器云这招真的是牛掰,不仅精确的打击了docker,而且 最重要的是: 使得分布式系统的...

  • 雪佛兰科鲁兹倒车辅助不工作

    故障: 倒车警报不想,辅助系统不工作 诊断: 倒车辅助系统也叫超声波驻车辅助系统,包括物体警报模块,后物体警报传感...

  • 我的钢笔画20180408

    继续辅助线练习,效果好了很多。人像还是不够精确,观察还需要更细致。

  • Mac系统辅助功能键盘设置方法

    Mac系统辅助键盘怎么开启?Mac系统中有辅助键盘,就是当没有外设键盘的时候,可以使用辅助键盘操作,下面我们就来看...

  • 【复盘】|2022.1.18

    需要去思考这套体系 方法论 12条操作系统,辅助你刻意练习,迭代升级。 【超级个体】:实现财富自由,需要设计一个只...

  • 最强辅助系统

    “啊,我靠,什么东西弄的我这么疼”一个男孩慢慢的从地上爬了起了

  • 你所不知道的Interface Builder / Storyb

    使用辅助线 显示 UI 元素间的相对位置 通过任意锚点独立改变元素尺寸 在层叠区域快速精确地拾取特定元素 使用辅助...

  • 褔彩3D2018年008期

    好久没写分析了,昨天的021都在我的精确预测之内,概率分析的精确打击这就是3D。 今晚百单丁3,个147没多少注自...

网友评论

      本文标题:超级辅助精确打击系统

      本文链接:https://www.haomeiwen.com/subject/jvbhuttx.html