Hi @AM,
Your experiment is commendable by showing difference in results. However, to address your query regarding, “shouldn't they have the same output?”
I did some experimentation using a different tle file already defined in matlab using both functions mentioned by you and wanted to let you know that both methods do aim to achieve similar outcomes but their subtle differences in the underlying processes leads to variations in the resulting satellite properties. TLE data provides a compact representation of a satellite's orbit, encapsulating essential orbital parameters. When you create a satellite scenario using the command satellite(sc, tlefile), MATLAB reads the TLE file and automatically initializes the satellite's properties based on the data provided. This method leverages the built-in algorithms for orbit propagation, which are optimized for TLE data.Conversely, when you manually extract parameters using the tleread() function and subsequently define the satellite's properties, you may inadvertently introduce discrepancies. The tleread() function extracts Keplerian elements, which are then used to define the satellite's orbit. However, the propagation model used in this case may differ from the one employed when reading TLE data directly. Please see attached results and let me explain the process to help you understand.
So, after glancing through attached results, you will notice key differences in Output. Let me first focus on orbit propagation model,the default orbit propagator is sdp4, which is specifically designed for TLE data. It accounts for perturbations and provides a more accurate representation of the satellite's trajectory. Now, using tleread(), the default propagator is sgp4, which may not account for the same perturbations as sdp4. This can lead to differences in the satellite's position and velocity over time. The second key point about initialization parameters, for TLE data the initialization of the satellite's properties is handled internally. In contrast, when manually defining parameters, there is a risk of omitting critical information or misconfiguring properties, leading to inconsistencies. The last key point difference is satellite properties, as you notice in the code,the properties of the satellites created from TLE data and those defined from Keplerian elements may differ in terms of their identifiers, orbit characteristics, and associated sensors or communication equipment. For instance, the output shows different IDs and potentially different configurations for sensors and transmitters. Just in case, if you still want to understand more about TLE files, please refer to
So, after observing results using example (eccentricOrbitSatellite.tle), it should be evident that the differences in orbit propagation models, initialization parameters, and satellite properties can lead to variations in the output. It is crucial to understand these nuances to ensure accurate modeling of satellite behavior in your simulations. If consistency is paramount, consider sticking to one method for defining your satellites to avoid discrepancies. Apart from this subject, in case if you have curiosity about retrieving the orbital elements of a specified satellite within a satellite scenario, I would recommend this function,
Hope, this explanation helps resolve your problem. Please let me know if you have any further questions.