Skip to content

Commit

Permalink
Merge pull request #692 from ut-issl/feature/add-orbit-interpolation
Browse files Browse the repository at this point in the history
Add orbit interpolation method as an Orbit calculation feature
  • Loading branch information
fukudakazuya authored Sep 30, 2024
2 parents a95ff06 + 7d36c93 commit 6d7e6d4
Show file tree
Hide file tree
Showing 9 changed files with 386 additions and 3 deletions.
101 changes: 101 additions & 0 deletions settings/sample_satellite/orbit_files/time_series_orbit.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
ephemeris_time[s],position_i_x[m],position_i_y[m],position_i_z[m],velocity_i_x[m/s],velocity_i_y[m/s],velocity_i_z[m/s]
715564027.4963,156763245.9386,-190393643.02541184,95564270.4990822,731.5280577804,-634.4221281717596,132.98336504802236
715571341.8627,162023931.9353,-194926426.171367,96482978.8459601,707.0923875188,-605.2501479322574,118.38289214154844
715580751.2772,168534730.9544,-200453013.18907884,97513617.99116926,677.0422627965,-569.8108622115121,100.91295380644247
715590160.6918,174769366.715,-205656058.9727065,98386069.09765702,648.3616956122,-536.4329528434344,84.7281405526448
715599570.1063,180739888.6927,-210553699.56114495,99111594.6969217,620.8775450338,-504.85673407112046,69.65780767685317
715608979.5209,186456843.2569,-215161841.20328796,99700000.18021005,594.4424482704001,-474.86616912323746,55.56158368780805
715618388.9354,191929490.2049,-219494526.00593194,100159885.85031083,568.9295652003,-446.2798086423517,42.32279056985807
715627798.35,197165976.2691,-223564224.29542544,100498846.07077189,544.2285178062,-418.9439729044354,29.843540226644436
715637207.7645,202173474.02679998,-227382069.5892678,100723627.25093108,520.2421941061,-392.7275481649419,18.04101995931441
715646617.1791,206958294.75550002,-230958052.53263763,100840256.581833,496.8841910615,-367.5179816098753,6.844649817128101
715656026.5936,211525978.5704,-234301179.1254007,100854145.55012357,474.07671709209995,-343.2181614827633,-3.8061286693342566
715665436.0082,215881367.1176,-237419604.4866989,100770176.03567857,451.7488351665,-319.7439821497691,-13.96358251603398
715674845.4227,220028660.7715,-240320745.87434497,100592771.62384214,429.83494299179995,-297.02243841836514,-23.673057026772398
715684254.8373,223971462.3471,-243011379.84516898,100325957.4025372,408.2734078304,-274.99014433466795,-32.97406764251687
715688959.5445,225867149.03579998,-244279720.14154235,100160183.10136902,397.6062824546,-264.21500341268177,-37.48237256388195
715691311.8982,226796212.94709998,-244894970.75910285,100069395.43673636,392.297964188,-258.88492536648516,-39.702727329505976
715692488.075,227256066.9413,-245197905.28111902,100022049.44062343,389.6497239813,-256.2339385142843,-40.80466121931643
715693076.1634,227484826.4524,-245348204.6453093,99997891.21608691,388.3270347076,-254.9119194651607,-41.35359225787661
715693370.2076,227598914.58020002,-245423062.94782877,99985691.14557286,387.6660416699,-254.25177379105472,-41.62755187427055
715693517.2297,227655885.7672,-245460419.32818958,99979560.91408469,387.3356322875,-253.92191632922396,-41.76440558805807
715693590.7408,227684353.1452,-245479079.33489326,99976488.2546943,387.170449285,-253.75704136909724,-41.83280096885237
715693627.4963,227698582.2808,-245488404.79353058,99974950.03975518,387.0878631942,-253.67461732285636,-41.866990796088785
715693664.2518,227712808.3809,-245497727.22272977,99973410.56821942,387.0052807057,-253.59220222884773,-41.901175383526976
715693737.7629,227741251.4755,-245516362.99438584,99970327.85625659,386.8401265214,-253.42739888672298,-41.969528845763975
715693884.785,227798101.2453,-245553598.1997845,99964147.36202367,386.5098612305,-253.09789951499374,-42.10617296672511
715694178.8292,227911655.13709998,-245627923.33201766,99951726.13516967,385.84950219539996,-252.43932944253976,-42.37921037220819
715694766.9176,228138180.5633,-245775993.06951877,99926643.07149409,384.529464206,-251.12389936513614,-42.924284844681424
715695943.0944,228588903.8329,-246069815.11524853,99875517.23990135,381.89205969790004,-248.49984289609012,-44.0104563161382
715698295.448,229481054.37669998,-246648226.5915791,99769448.4335765,376.6275455973,-243.2786576436546,-46.16707754877926
715703000.1553,231228279.27940002,-247768410.98403248,99542212.3891322,366.136563127,-232.9417901124887,-50.41889406757497
715712409.5699,234575175.5498,-249864486.83715355,99028658.11156674,345.2814878306,-212.67380519741258,-58.68783219796623
715721818.9844,237726448.8571,-251772294.0294614,98438697.0304816,324.5462401355,-192.91972373071175,-66.66304911845108
715731228.399,240682937.04799998,-253496537.78884944,97774993.95556167,303.868495393,-173.65301628832583,-74.36512371635561
715740637.8135,243444866.7706,-255041707.11874443,97040032.32399485,283.1802123355,-154.8543379394204,-81.81207590839726
715749106.2866,245763897.3543,-256282842.75216284,96319565.32200795,264.48839461250003,-138.32610684141042,-88.30922299688848
715756727.9124,247715273.24989998,-257281433.5083567,95624729.78376344,247.5516651684,-123.76515172840581,-93.99913165250393
715763199.9172,249270550.2093,-258043076.82122195,95001040.2375045,233.0418097246,-111.63700398060271,-98.71860716753693
715764453.2564,249560857.14790002,-258181540.37345752,94876746.62104207,230.2148028968,-109.31384644207176,-99.62097507452441
715771045.722,251029266.2951,-258862240.34528878,94204497.3168601,215.232889982,-97.234187173782,-104.3069613908248
715777638.1876,252398186.8889,-259464101.56689993,93501684.48945048,200.0225271461,-85.39821942497376,-108.89374333768635
715780934.4204,253044820.92339998,-259735980.8259846,93139018.80778934,192.3118091493,-79.57642059676128,-111.15085981087223
715784230.6533,253665904.8978,-259988780.5035829,92768952.32047178,184.518245749,-73.82209623673718,-113.38426428282429
715787526.8861,254261148.2185,-260222727.98699337,92391562.61257419,176.6309866243,-68.13835213318855,-115.59430630330104
715790823.1189,254830222.2022,-260438061.79940674,92006926.1074329,168.6377250352,-62.52885248353386,-117.78134367421778
715794119.3517,255372754.8073,-260635033.57938743,91615118.01604319,160.52441371449999,-56.99790610783423,-119.94575581908697
715797415.5845,255888324.3511,-260813910.3695098,91216212.23908782,152.2749120883,-51.55056962428947,-122.08796230464964
715800711.8173,256376451.9055,-260974977.27944264,90810281.19393465,143.87054530359998,-46.192771301132986,-124.20844851937845
715804008.0501,256836592.063,-261118540.5973533,90397395.54176973,135.2895478114,-40.93146018687843,-126.30780158925195
715807304.2829,257268121.6288,-261244931.44170713,89977623.77370559,126.50635469939999,-35.77478615038925,-128.38676097337967
715810600.5157,257670325.659,-261354510.06713092,89551031.59705815,117.49068989189999,-30.73231766504652,-130.44629034520545
715813896.7486,258042380.0688,-261447670.9613115,89117681.03791566,108.206379992,-25.81530548050535,-132.48768068750726
715815544.865,258216808.5207,-261488228.86425632,88898489.42981765,103.4501919854,-23.40789854246432,-133.50210214083344
715817192.9814,258383329.7337,-261524848.89902028,88677629.12981617,98.60979273507999,-21.037001521689067,-134.5126997642903
715818841.0978,258541799.28509998,-261557592.8894342,88455106.17566317,93.67822167639001,-18.70464658689187,-135.51980491408028
715820489.2142,258692060.6556,-261586526.15264535,88230926.00746208,88.64775394707,-16.413043019068255,-136.52381157986744
715822137.3306,258833943.8937,-261611717.80392477,88005093.35591441,83.50979066097,-14.164593385801247,-137.5251899165017
715823785.447,258967264.0687,-261633241.08914226,87777612.10270293,78.25473014546,-11.961910974625866,-138.5245028738693
715825433.5634,259091819.49580002,-261651173.74773768,87548485.11151291,72.87181577874,-9.80783838926299,-139.5224268191313
715827081.6798,259207389.6891,-261665598.40631473,87317714.02060133,67.34895543604,-7.705467117967636,-140.51977721816513
715827905.738,259261730.7033,-261671522.49707922,87201712.05298126,64.53084943674001,-6.6747085835792745,-141.01853795069
715828729.7962,259313732.9874,-261676603.0056241,87085298.98802114,61.672506264389995,-5.658157717396243,-141.51754076888784
715829553.8544,259363362.5727,-261680851.83007234,86968474.56262626,58.77193596654,-4.656279945320279,-142.01694239527401
715830377.9126,259410583.7969,-261684281.26050836,86851238.37816466,55.82701663589,-3.6695599897578433,-142.51691587513807
715831201.9708,259455359.1909,-261686903.99414158,86733589.88585323,52.8354832813,-2.6985024255133254,-143.01765247378125
715831613.9999,259476817.469,-261687916.9332046,86674610.80802988,51.32148640578,-2.21901027313298,-143.26837221964138
715832026.029,259497649.357,-261688733.15267596,86615528.3713341,49.794915539479994,-1.7436321819907548,-143.51936382592152
715832438.0581,259517849.6065,-261689354.36199412,86556342.45768659,48.25544164811,-1.2724370189009235,-143.77065732636473
715832850.0872,259537412.8313,-261689782.29894945,86497052.93615556,46.70272422018,-0.8054949711101358,-144.02228434826574
715833056.1018,259546953.8373,-261689924.34130937,86467369.27788354,45.921289506849995,-0.5736411618520876,-144.1482332724574
715833159.109,259551663.88189998,-261689977.47855306,86452517.71606982,45.52928349582,-0.45812251262906756,-144.21124346344493
715833262.1163,259556333.5023,-261690018.73064944,86437659.66249217,45.13641076078,-0.3428775532437385,-144.2742782075543
715833365.1236,259560962.6091,-261690048.1258378,86422795.11461459,44.742665523279996,-0.22790742978757095,-144.33733806403418
715833416.6272,259563261.9418,-261690058.38588107,86415360.40446058,44.54546389627,-0.17052579110550425,-144.36887758619264
715833442.3791,259564407.798,-261690062.40815455,86411642.44022457,44.44678051046,-0.14186089067985108,-144.38464977703632
715833455.255,259564979.773,-261690064.14249927,86409783.30576524,44.397418134279995,-0.12753492808685252,-144.39253648380785
715833461.6929,259565265.5221,-261690064.94046167,86408853.70044641,44.37273177024,-0.12037356969516821,-144.39647999052403
715833468.1309,259565551.1122,-261690065.692413,86407924.06977254,44.34804195369,-0.11321329362032628,-144.40042359965884
715833474.5688,259565836.5434,-261690066.39826164,86406994.4137039,44.32334868322,-0.10605410012540517,-144.4043673113163
715833481.0068,259566121.8157,-261690067.05791566,86406064.73220064,44.29865195737,-0.09889598951320977,-144.40831112569202
715833493.8827,259566691.883,-261690068.23919868,86404205.29311073,44.24924813399,-0.08458301799844037,-144.4161990630102
715833519.6345,259567830.109,-261690070.04887435,86400486.11015661,44.15039895917,-0.05597008191628561,-144.43197617613603
715833571.1381,259570098.92069998,-261690071.45888916,86393046.52529849,43.952534172890005,0.0012036988839412288,-144.46353538829288
715833674.1454,259574605.9433,-261690065.4539999,86378162.47852196,43.55613624739,0.11534238591767121,-144.5266740119086
715833777.1527,259579072.08789998,-261690047.70624298,86363271.92656122,43.15884219222,0.22920160051508986,-144.58984006005144
715833880.16,259583497.262,-261690018.24472678,86348374.86663583,42.760645969399995,0.34278017059822474,-144.65303412985975
715834086.1745,259592224.32450002,-261689924.29597896,86318561.21100996,41.96152259995,0.5690906628459516,-144.7795087632807
715834498.2036,259609182.6575,-261689597.1146299,86258855.67113212,40.35217808225,1.018291759624887,-145.0328214742402
715834910.2327,259625474.78980002,-261689085.79922697,86199045.65358807,38.72769666999,1.462868825843202,-145.2866532927219
715835322.2618,259641094.39819998,-261688392.27123213,86139130.93565343,37.08765741761,1.9027436874575798,-145.54104762892348
715835734.2909,259656034.9829,-261687518.48431313,86079111.27613047,35.4316237578,2.3378368583625644,-145.79605029732784
715836558.3491,259683852.1585,-261685238.1146352,85958756.06963718,32.069744452870005,3.193353728244979,-146.30807681567416
715837382.4073,259708870.53019997,-261682260.99020875,85837977.6974602,28.63822505694,4.0287580804102845,-146.82315341840265
715838206.4655,259731031.0285,-261678603.9638992,85716773.4561057,25.1329309837,4.843369248123992,-147.34174987416105
715839030.5237,259750271.04270002,-261674284.45738718,85595140.23262888,21.54939685128,5.636488761209044,-147.8643916997928
715839854.5819,259766524.1342,-261669320.47416422,85473074.4553026,17.88279303661,6.407402465571494,-148.39166769450065
715840678.6401,259779719.7196,-261663730.61178052,85350572.03771636,14.12788822914,7.155383391159113,-148.92423861411308
715841502.6984,259789782.72980002,-261657534.07106,85227628.3170478,10.27900705214,7.879695636643433,-149.46284729622104
715843150.8148,259800185.9332,-261643400.80021977,84980394.98085491,2.2741037471439998,9.254357245190995,-150.56163132943067
715844634.1195,259797975.8742,-261628811.0746532,84756314.34089553,-5.31953792671,10.40324886362125,-151.5807702951432
715845969.0938,259786114.5769,-261614274.80887884,84553328.72959259,-12.510306223079999,11.362263826441371,-152.5288019697381
11 changes: 11 additions & 0 deletions settings/sample_satellite/satellite.ini
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ logging = ENABLE
// RELATIVE : Relative dynamics (for formation flying simulation)
// KEPLER : Kepler orbit propagation without disturbances and thruster maneuver
// ENCKE : Encke orbit propagation with disturbances and thruster maneuver
// TIME_SERIES_FILE : Orbit propagation with time series file
propagate_mode = RK4

// Orbit initialize mode for RK4, KEPLER, and ENCKE
Expand Down Expand Up @@ -123,6 +124,16 @@ reference_satellite_id = 1
error_tolerance = 0.0001
///////////////////////////////////////////////////////////////////////////////

// Settings for orbit propagation with time series file ///////////
time_series_file_path = SETTINGS_DIR_FROM_EXE/sample_satellite/orbit_files/time_series_orbit.csv
number_of_interpolation = 5
// Interpolation method
0: POLYNOMIAL
1: TRIGONOMETRIC
interpolation_method = 0
orbital_period_correction_s = 86659.2 // Only used for trigonometric method. This sample value is used for the gnss satellits (24 * 60 * 60 * 1.003).
///////////////////////////////////////////////////////////////////////////////


[THERMAL]
calculation = DISABLE
Expand Down
1 change: 1 addition & 0 deletions src/dynamics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ add_library(${PROJECT_NAME} STATIC
orbit/relative_orbit.cpp
orbit/kepler_orbit_propagation.cpp
orbit/encke_orbit_propagation.cpp
orbit/time_series_file_orbit_propagation.cpp
orbit/initialize_orbit.cpp

thermal/node.cpp
Expand Down
11 changes: 11 additions & 0 deletions src/dynamics/orbit/initialize_orbit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "relative_orbit.hpp"
#include "rk4_orbit_propagation.hpp"
#include "sgp4_orbit_propagation.hpp"
#include "time_series_file_orbit_propagation.hpp"

Orbit* InitOrbit(const CelestialInformation* celestial_information, std::string initialize_file, double step_width_s, double current_time_jd,
double gravity_constant_m3_s2, std::string section, RelativeInformation* relative_information) {
Expand Down Expand Up @@ -96,6 +97,16 @@ Orbit* InitOrbit(const CelestialInformation* celestial_information, std::string
double error_tolerance = conf.ReadDouble(section_, "error_tolerance");
orbit = new EnckeOrbitPropagation(celestial_information, gravity_constant_m3_s2, step_width_s, current_time_jd, position_i_m, velocity_i_m_s,
error_tolerance);
} else if (propagate_mode == "TIME_SERIES_FILE") {
// initialize orbit for propagation with time series file
const std::string time_series_file_path = conf.ReadString(section_, "time_series_file_path");
const int number_of_interpolation = conf.ReadInt(section_, "number_of_interpolation");
const int interpolation_method = conf.ReadInt(section_, "interpolation_method");
const double orbital_period_correction_s = conf.ReadDouble(section_, "orbital_period_correction_s");

orbit = new TimeSeriesFileOrbitPropagation(celestial_information, time_series_file_path, number_of_interpolation, interpolation_method,
orbital_period_correction_s, current_time_jd);

} else {
std::cerr << "ERROR: orbit propagation mode: " << propagate_mode << " is not defined!" << std::endl;
std::cerr << "The orbit mode is automatically set as RK4" << std::endl;
Expand Down
3 changes: 2 additions & 1 deletion src/dynamics/orbit/orbit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ enum class OrbitPropagateMode {
kSgp4, //!< SGP4 propagation using TLE without thruster maneuver
kRelativeOrbit, //!< Relative dynamics (for formation flying simulation)
kKepler, //!< Kepler orbit propagation without disturbances and thruster maneuver
kEncke //!< Encke orbit propagation with disturbances and thruster maneuver
kEncke, //!< Encke orbit propagation with disturbances and thruster maneuver
kTimeSeriesFile //!< Orbit propagation using time series file
};

/**
Expand Down
Loading

0 comments on commit 6d7e6d4

Please sign in to comment.