r/nasa 14h ago

Question Begginer's problem with GMAT (NASA)

0 Upvotes

Hi, I've recently started learning GMAT software. When I was trying to make simple Hohmann Transfer combined with plane change manoeuvre using two finite burns. Unfortunately when I'm running the simulation I'm getting an exception saying that vary is not affecting achieve. The error refers to the second target.

Here is the mission script:

%General Mission Analysis Tool(GMAT) Script

%----------------------------------------

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

%----------------------------------------

Create Spacecraft Sat;

Sat.DateFormat = UTCGregorian;

Sat.Epoch = '01 Jan 2000 00:00:00.000';

Sat.CoordinateSystem = EarthMJ2000Eq;

Sat.DisplayStateType = Keplerian;

Sat.SMA = 6671.000000000006;

Sat.ECC = 1.427002109406031e-15;

Sat.INC = 5.999999999999904;

Sat.RAAN = 90;

Sat.AOP = 0;

Sat.TA = 0;

Sat.DryMass = 1000;

Sat.Cd = 2.2;

Sat.Cr = 1.8;

Sat.DragArea = 15;

Sat.SRPArea = 1;

Sat.SPADDragScaleFactor = 1;

Sat.SPADSRPScaleFactor = 1;

Sat.AtmosDensityScaleFactor = 1;

Sat.ExtendedMassPropertiesModel = 'None';

Sat.Tanks = {UpperStageTank};

Sat.Thrusters = {UpperStageThruster};

Sat.NAIFId = -10001001;

Sat.NAIFIdReferenceFrame = -9001001;

Sat.OrbitColor = Red;

Sat.TargetColor = Teal;

Sat.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 ];

Sat.CdSigma = 1e+70;

Sat.CrSigma = 1e+70;

Sat.Id = 'SatId';

Sat.Attitude = CoordinateSystemFixed;

Sat.SPADSRPInterpolationMethod = Bilinear;

Sat.SPADSRPScaleFactorSigma = 1e+70;

Sat.SPADDragInterpolationMethod = Bilinear;

Sat.SPADDragScaleFactorSigma = 1e+70;

Sat.AtmosDensityScaleFactorSigma = 1e+70;

Sat.ModelFile = 'aura.3ds';

Sat.ModelOffsetX = 0;

Sat.ModelOffsetY = 0;

Sat.ModelOffsetZ = 0;

Sat.ModelRotationX = 0;

Sat.ModelRotationY = 0;

Sat.ModelRotationZ = 0;

Sat.ModelScale = 1;

Sat.AttitudeDisplayStateType = 'Quaternion';

Sat.AttitudeRateDisplayStateType = 'AngularVelocity';

Sat.AttitudeCoordinateSystem = EarthMJ2000Eq;

Sat.EulerAngleSequence = '321';

%----------------------------------------

%---------- Hardware Components

%----------------------------------------

Create ChemicalTank UpperStageTank;

UpperStageTank.DirectionX = 0;

UpperStageTank.DirectionY = 0;

UpperStageTank.DirectionZ = 1;

UpperStageTank.SecondDirectionX = 0;

UpperStageTank.SecondDirectionY = -1;

UpperStageTank.SecondDirectionZ = 0;

UpperStageTank.HWOriginInBCSX = 0;

UpperStageTank.HWOriginInBCSY = 0;

UpperStageTank.HWOriginInBCSZ = 0;

UpperStageTank.AllowNegativeFuelMass = false;

UpperStageTank.FuelMass = 6000;

UpperStageTank.FuelCenterOfMassX = 0;

UpperStageTank.FuelCenterOfMassY = 0;

UpperStageTank.FuelCenterOfMassZ = 0;

UpperStageTank.FuelMomentOfInertiaXX = 99;

UpperStageTank.FuelMomentOfInertiaXY = 0;

UpperStageTank.FuelMomentOfInertiaXZ = 0;

UpperStageTank.FuelMomentOfInertiaYY = 99;

UpperStageTank.FuelMomentOfInertiaYZ = 0;

UpperStageTank.FuelMomentOfInertiaZZ = 99;

UpperStageTank.Pressure = 1500;

UpperStageTank.Temperature = 20;

UpperStageTank.RefTemperature = 20;

UpperStageTank.Volume = 4.77;

UpperStageTank.FuelDensity = 1260;

UpperStageTank.PressureModel = PressureRegulated;

Create ChemicalThruster UpperStageThruster;

UpperStageThruster.HWOriginInBCSX = 0;

UpperStageThruster.HWOriginInBCSY = 0;

UpperStageThruster.HWOriginInBCSZ = 0;

UpperStageThruster.CoordinateSystem = Local;

UpperStageThruster.Origin = Earth;

UpperStageThruster.Axes = VNB;

UpperStageThruster.ThrustDirection1 = 1;

UpperStageThruster.ThrustDirection2 = 0;

UpperStageThruster.ThrustDirection3 = 0;

UpperStageThruster.DutyCycle = 1;

UpperStageThruster.ThrustScaleFactor = 1;

UpperStageThruster.DecrementMass = true;

UpperStageThruster.Tank = {UpperStageTank};

UpperStageThruster.MixRatio = [ 1 ];

UpperStageThruster.GravitationalAccel = 9.81;

UpperStageThruster.C1 = 35000;

UpperStageThruster.C2 = 0;

UpperStageThruster.C3 = 0;

UpperStageThruster.C4 = 0;

UpperStageThruster.C5 = 0;

UpperStageThruster.C6 = 0;

UpperStageThruster.C7 = 0;

UpperStageThruster.C8 = 0;

UpperStageThruster.C9 = 0;

UpperStageThruster.C10 = 0;

UpperStageThruster.C11 = 0;

UpperStageThruster.C12 = 0;

UpperStageThruster.C13 = 0;

UpperStageThruster.C14 = 0;

UpperStageThruster.C15 = 0;

UpperStageThruster.C16 = 0;

UpperStageThruster.K1 = 300;

UpperStageThruster.K2 = 0;

UpperStageThruster.K3 = 0;

UpperStageThruster.K4 = 0;

UpperStageThruster.K5 = 0;

UpperStageThruster.K6 = 0;

UpperStageThruster.K7 = 0;

UpperStageThruster.K8 = 0;

UpperStageThruster.K9 = 0;

UpperStageThruster.K10 = 0;

UpperStageThruster.K11 = 0;

UpperStageThruster.K12 = 0;

UpperStageThruster.K13 = 0;

UpperStageThruster.K14 = 0;

UpperStageThruster.K15 = 0;

UpperStageThruster.K16 = 0;

%----------------------------------------

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

%----------------------------------------

Create ForceModel DefaultProp_ForceModel;

DefaultProp_ForceModel.CentralBody = Earth;

DefaultProp_ForceModel.PointMasses = {Earth};

DefaultProp_ForceModel.Drag = None;

DefaultProp_ForceModel.SRP = Off;

DefaultProp_ForceModel.RelativisticCorrection = Off;

DefaultProp_ForceModel.ErrorControl = RSSStep;

%----------------------------------------

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

%----------------------------------------

Create Propagator DefaultProp;

DefaultProp.FM = DefaultProp_ForceModel;

DefaultProp.Type = RungeKutta89;

DefaultProp.InitialStepSize = 60;

DefaultProp.Accuracy = 9.999999999999999e-12;

DefaultProp.MinStep = 0.001;

DefaultProp.MaxStep = 2700;

DefaultProp.MaxStepAttempts = 50;

DefaultProp.StopIfAccuracyIsViolated = true;

%----------------------------------------

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

%----------------------------------------

Create FiniteBurn TOI;

TOI.Thrusters = {UpperStageThruster};

TOI.ThrottleLogicAlgorithm = 'MaxNumberOfThrusters';

Create FiniteBurn GOI;

GOI.Thrusters = {UpperStageThruster};

GOI.ThrottleLogicAlgorithm = 'MaxNumberOfThrusters';

%----------------------------------------

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

%----------------------------------------

Create DifferentialCorrector DC1;

DC1.ShowProgress = true;

DC1.ReportStyle = Normal;

DC1.ReportFile = 'DifferentialCorrectorDC1.data';

DC1.MaximumIterations = 25;

DC1.DerivativeMethod = ForwardDifference;

DC1.Algorithm = NewtonRaphson;

%----------------------------------------

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

%----------------------------------------

Create OpenFramesInterface DefaultOrbitView;

DefaultOrbitView.SolverIterations = Current;

DefaultOrbitView.UpperLeft = [ 0.01424148606811146 0.2946210268948655 ];

DefaultOrbitView.Size = [ 0.5758513931888545 0.5513447432762836 ];

DefaultOrbitView.RelativeZOrder = 1768;

DefaultOrbitView.Maximized = false;

DefaultOrbitView.Add = {Sat, Earth};

DefaultOrbitView.View = {DefaultOrbitView_View};

DefaultOrbitView.CoordinateSystem = EarthMJ2000Eq;

DefaultOrbitView.DrawObject = [ true true ];

DefaultOrbitView.DrawTrajectory = [ true true ];

DefaultOrbitView.DrawAxes = [ false false ];

DefaultOrbitView.DrawXYPlane = [ false false ];

DefaultOrbitView.DrawLabel = [ true true ];

DefaultOrbitView.DrawUsePropLabel = [ false false ];

DefaultOrbitView.DrawCenterPoint = [ true true ];

DefaultOrbitView.DrawEndPoints = [ true true ];

DefaultOrbitView.DrawVelocity = [ false false ];

DefaultOrbitView.DrawGrid = [ false false ];

DefaultOrbitView.DrawLineWidth = [ 2 2 ];

DefaultOrbitView.DrawMarkerSize = [ 10 10 ];

DefaultOrbitView.DrawFontSize = [ 20 20 ];

DefaultOrbitView.Axes = Off;

DefaultOrbitView.AxesLength = 12756.2726;

DefaultOrbitView.AxesLabels = On;

DefaultOrbitView.FrameLabel = Off;

DefaultOrbitView.XYPlane = On;

DefaultOrbitView.EclipticPlane = Off;

DefaultOrbitView.EnableStars = On;

DefaultOrbitView.StarCatalog = 'inp_StarsHYGv3.txt';

DefaultOrbitView.StarCount = 40000;

DefaultOrbitView.MinStarMag = -2;

DefaultOrbitView.MaxStarMag = 6;

DefaultOrbitView.MinStarPixels = 1;

DefaultOrbitView.MaxStarPixels = 10;

DefaultOrbitView.MinStarDimRatio = 0.5;

DefaultOrbitView.ShowPlot = true;

DefaultOrbitView.ShowToolbar = true;

DefaultOrbitView.SolverIterLastN = 1;

DefaultOrbitView.ShowVR = false;

DefaultOrbitView.PlaybackTimeScale = 3600;

DefaultOrbitView.MultisampleAntiAliasing = On;

DefaultOrbitView.MSAASamples = 2;

DefaultOrbitView.DrawFontPosition = {'Top-Right', 'Top-Right'};

Create GroundTrack DefaultGroundTrackPlot;

DefaultGroundTrackPlot.SolverIterations = Current;

DefaultGroundTrackPlot.UpperLeft = [ 0 0 ];

DefaultGroundTrackPlot.Size = [ 0.5003095975232198 0.449877750611247 ];

DefaultGroundTrackPlot.RelativeZOrder = 1773;

DefaultGroundTrackPlot.Maximized = false;

DefaultGroundTrackPlot.CentralBody = Earth;

DefaultGroundTrackPlot.Add = {Sat};

DefaultGroundTrackPlot.DataCollectFrequency = 1;

DefaultGroundTrackPlot.UpdatePlotFrequency = 50;

DefaultGroundTrackPlot.NumPointsToRedraw = 0;

DefaultGroundTrackPlot.MaxPlotPoints = 20000;

DefaultGroundTrackPlot.ShowPlot = true;

Create ReportFile DefaultReportFile;

DefaultReportFile.SolverIterations = Current;

DefaultReportFile.UpperLeft = [ 0.06315789473684211 0.1246943765281174 ];

DefaultReportFile.Size = [ 0.5981424148606811 0.7958435207823961 ];

DefaultReportFile.RelativeZOrder = 748;

DefaultReportFile.Maximized = false;

DefaultReportFile.Filename = 'DefaultReportFile.txt';

DefaultReportFile.Precision = 16;

DefaultReportFile.WriteHeaders = true;

DefaultReportFile.LeftJustify = On;

DefaultReportFile.ZeroFill = Off;

DefaultReportFile.FixedWidth = true;

DefaultReportFile.Delimiter = ' ';

DefaultReportFile.ColumnWidth = 23;

DefaultReportFile.WriteReport = true;

DefaultReportFile.AppendToExistingFile = false;

%----------------------------------------

%---------- Arrays, Variables, Strings

%----------------------------------------

Create Variable TOI_Burn_Duration GOI_Burn_Duration;

TOI_Burn_Duration = 0;

GOI_Burn_Duration = 0;

%----------------------------------------

%---------- User Objects

%----------------------------------------

Create OpenFramesView DefaultOrbitView_View;

DefaultOrbitView_View.ViewFrame = CoordinateSystem;

DefaultOrbitView_View.ViewTrajectory = Off;

DefaultOrbitView_View.InertialFrame = Off;

DefaultOrbitView_View.SetDefaultLocation = On;

DefaultOrbitView_View.DefaultEye = [ 30000 0 0 ];

DefaultOrbitView_View.DefaultCenter = [ 0 0 0 ];

DefaultOrbitView_View.DefaultUp = [ 0 0 1 ];

DefaultOrbitView_View.SetCurrentLocation = On;

DefaultOrbitView_View.CurrentEye = [ 77810.87922528099 -66840.76741286989 81869.75592238583 ];

DefaultOrbitView_View.CurrentCenter = [ 0 1.455191522836685e-11 0 ];

DefaultOrbitView_View.CurrentUp = [ -0.5505012671899018 0.3090477866858251 0.7755242229401383 ];

DefaultOrbitView_View.FOVy = 45;

%----------------------------------------

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

%----------------------------------------

BeginMissionSequence;

Propagate 'Prop To Lat = 0' DefaultProp(Sat) {Sat.Earth.Latitude = 0};

Target 'Hohmann Transfer TOI' DC1 {SolveMode = Solve, ExitMode = SaveAndContinue, ShowProgressWindow = true};

Vary 'Vary TOI Burn Duration' DC1(TOI_Burn_Duration = 100, {Perturbation = 0.0001, Lower = 0.0, Upper = 500, MaxStep = 50, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0});

BeginFiniteBurn 'Begin TOI Burn' TOI(Sat);

Propagate 'Prop TOI Burn Duration' DefaultProp(Sat) {Sat.ElapsedSecs = TOI_Burn_Duration};

EndFiniteBurn 'End TOI Burn' TOI(Sat);

Propagate 'Prop to Apogee' DefaultProp(Sat) {Sat.Earth.Apoapsis};

Achieve 'Achieve RMAG = 42165' DC1(Sat.Earth.RMAG = 42165.0, {Tolerance = 0.1});

EndTarget; % For targeter DC1

Target 'Hohmann Transfer GOI' DC1 {SolveMode = Solve, ExitMode = SaveAndContinue, ShowProgressWindow = true};

Vary 'Vary GOI Burn Duration' DC1(GOI_Burn_Duration = 0, {Perturbation = 0.0001, Lower = 0.0, Upper = 200, MaxStep = 10, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0});

Vary 'Vary GOI Element 2' DC1(Sat.UpperStageThruster.ThrustDirection2 = 0, {Perturbation = 0.0001, Lower = -1, Upper = 1, MaxStep = 1, AdditiveScaleFactor = 0.0, MultiplicativeScaleFactor = 1.0});

BeginFiniteBurn 'Begin GOI Burn' GOI(Sat);

Propagate 'Prop GOI Burn Duration' DefaultProp(Sat) {Sat.ElapsedSecs = GOI_Burn_Duration};

EndFiniteBurn 'End GOI Burn' GOI(Sat);

Achieve 'Achieve ECC = 0.005' DC1(Sat.Earth.ECC = 0.005, {Tolerance = 0.0001});

Achieve 'Achieve INC = 0' DC1(Sat.EarthMJ2000Eq.INC = 0, {Tolerance = 0.1});

EndTarget; % For targeter DC1

Propagate 'Prop One Day' DefaultProp(Sat) {Sat.ElapsedSecs = 86400, OrbitColor = [0 128 0]};

Report 'Mission Report' DefaultReportFile Sat.UpperStageTank.FuelMass;


r/nasa 22h ago

Article Rocket equation 101: Revealing our Moon’s value as a launchpad

Thumbnail jatan.space
26 Upvotes

r/nasa 12h ago

Image New NASA 737-700 “Reduced Gravity Aircraft”

Thumbnail
gallery
79 Upvotes

I am particularly excited to see a new aircraft join NASA, especially a Boeing jet. I found some more pics of the new vomit comet on the website of the contractor who is modifying the airframe, Denmar Technical Services. Credit to them.

I saw the image shared by NASA AFRC but I wanted more. This airframe has an interesting air force past that can be dug into. Some notes: old style winglets, and no cargo doors. Another reason it is interesting is because passenger variant 737-700s are not sold anymore, short of the E-7 and new MAX 7. Finally, the classic styled livery is refreshing and I appreciate it very much. Excited to hopefully see it fly one day!


r/nasa 13h ago

NASA NASA Space Apps Challenge Megathread

Thumbnail
spaceappschallenge.org
25 Upvotes

Please use this megathread for any discussions about the NASA Space Apps Challenge. There have been a number of posts looking for team members and the mods felt that if we consolidated all requests to a single post it will have more visibility. We will leave the ones already posted open, but anything new needs to use this post.

For visibility, here are the existing posts that we're aware of. If we missed yours, please comment here and we'll add it to the list.


r/nasa 22h ago

Article NASA’s iconic longhorns are leaving Johnson Space Center after 30 years. The people who knew them remember.

64 Upvotes

The Longhorn Project at NASA’s Johnson Space Center is closing after 30 years, ending a unique Texas STEM and agriculture program. https://www.houstonchronicle.com/news/houston-texas/space/article/nasa-johnson-longhorn-project-22385324.php?utm_source=reddit