平行接近法导引弹道仿真

    image
    image
    image
    代码:

    点击查看python代码
    import numpy as np
    from math import *
    import matplotlib.pyplot as plt
    plt.rcParams ['font.sans-serif']= ['SimHei'] 
    
    def PingXing():
        xM = 0*1000
        yM = 0*1000
        #初始弹道倾角
        gammaM = 240/57.3
        Vm = 300
        aM = 10
        xT = 5*1000
        yT = 5*1000
        #初始弹道倾角
        gammaT = 5/57.3
        Vt = 300
        aT = 0
    
        T = 100
        step = 0.001
        K = int(T/step)
        pM = []
        pT = []
        gammaMA = []
        tn = []
        for i in range(0,K):
            #目标运动方程
            dVt = aT
            gammaT += (0.2*step)/57.3;
            Vt  = Vt + step*dVt
            dxT = Vt*cos(gammaT)
            dyT = Vt*sin(gammaT)
            xT  = xT + step*dxT
            yT  = yT + step*dyT
    
            #相对运动方程
            drx    = xT - xM
            dry    = yT - yM
            q      = atan2(dry,drx)
            yetaT  = q - gammaT             #目标速度矢量前置角
            yetaM  = asin(Vt/Vm*sin(yetaT)) #平行接近法制导律指令导弹速度矢量前置角
            gammaM = q-yetaM
            print('飞行时间 %6.3f ' % (i*step),
                  '视线角q %6.3f' % (q*57.3),
                  'yetaT %6.3f' % (yetaT*57.3),
                  'yetaM %6.3f' % (yetaM*57.3))
            
            #导弹运动方程
            dVm = aM
            dxM = Vm*cos(gammaM)
            dyM = Vm*sin(gammaM)
            xM  = xM + step*dxM
            yM  = yM + step*dyM
            Vm  = Vm + step*dVm
            gammaMdot = aM/Vm
            gammaTdot = aT/Vt
            pM.append([xM,yM])
            pT.append([xT,yT])
            tn.append(i*step)
            gammaMA.append([gammaM*57.3])
            if((yT < 0) or (yM <0)):
                break;
            if(sqrt((yT-yM)**2 + (xT-xM)**2)<1):
                break;
        pM = np.array(pM)
        pT = np.array(pT)
        show_GT(pM,pT)
        show_Var(tn,gammaMA)
        
    
    def show_Var(tn,Var):
        plt.scatter(tn,Var,s=1)
        plt.xlabel('x-price')
        plt.ylabel('y-amount')
        plt.legend(loc=4)  # 指定legend的位置,类似象限的位置
        plt.title('速度矢量前置角')
        plt.show()
    
    def show_GT(pM,pT):
        plot2 = plt.plot(pM[:,0], pM[:,1], 'r', label='导弹运动轨迹')
        plot2 = plt.plot(pT[:,0], pT[:,1], 'b', label='目标运动轨迹')
        # plt.scatter(pM[:,0], pM[:,1],s=1, label='导弹运动轨迹')
        # plt.scatter(pT[:,0], pT[:,1],s=1, label='目标运动轨迹')
        plt.xlabel('x-price')
        plt.ylabel('y-amount')
        plt.legend(loc=4)  # 指定legend的位置,类似象限的位置
        plt.title('平行接近导引弹道')
        plt.show()
        #plt.savefig('polyfit.png')
    
    
    
    if __name__ == "__main__":
        PingXing()
    

    仿真结果:
    image
    优点:弹道平直,末端过载较小
    缺点:需要目标的速度及速度矢量前置角信息

    posted @   相对维度  阅读(240)  评论(0编辑  收藏  举报
    相关博文:
    阅读排行:
    · 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
    · 地球OL攻略 —— 某应届生求职总结
    · 周边上新:园子的第一款马克杯温暖上架
    · 提示词工程——AI应用必不可少的技术
    · Open-Sora 2.0 重磅开源!
    历史上的今天:
    2022-08-12 线性二次最优控制-输出跟踪器matlab
    点击右上角即可分享
    微信分享提示