STK与matlab交互 Astrogator模块(7)

一、背景介绍

    根据前六节的介绍,均采用STK自带的Lambert工具箱求解双脉冲转移问题。从前文可以发现,采用Lambert制导求出的脉冲过大,形成的轨迹与实际工程能力严重不符。从这一节开始,将采用STK中的Differential Corrector对双脉冲转移问题进行求解。

二、案例仿真

结合实际案例:例如目标星是定轨在东经150°的地球同步轨道,蓝星是定在东经165°的地球同步轨道,蓝星在26 Jan 2024 04:00:00.000 UTCG开始实施机动,经过一天的时间机动到达目标星VVLH坐标系下(0,0,10km,1.4583m/s,0,0),根据前面介绍的知识,到达该状态后,蓝星将会在接下来的时刻绕飞目标星。

(1)参考前文的介绍,将VVLH坐标系转换成地球惯性系下的方式,是通过生成一个27 Jan 2024 04:00:00.000 UTCG时刻满足目标星VVLH坐标系(0,0,10km,1.4583m/s,0,0)的绕飞星,对其惯性坐标系生成报表,得到其初始位置的惯性坐标位置和速度。给出代码如下:

MissionTime='27 Jan 2024 04:00:00';% 在给定任务的第十天要求到达该位置
miu=3.986e5;omega=2*pi/period;z=10;    %绕飞短半轴
%% 利用CW方程选择能绕飞的点,根据理论知识,VVLH下绕飞椭圆的每个状态再不施加外部脉冲的时候,其绕飞椭圆均保持不变。
%% 根据初始条件 目标星的周期为86169.6sec 为了和前面报表的时间保持一致,本文取的时间步长为60sec
t=0:60:86169.6;dx=2*omega*z; 
X=[0,0,z,dx,0,0]';
VMC_SatName='raofei';
satellite3= root.CurrentScenario.Children.New('eSatellite', VMC_SatName);
satellite3.SetPropagatorType('ePropagatorAstrogator'); 
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList Initial_State Propagate']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Initial_State.CoordinateSystem "Satellite/target VVLH"']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Initial_State.CoordinateType Cartesian']);
rrxx=X(1);
rryy=X(2);
rrzz=X(3);
vvxx=X(4);
vvyy=X(5);
vvzz=X(6);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Initial_State.InitialState.Cartesian.X ',num2str(rrxx),' km']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Initial_State.InitialState.Cartesian.Y ',num2str(rryy),' km']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Initial_State.InitialState.Cartesian.Z ',num2str(rrzz),' km']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Initial_State.InitialState.Cartesian.Vx ',num2str(vvxx),' km/sec']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Initial_State.InitialState.Cartesian.Vy ',num2str(vvyy),' km/sec']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Initial_State.InitialState.Cartesian.Vz ',num2str(vvzz),' km/sec']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Initial_State.InitialState.Epoch ',MissionTime,' UTCG']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Propagate.StoppingConditions Epoch']);
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Propagate.StoppingConditions.Epoch.TripValue ',StopTime,' UTCG']);%
root.ExecuteCommand(['Astrogator */Satellite/raofei SetValue MainSequence.SegmentList.Propagate.Propagator Earth_J2']);
root.ExecuteCommand(['Astrogator */Satellite/raofei RunMCS']);
data_raofei=root.ExecuteCommand(['Report_RM */Satellite/raofei Style "Inertial Position Velocity" TimePeriod "',MissionTime,'" "',StopTime,'" TimeStep 3600']);
struct=regexp(data_raofei.Item(1),',','split');
End_rx=str2double(cell2mat(struct(2)));
End_ry=str2double(cell2mat(struct(3)));
End_rz=str2double(cell2mat(struct(4)));
End_vx=str2double(cell2mat(struct(5)));
End_vy=str2double(cell2mat(struct(6)));
End_vz=str2double(cell2mat(struct(7)));

得到的惯性坐标系下的坐标如下图所示

(2)在得到需要到达的位置后,现在给蓝星建立任务序列,通常需要使用Target Sequence进行求解,根据双脉冲轨道转移知识,单脉冲能够实现位置的到达,双脉冲则能使得速度和位置均满足目标条件。因此整个过程包含三个部分,脉冲机动,轨道转移,脉冲机动。这里用matlab代码完成上述操作。

root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList Initial_State Target_Sequence']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Initial_State.CoordinateType Modified Keplerian']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Initial_State.InitialState.Epoch ',StartTime,' UTCG']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.ElementType "Kozai-Izsak Mean"']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.Period ',num2str(period),' sec']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.ecc ',num2str(e)]);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.inc 0 deg']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.w 0 deg']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.TA ',num2str(Sat_TA),' deg']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Initial_State.InitialState.Keplerian.LAN ',num2str(Sat_LAN),' deg']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList Propagate Maneuver Propagate Maneuver']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Propagate.StoppingConditions.Duration.TripValue 0 sec']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Propagate1.StoppingConditions.Duration.TripValue 1 day']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver.ImpulsiveMnvr.AttitudeControl Thrust Vector']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver1.ImpulsiveMnvr.AttitudeControl Thrust Vector']);

(3)设置需要控制的量和希望到达的位置和速度,根据(1)得到了希望得到的位置和速度,我们将其加入Differential Corrector求解器里。控制变量选择第一次脉冲机动在VNC坐标系下的脉冲在3个方向的分量。

oot.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver.ImpulsiveMnvr.AttitudeControl Thrust Vector']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver1.ImpulsiveMnvr.AttitudeControl Thrust Vector']);
%% 设置控制变量
root.ExecuteCommand(['Astrogator */Satellite/blue AddMCSSegmentControl MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver ImpulsiveMnvr.Cartesian.X']);
root.ExecuteCommand(['Astrogator */Satellite/blue AddMCSSegmentControl MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver ImpulsiveMnvr.Cartesian.Y']);
root.ExecuteCommand(['Astrogator */Satellite/blue AddMCSSegmentControl MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver ImpulsiveMnvr.Cartesian.Z']);
root.ExecuteCommand(['Astrogator */Satellite/blue AddMCSSegmentControl MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver1 ImpulsiveMnvr.Cartesian.X']);
root.ExecuteCommand(['Astrogator */Satellite/blue AddMCSSegmentControl MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver1 ImpulsiveMnvr.Cartesian.Y']);
root.ExecuteCommand(['Astrogator */Satellite/blue AddMCSSegmentControl MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver1 ImpulsiveMnvr.Cartesian.Z']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Propagate1.Results Vx Vy Vz X Y Z']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetMCSControlValue MainSequence.SegmentList.Target_Sequence.Profiles.Differential_Corrector Maneuver ImpulsiveMnvr.Cartesian.X Active true']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetMCSControlValue MainSequence.SegmentList.Target_Sequence.Profiles.Differential_Corrector Maneuver ImpulsiveMnvr.Cartesian.Y Active true']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetMCSControlValue MainSequence.SegmentList.Target_Sequence.Profiles.Differential_Corrector Maneuver ImpulsiveMnvr.Cartesian.Z Active true']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetMCSConstraintValue MainSequence.SegmentList.Target_Sequence.Profiles.Differential_Corrector Propagate1 X Active true']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetMCSConstraintValue MainSequence.SegmentList.Target_Sequence.Profiles.Differential_Corrector Propagate1 Y Active true']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetMCSConstraintValue MainSequence.SegmentList.Target_Sequence.Profiles.Differential_Corrector Propagate1 Z Active true']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetMCSConstraintValue MainSequence.SegmentList.Target_Sequence.Profiles.Differential_Corrector Propagate1 X Desired ',num2str(End_rx),' km']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetMCSConstraintValue MainSequence.SegmentList.Target_Sequence.Profiles.Differential_Corrector Propagate1 Y Desired ',num2str(End_ry),' km']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetMCSConstraintValue MainSequence.SegmentList.Target_Sequence.Profiles.Differential_Corrector Propagate1 Z Desired ',num2str(End_rz),' km']);

(4)将Differential Corrector的工作模式转变为工作模式

root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.Action Run active profiles']);
root.ExecuteCommand(['Astrogator */Satellite/blue RunMCS']);

(5)第一次控制仅将位置控制到相应的位置,但速度没有达到相应的条件,需要根据此时的速度差来计算出第二次机动脉冲。然后将其加入第二次轨道机动中,代码如下

data=root.ExecuteCommand(['Report_RM */Satellite/blue Style "Inertial Position Velocity" TimePeriod "',StartTime,'" "',MissionTime,'" TimeStep 3600']);
line=data.count
struct=regexp(data.Item(line-2),',','split');
v_x=str2double(cell2mat(struct(5)));
v_y=str2double(cell2mat(struct(6)));
v_z=str2double(cell2mat(struct(7)));
%% 通过两者之差修正速度
deltavx=End_vx-v_x;
deltavy=End_vy-v_y;
deltavz=End_vz-v_z;
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver1.ImpulsiveMnvr.Cartesian.X ',num2str(deltavx),' km/sec']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver1.ImpulsiveMnvr.Cartesian.Y ',num2str(deltavy),' km/sec']);
root.ExecuteCommand(['Astrogator */Satellite/blue SetValue MainSequence.SegmentList.Target_Sequence.SegmentList.Maneuver1.ImpulsiveMnvr.Cartesian.Z ',num2str(deltavz),' km/sec']);

三、结果分析

经过上述仿真,得到的最终消耗脉冲的情况为83.5475m/s,第一次脉冲和第二次脉冲的情况如下

到达该位置后的蓝星相对轨迹如下图所示(其中没有形成闭合椭圆的原因,与求解器的精度有关)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值