v=size(T2); ty=v(1,1); yy=zeros(v(1,1),2);
yy(:,1) = Y(:,1).*cos(Y(:,2));
yy(:,2) = Y(:,1).*sin(Y(:,2));
a = max(sqrt((Ly(i,1)-yy(ty,1))^2+(Ly(i,2)-yy(ty,2))^2));
r(1,k)=a;
end;
R=min(r(1,:));
w=1; q=w; Ly(i,:)=Y(ty,:);
while ((w~=11)&&(R~=r(1,w)))
q = w; Ly(i,:)=Y(ty,:); w=w+1;
end;
G2(2,i)=pi/2-(q-1)*pi/(2*m); G2(1,i) = pi/2-(p-1)*pi/(2*m);
xo=[ Lx(i,1); Lx(i,2); Lx(i,3); Lx(i,4) ];
yo=[ Ly(i,1); Ly(i,2); Ly(i,3); Ly(i,4) ];
end;
G2
ro = max(sqrt((Lx(i,1)-Ly(i,1))^2+(Lx(i,2)-Ly(i,2))^2))
end
function [T,X] = sysx(fix, tspano, xo )
fi=fix;
x0=xo;
tspan = tspano;
[T,X] = ode45(@f,tspan,x0);
function dxdt = f(t,x)
dxdt = [x(3);
x(4)/x(1);
x(4)^2/x(1)-(0.592 - 0.12*cos(fi)^3)*149.6^2*10^12/x(1)^2;
-x(3)*x(4)/x(1)-(0.592-0.12*cos(fi)^2*sin(fi))*149.6^2*10^12];
end
end
function [T,Y] = sysy(fiy, tspano, yo )
fi=fiy;
y0=yo;
tspan = tspano;
[T,Y] = ode45(@f,tspan,y0);
function dydt = f(t,y)
dydt = [y(3);
y(4)/y(1);
y(4)^2/y(1)-(0.592 - 0.22*cos(fi)^3)*149.6^2*10^12/y(1)^2;
-y(3)*y(4)/y(1)-(0.592-0.22*cos(fi)^2*sin(fi))*149.6^2*10^12/y(1)^2];
end
end
%нижняя игра. когда Р знает что выбрал Е
function [] = second3_n(TT,N,M,Xo,Yo)
d=TT/N;
n=N;
m=M;
t= linspace(1,d*n,n);
xo = Xo; yo = Yo;
G = zeros(2,n); G2 = zeros(2,n);
mx2 = zeros(1,n-1); mn2 = zeros(1,n-1); mn2(1,1) = Yo(1,1)^2;
Lx = zeros(n,4); Ly = zeros(n,4);
for i=1:n-1
fix=zeros(1,m);
fiy=zeros(1,m);
for o=1:m
fix(o)=pi/2-(o-1)*pi/(2*m);
fiy(o)=pi/2-(o-1)*pi/(2*m);
end;
mx = zeros(m,m);
for j=1:m
for k = 1:m
[T1,X] = sysx(fix(j),[t(1) t(i+1)],xo);
[T2,Y] = sysy(fiy(k),[t(1) t(i+1)],yo);
u=size(T1); v=size(T2);
xx=zeros(u(1,1),2); yy=zeros(v(1,1),2);
tx=u(1,1); ty=v(1,1);
xx(:,1) = X(:,1).*cos(X(:,2)); xx(:,2) = X(:,1).*sin(X(:,2));
yy(:,1) = Y(:,1).*cos(Y(:,2)); yy(:,2) = Y(:,1).*sin(Y(:,2));
a = max(sqrt((xx(tx,1)-yy(ty,1))^2+(xx(tx,2)-yy(ty,2))^2));
mx(k,j)=a;
end;
end ;
mn2(1,i)=min(max(mx));
z=1; w=1; Lx(i,:)=X(tx,:);
Ly(i,:)=Y(ty,:); p=w; q=z;
while ((z~=m+1)&&(w~=m+1)&&(mn2(1,i)~=mx(z,w)))
while ((w~=m+1)&&(z~=m+1)&&(mn2(1,i)~=mx(z,w)))
p=w; Lx(i,:)=X(tx,:);
Ly(i,:)=Y(ty,:); q=z; w=w+1;
end;
z=z+1; w=1;
end;
G(1, i) = pi/2-(p-1)*pi/(2*m); G(2, i) = pi/2-(q-1)*pi/(2*m);
end;
xo=[ Lx(1,1); Lx(1,2); Lx(1,3); Lx(1,4) ];
yo=[ Ly(1,1); Ly(1,2); Ly(1,3); Ly(1,4) ];
G2(:,1)=G(:,1);
for i=2:n-1
r=zeros(1,m);
for j=1:m
[T1,X] = sysx(fix(j),[t(i) t(i+1)],xo);
u=size(T1);
tx=u(1,1);
xx=zeros(u(1,1),2);
xx(:,1) = X(:,1).*cos(X(:,2)); xx(:,2) = X(:,1).*sin(X(:,2));
a = max(sqrt((xx(tx,1)-Lx(i,1))^2+(xx(tx,2)-Lx(i,2))^2));
r(1,j)=a;
end;%j
R=min(r(1,:));
w=1; p=w;
Lx(i,:)=X(tx,:);
while ((w~=m+1)&&(R~=r(1,w)))
p=w; Lx(i,:)=X(tx,:); w=w+1;
end;
for k=1:m
[T2,Y] = sysy(fiy(k),[t(i) t(i+1)],yo);
v=size(T2); yy=zeros(v(1,1),2); ty=v(1,1);
yy(:,1) = Y(:,1).*cos(Y(:,2)); yy(:,2) = Y(:,1).*sin(Y(:,2));
a = max(sqrt((Ly(i,1)-yy(ty,1))^2+(Ly(i,2)-yy(ty,2))^2));
r(1,k)=a;
end;%k
R=min(r(1,:));
w=1; q=w; Ly(i,:)=Y(ty,:);
while ((w~=1+m)&&(R~=r(1,w)))
q = w; Ly(i,:)=Y(ty,:); w=w+1;
end;
G2(2,i)=pi/2-(q-1)*pi/(2*m);
G2(1,i) = pi/2-(p-1)*pi/(2*m);
xo=[ Lx(i,1); Lx(i,2); Lx(i,3); Lx(i,4) ];
yo=[ Ly(i,1); Ly(i,2); Ly(i,3); Ly(i,4) ];
end;
G2
ro = max(sqrt((Lx(i,1)-Ly(i,1))^2+(Lx(i,2)-Ly(i,2))^2))
end
Литература.
2. Барсегян В. Р., Малафеев О.А. Об игровых задачах в центральном ньютоновском поле тяготения. –Я.: Изд-во Якутск. ун-та, 1988. 51-56 с.
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.