SolarSystem.EphemerisSource = 'DE421'; Luna.EquatorialRadius = 1738.2e-30; Earth.EquatorialRadius = 1738.2e-30; Create CoordinateSystem SunOrigin_EME; SunOrigin_EME.Origin = Sun; SunOrigin_EME.Axes = MJ2000Eq; Create Spacecraft SimFermi; SimFermi.DateFormat = UTCGregorian; SimFermi.Epoch = '01 Mar 2013 00:00:00.000'; SimFermi.CoordinateSystem = SunOrigin_EME; SimFermi.DisplayStateType = Keplerian; SimFermi.SMA = 145864620 SimFermi.ECC = 0.001 SimFermi.INC = 0; SimFermi.RAAN = 0; SimFermi.AOP = 0; SimFermi.TA = 0; SimFermi.DryMass = 1000 SimFermi.Cr = 2 SimFermi.SRPArea = 500 Create Spacecraft Fermi; Fermi.DateFormat = UTCGregorian; Fermi.Epoch = '01 Mar 2013 00:00:00.000'; Fermi.CoordinateSystem = SunOrigin_EME; Fermi.DisplayStateType = Keplerian; Fermi.SMA = 145864620 Fermi.ECC = 0.001 Fermi.INC = 0; Fermi.RAAN = 0; Fermi.AOP = 0; Fermi.TA = 0; Fermi.DryMass = 1000 Fermi.Cr = 1e70 %this value not used Fermi.SRPArea = 1e70 %this value not used Fermi.Attitude = NadirPointing; Fermi.AttitudeReferenceBody = Sun; Fermi.AttitudeConstraintType = 'OrbitNormal'; Fermi.BodyAlignmentVectorX = 1; Fermi.BodyAlignmentVectorY = 0; Fermi.BodyAlignmentVectorZ = 0; Fermi.BodyConstraintVectorX = 0; Fermi.BodyConstraintVectorY = 0; Fermi.BodyConstraintVectorZ = 1; %above attitude should point X body axis towards Sun. Create Plate BP1 BP2 % BP1.Type = FixedInBody BP1.PlateNormal = [1.0, 0.0, 0.0] BP1.LitFraction = 1.0 BP1.AreaCoefficient = 1.0 BP1.Area = 500 BP1.SpecularFraction = 1 BP1.DiffuseFraction = 0 BP2.Type = FixedInBody BP2.PlateNormal = [-1.0, 0.0, 0.0] BP2.LitFraction = 1.0 BP2.AreaCoefficient = 1.0 BP2.Area = 1e70 %shouldnt be used since Sun not shining on this panel BP2.SpecularFraction = 0.5; BP2.DiffuseFraction = 0.1; Fermi.AddPlates = {BP1, BP2}; %The Fermi S/c attitude points the X axis towards the Sun. Fermi s/c uses NPlate model. %The orbit obtained should be identical to the SimFermi S/C canon-ball %SRP model, Cr=2.0, with a cross sectional area of 500 m^2 %and a mass of 1000 kg. % % Force model and propagator % Create ForceModel FM FM_Sim; Create Propagator Prop Prop_Sim; FM_Sim.CentralBody = Sun; FM_Sim.PointMasses = {Sun}; FM_Sim.SRP = On; FM_Sim.SRP.SRPModel = Spherical FM_Sim.Drag.AtmosphereModel = 'None' FM_Sim.ErrorControl = 'None'; Prop_Sim.FM = FM_Sim; Prop_Sim.Type = RungeKutta89; Prop_Sim.InitialStepSize = 5; %set small to make sure attitude is more accurate Prop_Sim.Accuracy = 1e-13; Prop_Sim.MinStep = 0; Prop_Sim.MaxStep = 60; Prop_Sim.MaxStepAttempts = 50; FM.CentralBody = Sun; FM.PointMasses = {Sun}; FM.SRP = On; FM.SRP.SRPModel = NPlate FM.Drag.AtmosphereModel = 'None' FM.ErrorControl = 'None'; Prop.FM = FM; Prop.Type = RungeKutta89; Prop.InitialStepSize = 5; %set small to make sure attitude is more accurate Prop.Accuracy = 1e-13; Prop.MinStep = 0; Prop.MaxStep = 60; Prop.MaxStepAttempts = 50; Create ReportFile rf Create Variable Pos_Error_meters BeginMissionSequence % Propagate Prop_Sim(SimFermi) {SimFermi.ElapsedSecs = 86400}; Propagate Prop(Fermi) {Fermi.ElapsedSecs = 86400}; % % Pos_Error_meters = 1000*sqrt ( (SimFermi.X-Fermi.X)^2 + (SimFermi.Y-Fermi.Y)^2 + (SimFermi.Z-Fermi.Z)^2 ); Report rf Pos_Error_meters %