In [ ]:
import numpy as np
import pandas as pd

In [ ]:
# From Sharp, A Collection of Restricted Three-Body Test Problems
# For problems 1 to 15, mu = 0.012277471 and for problems 16 to 20, mu = 0.000953875
# Columns are X, Z, Ydot, T
sharp_matrix = np.array([ [0.994000E+00, 0.0, -0.21138987966945026683E+01, 0.54367954392601899690E+01],
                          [0.994000E+00, 0.0, -0.20317326295573368357E+01, 0.11124340337266085135E+02],
                          [0.994000E+00, 0.0, -0.20015851063790825224E+01, 0.17065216560157962559E+02],
                          [0.997000E+00, 0.0, -0.16251217072210773125E+01, 0.22929723423442969481E+02],
                          [0.879962E+00, 0.0, -0.66647197988564140807E+00, 0.63006757422352314657E+01],
                          [0.879962E+00, 0.0, -0.43965281709207999128E+00, 0.12729711861022426544E+02],
                          [0.879962E+00, 0.0, -0.38089067106386964470E+00, 0.19138746281183026809E+02],
                          [0.997000E+00, 0.0, -0.18445010489730401177E+01, 0.12353901248612092736E+02],
                          [0.100000E+01, 0.0, -0.16018768253456252603E+01, 0.12294387796695023304E+02],
                          [0.100300E+01, 0.0, -0.14465123738451062297E+01, 0.12267904265603897140E+02],
                          [0.120000E+01, 0.0, -0.71407169828407848921E+00, 0.18337451820715063383E+02],
                          [0.120000E+01, 0.0, -0.67985320356540547720E+00, 0.30753758552146029263E+02],
                          [0.120000E+01, 0.0, -0.67153130632829144331E+00, 0.43214375227857454128E+02],
                          [0.120000E+01, 0.0, -0.66998291305226832207E+00, 0.55672334134347612727E+02],
                          [0.120000E+01, 0.0, -0.66975741517271092087E+00, 0.68127906604713772763E+02],
                          [-0.102745E+01, 0.0, 0.40334488290490413053E-01, 0.18371316400018903965E+03],
                          [-0.976680E+00, 0.0, -0.61191623926410837000E-01, 0.17733241131524483004E+03],
                          [-0.766650E+00, 0.0, -0.51230158665978820282E+00, 0.17660722897242937108E+03],
                          [-0.109137E+01, 0.0, 0.14301959822238380020E+00, 0.82949461922342093092E+02],
                          [-0.110137E+01, 0.0, 0.15354250908611454510E+00, 0.60952121909407746612E+02]])

# From Howell, Three-Dimensional, Periodic, 'Halo' Orbits

# Barbee IC #1 is from Barbee, Notional Mission 4 (Earth-Moon L1).  
#    Period = 12.135 days
#    mu = 0.012277471
# Barbee ICs #2-5 are from Barbee, Notional Mission 6 (Sun-Earth L2).  
#    The period for each of these is about 179.866605474505 days.  
#    Computed nondimensional T in matrix below as period/(TU=58.1313429643148 days).  
#    mu = 3.04009784138267e-06
# Columns are X, Z, Ydot, T
barbee_matrix = np.array([ [0.862307159058101, 0.0,                -0.187079489569182,  2.79101343456226],    # Earth-Moon L1, Notional Mission 4, Lyapunov (planar) orbit
                           [1.00816973209311,  0.0016377237781099,  0.0104999399086454, 3.09414158184716],    # Small
                           [1.00776865686578,  0.00233960542594808, 0.0119353025972439, 3.09414158184716],    # Medium
                           [1.00760154218772,  0.00267383478206151, 0.0123860358265127, 3.09414158184716],    # Large
                           [1.00733415870283,  0.00307491000939761, 0.0131599241389739, 3.09414158184716] ])  # Greater

# Create 'initial_condition_sets' DataFrame which uses 'author' and 'test_case' as its indices
initial_condition_sets = pd.DataFrame().\
        append(pd.DataFrame({
            'author':     'Howell',
            'test_case':  np.arange(2) + 1,
            'mu':         [0.04,         0.04],
            'x':          [0.723268,     0.723268],
            'z':          [0.040000,    -0.040000],
            'y_dot':      [0.198019,     0.198019],
            't':          [1.300177*2.0, 1.300177*2.0]})).\
        append(pd.DataFrame({
            'author':     'Barbee',
            'test_case':  np.arange(5) + 1,
            'mu':         np.concatenate((0.012277471 * np.ones(1), 3.04009784138267e-06 * np.ones(4))),
            'x':          barbee_matrix[:, 0],
            'z':          barbee_matrix[:, 1],
            'y_dot':      barbee_matrix[:, 2],
            't':          barbee_matrix[:, 3]})).\
        append(pd.DataFrame({
            'author':     'Sharp',
            'test_case':  np.arange(20) + 1,
            'mu':         np.concatenate((0.012277471 * np.ones(15), 0.000953875 * np.ones(5))),
            'x':          sharp_matrix[:, 0],
            'z':          sharp_matrix[:, 1],
            'y_dot':      sharp_matrix[:, 2],
            't':          sharp_matrix[:, 3]})).\
        set_index(['author', 'test_case'])