Path: CubeSat/RelativeOrbit
% Formation flying simulation for circular orbits. *** Notes on Usage *** Once this function has run and the outputs have been created, use the "FFSimPlotter" function to plot the data. *** Inputs *** Supply the initial state of the reference (el0) and the initial relative state (dEl0), define the desired relative motion (goals), how many orbits to simulate (nOrbits), the number of simulation points per orbit (nSPO), the disturbance options (distOpt), the cross-sectional area, mass. *** Estimated Absolute and Relative States (ECI) *** The estimated absolute and relative ECI position and velocity are provided by adding noise to the true state. This emulates the data provided by a relative navigation unit. *** Estimated Relative State (Hills) *** The estimated relative position and velocity in the Hill's frame is computed via a transformation from the estimated absolute and relative ECI position and velocity. This computation is performed in the "AbsRelECI2Hills" function. *** Estimated Orbital Elements *** The estimated mean orbital elements and mean orbital element differences are computed from the estimated absolute and relative ECI position and velocity. This computation is performed in the "ECI2MeanElements" function. *** Desired Orbital Elements *** At each step in the simulation, the initial goals are used along with the current estimate of the mean orbital elements to compute the desired orbital element differences. *** Desired Relative State (Hills) *** The desired element differences are transformed to the Hill's frame, defining the desired relative position and velocity. *** Relative State Error (Hills) *** The relative position errors and relative velocity errors are computed by comparing the desired and estimated states. -------------------------------------------------------------------------- Usage: simData = FFSim( simOptions ); -------------------------------------------------------------------------- ------ Inputs ------ simOptions (.) Data structure with the following fields: - el0 (1,6) Initial reference orbital elements (Alfriend format) [a,theta,i,q1,q2,W] - dEl0 (1,6) Initial orbital element differences (Alfriend format) - goals (.) Goals data structure defining desired relative motion - nOrbits (1) Number of orbits to simulate - nSPO (1) Number of simulation points per orbit - distOpt (1,3) Disturbance options (flags) (1) solar: whether to simulate with solar pressure or not (2) drag: whether to simulate with drag or not (3) J2: whether to simulate with J2 or not - mass (1,2) Mass of reference and relative [kg] - area (1,2) Cross-sectional area of reference and relative [m^2] ------- Outputs ------- simData (.) Simulation output data structure with the following fields - time (1,:) Time vector [orbits] - rE (3,:) True ECI position of reference - vE (3,:) True ECI velocity of reference - rE_est (3,:) Estimated ECI position of reference - vE_est (3,:) Estimated ECI velocity of reference - rH (3,:) True Hills-frame relative position - vH (3,:) True Hills-frame relative velocity - rH_est (3,:) Estimated Hills-frame relative position - vH_est (3,:) Estimated Hills-frame relative velocity - rH_des (3,:) Desired Hills-frame relative position - vH_des (3,:) Desired Hills-frame relative velocity - dElMean (6,:) True mean element differences - dElMean_est (6,:) Estimated mean element differences - dElMean_des (6,:) Desired mean element differences - elRefMean_est (6,:) Estimated mean elements of reference - fDiffDragH (3,:) Hills-frame differential drag force - fDiffDragE (3,:) ECI-frame differential drag force - fDiffSolarH (3,:) Hills-frame differential solar force - fDiffSolarE (3,:) ECI-frame differential solar force - fDiffJ2H (3,:) Hills-frame differential J2 force (apparent) - fDiffJ2E (3,:) ECI-frame differential J2 force (apparent) -------------------------------------------------------------------------- See also FFSimPlotter, AbsRelECI2Hills, ECI2MeanElements, Alfriend2El --------------------------------------------------------------------------
AC: ACData/ACTConstants AerospaceUtils: AtmosphericCalculations/AtmDens2 AerospaceUtils: Coord/ECIToEF AerospaceUtils: Coord/QHills CubeSat: RelativeOrbit/FFSimPlotter FormationFlying: Coord/CirclePhase FormationFlying: Coord/GetHillsMats FormationFlying: DataStructures/Geometry_Structure FormationFlying: Transformation/AbsRelECI2Hills FormationFlying: Transformation/DeltaElem2Hills FormationFlying: Transformation/ECI2MeanElements FormationFlying: Transformation/Goals2DeltaElem FormationFlying: Transformation/Goals2Hills FormationFlying: Transformation/Hills2DeltaElem FormationFlying: Transformation/Osc2Mean Orbit: GravityModels/LoadGEM Orbit: GravityModels/LoadGravityModel Orbit: GravityModels/NormalizationMatrix Orbit: GravityModels/UnnormalizeGravity Orbit: OrbitCoord/Alfriend2El Orbit: OrbitCoord/El2Alfriend Orbit: OrbitCoord/OrbElemDiff Orbit: OrbitMechanics/AGravity Plotting: GUI/AnimationGUI Plotting: Help/HelpSystem Plotting: Utilities/InitializeAxes SC: BasicOrbit/CP2I SC: BasicOrbit/E2M SC: BasicOrbit/E2Nu SC: BasicOrbit/El2RV SC: BasicOrbit/M2E SC: BasicOrbit/M2EApp SC: BasicOrbit/M2EEl SC: BasicOrbit/M2EHy SC: BasicOrbit/M2Nu SC: BasicOrbit/M2NuPb SC: BasicOrbit/Nu2E SC: BasicOrbit/Nu2M SC: BasicOrbit/OrbRate SC: BasicOrbit/RV2El SC: Disturbances/SolarF SC: Ephem/Eclipse SC: Ephem/SunV1 SC: SCData/sCTConstants SC: SCMat/GEMT1 Common: CommonData/Constants Common: CommonData/SwooshWatermark Common: CommonData/xSplashSmall Common: ComponentModels/Box Common: ComponentModels/Cone Common: ComponentModels/Frustrum Common: Database/Constant Common: General/CellToMat Common: General/CloseFigure Common: General/DeBlankLT Common: General/DeleteCell Common: General/DispWithTitle Common: General/GetNewTag Common: General/MatToCell Common: General/Watermark Common: Graphics/AddView Common: Graphics/AddZoom Common: Graphics/Axis3D Common: Graphics/CameraControls Common: Graphics/DrawVertices Common: Graphics/Ellipsd Common: Graphics/Map Common: Graphics/Mesh2 Common: Graphics/NPlot Common: Graphics/NewFig Common: Graphics/Plot2D Common: Graphics/PltStyle Common: Graphics/SliderBar Common: Graphics/TitleS Common: Graphics/XLabelS Common: Graphics/YLabelS Common: Graphics/ZLabelS Common: Quaternion/Mat2Q Common: Quaternion/QForm Common: Quaternion/QTForm Common: Quaternion/U2Q Common: Time/DTSToDTA Common: Time/Date2JD Common: Time/JD2000 Common: Time/JD2T Common: Time/T2JD Common: Transform/Altitude Common: Transform/RPhiTheta2Cart Common: Transform/RotMat Math: Analysis/PDAL Math: Analysis/SCHarm Math: Geometry/Perpendicular Math: Integration/RK4 Math: Integration/RK4TI Math: Linear/Cross Math: Linear/Dot Math: Linear/DupVect Math: Linear/Factorl Math: Linear/Mag Math: Linear/Unit Math: Trigonometry/CosD Math: Trigonometry/SinD Math: Trigonometry/WrapPhase
Back to the CubeSat Module page