Hi @Keaton, Have you made any progress or still have any questions or clarification required, please feel free to reach out
Satellite Scenario around other planets
Risposta accettata
5 Commenti
Hi @Keaton,
Sorry it took so long. Firstly, thank you you for your thorough testing and for sharing your findings. After carefully reviewing your comments and examining the official MATLAB R2025b documentation, I can confirm that your analysis is entirely correct.
You've identified the core issue precisely. When you attempted to use `centralBodyOptions(sc, CentralBody="Mars")`, MATLAB returned an error stating that the only valid argument names are 'UseEarthOrientationParameters' or 'EarthOrientationParameterFile'. This tells us exactly what the `centralBodyOptions()` function actually does - it manages Earth Orientation Parameters for the scenario, not the central body itself. My suggestion earlier while well-intentioned, was based on a misunderstanding of this function's purpose.
So, looking at the official documentation carefully, what I missed was the `CentralBodyOptions` property of the `satelliteScenario` object which is explicitly marked as "Read-only". This means that once a satellite scenario is created, you cannot modify which celestial body sits at its center. The property exists, but it cannot be changed after instantiation, and there is no constructor parameter available to set it to Mars during creation.
Your observation about the " intersects with the Earth's surface" error is particularly telling. When you increased the semi-major axis from 4,000,000 meters to 40,000,000 meters, you eliminated that error because you moved the orbit far enough from Earth's surface. However, the visualization still rendered the spacecraft orbiting Earth, not Mars. This confirms that while your `propagateOrbit()` function is correctly computing the orbital mechanics around Mars using the `Aero.spacecraft.CentralBodyOptions` class, the `satelliteScenario` and `satelliteScenarioViewer` tools remain fundamentally Earth-centric.
The coordinate system used by these visualization tools is based on Earth-centered reference frames - GCRF (Geocentric Celestial Reference Frame), ITRF (International Terrestrial Reference Frame), and ECEF (Earth-Centered Earth-Fixed). The entire architecture assumes Earth is at the origin. There is no mechanism in R2025b to shift this origin to Mars or any other planetary body.
Your conclusion that " we can propagate orbits around other planets just fine, but might not yet have the capability in the satellite scenario and satellite scenario viewer tools to visualize them" is absolutely accurate. The Aerospace Toolbox has robust support for multi-body orbital mechanics through `propagateOrbit()` and related functions, but the 3D visualization infrastructure has not yet been extended to support non-Earth central bodies.
I've reviewed the R2025b release notes and searched through the available documentation, and there is no indication of when this feature might be added to future releases. MathWorks has not published a roadmap item for multi-body visualization support in `satelliteScenario`.
My recommendation would be to file an enhancement request with MathWorks Technical Support. Given that the underlying propagation mathematics already supports multiple central bodies, extending the visualization system would be a logical next step. In the meantime, your Mars orbit data from `propagateOrbit()` is valid and accurate - you simply need to use alternative visualization methods if you require 3D representation of the trajectory.
You don't need to upload anything else. Your code is correct, your analysis is sound, and you've discovered a genuine limitation in the current version of the toolbox. This isn't a problem with your implementation; it's a feature that hasn't been implemented yet in the visualization components.
Well done on the systematic debugging and for reading the error messages carefully. That's exactly the right approach to identifying where the actual limitations lie.
Più risposte (1)
Hi @Keaton,
Yeah, actually you can visualize orbits around other planets now! It's a newer feature so that's probably why you haven't seen many examples floating around yet. MathWorks added support for non-Earth central bodies starting with R2024b and expanded it in R2025a.
Basically, you need to use the Aero.spacecraft.CentralBodyOptions class to specify which planet you want. The supported bodies are Sun, Moon, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, and Neptune. The way you do it is by creating a central body options object and passing it to your propagator.Here's a quick example of how you'd set up a Mars orbit:
% Define Mars as the central body centralBodyOpts = Aero.spacecraft.CentralBodyOptions(CentralBody="Mars");
% Set up your numerical propagator with Mars numericalPropOpts = Aero.spacecraft.NumericalPropagatorOptions( ... CentralBodyOptions=centralBodyOpts, ... GravitationalPotentialModel="point-mass");
% Then propagate your orbit [positions, velocities] = propagateOrbit( ... time, rEpoch, vEpoch, ... PropModel="numerical", ... CentralBodyOptions=centralBodyOpts, ... NumericalPropagatorOptions=numericalPropOpts);
For the satelliteScenario object itself, there's a CentralBodyOptions property that you can configure to use planets other than Earth. The scenario viewer should render the planet you select, though it might not be as detailed as the Earth rendering.
One thing to watch out for - if you're using TLE data or the SGP4/SDP4 propagators, those only work with Earth as the central body. For other planets you'll need to stick with numerical propagation or two-body Keplerian models.
Also worth noting that spherical harmonics gravity models (the more accurate ones) are currently only available for Earth, Moon, Mars, and custom bodies. For the other planets you'll be using point-mass or oblate ellipsoid (J2) models.
If you're working in Simulink, the Spacecraft Dynamics block also supports all these central bodies now, which is pretty handy.
You might want to check out the propagateOrbit documentation on the MathWorks site - they updated it recently with info about the CentralBodyOptions parameter. The release notes for R2024b and R2025a also have some details about these new capabilities.
Hope this helps! Let me know if you run into any issues setting it up.
References:
*MathWorks Documentation: propagateOrbit function <https://www.mathworks.com/help/aerotbx/ug/propagateorbit.html>
*Aero.spacecraft.CentralBodyOptions class documentation
*R2024b/R2025a Release Notes for Aerospace Toolbox
0 Commenti
Vedere anche
Categorie
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
