% ---- Spacecraft A Earth Baseline Create Spacecraft Sc; GMAT Sc.DateFormat = TAIModJulian; GMAT Sc.Epoch = '21545.000000000'; GMAT Sc.CoordinateSystem = EarthMJ2000Eq; GMAT Sc.DryMass = 850; GMAT Sc.Cd = 2.2; GMAT Sc.Cr = 1.8; GMAT Sc.DragArea = 15; GMAT Sc.SRPArea = 1; GMAT Sc.Tanks = {TankL}; GMAT Sc.Thrusters = {ThrusterB}; GMAT Sc.Attitude = CoordinateSystemFixed; GMAT Sc.AttitudeDisplayStateType = 'EulerAngles'; GMAT Sc.AttitudeRateDisplayStateType = 'AngularVelocity'; GMAT Sc.AttitudeCoordinateSystem = 'EarthMJ2000Eq'; GMAT Sc.EulerAngleSequence = '312'; GMAT Sc.EulerAngle1 = 35.2643896827547; GMAT Sc.EulerAngle2 = 0; GMAT Sc.EulerAngle3 = -45; GMAT Sc.AngularVelocityX = 0; GMAT Sc.AngularVelocityY = 0; GMAT Sc.AngularVelocityZ = 0; % --- Planet Specific Coords GMAT Sc.X = 7653.768; GMAT Sc.Y = 0; GMAT Sc.Z = 0; GMAT Sc.VX = 0; GMAT Sc.VY = 7.2166; GMAT Sc.VZ = 0; GMAT Earth.Mu = 398600.4415; % Tank L Baseline Blowdown Tank Create FuelTank TankL; GMAT TankL.FuelMass = 725; GMAT TankL.Pressure = 1200; GMAT TankL.Temperature = 20; GMAT TankL.RefTemperature = 12; GMAT TankL.Volume = 0.8; GMAT TankL.FuelDensity = 1029; GMAT TankL.PressureModel = BlowDown; % Thruster B Off Direction Create Thruster ThrusterB; GMAT ThrusterB.CoordinateSystem = Local; GMAT ThrusterB.Origin = Earth; GMAT ThrusterB.Axes = SpacecraftBody; GMAT ThrusterB.ThrustDirection1 = 1; GMAT ThrusterB.ThrustDirection2 = 0; GMAT ThrusterB.ThrustDirection3 = 0; GMAT ThrusterB.DutyCycle = 1; GMAT ThrusterB.ThrustScaleFactor = 1; GMAT ThrusterB.DecrementMass = true; GMAT ThrusterB.Tank = {TankL}; GMAT ThrusterB.GravitationalAccel = 9.81; GMAT ThrusterB.C1 = 10; GMAT ThrusterB.C2 = 0.25; GMAT ThrusterB.C3 = 0.25; GMAT ThrusterB.C4 = 0; GMAT ThrusterB.C5 = 0; GMAT ThrusterB.C6 = 0; GMAT ThrusterB.C7 = 0; GMAT ThrusterB.C8 = 0; GMAT ThrusterB.C9 = 0; GMAT ThrusterB.C10 = 0; GMAT ThrusterB.C11 = 0; GMAT ThrusterB.C12 = 0; GMAT ThrusterB.C13 = 0; GMAT ThrusterB.C14 = 0; GMAT ThrusterB.C15 = 0; GMAT ThrusterB.C16 = 0; GMAT ThrusterB.K1 = 300; GMAT ThrusterB.K2 = 0.25; GMAT ThrusterB.K3 = 0.25; GMAT ThrusterB.K4 = 0; GMAT ThrusterB.K5 = 0; GMAT ThrusterB.K6 = 0; GMAT ThrusterB.K7 = 0; GMAT ThrusterB.K8 = 0; GMAT ThrusterB.K9 = 0; GMAT ThrusterB.K10 = 0; GMAT ThrusterB.K11 = 0; GMAT ThrusterB.K12 = 0; GMAT ThrusterB.K13 = 0; GMAT ThrusterB.K14 = 0; GMAT ThrusterB.K15 = 0; GMAT ThrusterB.K16 = 0; %-------------------- % Create Finite Burn % ------------------- Create FiniteBurn fb1; GMAT fb1.Thrusters = {ThrusterB}; %--- Alternate Coord System Not needed for Earth Create ForceModel fm; GMAT fm.CentralBody = Earth; GMAT fm.PointMasses = {Earth}; GMAT fm.Drag = None; GMAT fm.SRP = Off; GMAT fm.ErrorControl = RSSStep; % Create a propagator Create Propagator prop; GMAT prop.FM = fm; GMAT prop.Type = RungeKutta56; GMAT prop.InitialStepSize = 0.001; GMAT prop.Accuracy = 1e-012; GMAT prop.MinStep = 0.001; %0.001; GMAT prop.MaxStep = 432000; %was 60 GMAT prop.MaxStepAttempts = 50; Create Variable loop; %% test for ReportFile FRR-30 %% Create a report file Create ReportFile rf1; GMAT rf1.Filename = 'Thruster_FBurn_Earth_ScA_ThrusterB_CS3_TankL_RK56.report'; GMAT rf1.Precision = 16; GMAT rf1.Add = {Sc.TAIModJulian, Sc.EarthMJ2000Eq.X, Sc.EarthMJ2000Eq.Y, Sc.EarthMJ2000Eq.Z, Sc.EarthMJ2000Eq.VX, Sc.EarthMJ2000Eq.VY, Sc.EarthMJ2000Eq.VZ, Sc.TotalMass, Sc.TankL.FuelMass}; GMAT rf1.WriteHeaders = On; GMAT rf1.ZeroFill = On; GMAT rf1.ColumnWidth = 27; GMAT rf1.LeftJustify = On; Create XYPlot XYPlot1; GMAT XYPlot1.SolverIterations = Current; GMAT XYPlot1.UpperLeft = [ 0.2830188679245283 0 ]; GMAT XYPlot1.Size = [ 0.5783018867924529 0.8508771929824561 ]; GMAT XYPlot1.RelativeZOrder = 284; GMAT XYPlot1.XVariable = Sc.ElapsedSecs; %Sc.ElapsedDays; GMAT XYPlot1.YVariables = {Sc.EarthMJ2000Eq.X}; GMAT XYPlot1.ShowGrid = true; GMAT XYPlot1.ShowPlot = true; %%%---------------------------------------- %%%---------- Mission Sequence %%%---------------------------------------- %%% %%% %%%-----------Begin Propagation and Report Generation-------- %%% Propagate based on preset propagation parameters %%% and current stop conditions. BeginMissionSequence; % %% Output Report file data for each propagation set in the FOR loop BeginFiniteBurn fb1(Sc); Propagate prop(Sc,{Sc.ElapsedSecs = 7200}) ClearPlot XYPlot1; Propagate BackProp prop(Sc,{Sc.ElapsedSecs = -7200}) EndFiniteBurn fb1(Sc); %