Você está na página 1de 5

%General Mission Analysis Tool(GMAT) Script

%Created: 2018-10-19 16:18:03

%----------------------------------------
%---------- Spacecraft
%----------------------------------------

Create Spacecraft Hubble;


GMAT Hubble.DateFormat = UTCGregorian;
GMAT Hubble.Epoch = '01 Jan 2000 11:59:28.000';
GMAT Hubble.CoordinateSystem = EarthMJ2000Eq;
GMAT Hubble.DisplayStateType = Keplerian;
GMAT Hubble.SMA = 6939.999999999995;
GMAT Hubble.ECC = 0.004219999999999452;
GMAT Hubble.INC = 28.50000000000001;
GMAT Hubble.RAAN = 270;
GMAT Hubble.AOP = 0;
GMAT Hubble.TA = 41.00000000000882;
GMAT Hubble.DryMass = 850;
GMAT Hubble.Cd = 2.2;
GMAT Hubble.Cr = 1.8;
GMAT Hubble.DragArea = 15;
GMAT Hubble.SRPArea = 1;
GMAT Hubble.NAIFId = -10001001;
GMAT Hubble.NAIFIdReferenceFrame = -9001001;
GMAT Hubble.OrbitColor = Red;
GMAT Hubble.TargetColor = Teal;
GMAT Hubble.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 Hubble.CdSigma = 1e+70;
GMAT Hubble.CrSigma = 1e+70;
GMAT Hubble.Id = 'SatId';
GMAT Hubble.Attitude = CoordinateSystemFixed;
GMAT Hubble.SPADSRPScaleFactor = 1;
GMAT Hubble.ModelFile = 'aura.3ds';
GMAT Hubble.ModelOffsetX = 0;
GMAT Hubble.ModelOffsetY = 0;
GMAT Hubble.ModelOffsetZ = 0;
GMAT Hubble.ModelRotationX = 0;
GMAT Hubble.ModelRotationY = 0;
GMAT Hubble.ModelRotationZ = 0;
GMAT Hubble.ModelScale = 1;
GMAT Hubble.AttitudeDisplayStateType = 'Quaternion';
GMAT Hubble.AttitudeRateDisplayStateType = 'AngularVelocity';
GMAT Hubble.AttitudeCoordinateSystem = EarthMJ2000Eq;
GMAT Hubble.EulerAngleSequence = '321';

%----------------------------------------
%---------- ForceModels
%----------------------------------------

Create ForceModel Propagator1_ForceModel;


GMAT Propagator1_ForceModel.CentralBody = Earth;
GMAT Propagator1_ForceModel.PrimaryBodies = {Earth};
GMAT Propagator1_ForceModel.PointMasses = {Luna, Sun};
GMAT Propagator1_ForceModel.Drag = None;
GMAT Propagator1_ForceModel.SRP = Off;
GMAT Propagator1_ForceModel.RelativisticCorrection = Off;
GMAT Propagator1_ForceModel.ErrorControl = RSSStep;
GMAT Propagator1_ForceModel.GravityField.Earth.Degree = 2;
GMAT Propagator1_ForceModel.GravityField.Earth.Order = 0;
GMAT Propagator1_ForceModel.GravityField.Earth.StmLimit = 100;
GMAT Propagator1_ForceModel.GravityField.Earth.PotentialFile = 'JGM2.cof';
GMAT Propagator1_ForceModel.GravityField.Earth.TideModel = 'None';

%----------------------------------------
%---------- Propagators
%----------------------------------------

Create Propagator Propagator1;


GMAT Propagator1.FM = Propagator1_ForceModel;
GMAT Propagator1.Type = PrinceDormand78;
GMAT Propagator1.InitialStepSize = 60;
GMAT Propagator1.Accuracy = 9.999999999999999e-12;
GMAT Propagator1.MinStep = 0;
GMAT Propagator1.MaxStep = 2700;
GMAT Propagator1.MaxStepAttempts = 50;
GMAT Propagator1.StopIfAccuracyIsViolated = true;

%----------------------------------------
%---------- Burns
%----------------------------------------

Create ImpulsiveBurn ImpulsiveBurn1;


GMAT ImpulsiveBurn1.CoordinateSystem = Local;
GMAT ImpulsiveBurn1.Origin = Earth;
GMAT ImpulsiveBurn1.Axes = VNB;
GMAT ImpulsiveBurn1.Element1 = 0;
GMAT ImpulsiveBurn1.Element2 = 0;
GMAT ImpulsiveBurn1.Element3 = 0;
GMAT ImpulsiveBurn1.DecrementMass = false;
GMAT ImpulsiveBurn1.Isp = 300;
GMAT ImpulsiveBurn1.GravitationalAccel = 9.81;

%----------------------------------------
%---------- Solvers
%----------------------------------------

Create DifferentialCorrector DC1;


GMAT DC1.ShowProgress = true;
GMAT DC1.ReportStyle = Normal;
GMAT DC1.ReportFile = 'DifferentialCorrectorDC1.data';
GMAT DC1.MaximumIterations = 100;
GMAT DC1.DerivativeMethod = ForwardDifference;
GMAT DC1.Algorithm = NewtonRaphson;

%----------------------------------------
%---------- Subscribers
%----------------------------------------

Create OrbitView OrbitView1;


GMAT OrbitView1.SolverIterations = Current;
GMAT OrbitView1.UpperLeft = [ 0.1652777777777778 0.02111111111111111 ];
GMAT OrbitView1.Size = [ 0.7506944444444444 0.87 ];
GMAT OrbitView1.RelativeZOrder = 38;
GMAT OrbitView1.Maximized = false;
GMAT OrbitView1.Add = {Hubble, Earth, Luna, Sun};
GMAT OrbitView1.CoordinateSystem = EarthMJ2000Eq;
GMAT OrbitView1.DrawObject = [ true true true true ];
GMAT OrbitView1.DataCollectFrequency = 1;
GMAT OrbitView1.UpdatePlotFrequency = 50;
GMAT OrbitView1.NumPointsToRedraw = 0;
GMAT OrbitView1.ShowPlot = true;
GMAT OrbitView1.MaxPlotPoints = 20000;
GMAT OrbitView1.ShowLabels = true;
GMAT OrbitView1.ViewPointReference = Earth;
GMAT OrbitView1.ViewPointVector = [ 10000 0 30000 ];
GMAT OrbitView1.ViewDirection = Earth;
GMAT OrbitView1.ViewScaleFactor = 1;
GMAT OrbitView1.ViewUpCoordinateSystem = EarthMJ2000Eq;
GMAT OrbitView1.ViewUpAxis = Z;
GMAT OrbitView1.EclipticPlane = Off;
GMAT OrbitView1.XYPlane = On;
GMAT OrbitView1.WireFrame = Off;
GMAT OrbitView1.Axes = On;
GMAT OrbitView1.Grid = Off;
GMAT OrbitView1.SunLine = Off;
GMAT OrbitView1.UseInitialView = On;
GMAT OrbitView1.StarCount = 7000;
GMAT OrbitView1.EnableStars = On;
GMAT OrbitView1.EnableConstellations = On;

Create GroundTrackPlot GroundTrackPlot1;


GMAT GroundTrackPlot1.SolverIterations = Current;
GMAT GroundTrackPlot1.UpperLeft = [ 0.5826388888888889 0.02111111111111111 ];
GMAT GroundTrackPlot1.Size = [ 0.4145833333333334 0.3855555555555555 ];
GMAT GroundTrackPlot1.RelativeZOrder = 20;
GMAT GroundTrackPlot1.Maximized = false;
GMAT GroundTrackPlot1.Add = {Hubble};
GMAT GroundTrackPlot1.DataCollectFrequency = 1;
GMAT GroundTrackPlot1.UpdatePlotFrequency = 50;
GMAT GroundTrackPlot1.NumPointsToRedraw = 0;
GMAT GroundTrackPlot1.ShowPlot = true;
GMAT GroundTrackPlot1.MaxPlotPoints = 20000;
GMAT GroundTrackPlot1.CentralBody = Earth;
GMAT GroundTrackPlot1.TextureMap = 'ModifiedBlueMarble.jpg';

Create XYPlot XYPlot1;


GMAT XYPlot1.SolverIterations = Current;
GMAT XYPlot1.UpperLeft = [ 0.1701388888888889 0.2666666666666667 ];
GMAT XYPlot1.Size = [ 0.3916666666666667 0.3966666666666667 ];
GMAT XYPlot1.RelativeZOrder = 15;
GMAT XYPlot1.Maximized = false;
GMAT XYPlot1.XVariable = Hubble.ElapsedSecs;
GMAT XYPlot1.YVariables = {Hubble.EarthMJ2000Eq.RAAN, Hubble.Earth.TA};
GMAT XYPlot1.ShowGrid = true;
GMAT XYPlot1.ShowPlot = true;

Create ReportFile ReportFile1;


GMAT ReportFile1.SolverIterations = Current;
GMAT ReportFile1.UpperLeft = [ 0.05555555555555555 0.1111111111111111 ];
GMAT ReportFile1.Size = [ 0.40625 0.4966666666666666 ];
GMAT ReportFile1.RelativeZOrder = 40;
GMAT ReportFile1.Maximized = false;
GMAT ReportFile1.Filename = 'ReportFile1.txt';
GMAT ReportFile1.Precision = 16;
GMAT ReportFile1.Add = {Hubble.ElapsedSecs, Hubble.EarthMJ2000Eq.RAAN,
Hubble.Earth.TA};
GMAT ReportFile1.WriteHeaders = true;
GMAT ReportFile1.LeftJustify = On;
GMAT ReportFile1.ZeroFill = Off;
GMAT ReportFile1.FixedWidth = true;
GMAT ReportFile1.Delimiter = ' ';
GMAT ReportFile1.ColumnWidth = 23;
GMAT ReportFile1.WriteReport = true;

%----------------------------------------
%---------- Arrays, Variables, Strings
%----------------------------------------
Create Variable INC;
GMAT INC = 0;

%----------------------------------------
%---------- Mission Sequence
%----------------------------------------

BeginMissionSequence;
PenUp GroundTrackPlot1 OrbitView1 XYPlot1;
Propagate Propagator1(Hubble) {Hubble.ElapsedSecs = Hubble.Earth.OrbitPeriod};
Target DC1 {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow =
true};
Vary DC1(ImpulsiveBurn1.Element1 = 0.5, {Perturbation = 0.0001, Lower = 0.0,
Upper = 10, MaxStep = 0.1, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor =
1.0});
Maneuver ImpulsiveBurn1(Hubble);
Achieve DC1(Hubble.Earth.RadApo = 15000, {Tolerance = 0.1});
EndTarget; % For targeter DC1
Propagate 'Propagate2' Propagator1(Hubble) {Hubble.Earth.Latitude = 0, OrbitColor =
[34 255 8]};
GMAT INC = Hubble.EarthMJ2000Eq.INC;
GMAT INC = INC/2;
GMAT Hubble.EarthMJ2000Eq.INC = INC;
Propagate Propagator1(Hubble) {Hubble.ElapsedSecs = Hubble.Earth.OrbitPeriod,
OrbitColor = [0 0 254]};

BeginScript
GMAT INC = Hubble.EarthMJ2000Eq.INC;
GMAT INC = INC*4;
GMAT Hubble.EarthMJ2000Eq.INC = INC;
EndScript;
Propagate Propagator1(Hubble) {Hubble.Earth.Apoapsis, OrbitColor = [255 255 11]};
Target DC1 {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow =
true};
Vary DC1(ImpulsiveBurn1.Element1 = 0.5, {Perturbation = 0.0001, Lower = 0.0,
Upper = 40, MaxStep = 0.4, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor =
1.0});
Maneuver ImpulsiveBurn1(Hubble);
Achieve DC1(Hubble.Earth.ECC = 0, {Tolerance = 0.001});
EndTarget; % For targeter DC1
PenDown GroundTrackPlot1 OrbitView1 XYPlot1;
Propagate Propagator1(Hubble) {Hubble.ElapsedSecs = Hubble.Earth.OrbitPeriod,
OrbitColor = [33 255 228]};

Você também pode gostar