%General Mission Analysis Tool(GMAT) Script %Created: 2018-12-28 17:10:14 %---------------------------------------- %---------- Spacecraft %---------------------------------------- Create Spacecraft inSight; GMAT inSight.DateFormat = UTCGregorian; GMAT inSight.Epoch = '05 May 2018 12:19:11.000'; GMAT inSight.CoordinateSystem = EarthMJ2000Eq; GMAT inSight.DisplayStateType = Keplerian; GMAT inSight.SMA = 6551.049999999998; GMAT inSight.ECC = 0.02622479920000132; GMAT inSight.INC = 63.99999999999999; GMAT inSight.RAAN = 125; GMAT inSight.AOP = 1.478779333471098e-006; GMAT inSight.TA = 179.9999985212207; GMAT inSight.DryMass = 694; GMAT inSight.Cd = 1; GMAT inSight.Cr = 1.8; GMAT inSight.DragArea = 15; GMAT inSight.SRPArea = 1; GMAT inSight.NAIFId = -10000001; GMAT inSight.NAIFIdReferenceFrame = -9000001; GMAT inSight.OrbitColor = Red; GMAT inSight.TargetColor = Teal; GMAT inSight.OrbitErrorCovariance = [ 1e+070 0 0 0 0 0 ; 0 1e+070 0 0 0 0 ; 0 0 1e+070 0 0 0 ; 0 0 0 1e+070 0 0 ; 0 0 0 0 1e+070 0 ; 0 0 0 0 0 1e+070 ]; GMAT inSight.CdSigma = 1e+070; GMAT inSight.CrSigma = 1e+070; GMAT inSight.Id = 'SatId'; GMAT inSight.Attitude = CoordinateSystemFixed; GMAT inSight.SPADSRPScaleFactor = 1; GMAT inSight.ModelFile = 'aura.3ds'; GMAT inSight.ModelOffsetX = 0; GMAT inSight.ModelOffsetY = 0; GMAT inSight.ModelOffsetZ = 0; GMAT inSight.ModelRotationX = 0; GMAT inSight.ModelRotationY = 0; GMAT inSight.ModelRotationZ = 0; GMAT inSight.ModelScale = 0.22; GMAT inSight.AttitudeDisplayStateType = 'Quaternion'; GMAT inSight.AttitudeRateDisplayStateType = 'AngularVelocity'; GMAT inSight.AttitudeCoordinateSystem = EarthMJ2000Eq; GMAT inSight.EulerAngleSequence = '321'; %---------------------------------------- %---------- ForceModels %---------------------------------------- Create ForceModel nearEarth_ForceModel; GMAT nearEarth_ForceModel.CentralBody = Earth; GMAT nearEarth_ForceModel.PrimaryBodies = {Earth}; GMAT nearEarth_ForceModel.PointMasses = {Sun}; GMAT nearEarth_ForceModel.Drag = None; GMAT nearEarth_ForceModel.SRP = Off; GMAT nearEarth_ForceModel.RelativisticCorrection = Off; GMAT nearEarth_ForceModel.ErrorControl = RSSStep; GMAT nearEarth_ForceModel.GravityField.Earth.Degree = 8; GMAT nearEarth_ForceModel.GravityField.Earth.Order = 8; GMAT nearEarth_ForceModel.GravityField.Earth.StmLimit = 100; GMAT nearEarth_ForceModel.GravityField.Earth.PotentialFile = 'JGM2.cof'; GMAT nearEarth_ForceModel.GravityField.Earth.TideModel = 'None'; Create ForceModel deepSpace_ForceModel; GMAT deepSpace_ForceModel.CentralBody = Sun; GMAT deepSpace_ForceModel.PointMasses = {Jupiter, Sun}; GMAT deepSpace_ForceModel.Drag = None; GMAT deepSpace_ForceModel.SRP = On; GMAT deepSpace_ForceModel.RelativisticCorrection = Off; GMAT deepSpace_ForceModel.ErrorControl = RSSStep; GMAT deepSpace_ForceModel.SRP.Flux = 1367; GMAT deepSpace_ForceModel.SRP.SRPModel = Spherical; GMAT deepSpace_ForceModel.SRP.Nominal_Sun = 149597870.691; Create ForceModel nearMars_ForceModel; GMAT nearMars_ForceModel.CentralBody = Mars; GMAT nearMars_ForceModel.PrimaryBodies = {Mars}; GMAT nearMars_ForceModel.PointMasses = {Sun}; GMAT nearMars_ForceModel.Drag = None; GMAT nearMars_ForceModel.SRP = Off; GMAT nearMars_ForceModel.RelativisticCorrection = Off; GMAT nearMars_ForceModel.ErrorControl = RSSStep; GMAT nearMars_ForceModel.GravityField.Mars.Degree = 4; GMAT nearMars_ForceModel.GravityField.Mars.Order = 4; GMAT nearMars_ForceModel.GravityField.Mars.StmLimit = 100; GMAT nearMars_ForceModel.GravityField.Mars.PotentialFile = 'Mars50c.cof'; GMAT nearMars_ForceModel.GravityField.Mars.TideModel = 'None'; %---------------------------------------- %---------- Propagators %---------------------------------------- Create Propagator nearEarth; GMAT nearEarth.FM = nearEarth_ForceModel; GMAT nearEarth.Type = RungeKutta89; GMAT nearEarth.InitialStepSize = 60; GMAT nearEarth.Accuracy = 9.999999999999999e-012; GMAT nearEarth.MinStep = 0.001; GMAT nearEarth.MaxStep = 2700; GMAT nearEarth.MaxStepAttempts = 50; GMAT nearEarth.StopIfAccuracyIsViolated = true; Create Propagator deepSpace; GMAT deepSpace.FM = deepSpace_ForceModel; GMAT deepSpace.Type = PrinceDormand78; GMAT deepSpace.InitialStepSize = 600; GMAT deepSpace.Accuracy = 9.999999999999999e-012; GMAT deepSpace.MinStep = 0; GMAT deepSpace.MaxStep = 2700; GMAT deepSpace.MaxStepAttempts = 50; GMAT deepSpace.StopIfAccuracyIsViolated = true; Create Propagator nearMars; GMAT nearMars.FM = nearMars_ForceModel; GMAT nearMars.Type = PrinceDormand78; GMAT nearMars.InitialStepSize = 60; GMAT nearMars.Accuracy = 9.999999999999999e-012; GMAT nearMars.MinStep = 0.001; GMAT nearMars.MaxStep = 1000; GMAT nearMars.MaxStepAttempts = 50; GMAT nearMars.StopIfAccuracyIsViolated = false; %---------------------------------------- %---------- Burns %---------------------------------------- Create ImpulsiveBurn CentaurBurn2; GMAT CentaurBurn2.CoordinateSystem = Local; GMAT CentaurBurn2.Origin = Earth; GMAT CentaurBurn2.Axes = VNB; GMAT CentaurBurn2.Element1 = 0; GMAT CentaurBurn2.Element2 = 0; GMAT CentaurBurn2.Element3 = 0; GMAT CentaurBurn2.DecrementMass = false; GMAT CentaurBurn2.Isp = 300; GMAT CentaurBurn2.GravitationalAccel = 9.810000000000001; Create ImpulsiveBurn TCM1; GMAT TCM1.CoordinateSystem = Local; GMAT TCM1.Origin = Earth; GMAT TCM1.Axes = VNB; GMAT TCM1.Element1 = 0; GMAT TCM1.Element2 = 0; GMAT TCM1.Element3 = 0; GMAT TCM1.DecrementMass = false; GMAT TCM1.Isp = 300; GMAT TCM1.GravitationalAccel = 9.810000000000001; Create ImpulsiveBurn TCM4; GMAT TCM4.CoordinateSystem = Local; GMAT TCM4.Origin = Earth; GMAT TCM4.Axes = VNB; GMAT TCM4.Element1 = 0; GMAT TCM4.Element2 = 0; GMAT TCM4.Element3 = 0; GMAT TCM4.DecrementMass = false; GMAT TCM4.Isp = 300; GMAT TCM4.GravitationalAccel = 9.810000000000001; Create ImpulsiveBurn TCM6; GMAT TCM6.CoordinateSystem = Local; GMAT TCM6.Origin = Earth; GMAT TCM6.Axes = VNB; GMAT TCM6.Element1 = 0; GMAT TCM6.Element2 = 0; GMAT TCM6.Element3 = 0; GMAT TCM6.DecrementMass = false; GMAT TCM6.Isp = 300; GMAT TCM6.GravitationalAccel = 9.810000000000001; Create ImpulsiveBurn Landing; GMAT Landing.CoordinateSystem = Local; GMAT Landing.Origin = Earth; GMAT Landing.Axes = VNB; GMAT Landing.Element1 = 0; GMAT Landing.Element2 = 0; GMAT Landing.Element3 = 0; GMAT Landing.DecrementMass = false; GMAT Landing.Isp = 300; GMAT Landing.GravitationalAccel = 9.810000000000001; %---------------------------------------- %---------- Coordinate Systems %---------------------------------------- Create CoordinateSystem SunMJ2000Eq; GMAT SunMJ2000Eq.Origin = Sun; GMAT SunMJ2000Eq.Axes = MJ2000Eq; Create CoordinateSystem MarsMJ2000Eq; GMAT MarsMJ2000Eq.Origin = Mars; GMAT MarsMJ2000Eq.Axes = MJ2000Eq; Create CoordinateSystem MarsFixed; GMAT MarsFixed.Origin = Mars; GMAT MarsFixed.Axes = BodyFixed; %---------------------------------------- %---------- 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 Earth_View; GMAT Earth_View.SolverIterations = Current; GMAT Earth_View.UpperLeft = [ 0.6356120826709062 0.002419354838709678 ]; GMAT Earth_View.Size = [ 0.3812400635930048 0.4669354838709677 ]; GMAT Earth_View.RelativeZOrder = 152; GMAT Earth_View.Maximized = false; GMAT Earth_View.Add = {inSight, Earth, Luna, Mars, Sun}; GMAT Earth_View.CoordinateSystem = EarthMJ2000Eq; GMAT Earth_View.DrawObject = [ true true true true true ]; GMAT Earth_View.DataCollectFrequency = 1; GMAT Earth_View.UpdatePlotFrequency = 50; GMAT Earth_View.NumPointsToRedraw = 0; GMAT Earth_View.ShowPlot = true; GMAT Earth_View.MaxPlotPoints = 20000; GMAT Earth_View.ShowLabels = true; GMAT Earth_View.ViewPointReference = Earth; GMAT Earth_View.ViewPointVector = [ 30000 0 0 ]; GMAT Earth_View.ViewDirection = Earth; GMAT Earth_View.ViewScaleFactor = 1; GMAT Earth_View.ViewUpCoordinateSystem = EarthMJ2000Eq; GMAT Earth_View.ViewUpAxis = Z; GMAT Earth_View.EclipticPlane = Off; GMAT Earth_View.XYPlane = On; GMAT Earth_View.WireFrame = Off; GMAT Earth_View.Axes = On; GMAT Earth_View.Grid = Off; GMAT Earth_View.SunLine = Off; GMAT Earth_View.UseInitialView = On; GMAT Earth_View.StarCount = 2000; GMAT Earth_View.EnableStars = On; GMAT Earth_View.EnableConstellations = Off; Create OrbitView Sun_View; GMAT Sun_View.SolverIterations = Current; GMAT Sun_View.UpperLeft = [ 0.3332273449920509 0.003225806451612903 ]; GMAT Sun_View.Size = [ 0.3027027027027027 0.9266129032258065 ]; GMAT Sun_View.RelativeZOrder = 148; GMAT Sun_View.Maximized = false; GMAT Sun_View.Add = {inSight, Earth, Sun, Mars}; GMAT Sun_View.CoordinateSystem = SunMJ2000Eq; GMAT Sun_View.DrawObject = [ true true true true ]; GMAT Sun_View.DataCollectFrequency = 1; GMAT Sun_View.UpdatePlotFrequency = 50; GMAT Sun_View.NumPointsToRedraw = 0; GMAT Sun_View.ShowPlot = true; GMAT Sun_View.MaxPlotPoints = 20000; GMAT Sun_View.ShowLabels = true; GMAT Sun_View.ViewPointReference = Sun; GMAT Sun_View.ViewPointVector = [ 0 0 520000000 ]; GMAT Sun_View.ViewDirection = Sun; GMAT Sun_View.ViewScaleFactor = 1; GMAT Sun_View.ViewUpCoordinateSystem = SunMJ2000Eq; GMAT Sun_View.ViewUpAxis = Z; GMAT Sun_View.EclipticPlane = Off; GMAT Sun_View.XYPlane = On; GMAT Sun_View.WireFrame = Off; GMAT Sun_View.Axes = On; GMAT Sun_View.Grid = Off; GMAT Sun_View.SunLine = Off; GMAT Sun_View.UseInitialView = On; GMAT Sun_View.StarCount = 7000; GMAT Sun_View.EnableStars = On; GMAT Sun_View.EnableConstellations = Off; %---------------------------------------- %---------- Subscribers %---------------------------------------- Create OrbitView Mars_View; GMAT Mars_View.SolverIterations = Current; GMAT Mars_View.UpperLeft = [ 0.6356120826709062 0.4685483870967742 ]; GMAT Mars_View.Size = [ 0.3818759936406995 0.460483870967742 ]; GMAT Mars_View.RelativeZOrder = 156; GMAT Mars_View.Maximized = false; GMAT Mars_View.Add = {inSight, Earth, Luna, Mars, Sun}; GMAT Mars_View.CoordinateSystem = MarsMJ2000Eq; GMAT Mars_View.DrawObject = [ true true true true true ]; GMAT Mars_View.DataCollectFrequency = 1; GMAT Mars_View.UpdatePlotFrequency = 50; GMAT Mars_View.NumPointsToRedraw = 0; GMAT Mars_View.ShowPlot = true; GMAT Mars_View.MaxPlotPoints = 20000; GMAT Mars_View.ShowLabels = true; GMAT Mars_View.ViewPointReference = Mars; GMAT Mars_View.ViewPointVector = [ -80000 -80000 80000 ]; GMAT Mars_View.ViewDirection = Mars; GMAT Mars_View.ViewScaleFactor = 1; GMAT Mars_View.ViewUpCoordinateSystem = MarsFixed; GMAT Mars_View.ViewUpAxis = Z; GMAT Mars_View.EclipticPlane = Off; GMAT Mars_View.XYPlane = On; GMAT Mars_View.WireFrame = Off; GMAT Mars_View.Axes = On; GMAT Mars_View.Grid = Off; GMAT Mars_View.SunLine = Off; GMAT Mars_View.UseInitialView = On; GMAT Mars_View.StarCount = 2000; GMAT Mars_View.EnableStars = On; GMAT Mars_View.EnableConstellations = Off; Create GroundTrackPlot MarsGroundPlot; GMAT MarsGroundPlot.SolverIterations = Current; GMAT MarsGroundPlot.UpperLeft = [ 0 0.4653225806451613 ]; GMAT MarsGroundPlot.Size = [ 0.3338632750397456 0.4645161290322581 ]; GMAT MarsGroundPlot.RelativeZOrder = 140; GMAT MarsGroundPlot.Maximized = false; GMAT MarsGroundPlot.Add = {inSight, Earth}; GMAT MarsGroundPlot.DataCollectFrequency = 1; GMAT MarsGroundPlot.UpdatePlotFrequency = 50; GMAT MarsGroundPlot.NumPointsToRedraw = 0; GMAT MarsGroundPlot.ShowPlot = true; GMAT MarsGroundPlot.MaxPlotPoints = 20000; GMAT MarsGroundPlot.CentralBody = Mars; GMAT MarsGroundPlot.TextureMap = 'Mars_JPLCaltechUSGS.jpg'; Create GroundTrackPlot EarthGroundPlot; GMAT EarthGroundPlot.SolverIterations = Current; GMAT EarthGroundPlot.UpperLeft = [ 0 0.001612903225806452 ]; GMAT EarthGroundPlot.Size = [ 0.3338632750397456 0.4645161290322581 ]; GMAT EarthGroundPlot.RelativeZOrder = 144; GMAT EarthGroundPlot.Maximized = false; GMAT EarthGroundPlot.Add = {inSight}; GMAT EarthGroundPlot.DataCollectFrequency = 1; GMAT EarthGroundPlot.UpdatePlotFrequency = 50; GMAT EarthGroundPlot.NumPointsToRedraw = 0; GMAT EarthGroundPlot.ShowPlot = true; GMAT EarthGroundPlot.MaxPlotPoints = 20000; GMAT EarthGroundPlot.CentralBody = Earth; GMAT EarthGroundPlot.TextureMap = 'ModifiedBlueMarble.jpg'; %---------------------------------------- %---------- Arrays, Variables, Strings %---------------------------------------- Create Variable earthSOI marsSOI; GMAT earthSOI = 924000; GMAT marsSOI = 576000; %---------------------------------------- %---------- Mission Sequence %---------------------------------------- BeginMissionSequence; Toggle 'GroundPlotCondition' EarthGroundPlot MarsGroundPlot Off; Toggle 'Start_2DEarthPlot' EarthGroundPlot On; Propagate 'Centaur_CoastPhase1' nearEarth(inSight) {inSight.ElapsedSecs = 4029}; Target 'toTCM1_CoastPhase' DefaultDC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = false}; Vary 'V.burn2_Centaur' DefaultDC(CentaurBurn2.Element1 = 3.203773055507344, {Perturbation = 0.0001, Lower = 0.0, Upper = 5, MaxStep = 0.2, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Maneuver 'Centaur_Burn2' CentaurBurn2(inSight); Propagate 'proptoTCM1' nearEarth(inSight) {inSight.ElapsedSecs = 1463199}; Achieve 'reachEarthSOI' DefaultDC(inSight.Earth.RMAG = earthSOI, {Tolerance = 0.1}); EndTarget; % For targeter DefaultDC Toggle 'End_2DEarthPlot' EarthGroundPlot Off; Target 'toTCM2_targetingMars' DefaultDC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = false}; Vary 'V.TCM1' DefaultDC(TCM1.Element1 = -1.762904981160818, {Perturbation = 0.0001, Lower = -10, Upper = 10, MaxStep = 0.2, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Vary 'N.TCM1' DefaultDC(TCM1.Element2 = -0.4530696364876147, {Perturbation = 0.0001, Lower = -10, Upper = 10, MaxStep = 0.2, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Vary 'B.TCM1' DefaultDC(TCM1.Element3 = 2.582941024446413, {Perturbation = 0.0001, Lower = -10, Upper = 10, MaxStep = 0.2, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Maneuver 'TCM1' TCM1(inSight); Propagate 'proptoTimeSOI' deepSpace(inSight) {inSight.ElapsedSecs = 16243200, inSight.Mars.Altitude = 1000000}; Achieve 'BdotT0' DefaultDC(inSight.MarsMJ2000Eq.BdotT = 0, {Tolerance = 0.1}); Achieve 'BdotR0' DefaultDC(inSight.MarsMJ2000Eq.BdotR = 0, {Tolerance = 0.1}); Achieve 'ElapsedDays' DefaultDC(inSight.ElapsedDays = 190, {Tolerance = 1}); Achieve 'alt1e6' DefaultDC(inSight.Mars.Altitude = 1000000, {Tolerance = 1}); EndTarget; % For targeter DefaultDC Toggle 'Start_2DMarsPlot' MarsGroundPlot On; Target 'toTCM5' DefaultDC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = false}; Vary 'V.TCM4' DefaultDC(TCM4.Element1 = -0.676637704026937, {Perturbation = 0.0001, Lower = -10, Upper = 10, MaxStep = 0.1, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Vary 'N.TCM4' DefaultDC(TCM4.Element2 = -0.06649428490271575, {Perturbation = 0.0001, Lower = -1, Upper = 1, MaxStep = 0.1, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Vary 'B.TCM4' DefaultDC(TCM4.Element3 = -2.3360290532948, {Perturbation = 0.0001, Lower = -10, Upper = 10, MaxStep = 0.1, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Maneuver 'TCM4' TCM4(inSight); Propagate 'proptoTCM5' nearMars(inSight) {inSight.Mars.Altitude = marsSOI, StopTolerance = 1e-005}; Achieve 'BdotT0_2' DefaultDC(inSight.MarsMJ2000Eq.BdotR = 0, {Tolerance = 0.1}); Achieve 'BdotR0_2' DefaultDC(inSight.MarsMJ2000Eq.BdotT = 0, {Tolerance = 0.1}); Achieve 'TOF' DefaultDC(inSight.ElapsedDays = 197, {Tolerance = 0.1}); EndTarget; % For targeter DefaultDC Target 'toEDL' DefaultDC {SolveMode = Solve, ExitMode = DiscardAndContinue, ShowProgressWindow = false}; Vary 'V.TCM6' DefaultDC(TCM6.Element1 = -0.02858545706414507, {Perturbation = 0.0001, Lower = -5, Upper = 5, MaxStep = 0.1, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Vary 'N.TCM6' DefaultDC(TCM6.Element2 = 0.005228715448683213, {Perturbation = 0.0001, Lower = -5, Upper = 5, MaxStep = 0.1, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Vary 'B.TCM6' DefaultDC(TCM6.Element3 = -0.1973171921623894, {Perturbation = 0.0001, Lower = -5, Upper = 5, MaxStep = 0.1, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0}); Maneuver 'TCM6' TCM6(inSight); Propagate 'proptoEDL' nearMars(inSight) {inSight.Mars.Altitude = 1000, inSight.ElapsedSecs = 17739330}; Achieve 'MarsLong' DefaultDC(inSight.Mars.Longitude = 60.9, {Tolerance = 0.1}); Achieve 'MarsLat' DefaultDC(inSight.Mars.Latitude = -5, {Tolerance = 0.1}); EndTarget; % For targeter DefaultDC Propagate nearEarth(inSight) {inSight.ElapsedSecs = 1}; Toggle 'End_2DMarsPlot' MarsGroundPlot Off;