Best way to calculate probability of collision

Hi all! :slight_smile:

I would like to ask for advice before I try something…
I have two spacecraft orbits for which I would like to calculate the probability of collision. I would like to ask if anyone with expertise in doing this has any tips.

I am considering:

  • a) generating my own CDMs (as it seems this is what the ProbabilityOfCollision module works with)
  • b) Using the ProbabilityOfCollision method of the Patera2005 Class for example and simply calculating all the required inputs myself.

Is there a better way of doing this?

For context I have written my own estimation routines so I have access to the covariance matrices and could feasibly propagate them to TCA.

Any help/tips/examples much appreciated! :hatched_chick:
Thank you!!

Charles

Hello @charlesc :wave:,

I think generating your own CDMs will be overkill if you already have/can propagate orbits and their associated covariances at/to TCA.

I would suggest creating a probability computing instance (i would recommend Laas2015 or Patera2005) and use this method :

compute(Orbit primaryAtTCA, StateCovariance primaryCovariance, Orbit secondaryAtTCA, StateCovariance secondaryCovariance, double combinedRadius)

or

compute(Orbit primaryAtTCA, StateCovariance primaryCovariance, double primaryRadius, Orbit secondaryAtTCA, StateCovariance secondaryCovariance, double secondaryRadius)

Hope it helps you !

Cheers :slight_smile: ,
Vincent

EDIT : In fact you have access to all these methods to compute the probability of collision ShortTermEncounter2DPOCMethod (OREKIT 12.0.1 API)

1 Like

Hello @Vincent :wave:

Ok perfect. I will try them all then :crazy_face: !

Thank you this is very helpful!
Charles

1 Like

Hello @Vincent ,

Sorry to bother you again. I have been trying to get a simple example working but I keep getting this error:

----> 2 poc = Patera2005.compute(orbit1, covariance1, radius1, orbit2, covariance2, radius2)
TypeError: descriptor 'compute' for 'Patera2005' objects doesn't apply to a 'CartesianOrbit' object

I have tried with KeplerianOrbit, CartesianOrbit, EquinoctialOrbit and CircularOrbit.

Am I maybe using the wrong kind of Orbit? Should I be using a different kind of class?

My full code snippet is here:


#placeholder states and TCA
state1 = [7000000.0, 0.0, 0.0, 0.0, 7000.0, 0.0]
state2 = [7100000.0, 0.0, 0.0, 0.0, 7000.1, 0.0]
tca = datetime.datetime(2020, 1, 1, 0, 0, 0)

orbit1 = CartesianOrbit(PVCoordinates(Vector3D(float(state1[0]), float(state1[1]), float(state1[2])),
                        Vector3D(float(state1[3]), float(state1[4]), float(state1[5]))),
                        FramesFactory.getEME2000(),
                        datetime_to_absolutedate(tca),
                        Constants.WGS84_EARTH_MU)

orbit2 = CartesianOrbit(PVCoordinates(Vector3D(float(state2[0]), float(state2[1]), float(state2[2])),
                        Vector3D(float(state2[3]), float(state2[4]), float(state2[5]))),
                        FramesFactory.getEME2000(),
                        datetime_to_absolutedate(tca),
                        Constants.WGS84_EARTH_MU)

radius1 = 1.0
radius2 = 1.0

covariance1 = MatrixUtils.createRealMatrix(6, 6)
covariance2 = MatrixUtils.createRealMatrix(6, 6)

#fill covariance with random values
for i in range(6):
    for j in range(6):
        covariance1.setEntry(i, j, random.random())
        covariance2.setEntry(i, j, random.random())

# Patera2005.compute(Orbit primaryAtTCA, StateCovariance primaryCovariance, double primaryRadius, Orbit secondaryAtTCA, StateCovariance secondaryCovariance, double secondaryRadius)
poc = Patera2005.compute(orbit1, covariance1, radius1, orbit2, covariance2, radius2)
print(f"Probability of collision: {poc}")

Thanks in advance! :smile:

Charles

EDIT: just realized my covariance is not passed as StateCovariance. Will try fixing that now! Sorry

EDIT2: I get a new error now…

InvalidArgsError: (<class 'org.orekit.ssa.collision.shorttermencounter.probability.twod.Patera2005'>, 'compute', (<CartesianOrbit: Cartesian parameters: {P(7000000.0, 0.0, 0.0), V(0.0, 7000.0, 0.0)}>, <StateCovariance: org.orekit.propagation.StateCovariance@6601cc93>, 1.0, <CartesianOrbit: Cartesian parameters: {P(7100000.0, 0.0, 0.0), V(0.0, 7000.1, 0.0)}>, <StateCovariance: org.orekit.propagation.StateCovariance@63716833>, 1.0))

From this code:

state1 = [7000000.0, 0.0, 0.0, 0.0, 7000.0, 0.0]
state2 = [7100000.0, 0.0, 0.0, 0.0, 7000.1, 0.0]
tca = datetime.datetime(2020, 1, 1, 0, 0, 0)

orbit1 = CartesianOrbit(PVCoordinates(Vector3D(float(state1[0]), float(state1[1]), float(state1[2])),
                        Vector3D(float(state1[3]), float(state1[4]), float(state1[5]))),
                        FramesFactory.getEME2000(),
                        datetime_to_absolutedate(tca),
                        Constants.WGS84_EARTH_MU)

orbit2 = CartesianOrbit(PVCoordinates(Vector3D(float(state2[0]), float(state2[1]), float(state2[2])),
                        Vector3D(float(state2[3]), float(state2[4]), float(state2[5]))),
                        FramesFactory.getEME2000(),
                        datetime_to_absolutedate(tca),
                        Constants.WGS84_EARTH_MU)

radius1 = 1.0
radius2 = 1.0

cov_mat1 = MatrixUtils.createRealMatrix(6, 6)
cov_mat2 = MatrixUtils.createRealMatrix(6, 6)

for i in range(6):

    for j in range(6):
        cov_mat1.setEntry(i, j, random.random())
        cov_mat2.setEntry(i, j, random.random())

covariance1 = StateCovariance(cov_mat1, datetime_to_absolutedate(tca), FramesFactory.getEME2000(), OrbitType.CARTESIAN, PositionAngleType.TRUE)
covariance2 = StateCovariance(cov_mat2, datetime_to_absolutedate(tca), FramesFactory.getEME2000(), OrbitType.CARTESIAN, PositionAngleType.TRUE)

# Patera2005.compute(Orbit primaryAtTCA, StateCovariance primaryCovariance, double primaryRadius, Orbit secondaryAtTCA, StateCovariance secondaryCovariance, double secondaryRadius)
patera2005 = Patera2005() 
poc_result = patera2005.compute(orbit1, covariance1, radius1, orbit2, covariance2, radius2)
print(f"Probability of collision: {poc_result}")

EDIT3:

Fixed it by changing the method call to:

patera2005 = Patera2005() 
poc_result = patera2005.compute(orbit1, covariance1, orbit2, covariance2, radius2, 1e-10)

and putting real values in my covariance matrix (otherwise i was getting some non symmetric matrix error).

1 Like

No worries, is everything ok now ? I apologize for not seeing your post earlier :sweat:.

Yes all working!

Please don’t apologise. You are always so helpful on this forum :smiley:

Thanks again.
Charles

1 Like

Hello!! I’m trying to reproduce your code. How did you get the result if ProbabilityOfCollision compute(double xm,
double ym,
double sigmaX,
double sigmaY,
double radius,
org.hipparchus.analysis.integration.UnivariateIntegrator integrator,
int customMaxNbOfEval)
has absolutely different args in comparison with what you used?? Thus I get InvalidArgsError

Hi @daiana and sorry for the delay,

If i understand your problem correctly, you are trying to compute a probability of collision using the following signature ?

ProbabilityOfCollision compute(double xm,double ym,double sigmaX,double sigmaY,double radius, UnivariateIntegrator integrator,int customMaxNbOfEval)

This signature is specific to numerical probability of collision computing method and is not necessary strictly speaking (you can also use the default signature which will use default values for the integrator and maximum number of evaluations…)

Could you provide a sample of your code which reproduce the issue ?

Cheers,
Vincent

Hi @daiana,

Here is a Gist of the code I used in its entirety: PoC_test.ipynb · GitHub

I’m sorry it is quite messy. It was just a quick Jupyter Notebook to understand how this worked. Hopefully this helps.

Charles

4 Likes

Hi @charlesc and thank you for sharing this notebook ! I’m sure it will be super helpful to other users :heart:.

1 Like

thank you @Vincent, @charlesc for your response!! All works now. I’m just wondering where did you get your covariance_values3 matrix from?? I’ve tried to get correlation coefficient matrix from BatchLS estimation, but it gives me matrix with diagonal elements 1 and rest are zeroes

Hi @daiana,

Glad this was helpful. My covariance values were example values that I had lying around. I don’t have that much experience with the BLS estimation routine in Orekit so I’m not sure I can help you with that. Usually getting an identity matrix suggests “perfect” estimate which does seem suspect… Have you checked out this tutorial by @yzokras. It is a great starting point.

Best,
Charles

Hello Orekit community!

I am new at Orekit and I am trying to implement different methods for calculating the probability of collision.
At the moment, I am wondering why the Patera2005 method consistently returns probability values below approximately 26%.
I have used the code provided by @charlesc and made some modifications.

import orekit
from orekit.pyhelpers import setup_orekit_curdir
orekit.pyhelpers.download_orekit_data_curdir()
vm = orekit.initVM()
setup_orekit_curdir()
from orekit.pyhelpers import datetime_to_absolutedate
from org.hipparchus.geometry.euclidean.threed import Vector3D
from org.orekit.propagation import StateCovariance
from org.orekit.frames import FramesFactory
from org.orekit.orbits import PositionAngleType, CartesianOrbit, OrbitType
from org.orekit.ssa.collision.shorttermencounter.probability.twod import Patera2005
from org.orekit.utils import Constants
import datetime
import random
from org.orekit.utils import IERSConventions, PVCoordinates
from org.hipparchus.linear import MatrixUtils
import numpy as np
import matplotlib.pyplot as plt

# Define the covariance matrix
covariance_values3 = [
    [-5.826e-1, 2.538e-2, -2.476e-6, -1.628e-4, -1.782e-4, 1.605e-4],
    [2.538e-2, 7.537e-1, -8.935e-2, -2.343e-4, -7.149e-4, 5.660e-4],
    [-2.476e-6, -8.935e-2, 9.269e-1, 2.591e-4, 6.95e-4, -7.503e-4],
    [-1.628e-4, -2.343e-4, 2.591e-4,2.591e-7, 4.042e-7, -3.707e-7],
    [-1.782e-4, -7.149e-4, 6.95e-4, 4.042e-7, 1.198e-6, -9.648e-7],
    [1.605e-4, 5.660e-4, -7.503e-4, -3.707e-7, -9.648e-7, 1.066e-6]]

Pc_list = []
dist_list = []

# Convert the Python list to a Java double[][]
jarray = MatrixUtils.createRealMatrix(len(covariance_values3), len(covariance_values3[0]))
for i in range(len(covariance_values3)):
    for j in range(len(covariance_values3[i])):
        try:
            jarray.setEntry(i, j, covariance_values3[i][j])
        except:
            print(i, j, covariance_values3[i][j])
            print(f"value: {covariance_values3[i][j]}")
            raise

# Use MatrixUtils to create a RealMatrix object from the 2D array
cov_mat1 = jarray
cov_mat2  = jarray

def symmetrize(matrix):
    nrows, ncols = matrix.getRowDimension(), matrix.getColumnDimension()
    for i in range(nrows):
        for j in range(i+1, ncols):
            value = (matrix.getEntry(i, j) + matrix.getEntry(j, i)) / 2.0
            matrix.setEntry(i, j, value)
            matrix.setEntry(j, i, value)

# Apply symmetrization covariance
symmetrize(cov_mat1)
symmetrize(cov_mat2)

def generate_symmetric_covariance_matrix(size):
    # Create an empty matrix of the desired size
    matrix = MatrixUtils.createRealMatrix(size, size)

    # Fill the upper triangle and diagonal with random values
    for i in range(size):
        for j in range(i, size):
            value = random.random()
            matrix.setEntry(i, j, value)
            matrix.setEntry(j, i, value)  # Mirror to make it symmetric

    return matrix

# Test case
state1 = [600000.0, 0.0, 0.0, 0.0, 7000.0, 0.0]
state2_values = np.linspace(600000.01, 600010.0, 20)

for i in range(len(state2_values)):
    x2 = state2_values[i]
    print(x2)
    state2 = [x2, 0, 0, 0, 7000.24, 0]
    print(state2)

    dist =  np.linalg.norm(np.array(state2[:3]) - np.array(state1[:3])) # in m
    dist_list.append(dist)

    tca = datetime.datetime(2020, 1, 1, 0, 0, 0)

    orbit1 = CartesianOrbit(PVCoordinates(Vector3D(float(state1[0]), float(state1[1]), float(state1[2])),
                                          Vector3D(float(state1[3]), float(state1[4]), float(state1[5]))),
                            FramesFactory.getEME2000(),
                            datetime_to_absolutedate(tca),
                            Constants.WGS84_EARTH_MU)
    orbit2 = CartesianOrbit(PVCoordinates(Vector3D(float(state2[0]), float(state2[1]), float(state2[2])),
                                          Vector3D(float(state2[3]), float(state2[4]), float(state2[5]))),
                            FramesFactory.getEME2000(),
                            datetime_to_absolutedate(tca),
                            Constants.WGS84_EARTH_MU)

    radius1 = 1.0
    radius2 = 1.0

    covariance1 = StateCovariance(cov_mat1, datetime_to_absolutedate(tca),
                                  FramesFactory.getITRF(IERSConventions.IERS_2010, False), OrbitType.CARTESIAN,
                                  PositionAngleType.TRUE)
    covariance2 = StateCovariance(cov_mat2, datetime_to_absolutedate(tca),
                                  FramesFactory.getITRF(IERSConventions.IERS_2010, False), OrbitType.CARTESIAN,
                                  PositionAngleType.TRUE)

    patera2005 = Patera2005()
    poc_result = patera2005.compute(orbit1, covariance1, orbit2, covariance2, radius2, 1e-10)
    print(f"Probability of collision: {poc_result.getValue()}, Distance: {dist}")
    PoC = poc_result.getValue()
    Pc_list.append(PoC)

# Plot
plt.plot(dist_list, Pc_list, marker='o', linestyle='-', color='b')
plt.xlabel('Distance [m]')
plt.ylabel('PoC (Probability of Collision)')
plt.title('PoC vs Distance')
plt.show()

Thanks you in advance for any help or hints!

Special thanks to @charlesc for sharing your code!

Hi @Pluto,

Have you compared it to the Laas2015 method ?

Cheers,
Vincent

Hello @Vincent!

I’ve compared the results from Patera2005(), Alfano2005() and Laas2015():

Patera2005:    Probability of collision: 0.2639894073323268, Distance: 0.010000000009313226
Alfano2005:    Probability of collision: 0.263989413067941, Distance: 0.010000000009313226
Laas2015:      Probability of collision: 0.26398940733232684, Distance: 0.010000000009313226

:thinking: :sweat_smile:

I also tried different state_values (ECI coordinates):

state1_values = [
    [7969557.584371368, -697.2459461257795 * 1000, 0.0001191366704725142 * 1000, -0.0214704519280076, -0.2454071816657668, 7.054386544723847],
    [7957093.312609353, -710.9856543308773 * 1000, 423.0649746445721 * 1000, -0.3939074365449233, -0.2124760723159051, 7.044471471888235],
    [7922310.948759113, -722.7311687856218 * 1000, 844.9406918369713 * 1000, -0.7652316944153198, -0.178949718413397, 7.014758097264377],
    [7865308.742259164, -732.4496099808009 * 1000, 1264.441649552645 * 1000, -1.13439452032407, -0.1449228833108551, 6.965331769130916],
    [7786247.685345927, -740.1138277451807 * 1000, 1680.38904500528 * 1000, -1.500353716068028, -0.1104917334039638, 6.896334353029129],
    [7685351.028806785, -745.7024767186105 * 1000, 2091.614271142326 * 1000, -1.86207671176186, -0.07575354725653781, 6.80796374407466],
    [7562903.611716235, -749.2000742858399 * 1000, 2496.962259061928 * 1000, -2.21854364279666, -0.04080642206274133, 6.700473190657545],
    [7419251.008223491, -750.5970408526157 * 1000, 2895.294774318225 * 1000, -2.568750368977221, -0.005748978822111793, 6.574170434649432],
    [7254798.49524674, -749.8897224275645 * 1000, 3285.493656290732 * 1000, -2.911711423113801, 0.02931993241999561, 6.42941667449308],
    [7070009.845666385, -747.0803955533999 * 1000, 3666.463990210629 * 1000, -3.246462877240509, 0.06430152595428239, 6.26662535868165],
    [6865405.952289308, -742.1772547080967 * 1000, 4037.137201917687 * 1000, -3.572065115652868, 0.09909737115638183, 6.086260818124199],
    [6641563.288471377, -735.1943823699219 * 1000, 4396.474065957068 * 1000, -3.887605505078044, 0.1336096794187112, 5.888836746723983],
    [6399112.211831155, -726.1517020087878 * 1000, 4743.46761820549 * 1000, -4.192200953485932, 0.1677415861655228, 5.674914540155861],
    [6138735.117960103, -715.0749143295886 * 1000, 5077.145964830811 * 1000, -4.48500035029079, 0.2013974269459271, 5.445101503311648],
    [5861164.451431872, -701.9954171504436 * 1000, 5396.574980027186 * 1000, -4.765186881953338, 0.2344830067024361, 5.200048937185205]
]
state2_values = [
    [7969557.584733961, 697.245941981265 * 1000, 0 * 1000, -0.02147034714563385, 0.2454071908330376, 7.054386544723851],
    [7957093.280948667, 710.9857322542836 * 1000, 423.0648681551032 * 1000, -0.3939086300099961, 0.2124788184316714, 7.044471862594105],
    [7922310.80385303, 722.7314957374625 * 1000, 844.9406156823031 * 1000, -0.7652342886032188, 0.1789552795834302, 7.014758683873606],
    [7865308.398297468, 732.4503552046098 * 1000, 1264.441609298809 * 1000, -1.134398565080234, 0.1449312575672284, 6.965332344128319],
    [7786247.055171409, 740.1151579845531 * 1000, 1680.389033652067 * 1000, -1.500359206293834, 0.1105028396655838, 6.896334706866124],
    [7685350.027211153, 745.7045515355878 * 1000, 2091.61426932662 * 1000, -1.862083587908707, 0.07576722773917952, 6.807963675981536],
    [7562902.158622827, 749.2030415660242 * 1000, 2496.962235897523 * 1000, -2.218551794123314, 0.0408224460821384, 6.700472518941188],
    [7419249.031596448, 750.6010325783673 * 1000, 2895.294688822552 * 1000, -2.568759639363416, 0.005767047912263784, 6.574169005861251],
    [7254795.933583231, 749.8948507953663 * 1000, 3285.493459313925 * 1000, -2.911721619074084, -0.0293001781706439, 6.429414370922675],
    [7070006.649953793, 747.086749505084 * 1000, 3666.463626752676 * 1000, -3.246473777655495, -0.06428050046432179, 6.266622103736739],
    [6865402.087341308, 742.1848969381932 * 1000, 4037.136613696936 * 1000, -3.572076482638715, -0.09907553394246899, 6.086256579289844],
    [6641558.733593603, 735.2033468630161 * 1000, 4396.473194079372 * 1000, -3.887617095354825, -0.1335875263633164, 5.888831535945493],
    [6399106.960806289, 726.1619921515224 * 1000, 4743.466405778755 * 1000, -4.192212529585542, -0.1677196396222657, 5.674908411650404],
    [6138729.178381383, 715.0865016319127 * 1000, 5077.144359374832 * 1000, -4.48501169096597, -0.2013762253558131, 5.445094548973004],
    [5861157.843450683, 702.0082405999848 * 1000, 5396.572935543035 * 1000, -4.76519779120984, -0.2344630939049733, 5.200041279894065]
]

… and received the following output:

Probability of collision: 0.2568413475665797, Distance: 1394491.8881070497
Probability of collision: 0.0011190209961050093, Distance: 1421971.3865851653
Probability of collision: 3.94524382569267e-17, Distance: 1445462.6645230935
Probability of collision: 5.415617341846936e-61, Distance: 1464899.9651854518
Probability of collision: 5.465749486053548e-194, Distance: 1480228.985729868
Probability of collision: -0.0, Distance: 1491407.0282545346
Probability of collision: -0.0, Distance: 1498403.115852569
Probability of collision: -0.0, Distance: 1501198.0734322867
Probability of collision: -0.0, Distance: 1499784.5732251313
Probability of collision: -0.0, Distance: 1494167.1450619455
Probability of collision: -0.0, Distance: 1484362.1516514383
Probability of collision: -0.0, Distance: 1470397.7292402515
Probability of collision: -0.0, Distance: 1452313.694170309
Probability of collision: -0.0, Distance: 1430161.415974736
Probability of collision: 3.708983566604151e-271, Distance: 1404003.6577674672

Maybe I made a mistake by providing ECI coordinates?
Is there a threshold above which a collision is considered very likely?

Hello @Pluto and sorry for the delay !

ECI are expected you are right. I suppose that the different state values come from an ephemeris ? You can use an ExtremumApproachDetector (doc here) to find the time of closest approach (TCA) and hence, the states at this epoch.

Typical thresholds are :

  • 10e-6 → Conjunction is monitored to look for increase in PoC
  • 10e-4 → Collision avoidance must be triggered, risk is too high

Keep in mind that each satellite operator can define its own thresholds and concept of operations !

Cheers,
Vincent

Hello again!

I’m currently facing another issue. I am propagating two satellites: one in a smaller orbit and the other in a larger orbit. Every five orbits of the smaller satellite, they encounter each other.

To calculate the probability of collision, I’m using the same code provided in my previous post (see above).

I utilize a NumericalPropagator, which returns the following states:

# States of satellite 1
state1_list:  [[7000000.0, 0.0, 0.0, -0.0, 7583.689699484239, 0.0], [6636708.567905831, 2235614.5193379736, -5.765585328572826, -2400.2379546146276, 7190.263458772469, -0.03594584631054044], [5585421.431867369, 4239578.56990838, -19.234047464289876, -4545.872275336009, 6053.800173311897, -0.05003497493780794], [3957237.7794939876, 5805892.814852061, -34.68032967136494, -6212.884675459366, 4299.5009286835, -0.05331876038794264], [1922600.6752291957, 6776336.228803605, -51.90107293847004, -7233.258735924839, 2117.1282887391462, -0.061758733410082624], [-308245.8900704705, 7056330.47009675, -70.55345579359695, -7511.587737977499, -263.1962260022617, -0.05876493245267626], [-2508247.0707072974, 6623020.811197929, -85.01573811858458, -7031.425442981112, -2597.9171082589264, -0.03582751314718371], [-4456976.728531501, 5525404.350144222, -92.38750025236332, -5852.23123536947, -4655.530889337161, -0.01536406705806636], [-5962038.216775362, 3877388.6696608323, -94.98601300852604, -4099.26988452378, -6237.9584491613, -0.0012012337769948082], [-6876672.196000056, 1845196.9752464178, -91.35704901690136, -1948.7642987389293, -7196.7324396604845, 0.029480990140265135], [-7112470.609942177, -369230.85550451, -75.3560040695825, 389.4851067964487, -7443.515239392665, 0.07856504029232335], [-6646744.13840384, -2547231.1719049695, -44.698528601271704, 2690.206103780411, -6955.748200098419, 0.1233361690515464], [-5524394.138380117, -4473479.808834631, -3.2381256763633246, 4731.17732760609, -5778.146824946491, 0.14976215872841114], [-3854207.477034553, -5955859.2707064785, 43.17856513716616, 6311.77512469264, -4019.8695331308863, 0.15621880641124594], [-1799660.108749709, -6843810.026078201, 88.15340780221555, 7270.945453413487, -1847.1915846230734, 0.13924719513370573], [435491.9327546386, -7043746.928807696, 124.00715721089303, 7503.7828309129045, 528.8392495398964, 0.09547555994273696], [2626195.3803316, -6529955.0346098235, 143.41935587354578, 6975.1038209113085, 2870.242152226738, 0.03192037961959346], [4548398.300372606, -5349325.708397209, 142.90569884717144, 5727.494587809017, 4935.146003952241, -0.03433311303680296], [6002601.6607127655, -3618639.463191932, 123.89700168665725, 3881.298917420149, 6503.964396566815, -0.09035692589273081], [6836014.160810202, -1513892.3969185986, 89.67302042657214, 1625.1210894116546, 7405.735901290364, -0.13677564431652992], [6960323.970408577, 747821.8090338018, 42.0970946319696, -803.8496445973485, 7540.57670319604, -0.18030197043795382], [6362268.526757196, 2931953.787594789, -18.208671281796818, -3147.528222510935, 6893.365758483784, -0.22008978227370302], [5105251.904290693, 4812552.68108636, -87.66699819137989, -5158.110066347178, 5535.873742318062, -0.2367824171525653], [3321733.74208313, 6197129.53274403, -155.77137009462268, -6627.501132862888, 3616.8284371854015, -0.20986056804246156], [1197685.9757954795, 6946985.563362061, -210.46946842472562, -7410.116485719194, 1342.2033515763987, -0.1523391052841147], [-1048421.3095180149, 6990646.429082373, -246.72552522618525, -7436.253474204064, -1050.3253758226476, -0.08886386180949135], [-3189104.641498214, 6329310.624272092, -262.67842002132454, -6715.246055872877, -3318.3289291321576, -0.014350724072257605], [-5010916.039989178, 5034504.794365066, -253.70775948278688, -5329.765748393442, -5239.112497307285, 0.07495588413557061], [-6334758.8569420185, 3239071.9198774444, -218.97406974704668, -3423.7575592818275, -6629.416352129974, 0.15215404104583813], [-7031969.25471548, 1123074.6387222325, -165.20388758035867, -1186.6622795787193, -7359.634449361096, 0.20290778163361983], [-7035330.551665107, -1103785.6447528847, -98.06907965253552, 1164.3867974320124, -7362.863788307142, 0.24465280884557888], [-6344600.554263856, -3221709.6560039115, -18.663007437423943, 3403.1093907974746, -6638.991479797509, 0.28277564524016735], [-5026493.028979703, -5020917.4489921015, 69.16909754814363, 5312.473678747541, -5254.592558392142, 0.2970218992846621], [-3209146.0023164805, -6321142.658892291, 155.74907767898395, 6703.0593173710795, -3338.7741888418896, 0.2739284288923055], [-1071151.2484859526, -6989173.6721712835, 230.0839086298073, 7430.755671191488, -1074.20799469688, 0.21634730217924117], [1174464.8960483507, -6952930.63271879, 282.51032531842696, 7412.484629112464, 1317.0461204801948, 0.12824383307858794], [3300468.3888379065, -6210479.7806004975, 304.3351625489046, 6638.162850375555, 3593.0985156915367, 0.013577299004428306], [5088368.1035472285, -4832441.542336315, 289.3678362400477, 5176.462277812793, 5516.49896926883, -0.11354766372425618], [6351835.03221388, -2956655.4384222236, 237.43663683613104, 3171.7772123889117, 6881.058756103657, -0.2285341353987839], [6957697.286693146, -774904.9123131423, 155.5352768056798, 831.0924608358714, 7537.218115637196, -0.3112883561178202], [6841576.2548492225, 1487229.6306440309, 54.294728381486294, -1598.361523868569, 7411.865092515151, -0.3580881944127531], [6015691.626643894, 3595145.489134541, -56.39041250386525, -3858.396146750454, 6518.70384245008, -0.37552192276400076], [4567428.418116542, 5331294.783399216, -168.48193450808262, -5711.167706534013, 4956.390625524997, -0.3669872717858208], [2648921.968292174, 6518913.943421889, -272.84710453644425, -6966.9414782692975, 2895.0778454654574, -0.3208546764329049], [459391.2288580183, 7040310.498138775, -355.72163982015604, -7504.078319563817, 554.2151777000502, -0.2233108191789887], [-1777035.766047445, 6847728.204732878, -403.3650614777739, -7278.960310167285, -1823.9319893378579, -0.09182205356040234], [-3834974.7641050937, 5966174.720530478, -410.9110596243859, -6326.097287205808, -4000.7620021140674, 0.04003189732711582], [-5510187.144192065, 4488728.562222091, -379.94108526158357, -4750.057081891426, -5764.534851645258, 0.16626087586416394], [-6638657.118459545, 2565639.5173280584, -311.48083242811276, -2711.8243897521197, -6948.379765814524, 0.2878487129545949], [-7111056.070744185, 388871.7967238184, -210.4211455447561, -412.0588335770558, -7442.6814990048615, 0.37781640758445456], [-6881960.173792085, -1826280.607582136, -90.12106761983095, 1926.9274003030446, -7202.359621382927, 0.4161020026504053], [-5973565.338685787, -3861089.839133613, 35.69083455466452, 4079.7790146067446, -6249.7043188661255, 0.4186969458857587], [-4473796.6448974535, -5513473.317264402, 158.99393285996143, 5836.712784740273, -4672.766296449429, 0.39907199129444026], [-2528920.4520805376, -6616953.626261272, 271.6216405679241, 7021.5188454483605, -2619.5404202630616, 0.3445750463630401], [-330866.568702559, -7057201.314179213, 361.28735503045436, 7508.7144481951245, -287.4885806689945, 0.24636729730853846], [1900294.3947937898, -6784614.677042486, 416.0808595066247, 7238.320699819355, 2092.460049488684, 0.11455422570634559], [3937665.6531687463, -5821292.313152989, 427.98227995551434, 6225.985883426455, 4277.168863144914, -0.037760403481243224], [5570881.395301141, -4260974.21477868, 392.4845993737109, 4566.066848621676, 6036.607423785013, -0.19917031183119052], [6629048.65019521, -2261086.855723563, 309.450268291243, 2425.485787280885, 7180.623188238159, -0.3505071066575255], [7000310.074966723, -27022.937095158733, 185.99203372464262, 27.328185892702777, 7583.15382771798, -0.4639468422946809], [6645090.105184793, 2209851.351364935, 37.08219051221472, -2374.354082367092, 7199.10456627217, -0.5181517246990536], [5600930.233562756, 4217732.183530194, -118.76819486751198, -4524.729742032136, 6070.75347886257, -0.5115425611900878], [3978061.1512566223, 5790062.655183594, -265.0255746538633, -6198.9098731126205, 4322.191994896619, -0.4567680289135051], [1946369.1598201557, 6767803.834236359, -389.3410233822311, -7227.702171614519, 2142.571727775849, -0.3666037868655027], [-284090.78333513346, 7055463.109751324, -481.4659817429196, -7514.479391646075, -238.01797302085538, -0.24087609844924784], [-2486115.584828751, 6629335.7616671715, -529.6710945404508, -7041.798531333634, -2575.5906331368865, -0.07427440245120304], [-4438884.976728644, 5537742.962665006, -523.9417586534754, -5868.492368489578, -4637.9568826296945, 0.11235276325718538], [-5949474.055645175, 3894127.5192198614, -464.3089320096619, -4119.532655375051, -6226.342005474097, 0.2796691921880017], [-6870544.100126893, 1864451.0314990785, -359.5187112875519, -1971.0979655162364, -7191.62493450704, 0.4139165418816333], [-7113130.159297693, -349435.37608179543, -218.9529773334619, 366.85021889401924, -7445.003001985574, 0.5170323377567284], [-6654029.8088642545, -2528850.177878167, -54.57177648936107, 2668.942473450358, -6963.632284090928, 0.5673875688666805], [-5537650.13703206, -4458364.375922079, 114.00163106490507, 4712.902319194383, -5791.925394792809, 0.5446903557882983], [-3872300.2998994933, -5945665.4158824, 266.7693734266771, 6298.069920517104, -4038.7350850332314, 0.4674798647407954], [-1820982.7003397425, -6839885.563967175, 391.6987796474748, 7263.364368010937, -1869.8541752034307, 0.3611113486467045], [412977.156924848, -7046957.142006572, 480.39380133715844, 7503.580822582117, 504.3107992229468, 0.22436424133817218], [2604812.429299074, -6540499.280153247, 522.991984804706, 6982.8797110804035, 2846.320261360659, 0.05522979355948612], [4530518.083150536, -5366617.788170773, 512.0360388160583, 5742.93877661272, 4914.531524933871, -0.12883967410090427], [5990357.958412893, -3641292.367008665, 446.27520229633274, 3903.135028997046, 6489.247574871635, -0.30730293309450296], [6831006.039251751, -1539800.810287608, 329.7245067594239, 1651.0612991604723, 7399.033730352234, -0.4649085647099116], [6963335.291333047, 721261.8808288958, 171.25868867925038, -776.879452836685, 7543.025068262531, -0.5829649088249851], [6373101.488961032, 2907502.4903107276, -13.658481735432076, -3122.920945467841, 6904.838059678162, -0.6373440802089828], [5122711.768625475, 4792722.20377276, -203.14244325568484, -5138.994970997754, 5554.8423050057645, -0.6125094493091613], [3343820.5037288074, 6183796.298449295, -373.82547962295996, -6616.024691412338, 3640.6872408728814, -0.5148559129775255], [1221941.1222786275, 6941165.713974029, -507.0347989956814, -7407.186660700666, 1367.9217059011976, -0.3670338272348744], [-1024549.576502495, 6992448.950500784, -591.4685890757369, -7441.608567928559, -1025.6847955469452, -0.19295637326950682], [-3167943.7940902337, 6338031.647156975, -621.3396338591035, -6727.711206992339, -3297.1950871599643, -0.003691054375628139], [-4994350.154891849, 5048815.241848527, -592.2199114212945, -5347.620639724715, -5223.208687726721, 0.19943430879027924], [-6324118.153209647, 3257234.074307033, -502.2354956918731, -3445.0807505650423, -6619.760797718916, 0.39607024603254315], [-7028004.375227685, 1143132.7200150006, -359.2986851011381, -1209.526487081841, -7356.685637080665, 0.5465100746243685], [-7038223.591182796, -1083852.26324395, -180.72204481464738, 1141.8248662390877, -7366.607744851411, 0.6340968269926741], [-6354004.681253592, -3203862.6219490035, 15.686879332266813, 3382.537742846902, -6649.077634648322, 0.6660066202074896], [-5041564.545977018, -5006972.6122903265, 212.25441548144144, 5295.535739526038, -5270.382485045433, 0.6312957744237946], [-3228554.9282918666, -6312663.885857649, 386.0931309317328, 6691.330410194623, -3359.21197649826, 0.5146193884709729], [-1093120.3533948765, -6987340.87382483, 515.1880397393887, 7425.630019786814, -1097.7815291997883, 0.34016234775154097], [1152087.5319333582, -6958387.672941298, 588.4630548720177, 7415.016422220585, 1292.4189950666578, 0.1471065488043689], [3280052.305812928, -6223161.269526099, 602.7619586598398, 6648.681571747089, 3570.024536972128, -0.05308884437832617], [5072232.791334799, -4851464.755000254, 556.2059034748688, 5194.27439847911, 5497.742117789256, -0.25649101592994333], [6341930.819255568, -2980348.4540172024, 450.6736346599789, 3195.1391143917194, 6869.031850098511, -0.44185529512566], [6955322.853797973, -800975.8988953603, 295.19281305347874, 857.4475418633542, 7533.597208571324, -0.5866624088706311], [6847171.680142346, 1461431.547920406, 103.97293584794653, -1572.1299831881324, 7417.313684655915, -0.6785203837445621], [6028734.1970900195, 3572284.10458088, -105.55577338238474, -3835.489036780853, 6532.6325780421885, -0.7065768508333101]]

# States of satellite 2
state2_list:  [[6999999.999999999, 0.0, 0.0, -0.0, 5.955813138377964e-13, 9726.580990575623], [6642650.384475169, -3.5515911565067646, 2868686.4633573317, -2323.4388344870276, -0.022425993030090383, 9245.105058641593], [5665378.783672304, -12.578443144924835, 5477745.388335768, -4071.1178090047006, -0.035745005577993066, 8077.09935818824], [4270938.873647185, -23.687311774019214, 7695742.589053407, -5119.028944542874, -0.036686444834926384, 6708.718483167684], [2646726.8461641828, -34.11946047131062, 9513391.423548777, -5639.317666339421, -0.0326727053749579, 5437.441133616985], [919798.1546120616, -43.31231232591469, 10977640.667511698, -5832.764727815228, -0.028733907170473368, 4357.561592405768], [-834444.684556515, -51.432610921748804, 12147015.45368576, -5839.4332886981, -0.025508772335914753, 3467.768831247482], [-2573673.9076830903, -58.67197999263951, 13074338.020979524, -5743.0505658968705, -0.022829890334050373, 2738.3201732213765], [-4274806.321512321, -65.16971506474147, 13802803.819472635, -5591.313737372207, -0.020544633026051945, 2137.0197131002847], [-5925656.686332664, -71.02842631520498, 14366617.907534473, -5411.148720390131, -0.018557084424438996, 1636.6011180630348], [-7520199.484675164, -76.32737523464095, 14792696.586071558, -5217.812464686834, -0.016804224133681777, 1215.6714192811246], [-9055907.424318723, -81.12994956466764, 15102319.657963606, -5019.988421850606, -0.015241621436077107, 857.8599045759547], [-10532243.963593777, -85.48805118020664, 15312467.510275554, -4822.608740480565, -0.013836298091261153, 550.6948354756721], [-11949797.084771274, -89.44490363028717, 15436839.525630364, -4628.432091858495, -0.012562902975082576, 284.63120670961814], [-13309774.188145608, -93.03697520274709, 15486614.199463842, -4438.940713589291, -0.01140145991048452, 52.30069063413947], [-14613704.034328163, -96.29536165727372, 15471014.560779756, -4254.859998994851, -0.01033593584253814, -152.04350589120205], [-15863259.60968322, -99.24681554666363, 15397730.634291183, -4076.464882330809, -0.00935327609405622, -332.9319372228698], [-17060152.82652016, -101.91453224989353, 15273237.663857987, -3903.7633724525795, -0.00844272541059659, -493.97446449013984], [-18206072.519360095, -104.3187619831098, 15103038.173985701, -3736.6079123229074, -0.0075953342012459344, -638.0768279592612], [-19302648.83102136, -106.47729367314571, 14891848.020551246, -3574.763571308131, -0.006803590352368983, -767.6006082084001], [-20351433.801145975, -108.40584235129339, 14643740.89116685, -3417.950005092311, -0.006061139263117908, -884.48248088616], [-21353891.92624572, -110.11836261449835, 14362261.683443524, -3265.867255482185, -0.005362567606507559, -990.3240068280702], [-22311396.83224546, -111.62730461735119, 14050516.338890938, -3118.21148362286, -0.004703234140840978, -1086.459914094373], [-23225231.645774484, -112.94382485595251, 13711243.68807199, -2974.68437990438, -0.004079135875342176, -1174.0105335236426], [-24096591.543952126, -114.07796102237971, 13346873.418857254, -2834.998581251496, -0.003486801187102466, -1253.9224466371666], [-24926587.52179728, -115.0387780454098, 12959573.240434306, -2698.8805638297717, -0.0029232037343391096, -1327.000280757154], [-25716250.77034791, -115.83449083633995, 12551287.56109572, -2566.071944704709, -0.0023856925853247704, -1393.9317927996149], [-26466537.284473505, -116.47256806261211, 12123769.444798306, -2436.329790496165, -0.0018719351083965063, -1455.3078187144743], [-27178332.464442156, -116.95982036482937, 11678607.202463744, -2309.426318056077, -0.00137986998791807, -1511.6382604755843], [-27852455.568825558, -117.30247573745163, 11217246.668738201, -2185.148235596676, -0.0009076683361145005, -1563.364989273236], [-28489663.936651845, -117.50624425549525, 10741009.985116236, -2063.2958843603174, -0.0004537013229674508, -1610.872329373842], [-29090656.935505826, -117.57637390982204, 10251111.535853097, -1943.6822834117618, -1.6513088063792162e-05, -1654.4956292947786], [-29656079.6170104, -117.51769898359821, 9748671.549543742, -1826.1321425066697, 0.0004052020410847778, -1694.5283096616288], [-30186526.07664654, -117.33468214122271, 9234727.776243258, -1710.4808832993576, 0.0008126187992593977, -1731.227689230878], [-30682542.524346206, -117.0314511928099, 8710245.569974972, -1596.5736929408415, 0.0012067973218720571, -1764.819824173013], [-31144630.077802025, -116.61183133037719, 8176126.643864511, -1484.2646234967583, 0.001588697069658676, -1795.5035451691735], [-31573247.293354012, -116.07937349729406, 7633216.715840559, -1373.415743696248, 0.001959188742564087, -1823.453838105615], [-31968812.450548477, -115.43737944345277, 7082312.223791406, -1263.8963450640492, 0.0023190645101876157, -1848.8246841936216], [-32331705.60662333, -114.6889239297595, 6524166.257958963, -1155.5822016645116, 0.002669046826090121, -1871.7514520292043], [-32662270.436660096, -113.83687447283103, 5959493.833447898, -1048.354880948184, 0.0030097960451711562, -1892.352915835734], [-32960815.874222625, -112.88390896103557, 5388976.605701557, -942.1011021707473, 0.0033419170245987994, -1910.732959712433], [-33227617.566151325, -111.83253142373898, 4813267.115633459, -836.7121383026504, 0.0036659648574113154, -1926.98201624969], [-33462919.15391398, -110.68508619484285, 4232992.638021559, -732.083257098963, 0.003982449862360857, -1941.1782786944227], [-33666933.39260257, -109.44377067787333, 3648758.6961674048, -628.1131969400406, 0.004291841932630811, -1953.388718442383], [-33839843.11735488, -108.11064689176283, 3061152.2972236844, -524.7036731086583, 0.00459457432878511, -1963.669933606189], [-33981802.06569583, -106.68765195307608, 2470744.9356358484, -421.75891028716546, 0.004891046986957848, -1972.068849453923], [-34092935.56305038, -105.17660763098587, 1878095.406540886, -319.18519720463235, 0.005181629401266119, -1978.6232873960264], [-34173341.07748141, -103.5792290951751, 1283752.466497437, -216.89045951602088, 0.005466663129258154, -1983.3624157306842], [-34223088.64855258, -101.89713296353719, 688257.3754143562, -114.78384713796667, 0.005746463960498445, -1986.3070923900536], [-34242221.1941026, -100.13184474567657, 92146.35086876253, -12.77533238889417, 0.006021323780824194, -1987.4701073397296], [-34230754.69763676, -98.28480576947362, -504047.03593833296, 89.224684621475, 0.006291512158110356, -1986.8563299703399], [-34188678.27798624, -96.35737967114986, -1099789.494620084, 191.30576684062765, 0.006557277669319323, -1984.4627646965007], [-34115954.14184548, -94.3508585241899, -1694545.6531278738, 293.5578308117347, 0.006818848982974799, -1980.27851596771], [-34012517.41876351, -92.26646867904955, -2287775.671119597, 396.0715403518969, 0.0070764357057893825, -1974.284661927168], [-33878275.87712642, -90.10537638376549, -2878932.801403401, 498.93870685117696, 0.007330228996796586, -1966.4540339591588], [-33713109.51861485, -87.86869325540272, -3467460.870549795, 602.2526997372843, 0.00758040194678879, -1956.750897273303], [-33516870.04754382, -85.5574816738134, -4052791.6479751808, 706.1088707453024, 0.007827109714920913, -1945.130525409542], [-33289380.21038235, -83.17276017259192, -4634342.070294437, 810.6049957536301, 0.008070489407749973, -1931.538659026995], [-33030432.999601267, -80.71550890763221, -5211511.284428176, 915.8417380907051, 0.008310659678444835, -1915.9108364651988], [-32739790.714802764, -78.1866752916637, -5783677.468708418, 1021.9231373732912, 0.008547720015039534, -1898.1715802208842], [-32417183.872843534, -75.58717989402656, -6350194.385892947, 1128.9571280925068, 0.008781749675951564, -1878.2334195244084], [-32062309.957377512, -72.91792271936902, -6910387.615363541, 1237.0560922977556, 0.009012806217936356, -1855.9957244491732], [-31674831.99692518, -70.179789997743, -7463550.403576862, 1346.3374508102133, 0.009240923545407545, -1831.3433212197044], [-31254376.959246233, -67.37366164284566, -8008939.061712428, 1456.9242973801256, 0.009466109389572909, -1804.1448513118783], [-30800533.94849075, -64.50041956637611, -8545767.82697531, 1568.9460800168451, 0.009688342099710803, -1774.250828190671], [-30312852.190395128, -61.56095707661213, -9073203.088589786, 1682.5393332647275, 0.009907566595242214, -1741.491334623345], [-29790838.789776105, -58.556189640994404, -9590356.860425606, 1797.848464319662, 0.010123689283438446, -1705.6732898047217], [-29233956.24391679, -55.487067359287636, -10096279.35847277, 1915.0265943544362, 0.010336571690058808, -1666.5771981972491], [-28641619.695374794, -52.35458958059521, -10589950.511774318, 2034.2364539106306, 0.01054602247393924, -1623.9532699044162], [-28013193.908639595, -49.15982221075263, -11070270.198300887, 2155.6513272195025, 0.010751787394502355, -1577.5167740617828], [-27347989.95747395, -45.90391840555681, -11536046.95044168, 2279.4560340838534, 0.010953536663333027, -1526.942450117156], [-26645261.614521965, -42.58814354267107, -11985984.815417642, 2405.8479283564975, 0.011150848922915449, -1471.8577542160313], [-25904201.443102483, -39.213905628893606, -12418667.980142003, 2535.0378773739526, 0.011343190836369697, -1411.834655413701], [-25123936.6049205, -35.78279265549742, -12832542.672664065, 2667.2511643267662, 0.01152989091055938, -1346.3796138444966], [-24303524.419592913, -32.29661889968363, -13225895.726265978, 2802.728221434131, 0.011710105664925873, -1274.9212629531046], [-23441947.746790536, -28.757482839205835, -13596829.02784919, 2941.725049662228, 0.011882775529527129, -1196.7951701038833], [-22538110.31621829, -25.16784028064326, -13943228.856048388, 3084.5131007158443, 0.012046566799668127, -1111.2248496732586], [-21590832.215123784, -21.530597621321416, -14262728.82786369, 3231.3782734544293, 0.012199794421425065, -1017.2979291270912], [-20598845.874096185, -17.849232057016064, -14552664.789232448, 3382.6184844843283, 0.012340318061430253, -913.9359913589628], [-19560793.095910326, -14.127948303322329, -14810019.46761314, 3538.538970252539, 0.012465400384984678, -799.8560918413153], [-18475223.99145907, -10.37188548072961, -15031354.000079563, 3699.4439972841988, 0.012571510997495849, -673.5212129023005], [-17340599.1905851, -6.587393973505061, -15212722.482010067, 3865.622883496774, 0.012654050853801072, -533.0758760288868], [-16155297.498566415, -2.782411558207347, -15349564.338416955, 4037.3269704557565, 0.012706957950807798, -376.26164972922624], [-14917632.464432785, 1.033016969332397, -15436567.441816526, 4214.732092086788, 0.012722131949485167, -200.3051673520863], [-13625883.446804984, 4.846008360482607, -15467492.255773483, 4397.877552949036, 0.012688576011661535, -1.7682274034079057], [-12278350.286232766, 8.63978952455499, -15434943.542802248, 4586.566560755882, 0.012591085485816162, 223.65478275302758], [-10873446.653476825, 12.392150305267386, -15330070.888409631, 4780.202427394793, 0.012408190184445441, 481.4129460443504], [-9409857.420327164, 16.073106240847952, -15142171.894989751, 4977.515851012389, 0.012108831937543547, 778.4771988697228], [-7886803.478328555, 19.641265404535886, -14858161.84679631, 5176.1039412641285, 0.011646841377711263, 1123.8592810190187], [-6304489.881959976, 23.03800877114043, -14461860.97264757, 5371.637314311978, 0.010951510497825145, 1529.316414965056], [-4664872.532334135, 26.17790112568125, -13933037.578280764, 5556.470631267242, 0.00991124747606979, 2010.277214289595], [-2972988.5686374726, 28.932592735367844, -13246142.776881741, 5717.16473668683, 0.00834564729019876, 2586.9529765426205], [-1239299.3324985728, 31.10405746356469, -12368715.621842936, 5830.015575911139, 0.005962284276297638, 3285.329257334556], [516140.224123716, 32.38387569107181, -11259634.561692934, 5853.022123992169, 0.0023132996805622875, 4136.871551884736], [2256296.1442954317, 32.30990017177182, -9868053.58493451, 5712.115824874501, -0.0031488913240736195, 5173.275728807902], [3914652.5344397565, 30.286983436808953, -8135783.50509483, 5281.283292332094, -0.010645120187590002, 6406.251094011843], [5377170.229590585, 25.801952219418343, -6010472.723339503, 4370.500362613941, -0.019338526291613128, 7771.481433524553], [6468684.950036117, 18.581026886533934, -3483217.8951978516, 2784.0146880499815, -0.02945031333124248, 9024.488084992887], [6981225.750883553, 7.084312933309622, -653610.5509127807, 552.3711667385944, -0.04979847462691081, 9700.912599460757], [6784205.073703579, -12.318567253424769, 2240437.2783095255, -1832.0016624364607, -0.07928872187507008, 9430.117599459967], [5931818.999962821, -39.35968057835713, 4924642.994737105, -3735.7013722275724, -0.09860921308675036, 8373.011800110555]]

The problem I’m encountering is that the function outputs probability of collision (PoC) values of either 0.0 or nan, even when the satellites meet at the first state and after five (smaller) orbits.

I also propagated two satellites in nearly circular orbits. For this test case, I observed the following behavior:

  • At the first state, the PoC value is very high (PoC = 0.27808474713867776).
  • At the second state, the PoC value significantly decreases (PoC = 7.737422246292218e-33).
  • For all subsequent states, the PoC values are 0.0, even when the satellites meet again.

I would greatly appreciate any hints or guidance regarding this issue!

Hello @Pluto,

Could you provide the state covariances associated to your states ?

Cheers,
Vincent

Hello @Vincent!

Here is the code snippet that computes the covariance matrices:

# Define the covariance matrix
covariance_values3 = [
    [-5.826e-1, 2.538e-2, -2.476e-6, -1.628e-4, -1.782e-4, 1.605e-4],
    [2.538e-2, 7.537e-1, -8.935e-2, -2.343e-4, -7.149e-4, 5.660e-4],
    [-2.476e-6, -8.935e-2, 9.269e-1, 2.591e-4, 6.95e-4, -7.503e-4],
    [-1.628e-4, -2.343e-4, 2.591e-4, 2.591e-7, 4.042e-7, -3.707e-7],
    [-1.782e-4, -7.149e-4, 6.95e-4, 4.042e-7, 1.198e-6, -9.648e-7],
    [1.605e-4, 5.660e-4, -7.503e-4, -3.707e-7, -9.648e-7, 1.066e-6]]

# Convert the Python list to a Java double[][]
jarray = MatrixUtils.createRealMatrix(len(covariance_values3), len(covariance_values3[0]))
for i in range(len(covariance_values3)):
    for j in range(len(covariance_values3[i])):
        try:
            jarray.setEntry(i, j, covariance_values3[i][j])
        except:
            print(i, j, covariance_values3[i][j])
            print(f"value: {covariance_values3[i][j]}")
            raise

# Use MatrixUtils to create a RealMatrix object from the 2D array
cov_mat1 = jarray
cov_mat2 = jarray

def symmetrize(matrix):
    nrows, ncols = matrix.getRowDimension(), matrix.getColumnDimension()
    for i in range(nrows):
        for j in range(i + 1, ncols):
            value = (matrix.getEntry(i, j) + matrix.getEntry(j, i)) / 2.0
            matrix.setEntry(i, j, value)
            matrix.setEntry(j, i, value)

# Apply covariance symmetrization
symmetrize(cov_mat1)
symmetrize(cov_mat2)

covariance1 = StateCovariance(cov_mat1, datetime_to_absolutedate(tca),
                                  FramesFactory.getITRF(IERSConventions.IERS_2010, False), OrbitType.CARTESIAN,
                                  PositionAngleType.TRUE)
covariance2 = StateCovariance(cov_mat2, datetime_to_absolutedate(tca),
                                  FramesFactory.getITRF(IERSConventions.IERS_2010, False), OrbitType.CARTESIAN,
                                  PositionAngleType.TRUE)

Thank you for the code snippet @Pluto !

I would like to confirm that your covariances are defined in ITRF frame ? This is quite unusual for state covariances ?

Cheers,
Vincent