- The
Geopotential
class calculates the gravity acceleration of the earth with the EGM96 geo-potential model.
src/disturbances/geopotential.cpp, .hpp
src/library/gravity/gravity_potential.cpp, .hpp
s2e-core/ExtLibraries/GeoPotential/egm96_to360.ascii
- The EGM96 geopotential coefficients file was downloaded from NASA's EMG96 website, but we cannot access it now.
- Make an instance of the
Geopotential
class inInitializeInstances
function indisturbances.cpp
- Create an instance by using the initialization function
InitGeopotential
- Create an instance by using the initialization function
- Choose an orbit propagator mode that considers disturbances.
- Edit the
disturbance.ini
file- Select
ENABLE
forcalculation
andlogging
- Select
degree
of calculation- When the
degree
is smaller than 1, it is overwritten as 0. - When the
degree
is larger than 360, it is overwritten as 360. - NOTE: The calculation time is related to the selected degree.
- When the
- Select
- The base algorithm is referred to Satellite Orbits chapter 3.2.
- This function reads the geopotential coefficients from the EGM96 file
egm96_to360.ascii
. - The file doesn't have coefficients for
n=0,m=0
,n=1,m=0
, andn=1,m=1
. - All coefficients are completely normalized by following normalization function
$N_{n,m}$
- where
$\delta_{0m}$ is the Kronecker delta.
- Input
- file path of
egm96_to360.ascii
- maximum degree for geopotential calculation
- file path of
- Output
- Return: reading is succeeded or not.
- Normalized coefficient
$C_{n,m}$ and$S_{n,m}$
- algorithm
- The file format of
egm96_to360.ascii
isn,m,Cnm,Snm,sigmaCnm,sigmaSnm
in line with space delimiter. In this calculation, thesigmaCnm
andsigmaSnm
are not used. - The total number of reading lines is defined as the following equation
- where
$n$ is maximum degree, and -3 is for the coefficients ofn=0,m=0
,n=1,m=0
, andn=1,m=1
, which are not in the file.
- note
- When the reading file process is failed, the maximum degree is set to zero, and a simple Kepler calculation will be executed.
- We chose to use the recursion algorithm written in chapter 3.2.4 of Satellite Orbits since the calculation of the Legendre polynomials for spherical harmonics is time-consuming.
- However, the original equation in the book is unnormalized form, and it is not suitable with the normalized coefficients.
- For a small degree, users can directly use the normalized function
$N_{n,m}$ to unnormalize the coefficients or to normalize the functions$V_{n,m}$ and$V_{n,m}$ . But for a large degree, the factorial calculation in the$N_{n,m}$ reaches a huge value, which standarddouble
variables cannot handle. - To avoid that, the normalized recursion algorithm was derived as described in Section 3.
- There are the following two functions:
v_w_nn_update
v_w_nm_update
- Inputs
- Both functions
- Satellite position in ECEF frame
$x, y, z$ - degree and order as
$n$ and$m$
- Satellite position in ECEF frame
-
v_w_nn_update
:$V_{n-1,n-1}$ and$W_{n-1,n-1}$ -
v_w_nm_update
:$V_{n-1,m}, W_{n-1,m}, V_{n-2,m}$ , and$W_{n-2,m}$
- Both functions
- Outputs
-
v_w_nn_update
:$V_{n,n}$ and$W_{n,n}$ -
v_w_nm_update
:$V_{n,m}$ and$W_{n,m}$
-
For unnormalized algorithms, see chapter 3.2.4 of Satellite Orbits.
For normalized algorithm, we use following normalizing relation for Legendre polynomials,
The recursion calculation of V and W can be changed to a normalized version as follows
The recurrence relation of normalize function can be expressed as follows
So, the divisions of the normalized functions are described as follows
The recurrence relations for normalized V and W are derived as follows
- This function calculates gravity acceleration
- Input
- normalized coefficients
$\bar{C}_{n,m}$ $\bar{S}_{n,m}$
- normalized function
$\bar{V}_{n,m}$ $\bar{W}_{n,m}$
- normalized coefficients
- Output
- Gravity acceleration in ECEF frame
For unnormalized algorithms, See chapter 3.2.5 of Satellite Orbits.
When we use the normalized coefficients and normalized functions, the acceleration calculation is described like follows
The division of normalized function
When
When
When
When
- To accelerate the calculation, the double
for loop
of acceleration calculation and the recursion loop need to be integrated in future.
- The calculated gravity acceleration is compared with Matlab's Gravity Spherical Harmonics calculation.
- The satellite position in the ECEF frame calculated by S2E is inputted to the
CalcAccelerationECEF
andgravitysphericalharmonic( r, 'EGM96',360, 'Error' );
function of Matlab.- Both calculations use EGM96.
- The degree of Matlab is fixed to 360, the degree of S2E is changed to check the relationship between the degree and the accuracy.
-
input files
- Default initialize files
-
initial values
-
Default initialize files
simulation_start_time_utc = 2020/01/01 11:00:00.0 simulation_duration_s = 200 simulation_step_s = 0.1 orbit_update_period_s = 0.1 log_output_period_s = 5 simulation_speed_setting = 0
-
Especially, we chose following TLE for orbit calculation
tle1=1 38666U 12003B 12237.00000000 +.00000100 00000-0 67980-4 0 00008 tle2=2 38666 098.6030 315.4100 0000010 300.0000 180.0000 14.09465034 0011
-
Inputted satellite position in ECEF frame
-
- results
- Calculated gravity acceleration by
gravitysphericalharmonic(r,'EGM96',360,'Error' )
- Difference between
CalcAccelerationECEF
output whendegree=0=1
and Matlab's output (degree = 360
)- You can see significant error since
CalcAccelerationECEF
does not care about high-order gravity potential.
- You can see significant error since
- Difference between
CalcAccelerationECEF
output whendegree=360 and Matlab's output (
degree = 360`)- The error is relatively small
- Finally, the relationship between degree and accuracy is summarized.
- The error is limited to 1e-8 [m/s2]. The cause of the error should be considered when users need accurate orbit propagation.
- Note
- To check the accuracy of the calculation, the resolution of
log output
should be larger than 10.- In this case, the author chose the resolution as 15.
- To check the accuracy of the calculation, the resolution of
- The author has checked the relationship between the degree and the calculation speed.
chrono
class was used as follows
chrono::system_clock::time_point start, end;
start = chrono::system_clock::now();
debug_pos_ecef_m_ = spacecraft.dynamics_->orbit_->GetPosition_ecef_m();
CalcAccelerationEcef(dynamics.GetOrbit().GetPosition_ecef_m());
end = chrono::system_clock::now();
time_ms_ = static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0);
- The
time_ms_
is logged every log output step, and 400 data of the calculation time is saved. The averaged value of the 400 data is evaluated here. - Environment
- Core i7-8650U(2.11GHz)
- VS2017 32bit debug
- input files
- Same with accuracy verification
- initial values
- Same with accuracy verification
- When
degree=0=1
, the calculation time is just0.018 msec
. - When
degree=2 and 10
, the calculation time is0.035 msec and 0.2 msec
, respectively. - When
degree=360
, the calculation time reaches110 msec
, but it is faster than the calculation time ofgravitysphericalharmonic( r, 'EGM96',360, 'Error' )
, which is700 ms
.
- Note
- Oliver Montenbruck, and Eberhard Gill, "Satellite Orbits", Springer
- NASA's EMG96 website
- Matlab Gravity Spherical Harmonics
- Summary of gravity models