-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathVenus Mission Part1.script
379 lines (304 loc) · 13.2 KB
/
Venus Mission Part1.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
%General Mission Analysis Tool(GMAT) Script
%Created: 2024-05-06 14:25:23
%----------------------------------------
%---------- Spacecraft
%----------------------------------------
Create Spacecraft VenusOne;
GMAT VenusOne.DateFormat = UTCGregorian;
GMAT VenusOne.Epoch = '05 Jan 2025 13:00:00.000';
GMAT VenusOne.CoordinateSystem = EarthFixed;
GMAT VenusOne.DisplayStateType = OutgoingAsymptote;
GMAT VenusOne.OutgoingRadPer = 6577.999999999964;
GMAT VenusOne.OutgoingC3Energy = 6.899999999999366;
GMAT VenusOne.OutgoingRHA = 50.00000000000089;
GMAT VenusOne.OutgoingDHA = 27.99999999999993;
GMAT VenusOne.OutgoingBVAZI = 79.99999999999973;
GMAT VenusOne.TA = 8.537736462515939e-07;
GMAT VenusOne.DryMass = 2000;
GMAT VenusOne.Cd = 2.2;
GMAT VenusOne.Cr = 1.8;
GMAT VenusOne.DragArea = 15;
GMAT VenusOne.SRPArea = 1;
GMAT VenusOne.SPADDragScaleFactor = 1;
GMAT VenusOne.SPADSRPScaleFactor = 1;
GMAT VenusOne.Tanks = {MMH};
GMAT VenusOne.NAIFId = -10000001;
GMAT VenusOne.NAIFIdReferenceFrame = -9000001;
GMAT VenusOne.OrbitColor = Red;
GMAT VenusOne.TargetColor = Teal;
GMAT VenusOne.OrbitErrorCovariance = [ 1e+70 0 0 0 0 0 ; 0 1e+70 0 0 0 0 ; 0 0 1e+70 0 0 0 ; 0 0 0 1e+70 0 0 ; 0 0 0 0 1e+70 0 ; 0 0 0 0 0 1e+70 ];
GMAT VenusOne.CdSigma = 1e+70;
GMAT VenusOne.CrSigma = 1e+70;
GMAT VenusOne.Id = 'SatId';
GMAT VenusOne.Attitude = CoordinateSystemFixed;
GMAT VenusOne.SPADSRPInterpolationMethod = Bilinear;
GMAT VenusOne.SPADSRPScaleFactorSigma = 1e+70;
GMAT VenusOne.SPADDragInterpolationMethod = Bilinear;
GMAT VenusOne.SPADDragScaleFactorSigma = 1e+70;
GMAT VenusOne.ModelFile = 'aura.3ds';
GMAT VenusOne.ModelOffsetX = 0;
GMAT VenusOne.ModelOffsetY = 0;
GMAT VenusOne.ModelOffsetZ = 0;
GMAT VenusOne.ModelRotationX = 0;
GMAT VenusOne.ModelRotationY = 0;
GMAT VenusOne.ModelRotationZ = 0;
GMAT VenusOne.ModelScale = 1;
GMAT VenusOne.AttitudeDisplayStateType = 'Quaternion';
GMAT VenusOne.AttitudeRateDisplayStateType = 'AngularVelocity';
GMAT VenusOne.AttitudeCoordinateSystem = EarthMJ2000Eq;
GMAT VenusOne.EulerAngleSequence = '321';
%----------------------------------------
%---------- Hardware Components
%----------------------------------------
Create ChemicalTank MMH;
GMAT MMH.AllowNegativeFuelMass = true;
GMAT MMH.FuelMass = 2000;
GMAT MMH.Pressure = 1500;
GMAT MMH.Temperature = 20;
GMAT MMH.RefTemperature = 20;
GMAT MMH.Volume = 4;
GMAT MMH.FuelDensity = 880;
GMAT MMH.PressureModel = PressureRegulated;
%----------------------------------------
%---------- ForceModels
%----------------------------------------
Create ForceModel NearEarth_ForceModel;
GMAT NearEarth_ForceModel.CentralBody = Earth;
GMAT NearEarth_ForceModel.PrimaryBodies = {Earth};
GMAT NearEarth_ForceModel.PointMasses = {Luna, Sun};
GMAT NearEarth_ForceModel.Drag = None;
GMAT NearEarth_ForceModel.SRP = On;
GMAT NearEarth_ForceModel.RelativisticCorrection = Off;
GMAT NearEarth_ForceModel.ErrorControl = RSSStep;
GMAT NearEarth_ForceModel.GravityField.Earth.Degree = 4;
GMAT NearEarth_ForceModel.GravityField.Earth.Order = 4;
GMAT NearEarth_ForceModel.GravityField.Earth.StmLimit = 100;
GMAT NearEarth_ForceModel.GravityField.Earth.PotentialFile = 'JGM2.cof';
GMAT NearEarth_ForceModel.GravityField.Earth.TideModel = 'None';
GMAT NearEarth_ForceModel.SRP.Flux = 1367;
GMAT NearEarth_ForceModel.SRP.SRPModel = Spherical;
GMAT NearEarth_ForceModel.SRP.Nominal_Sun = 149597870.691;
Create ForceModel Sol_ForceModel;
GMAT Sol_ForceModel.CentralBody = Sun;
GMAT Sol_ForceModel.PointMasses = {Earth, Jupiter, Mars, Mercury, Neptune, Pluto, Saturn, Sun, Uranus, Venus};
GMAT Sol_ForceModel.Drag = None;
GMAT Sol_ForceModel.SRP = On;
GMAT Sol_ForceModel.RelativisticCorrection = Off;
GMAT Sol_ForceModel.ErrorControl = RSSStep;
GMAT Sol_ForceModel.SRP.Flux = 1367;
GMAT Sol_ForceModel.SRP.SRPModel = Spherical;
GMAT Sol_ForceModel.SRP.Nominal_Sun = 149597870.691;
Create ForceModel NearVenus_ForceModel;
GMAT NearVenus_ForceModel.CentralBody = Venus;
GMAT NearVenus_ForceModel.PrimaryBodies = {Venus};
GMAT NearVenus_ForceModel.PointMasses = {Sun};
GMAT NearVenus_ForceModel.Drag = None;
GMAT NearVenus_ForceModel.SRP = On;
GMAT NearVenus_ForceModel.RelativisticCorrection = Off;
GMAT NearVenus_ForceModel.ErrorControl = RSSStep;
GMAT NearVenus_ForceModel.GravityField.Venus.Degree = 4;
GMAT NearVenus_ForceModel.GravityField.Venus.Order = 4;
GMAT NearVenus_ForceModel.GravityField.Venus.StmLimit = 100;
GMAT NearVenus_ForceModel.GravityField.Venus.PotentialFile = 'MGNP180U.cof';
GMAT NearVenus_ForceModel.GravityField.Venus.TideModel = 'None';
GMAT NearVenus_ForceModel.SRP.Flux = 1367;
GMAT NearVenus_ForceModel.SRP.SRPModel = Spherical;
GMAT NearVenus_ForceModel.SRP.Nominal_Sun = 149597870.691;
%----------------------------------------
%---------- Propagators
%----------------------------------------
Create Propagator NearEarth;
GMAT NearEarth.FM = NearEarth_ForceModel;
GMAT NearEarth.Type = PrinceDormand78;
GMAT NearEarth.InitialStepSize = 600;
GMAT NearEarth.Accuracy = 1e-13;
GMAT NearEarth.MinStep = 0;
GMAT NearEarth.MaxStep = 86400;
GMAT NearEarth.MaxStepAttempts = 50;
GMAT NearEarth.StopIfAccuracyIsViolated = true;
Create Propagator Sol;
GMAT Sol.FM = Sol_ForceModel;
GMAT Sol.Type = PrinceDormand78;
GMAT Sol.InitialStepSize = 600;
GMAT Sol.Accuracy = 1e-13;
GMAT Sol.MinStep = 0;
GMAT Sol.MaxStep = 86400;
GMAT Sol.MaxStepAttempts = 50;
GMAT Sol.StopIfAccuracyIsViolated = true;
Create Propagator NearVenus;
GMAT NearVenus.FM = NearVenus_ForceModel;
GMAT NearVenus.Type = PrinceDormand78;
GMAT NearVenus.InitialStepSize = 600;
GMAT NearVenus.Accuracy = 1e-13;
GMAT NearVenus.MinStep = 0;
GMAT NearVenus.MaxStep = 86400;
GMAT NearVenus.MaxStepAttempts = 50;
GMAT NearVenus.StopIfAccuracyIsViolated = true;
%----------------------------------------
%---------- Burns
%----------------------------------------
Create ImpulsiveBurn DSM;
GMAT DSM.CoordinateSystem = Local;
GMAT DSM.Origin = Earth;
GMAT DSM.Axes = VNB;
GMAT DSM.Element1 = 0;
GMAT DSM.Element2 = 0;
GMAT DSM.Element3 = 0;
GMAT DSM.DecrementMass = true;
GMAT DSM.Tank = {MMH};
GMAT DSM.Isp = 316;
GMAT DSM.GravitationalAccel = 9.81;
%----------------------------------------
%---------- Coordinate Systems
%----------------------------------------
Create CoordinateSystem venusXYZ;
GMAT venusXYZ.Origin = Venus;
GMAT venusXYZ.Axes = BodyInertial;
Create CoordinateSystem SolXYZ;
GMAT SolXYZ.Origin = Sun;
GMAT SolXYZ.Axes = MJ2000Ec;
%----------------------------------------
%---------- Solvers
%----------------------------------------
Create DifferentialCorrector DefaultDC;
GMAT DefaultDC.ShowProgress = true;
GMAT DefaultDC.ReportStyle = Normal;
GMAT DefaultDC.ReportFile = 'DifferentialCorrectorDefaultDC.data';
GMAT DefaultDC.MaximumIterations = 25;
GMAT DefaultDC.DerivativeMethod = ForwardDifference;
GMAT DefaultDC.Algorithm = NewtonRaphson;
%----------------------------------------
%---------- Subscribers
%----------------------------------------
Create OrbitView EarthView;
GMAT EarthView.SolverIterations = Current;
GMAT EarthView.UpperLeft = [ 0.5058823529411764 0.008353221957040573 ];
GMAT EarthView.Size = [ 0.2235294117647059 0.4307875894988067 ];
GMAT EarthView.RelativeZOrder = 1376;
GMAT EarthView.Maximized = false;
GMAT EarthView.Add = {VenusOne, Earth, Sun, Venus, Luna};
GMAT EarthView.CoordinateSystem = EarthMJ2000Eq;
GMAT EarthView.DrawObject = [ true true true true true ];
GMAT EarthView.DataCollectFrequency = 1;
GMAT EarthView.UpdatePlotFrequency = 50;
GMAT EarthView.NumPointsToRedraw = 0;
GMAT EarthView.ShowPlot = true;
GMAT EarthView.MaxPlotPoints = 20000;
GMAT EarthView.ShowLabels = true;
GMAT EarthView.ViewPointReference = Earth;
GMAT EarthView.ViewPointVector = [ -30000 0 10000 ];
GMAT EarthView.ViewDirection = Earth;
GMAT EarthView.ViewScaleFactor = 1;
GMAT EarthView.ViewUpCoordinateSystem = EarthMJ2000Eq;
GMAT EarthView.ViewUpAxis = Z;
GMAT EarthView.EclipticPlane = Off;
GMAT EarthView.XYPlane = On;
GMAT EarthView.WireFrame = Off;
GMAT EarthView.Axes = On;
GMAT EarthView.Grid = Off;
GMAT EarthView.SunLine = Off;
GMAT EarthView.UseInitialView = On;
GMAT EarthView.StarCount = 7000;
GMAT EarthView.EnableStars = Off;
GMAT EarthView.EnableConstellations = Off;
Create OrbitView SolView;
GMAT SolView.SolverIterations = Current;
GMAT SolView.UpperLeft = [ 0.5064705882352941 0.4451073985680191 ];
GMAT SolView.Size = [ 0.4670588235294117 0.5417661097852029 ];
GMAT SolView.RelativeZOrder = 1372;
GMAT SolView.Maximized = false;
GMAT SolView.Add = {VenusOne, Earth, Sun, Venus};
GMAT SolView.CoordinateSystem = SolXYZ;
GMAT SolView.DrawObject = [ true true true true ];
GMAT SolView.DataCollectFrequency = 1;
GMAT SolView.UpdatePlotFrequency = 50;
GMAT SolView.NumPointsToRedraw = 0;
GMAT SolView.ShowPlot = true;
GMAT SolView.MaxPlotPoints = 20000;
GMAT SolView.ShowLabels = true;
GMAT SolView.ViewPointReference = Sun;
GMAT SolView.ViewPointVector = [ 0 0 500000000 ];
GMAT SolView.ViewDirection = Sun;
GMAT SolView.ViewScaleFactor = 1;
GMAT SolView.ViewUpCoordinateSystem = SolXYZ;
GMAT SolView.ViewUpAxis = Z;
GMAT SolView.EclipticPlane = Off;
GMAT SolView.XYPlane = On;
GMAT SolView.WireFrame = Off;
GMAT SolView.Axes = On;
GMAT SolView.Grid = Off;
GMAT SolView.SunLine = Off;
GMAT SolView.UseInitialView = On;
GMAT SolView.StarCount = 7000;
GMAT SolView.EnableStars = Off;
GMAT SolView.EnableConstellations = Off;
Create OrbitView VenusView;
GMAT VenusView.SolverIterations = Current;
GMAT VenusView.UpperLeft = [ 0.7329411764705882 0.01073985680190931 ];
GMAT VenusView.Size = [ 0.2394117647058824 0.4295942720763723 ];
GMAT VenusView.RelativeZOrder = 1380;
GMAT VenusView.Maximized = false;
GMAT VenusView.Add = {VenusOne, Venus, Sun, Earth};
GMAT VenusView.CoordinateSystem = venusXYZ;
GMAT VenusView.DrawObject = [ true true true true ];
GMAT VenusView.DataCollectFrequency = 1;
GMAT VenusView.UpdatePlotFrequency = 50;
GMAT VenusView.NumPointsToRedraw = 0;
GMAT VenusView.ShowPlot = true;
GMAT VenusView.MaxPlotPoints = 20000;
GMAT VenusView.ShowLabels = true;
GMAT VenusView.ViewPointReference = Venus;
GMAT VenusView.ViewPointVector = [ 15000 -33000 9000 ];
GMAT VenusView.ViewDirection = Venus;
GMAT VenusView.ViewScaleFactor = 1;
GMAT VenusView.ViewUpCoordinateSystem = venusXYZ;
GMAT VenusView.ViewUpAxis = Z;
GMAT VenusView.EclipticPlane = Off;
GMAT VenusView.XYPlane = On;
GMAT VenusView.WireFrame = Off;
GMAT VenusView.Axes = On;
GMAT VenusView.Grid = Off;
GMAT VenusView.SunLine = Off;
GMAT VenusView.UseInitialView = On;
GMAT VenusView.StarCount = 7000;
GMAT VenusView.EnableStars = Off;
GMAT VenusView.EnableConstellations = Off;
Create GroundTrackPlot WenChang;
GMAT WenChang.SolverIterations = Current;
GMAT WenChang.UpperLeft = [ 0.01529411764705882 0.4463007159904535 ];
GMAT WenChang.Size = [ 0.49 0.5381861575178998 ];
GMAT WenChang.RelativeZOrder = 1368;
GMAT WenChang.Maximized = false;
GMAT WenChang.Add = {VenusOne};
GMAT WenChang.DataCollectFrequency = 1;
GMAT WenChang.UpdatePlotFrequency = 50;
GMAT WenChang.NumPointsToRedraw = 0;
GMAT WenChang.ShowPlot = true;
GMAT WenChang.MaxPlotPoints = 20000;
GMAT WenChang.CentralBody = Earth;
GMAT WenChang.TextureMap = 'ModifiedBlueMarble.jpg';
%----------------------------------------
%---------- Arrays, Variables, Strings
%----------------------------------------
Create Variable huaxing;
GMAT huaxing = 0;
%----------------------------------------
%---------- Mission Sequence
%----------------------------------------
BeginMissionSequence;
Target 'Target to Venus' DefaultDC {SolveMode = RunInitialGuess, ExitMode = SaveAndContinue, ShowProgressWindow = true};
Vary 'Vary chijing' DefaultDC(VenusOne.OutgoingRHA = 68.62687844932675, {Perturbation = 0.0001, Lower = 0, Upper = 180, MaxStep = 20, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0});
Vary 'Vary chiwei' DefaultDC(VenusOne.OutgoingDHA = 43.66790795676589, {Perturbation = 0.0001, Lower = -89, Upper = 89, MaxStep = 20, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0});
Propagate 'Prop 1 day' NearEarth(VenusOne) {VenusOne.ElapsedDays = 1};
Propagate 'Prop 120 days' Sol(VenusOne) {VenusOne.ElapsedDays = 120};
Propagate 'Prop to Venus pe' NearVenus(VenusOne) {VenusOne.Venus.Periapsis};
Achieve 'Achieve bdotR=0' DefaultDC(VenusOne.venusXYZ.BdotR = 0, {Tolerance = 0.1});
Achieve 'Achieve bdotT=16700' DefaultDC(VenusOne.venusXYZ.BdotT = 16700, {Tolerance = 0.1});
EndTarget; % For targeter DefaultDC
Target 'Into Venus Orbit' DefaultDC {SolveMode = RunInitialGuess, ExitMode = SaveAndContinue, ShowProgressWindow = true};
Vary 'Vary DSM.v' DefaultDC(DSM.Element1 = -1.704058338105775, {Perturbation = 0.0001, Lower = -10, Upper = 10, MaxStep = 0.2, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0});
Maneuver 'Apply DSM' DSM(VenusOne);
Propagate 'Prop to ap' NearVenus(VenusOne) {VenusOne.Venus.Apoapsis};
Achieve 'Achieve Period=24h' DefaultDC(VenusOne.Venus.OrbitPeriod = 86400, {Tolerance = 0.1});
EndTarget; % For targeter DefaultDC
Propagate 'Prop to pe' NearVenus(VenusOne) {VenusOne.Venus.Periapsis};