Target interception problem—differential game
In a small experiment of partial differentiation, the author uses differential countermeasures to solve the problem of target interception. Solve the self-sufficient parameters, and I hope you can correct me a lot.
Problem Description
The missile is launched from the origin of the coordinates at the speed
of the launch angle
. At a height of H=100m, an aircraft flies
horizontally to the negative direction of the x-axis at a speed of l=100m from the horizontal origin . Find the minimum when the missile can hit the height H The minimum range angle of the missile to intercept the aircraft. As shown below. (Take the acceleration of gravity g=9.8m/s^2, take
)
Solution ideas
Solve the numerical solution sequence point of missile velocity with respect to time
From physics knowledge, the following differential equations can be established:
among them: u1(t) is the function of the missile x direction with respect to t; u3(t) is the function of the missile y direction with respect to time t. Substituting in the data:
Use the fourth-order Runge-Kutta algorithm for the above differential equation (the algorithm principle is as follows): {yi + 1 = yi + 1 6 (K 1 + 2 K 2 + 2 K 3 + K 4) K 1 = hf (xi, yi) K 2 = hf (xi + h 2, yi + 1 2 K 1) K 3 = hf (xi + h 2, yi + 1 2 K 2) K 4 = hf (xi + h, yi + K 3) \left\{\begin{array}{l}y_{i+1}=y_{i}+\frac{1}{6}\left(K_{1}+2 K_{2} +2 K_{3}+K_{4}\right) \\ K_{1}=hf\left(x_{i}, y_{i}\right) \\ K_{2}=hf\left(x_{ i}+\frac{h}{2}, y_{i}+\frac{1}{2} K_{1}\right) \\ K_{3}=hf\left(x_{i}+\frac {h}{2}, y_{i}+\frac{1}{2} K_{2}\right) \\ K_{4}=hf\left(x_{i}+h, y_{i}+ K_{3}\right)\end{array}\right.⎩⎪⎪⎪⎪⎨⎪⎪⎪⎪⎧Yi+1=Yi+61(K1+2 K2+2 K3+K4)K1=hf(xi,Yi)K2=hf(xi+2h,Yi+21K1)K3=hf(xi+2h,Yi+21K2)K4=hf(xi+h,Yi+K3)
Solve the sequence points of u2(t) and u4(t) with respect to time t.
Angle solution
Using the idea of dichotomy, the initial angle is 0, the step length is taken
, and the fourth-order Runge-Kutta algorithm is used to obtain the numerical solution of the velocity of the missile corresponding to the corresponding time point, and the displacement of the missile at different angles is obtained by interpolation Circumstances, and find the angle at which the maximum height of the missile is 100m in the y-axis direction. The specifically designed solution algorithm program runs as follows:
Solution results and procedures
The minimum firing angle at which the missile can hit a height H
First, the Runge-Kutta algorithm is implemented through the program:
function [x,y]=runge_kutta1(ufunc,y0,h,a,b)
%参数表顺序依次是微分方程组的函数名称,初始值向量,步长,时间起点,时间终点
n=floor((b-a)/h);%求步数
x(1)=a;%时间起点
y(:,1)=y0;%赋初值,可以是向量,但是要注意维数
for ii=1:n
x(ii+1)=x(ii)+h;
k1=ufunc(x(ii),y(:,ii));
k2=ufunc(x(ii)+h/2,y(:,ii)+h*k1/2);
k3=ufunc(x(ii)+h/2,y(:,ii)+h*k2/2);
k4=ufunc(x(ii)+h,y(:,ii)+h*k3);
y(:,ii+1)=y(:,ii)+h*(k1+2*k2+2*k3+k4)/6;
%按照龙格库塔方法进行数值求解
end
Substitution function to try:
Differentiation program
%导弹函数x y方向的速度的方程y(1)是速度v0 y(2)为射角
function dy=Missile(x,y)
dy = zeros(2,1);%始化列向量
%定义y方向
dy(1) = -(y(1)*0.025+9.8);
% dy(2) = y(2);
% %定义x方向
% dy(3) =-y(3)*0.01;
dy(2)=-(y(2)*0.025);
[T1,F1]=runge_kutta1(@Missile,[300*sin(pi/3) 300*cos(pi/3)],0.01,0,2);
%subplot(122)
plot(T1,F1)%自编的龙格库塔函数效果
legend('y方向的速度','x方向的速度')
title('自编的 龙格库塔函数')
Operation result (try assuming that the firing angle is pi/3):
Using the Runge-Kutta method and the angle iteration thought program to obtain the minimum firing angle when the missile can hit the height H, the program is:
%定义速度为300m/s,飞机从高100m的地方水平距离为100米以50m/s的速度向y轴方向飞行
%最大飞行时间是2s,取射角为c,按区间值pi/180长度进行迭代
H=100;
v=300;
%飞机的速度
v1=50;
%H=0;
t=0;
%x轴方向l方向
l=100;
%导弹的水平路程
x=0;
%找到一个初始角
for c=0:pi/180:pi/2
[T,F1]=runge_kutta1(@Missile,[300*sin(c) 300*cos(c) ],0.01,0,2);
h=0;
j=1;
F11=F1(1,:);
for i=1:0.01:2
d=0;
h=h+0.01*F11(j);
j=j+1;
if h<H+0.1&&h>H-0.1
d=1;
fprintf('高度正好到h时角度:c=%d',c);
break;
else
fprintf('角度:c=%d,达不到高度\n',c);
end
end
if d==1
break;
end
end
Iteratively try to solve the problem with a step size of pi/180. When h<H+0.1&&h>H-0.1 is deemed to meet the height condition, the iteration stops and the result is obtained. The final running result is:
The minimum angle to reach high is c=5.061455e-01.
Minimum range angle
Use the idea of dichotomy to find the minimum range angle and draw the realization of the trajectory of the two at the same time ()
二分程序
The results of the two motion trajectories of the program are as follows: The
minimum intercept range angle is 1.00, and the missile intercepts the aircraft at this time
summary
This experiment mainly solves the missile interception problem through the idea of Runge-Kutta method and interpolation type integration. It is solved that when the firing angle is 0.5061, the maximum firing height of the missile can be 100m; the minimum intercepting range angle is 1.00, The missile can intercept the aircraft. In this experiment, when solving the minimum intercept range angle, the idea of dichotomy is used to solve the problem, which reduces the calculation amount of the solution, but in terms of error analysis and sensitivity analysis, it is still an improvement and improvement in the future. Further research is needed to make the experiment get More precise results.