本文主要是介绍TH方程学习(5),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一、内容介绍
在本节中,将会利用TH方程的状态转移矩阵,求解双脉冲轨道转移问题:给定转移时间T,通过状态转移矩阵求解初始速度增量和末端速度,使得追踪星在初始速度增量的作用下转移到目标位置,追踪星到达后,在的作用下达到期望的相对速度。
在第四节中,在给定目标星初始偏心率,近地点高度,真近地点角以及转移时间的情况下,可以求出其状态转移矩阵。根据状态转移矩阵的性质,可以写为如下形式
因此,对于第一次需要的脉冲,可以通过
对于第二次需要施加的脉冲,可以得到
二、案例仿真
本文使用STK进行了一次案例仿真,代码如下:TH_solver函数在第四节给出
% 使用STK验证VVLH坐标系
clc;clear
uiApplication = actxGetRunningServer('STK12.application');
root = uiApplication.Personality2;
checkempty = root.Children.Count;
if checkempty ~= 0root.CurrentScenario.Unloadroot.CloseScenario;
end
root.NewScenario('VVLH');
StartTime = '26 Jan 2024 04:00:00.000'; % 场景开始时间
StopTime = '10 Feb 2024 04:00:00.000'; % 场景结束时间
root.ExecuteCommand(['SetAnalysisTimePeriod * "',StartTime,'" "',StopTime,'"']);
root.ExecuteCommand(' Animate * Reset');
SatName = 'Target'; % SAR_ GX_ Sat_ GX_1_ SAR_1_
satellite = root.CurrentScenario.Children.New('eSatellite', SatName);
satellite.SetPropagatorType('ePropagatorAstrogator'); % 不设置的时候默认为二体模型 ePropagatorJ4Perturbation
satellite.Propagator;
% 目标星初始状态
Perigee = 500;
T = 60;
% 追踪星在VVLH坐下的相对位置
delta_r = [0.1;0.01;0.01];
delta_v = [0.0001;0.0001;0.0001];
Perige = 6378.137+Perigee;
ecc = 0.1;
sma = Perige/(1-ecc);
Inc = 30;
w = 0;
RAAN = 0;
TA = 45;
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' SetValue MainSequence.SegmentList Initial_State Propagate']);
InitialState=satellite.Propagator.MainSequence.Item(0);
%% 初始化卫星参数
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' SetValue MainSequence.SegmentList.Initial_State.CoordinateType Modified Keplerian']);
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' SetValue MainSequence.SegmentList.Initial_State.InitialState.Epoch ',StartTime,' UTCG']);
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.sma ',num2str(sma),' km']);
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.ecc ',num2str(ecc)]);
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.inc ',num2str(Inc),' deg']);
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.w ',num2str(w),' deg']);
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.RAAN ',num2str(RAAN),' deg']);
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.TA ',num2str(TA),' deg']);
%% 二体传播
Propagate=satellite.Propagator.MainSequence.Item(1);
Propagate.PropagatorName='Earth Point Mass';
root.ExecuteCommand(['Astrogator */Satellite/',SatName,' RunMCS']);% 插入目标星
SatName2 = 'Chaser';
satellite2 = root.CurrentScenario.Children.New('eSatellite', SatName2);
satellite2.SetPropagatorType('ePropagatorAstrogator'); % 不设置的时候默认为二体模型 ePropagatorJ4Perturbation
satellite2.Propagator;
InitialState2=satellite2.Propagator.MainSequence.Item(0);
InitialState2.CoordSystemName='Satellite/Target VVLH';
InitialState2.Element.X=delta_r(1);
InitialState2.Element.Y=delta_r(2);
InitialState2.Element.Z=delta_r(3);
InitialState2.Element.Vx=delta_v(1);
InitialState2.Element.Vy=delta_v(2);
InitialState2.Element.Vz=delta_v(3);
Propagate2=satellite2.Propagator.MainSequence.Item(1);
Propagate2.PropagatorName='Earth Point Mass';
satellite2.Propagator.MainSequence.Insert('eVASegmentTypeManeuver','Maneuver1','Propagate');
Maneuver=satellite2.Propagator.MainSequence.Item(1);
root.ExecuteCommand(['Astrogator */Satellite/',SatName2,' SetValue MainSequence.SegmentList.Maneuver1.ImpulsiveMnvr.AttitudeControl Thrust Vector']);
Maneuver.Maneuver.AttitudeControl.ThrustAxesName='Satellite VVLH.Axes';satellite2.Propagator.MainSequence.Insert('eVASegmentTypeManeuver','Maneuver2','Propagate');
satellite2.Propagator.MainSequence.Insert('eVASegmentTypePropagate','Propagate1','Maneuver2');
Propagate3=satellite2.Propagator.MainSequence.Item(2);
Propagate3.PropagatorName='Earth Point Mass';
Propagate3.Properties.Color=255;
Propagate3.StoppingConditions.Item(0).Properties.Trip = T;
root.ExecuteCommand(['Astrogator */Satellite/',SatName2,' SetValue MainSequence.SegmentList.Maneuver2.ImpulsiveMnvr.AttitudeControl Thrust Vector']);
Maneuver2=satellite2.Propagator.MainSequence.Item(3);
Maneuver2.Maneuver.AttitudeControl.ThrustAxesName='Satellite VVLH.Axes';
%% 本代码旨在使用TH方程求解双脉冲转移问题% 期望到达的位置
r_f = zeros(3,1);
v_f = zeros(3,1);
% TH求出状态转移矩阵
[v,Phi,vv]=TH_solver(ecc,Perigee,TA,delta_r,delta_v,T);
% 求出状态转移矩阵的每个部分
Phi_rr = Phi(1:3,1:3);
Phi_rv = Phi(1:3,4:6);
Phi_vr = Phi(4:6,1:3);
Phi_vv = Phi(4:6,4:6);
% 求出第一次脉冲施加的大小
vv_0 = inv(Phi_rv)*(r_f-Phi_rr*delta_r);
dv1 = vv_0-delta_v;
% 求出第二次施加脉冲的大小
vv_f = Phi_vr*delta_r+Phi_vv*vv_0;
dv2 = v_f-vv_f;
Maneuver.Maneuver.AttitudeControl.X=dv1(1)*1000;
Maneuver.Maneuver.AttitudeControl.Y=dv1(2)*1000;
Maneuver.Maneuver.AttitudeControl.Z=dv1(3)*1000;
Maneuver2.Maneuver.AttitudeControl.X=dv2(1)*1000;
Maneuver2.Maneuver.AttitudeControl.Y=dv2(2)*1000;
Maneuver2.Maneuver.AttitudeControl.Z=dv2(3)*1000;
root.ExecuteCommand(['Astrogator */Satellite/',SatName2,' RunMCS']);
% 报告二颗卫星的三维关系
satellite.VO.OrbitSystems.InertialByWindow.IsVisible=0;
satellite2.VO.OrbitSystems.InertialByWindow.IsVisible=0;
satellite2.VO.OrbitSystems.Add('Satellite/Target VVLH System')
satellite.VO.Vector.RefCrdns.Item(2).Visible=1;targetdata=root.ExecuteCommand(['Report_RM */Satellite/Target Style "VVLH" TimePeriod "26 Jan 2024 04:00:00.000" "26 Jan 2024 16:00:00.000" TimeStep 10']);
Num=targetdata.Count;
root.ExecuteCommand('Astrogator */Satellite/Target ClearDWCGraphics');
root.ExecuteCommand('Astrogator */Satellite/Chaser ClearDWCGraphics');
for j=1:Num-2struct=regexp(targetdata.Item(j),',','split');Tar_x(j)=str2double(struct{2});Tar_y(j)=str2double(struct{3});Tar_z(j)=str2double(struct{4});
endfigure(1)
plot3(Tar_x(1:12),Tar_y(1:12),Tar_z(1:12),'LineWidth',1);
axis([-0.1 0.1 -0.1 0.1 -0.1 0.1])
set(gca,'XDir','reverse');
set(gca,'YDir','reverse');
set(gca,'ZDir','reverse');
xlabel('X axis(km)','FontName','Times New Roman')
ylabel('Y axis(km)','FontName','Times New Roman')
zlabel('Z axis(km)','FontName','Times New Roman')
title('e=0.1,Perigee=500km','FontName','Times New Roman')
grid on
hold on
plot3(0,0,0,'g.')
plot3(delta_r(1),delta_r(2),delta_r(3),'r.')
legend('transfer trajectory(TH)','Original','Final','Location','Northeast')
这篇关于TH方程学习(5)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!