diff --git a/examples/symba_gr_test/init_cond.py b/examples/symba_gr_test/init_cond.py index 2639272e7..a5dbe9118 100755 --- a/examples/symba_gr_test/init_cond.py +++ b/examples/symba_gr_test/init_cond.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 import swiftest +from numpy.random import default_rng +import numpy as np sim = swiftest.Simulation() sim.param['PL_IN'] = "pl.swiftest.in" @@ -43,7 +45,30 @@ for name, id in bodyid.items(): sim.add(name, idval=id, date="2027-04-30") - + +Me_a = sim.ds.isel(id=1)['a'].values +Me_e = sim.ds.sel(id=1)['e'].values +Me_i = sim.ds.sel(id=1)['inc'].values + +capom_pl = default_rng().uniform(0.0, 360.0, 1) +omega_pl = default_rng().uniform(0.0, 360.0, 1) +capm_pl = default_rng().uniform(0.0, 360.0, 1) + +capom_tp = default_rng().uniform(0.0, 360.0, 1) +omega_tp = default_rng().uniform(0.0, 360.0, 1) +capm_tp = default_rng().uniform(0.0, 360.0, 1) + +GMcb = sim.ds.isel(id=0)['Gmass'].values +GU = swiftest.GC / (sim.param['DU2M']**3 / (sim.param['MU2KG'] * sim.param['TU2S']**2)) +dens = 3000.0 / (sim.param['MU2KG'] / sim.param['DU2M']**3) # Assume a bulk density of 3 g/cm^3 +GM_pl = 2e-7 +M_pl = GM_pl / GU +R_pl = (3 * M_pl / (4 * np.pi * dens))**(1.0 / 3.0) +Rh_pl = Me_a * (GM_pl / (3 * GMcb))**(1.0/3.0) + +sim.addp(np.full(1,9), np.full(1,'Planetesimal'), Me_a, Me_e, Me_i, capom_pl, omega_pl, capm_pl, GMpl=np.full(1, GM_pl), Rpl=np.full(1, R_pl), rhill=Rh_pl) +sim.addp(np.full(1,10), np.full(1,'TestParticle'), Me_a, Me_e, Me_i, capom_tp, omega_tp, capm_tp) + sim.save("param.swiftest.in") sim.param['PL_IN'] = "pl.swifter.in" sim.param['TP_IN'] = "tp.swifter.in" diff --git a/examples/symba_gr_test/pl.swifter.in b/examples/symba_gr_test/pl.swifter.in index dffe532c6..869b2fc13 100644 --- a/examples/symba_gr_test/pl.swifter.in +++ b/examples/symba_gr_test/pl.swifter.in @@ -1,36 +1,40 @@ -9 +10 0 39.476926408897626 0.0 0.0 0.0 0.0 0.0 0.0 -1 6.5537098095653139645e-06 0.0014751260185578720416 +1 6.553709809565314146e-06 0.0014751260185578724335 1.6306381826061645943e-05 0.22527006614756858727 0.22185515636479818946 -0.0025292250509892700606 -9.2410583833491193135 7.7546860001024244665 1.481285384055779404 -2 9.663313399581537916e-05 0.006759120024335718617 +2 9.6633133995815381836e-05 0.0067591200243357198168 4.0453784346544178454e-05 0.6401338616632904488 -0.3439628247287493945 -0.041662537354174501714 3.4536908505004217623 6.4771489080253446934 -0.110257596056190005656 -3 0.000120026935827952453094 0.0100446292823340959596 +3 0.000120026935827952456416 0.010044629282334098766 4.25875607065040958e-05 -0.7819504386201725499 -0.6346854491951327004 4.4451463454996458186e-05 3.8578491980751480153 -4.9026737310919641898 0.0002888700847309900442 -4 1.2739802010675941456e-05 0.0072466212625671651507 +4 1.2739802010675941808e-05 0.0072466212625671666944 2.265740805092889601e-05 -1.6500171831673979828 -0.023341429362091121319 0.039964339661466272147 0.2624112744618213919 -4.673688782463607376 -0.10439239110136837694 -5 0.037692251088985676735 0.35521688466465032753 +5 0.03769225108898567778 0.35521688466465040944 0.00046732617030490929307 -4.540785007788180394 2.8642873711036669349 0.08969619001756239107 -1.5037012644183387769 -2.204631616790602934 0.042803317383791750652 -6 0.011285899820091272997 0.43538665458575465117 +6 0.01128589982009127331 0.43538665458575473606 0.00038925687730393611812 8.9010680046292307566 2.902848867584423953 -0.40487415052930197934 -0.7439396408265333407 1.9316851317225221362 -0.004029214768814220126 -7 0.0017236589478267730203 0.46987236554736915505 +7 0.001723658947826773068 0.46987236554736924745 0.00016953449859497231466 8.1785533453299539275 17.594789418581910923 -0.04069518248189726156 -1.3149276792509819067 0.53722869521767089375 0.019051745273498437594 -8 0.0020336100526728302319 0.7749718408665498732 +8 0.0020336100526728302882 0.7749718408665500834 0.000164587904124493665 29.794198627119580891 2.0446309861539178065 -0.7287194786837880578 -0.08754730406665780868 1.1492225523523839664 -0.021678684633280679721 +9 1.9999999999999999095e-07 0.0004609743061784924374 +6.20967433941813041e-06 +nan nan nan +nan nan nan diff --git a/examples/symba_gr_test/pl.swiftest.in b/examples/symba_gr_test/pl.swiftest.in index 37ebc69a0..1c629790f 100644 --- a/examples/symba_gr_test/pl.swiftest.in +++ b/examples/symba_gr_test/pl.swiftest.in @@ -1,33 +1,37 @@ -8 -Mercury 6.5537098095653139645e-06 0.0014751260185578720416 +9 +Mercury 6.553709809565314146e-06 0.0014751260185578724335 1.6306381826061645943e-05 0.38709858430953941744 0.20562340108970009189 7.0033025080013837638 48.296118373786072198 29.20442403952453958 338.33948746828792764 -Venus 9.663313399581537916e-05 0.006759120024335718617 +Venus 9.6633133995815381836e-05 0.0067591200243357198168 4.0453784346544178454e-05 0.72332975797361009906 0.006717605698865438367 3.3944392733422819042 76.60235891771118588 54.960379460829607012 200.47893395506480374 -Earth 0.000120026935827952453094 0.0100446292823340959596 +Earth 0.000120026935827952456416 0.010044629282334098766 4.25875607065040958e-05 0.99999048745432228547 0.016714003765458580048 0.0036378626088630029375 175.0251726002310022 287.96196288125747742 114.34829340424269617 -Mars 1.2739802010675941456e-05 0.0072466212625671651507 +Mars 1.2739802010675941808e-05 0.0072466212625671666944 2.265740805092889601e-05 1.5237119255895350545 0.09344151133508207807 1.8474416735579008986 49.47285721247470036 286.7379771285890797 209.33967734771380265 -Jupiter 0.037692251088985676735 0.35521688466465032753 +Jupiter 0.03769225108898567778 0.35521688466465040944 0.00046732617030490929307 5.202727800851599582 0.048244977116379678117 1.3036311345700750675 100.51925884330809424 273.58984028825142332 129.5536700659941971 -Saturn 0.011285899820091272997 0.43538665458575465117 +Saturn 0.01128589982009127331 0.43538665458575473606 0.00038925687730393611812 9.532011952667287957 0.054863298704333408884 2.4879063632803011252 113.63057816762059815 339.54673564023909194 290.89958065689040723 -Uranus 0.0017236589478267730203 0.46987236554736915505 +Uranus 0.001723658947826773068 0.46987236554736924745 0.00016953449859497231466 19.244988382902359803 0.0479617494230129629 0.7730102596086204647 74.012580980165793676 93.595549122802268016 262.86586372775150267 -Neptune 0.0020336100526728302319 0.7749718408665498732 +Neptune 0.0020336100526728302882 0.7749718408665500834 0.000164587904124493665 30.038959912561129073 0.008955570159296157365 1.7711193542961420899 131.82211597488270627 284.47484279411258967 308.45137222693909962 +Planetesimal 1.9999999999999999095e-07 0.0004609743061784924374 +6.20967433941813041e-06 +0.38709858430953941744 0.20562340108970009189 7.0033025080013837638 +96.63690427760462853 41.241157268984508733 305.79195407738086487 diff --git a/examples/symba_gr_test/tp.swifter.in b/examples/symba_gr_test/tp.swifter.in index 573541ac9..eec5bc877 100644 --- a/examples/symba_gr_test/tp.swifter.in +++ b/examples/symba_gr_test/tp.swifter.in @@ -1 +1,4 @@ -0 +1 +10 +nan nan nan +nan nan nan diff --git a/examples/symba_gr_test/tp.swiftest.in b/examples/symba_gr_test/tp.swiftest.in index 573541ac9..427febb15 100644 --- a/examples/symba_gr_test/tp.swiftest.in +++ b/examples/symba_gr_test/tp.swiftest.in @@ -1 +1,4 @@ -0 +1 +TestParticle +0.38709858430953941744 0.20562340108970009189 7.0033025080013837638 +91.57330105121243946 163.58917166648961938 345.1110833758885974