参考文献:《几种增大空地导弹落角的制导方式比较》
clear
clc
%-----------导弹参数---------
V_m=260;%飞行速度
X_m=0;
Y_m=1000; %初始飞行高度
theta_m=0*pi/180; %弹道倾角
%----------目标参数---------
V_t=0; %静止目标
X_t=4800;
Y_t=0;
theta_t=0;
dtheta_t=0;
n_t=0;
A_t=0;
R=sqrt((X_m-X_t)^2+(Y_m-Y_t)^2);
q=atan((Y_t-Y_m)/(X_t-X_m));
dR=((X_m-X_t)*(V_m*cos(theta_m)-V_t*cos(theta_t))+(Y_m-Y_t)*(V_m*sin(theta_m)-V_t*sin(theta_t)))/sqrt((X_m-X_t)^2+(Y_m-Y_t)^2);
dq=((X_t-X_m)*(V_t*sin(theta_t)-V_m*sin(theta_m))-(Y_t-Y_m)*(V_t*cos(theta_t)-V_m*cos(theta_m)))/((X_m-X_t)^2+(Y_m-Y_t)^2);
n_m=-q+theta_m;
c=3;
g=9.8;
n=1;
t=0;
dt=0.01;
while (dR<0)
Am=4*dq*abs(dR)+(c+1)*g*cos(theta_m); %过重补比例导引
dtheta_m=Am/V_m; %纵向通道:弹道倾角变化函数
theta_m=theta_m+dtheta_m*dt;
%----------------------------计算坐标----------------------------
X_m=X_m+V_m*cos(theta_m)*dt;
Y_m=Y_m+V_m*sin(theta_m)*dt;
n_m=-q+theta_m;
R=sqrt((X_m-X_t)^2+(Y_m-Y_t)^2);
q=atan((Y_t-Y_m)/(X_t-X_m));
dR=((X_m-X_t)*(V_m*cos(theta_m)-V_t*cos(theta_t))+(Y_m-Y_t)*(V_m*sin(theta_m)-V_t*sin(theta_t)))/sqrt((X_m-X_t)^2+(Y_m-Y_t)^2);
dq=((X_t-X_m)*(V_t*sin(theta_t)-V_m*sin(theta_m))-(Y_t-Y_m)*(V_t*cos(theta_t)-V_m*cos(theta_m)))/((X_m-X_t)^2+(Y_m-Y_t)^2);
alpha=Am/g/(0.3*g);%计算攻角
theta_m_store(n)=theta_m; %保存弹道倾角
alpha_store(n)=alpha;%保存攻角
Am_store(n)=Am; %保存纵向过载
P_m_store(:,n)=[X_m;Y_m]; %保存拦截弹坐标
n=n+1;
t=t+dt;
end
disp('脱靶量为(m):')
R
disp('飞行时间为(s):')
t
figure(1)
plot(P_m_store(1,:),P_m_store(2,:),X_t,Y_t,'r+')
hold on
xlabel('X/m')
ylabel('Y/m')
figure(2)
plot((1:n-1)*dt,Am_store)
hold on
xlabel('time/s')
ylabel('Acceleration/m^2')
title('加速度')
figure(3)
plot((1:n-1)*dt,theta_m_store*180/pi)
hold on
xlabel('time/s')
ylabel('\theta_m/°')
title('弹道倾角')
figure(4)
plot((1:n-1)*dt,alpha_store*180/pi)
hold on
xlabel('time/s')
ylabel('\alpha/°')
title('攻角')