Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed unit issue in initial conditions generator (Horizons does AU/d not AU/y)
  • Loading branch information
daminton committed Jun 17, 2021
1 parent a6c54ae commit e604334
Show file tree
Hide file tree
Showing 8 changed files with 587 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
39.47692640889762629
0.00029591220819207776388
0.0046504672609621575315
4.7535806948127356533e-12
-2.2473967953572827815e-18
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! Swiftest input file generated using init_cond.py
T0 0
TSTOP 1.0
DT 0.0027378507871321013
TSTOP 365.25
DT 1.0
CB_IN cb.swiftest.in
PL_IN pl.swiftest.in
TP_IN tp.in
Expand All @@ -10,7 +10,7 @@ ISTEP_OUT 1
ISTEP_DUMP 1
BIN_OUT bin.swiftest.dat
OUT_TYPE REAL8
OUT_FORM XV
OUT_FORM EL
OUT_STAT REPLACE
CHK_CLOSE yes
CHK_RMIN 0.004650467260962157
Expand All @@ -26,4 +26,4 @@ ROTATION no
GR no
MU2KG 1.988409870698051e+30
DU2M 149597870700.0
TU2S 31557600.0
TU2S 86400.0
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

MU2KG = np.longdouble(GMSunSI / GC) #Conversion from mass unit to kg
DU2M = np.longdouble(AU2M) #Conversion from radius unit to centimeters
TU2S = np.longdouble(year) #Conversion from time unit to seconds
TU2S = np.longdouble(JD) #Conversion from time unit to seconds
GU = np.longdouble(GC / (DU2M**3 / (MU2KG * TU2S**2)))
GMSun = np.longdouble(GMSunSI / (DU2M**3 / TU2S**2))

# Solar oblatenes values: From Mecheri et al. (2004), using Corbard (b) 2002 values (Table II)
J2 = 0.0 #np.longdouble(2.198e-7) * (Rsun / DU2M)**2
J4 = 0.0 #np.longdouble(-4.805e-9) * (Rsun / DU2M)**4
J2 = np.longdouble(2.198e-7) * (Rsun / DU2M)**2
J4 = np.longdouble(-4.805e-9) * (Rsun / DU2M)**4

npl = 9
ntp = 2 * npl
Expand Down Expand Up @@ -190,7 +190,7 @@
print(f'ISTEP_DUMP {iout:d}')
print(f'BIN_OUT {swifter_bin}')
print(f'OUT_TYPE REAL8')
print(f'OUT_FORM XV')
print(f'OUT_FORM EL')
print(f'OUT_STAT NEW')
print(f'J2 {J2}')
print(f'J4 {J4}')
Expand Down Expand Up @@ -221,7 +221,7 @@
print(f'ISTEP_DUMP {iout:d}')
print(f'BIN_OUT {swiftest_bin}')
print(f'OUT_TYPE REAL8')
print(f'OUT_FORM XV')
print(f'OUT_FORM EL')
print(f'OUT_STAT REPLACE')
print(f'CHK_CLOSE yes')
print(f'CHK_RMIN {rmin}')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
! Swifter input file generated using init_cond.py
T0 0
TSTOP 1.0
DT 0.0027378507871321013
TSTOP 365.25
DT 1.0
PL_IN pl.swifter.in
TP_IN tp.in
IN_TYPE ASCII
ISTEP_OUT 1
ISTEP_DUMP 1
BIN_OUT bin.swifter.dat
OUT_TYPE REAL8
OUT_FORM XV
OUT_FORM EL
OUT_STAT NEW
J2 4.7535806948127355e-12
J4 -2.2473967953572827e-18
Expand Down
20 changes: 10 additions & 10 deletions examples/rmvs_swifter_comparison/9pl_18tp_encounters/pl.swifter.in
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
10
1 39.47692640889762629
1 0.00029591220819207776388
0.0 0.0 0.0
0.0 0.0 0.0
2 6.553709809565314e-06 0.0014751258227142052 ! mercury
2 4.9125474498983625e-11 0.0014751258227142052 ! mercury
1.6306381826061646e-05
0.008059842448018334 -0.4616051037329109 -0.03846017738329229
0.02248719132054853 0.001934639213990692 -0.001904656977422976
3 9.663313399581539e-05 0.006759134232034941 ! venus
3 7.243452483873647e-10 0.006759134232034941 ! venus
4.0453784346544176e-05
-0.5115875215389065 0.5030818749037324 0.03642547299277956
-0.01425515725454357 -0.01452868630179309 0.0006232072038298823
4 0.00012002693582795246 0.010044625087011915 ! earthmoon
4 8.997011382166019e-10 0.010044625087011915 ! earthmoon
4.25875607065041e-05
-0.1090020607540907 -1.009893805009766 4.823302918632528e-05
0.01682491922568941 -0.001910549762056979 3.992660742687128e-08
5 1.2739802010675942e-05 0.0072467897902424765 ! mars
5 9.549535102761465e-11 0.0072467897902424765 ! mars
2.2657408050928896e-05
-1.342897929331636 0.9778655112682739 0.05343398538723887
-0.007712315645393206 -0.01011917844182223 -2.287744801261131e-05
6 0.037692251088985676 0.3552720805286442 ! jupiter
6 2.825345908631355e-07 0.3552720805286442 ! jupiter
0.0004673261703049093
3.923184193414315 -3.168419770483168 -0.0746147877972047
0.004655552638985802 0.006232623300954468 -0.0001300429201057457
7 0.011285899820091273 0.4376460836930155 ! saturn
7 8.459715183006416e-08 0.4376460836930155 ! saturn
0.00038925687730393614
6.185794462795267 -7.804174837804826 -0.110498432926239
0.004066833203985018 0.003458637040736611 -0.0002219310939327014
8 0.001723658947826773 0.46946272948265794 ! uranus
8 1.2920249163736674e-08 0.46946272948265794 ! uranus
0.00016953449859497232
14.9290976575471 12.92949673572929 -0.1454099139559955
-0.002599557960646664 0.002795888198858545 4.391864857782088e-05
9 0.0020336100526728304 0.78119478483336 ! neptune
9 1.5243589003230834e-08 0.78119478483336 ! neptune
0.00016458790412449367
29.54416169025338 -4.716921603714237 -0.5838030174427992
0.0004792636209523189 0.00312573757291745 -7.53264045199501e-05
10 2.924216771029454e-07 0.05379680851617536 ! plutocharon
10 2.1919422829042796e-12 0.05379680851617536 ! plutocharon
7.943294877391593e-06
14.54448346259197 -31.05223519593471 -0.8828000265625595
0.002923077617691739 0.0006625916902153526 -0.0009142553677224461
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
9
2 6.553709809565314e-06 ! mercury
2 4.9125474498983625e-11 ! mercury
1.6306381826061646e-05
0.008059842448018334 -0.4616051037329109 -0.03846017738329229
0.02248719132054853 0.001934639213990692 -0.001904656977422976
3 9.663313399581539e-05 ! venus
3 7.243452483873647e-10 ! venus
4.0453784346544176e-05
-0.5115875215389065 0.5030818749037324 0.03642547299277956
-0.01425515725454357 -0.01452868630179309 0.0006232072038298823
4 0.00012002693582795246 ! earthmoon
4 8.997011382166019e-10 ! earthmoon
4.25875607065041e-05
-0.1090020607540907 -1.009893805009766 4.823302918632528e-05
0.01682491922568941 -0.001910549762056979 3.992660742687128e-08
5 1.2739802010675942e-05 ! mars
5 9.549535102761465e-11 ! mars
2.2657408050928896e-05
-1.342897929331636 0.9778655112682739 0.05343398538723887
-0.007712315645393206 -0.01011917844182223 -2.287744801261131e-05
6 0.037692251088985676 ! jupiter
6 2.825345908631355e-07 ! jupiter
0.0004673261703049093
3.923184193414315 -3.168419770483168 -0.0746147877972047
0.004655552638985802 0.006232623300954468 -0.0001300429201057457
7 0.011285899820091273 ! saturn
7 8.459715183006416e-08 ! saturn
0.00038925687730393614
6.185794462795267 -7.804174837804826 -0.110498432926239
0.004066833203985018 0.003458637040736611 -0.0002219310939327014
8 0.001723658947826773 ! uranus
8 1.2920249163736674e-08 ! uranus
0.00016953449859497232
14.9290976575471 12.92949673572929 -0.1454099139559955
-0.002599557960646664 0.002795888198858545 4.391864857782088e-05
9 0.0020336100526728304 ! neptune
9 1.5243589003230834e-08 ! neptune
0.00016458790412449367
29.54416169025338 -4.716921603714237 -0.5838030174427992
0.0004792636209523189 0.00312573757291745 -7.53264045199501e-05
10 2.924216771029454e-07 ! plutocharon
10 2.1919422829042796e-12 ! plutocharon
7.943294877391593e-06
14.54448346259197 -31.05223519593471 -0.8828000265625595
0.002923077617691739 0.0006625916902153526 -0.0009142553677224461
Loading

0 comments on commit e604334

Please sign in to comment.