├── posidonius ├── tests │ ├── __init__.py │ ├── test_base.py │ ├── common │ │ └── __init__.py │ ├── test_tides.py │ └── test_flattening.py ├── particles │ ├── __init__.py │ └── axes.py ├── analysis │ ├── __init__.py │ ├── computation.py │ └── history.py ├── integrator │ ├── __init__.py │ ├── leapfrog.py │ ├── common.py │ ├── whfast.py │ └── ias15.py ├── effects │ ├── __init__.py │ ├── wind.py │ ├── general_relativity.py │ ├── disk.py │ ├── rotational_flattening.py │ └── tides.py ├── __init__.py └── constants.py ├── benches └── common ├── .coveragerc ├── requirements.txt ├── pytest.ini ├── dev-requirements.txt ├── src ├── particles │ ├── axes.rs │ ├── mod.rs │ └── common.rs ├── effects │ ├── rotational_flattening │ │ ├── mod.rs │ │ └── creep_coplanar.rs │ ├── tides │ │ └── mod.rs │ ├── mod.rs │ └── wind.rs ├── integrator │ └── mod.rs ├── lib.rs └── constants.rs ├── tests ├── data │ ├── test_order-whfast_whds │ │ ├── particle_0.json │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ └── particle_4.json │ ├── test_integrator-whfast_whds │ │ ├── particle_0.json │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ └── particle_4.json │ ├── test_order-whfast_democraticheliocentric │ │ ├── particle_0.json │ │ ├── particle_1.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_2.json │ ├── test_integrator-whfast_democraticheliocentric │ │ ├── particle_0.json │ │ ├── particle_1.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_2.json │ ├── test_order-ias15 │ │ ├── particle_2.json │ │ ├── particle_1.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_disk-disabled_disk │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_disk-enabled_disk │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_integrator-ias15 │ │ ├── particle_2.json │ │ ├── particle_1.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_order-ias15_binary │ │ ├── particle_0.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ ├── particle_5.json │ │ └── particle_1.json │ ├── test_order-leapfrog │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_0.json │ │ └── particle_4.json │ ├── test_order-whfast_jacobi │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_star_types-m_dwarf │ │ ├── particle_1.json │ │ ├── particle_3.json │ │ ├── particle_2.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_star_types-solar_like │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_tides-enabled_tides │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_integrator-leapfrog │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_0.json │ │ └── particle_4.json │ ├── test_integrator-whfast_jacobi │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_star_types-brown_dwarf │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_tides-disabled_tides │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_flattening-enabled_flattening │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_general_relativity-kidder1995 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_general_relativity-none │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_tides_creep-enabled_tides │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_0.json │ │ └── particle_4.json │ ├── test_tides_kaula-enabled_both_tides │ │ ├── particle_3.json │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_evolution-brown_dwarf_leconte2011 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_evolution-m_dwarf_baraffe1998 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_evolution-m_dwarf_baraffe2015 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_0.json │ │ └── particle_4.json │ ├── test_evolution-m_dwarf_non_evolving │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_evolution-solar_like_baraffe1998 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_evolution-solar_like_baraffe2015 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_0.json │ │ └── particle_4.json │ ├── test_evolution-solar_like_non_evolving │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_flattening-disabled_flattening │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_0.json │ │ └── particle_4.json │ ├── test_general_relativity-anderson1975 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_general_relativity-newhall1983 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_tides_kaula-enabled_planet_tides │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ ├── test_evolution-brown_dwarf_non_evolving │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_0.json │ │ └── particle_4.json │ ├── test_evolution-solar_like_bolmontmathis2016 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json │ └── test_evolution-solar_like_galletbolmont2017 │ │ ├── particle_1.json │ │ ├── particle_2.json │ │ ├── particle_3.json │ │ ├── particle_4.json │ │ └── particle_0.json ├── common │ └── mod.rs └── test_tides_creep.rs ├── scripts ├── clean_json.py ├── raw_history.py └── explore_single_resonance.py ├── Cargo.toml ├── pyproject.toml ├── setup.py └── .gitignore /posidonius/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /benches/common: -------------------------------------------------------------------------------- 1 | ../tests/common/ -------------------------------------------------------------------------------- /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | source = posidonius 3 | omit = posidonius/tests* 4 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | numpy>=2.1.0 2 | pandas>=2.2.2 3 | matplotlib>=3.9.2 4 | six>=1.16.0 5 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | addopts = --cov=posidonius --cov-report=term-missing 3 | testpaths = posidonius/tests 4 | -------------------------------------------------------------------------------- /dev-requirements.txt: -------------------------------------------------------------------------------- 1 | pytest>=8.3.2 2 | pytest-cov>=5.0.0 3 | pytest-pudb>=0.7.0 4 | coveralls>=4.0.1 5 | ipython>=8.26.0 6 | pudb>=2024.1.2 7 | -------------------------------------------------------------------------------- /posidonius/particles/__init__.py: -------------------------------------------------------------------------------- 1 | import posidonius.particles.axes 2 | import posidonius.particles.particle 3 | import posidonius.particles.universe 4 | -------------------------------------------------------------------------------- /posidonius/analysis/__init__.py: -------------------------------------------------------------------------------- 1 | import posidonius.analysis.computation 2 | import posidonius.analysis.history 3 | import posidonius.analysis.resonances 4 | -------------------------------------------------------------------------------- /src/particles/axes.rs: -------------------------------------------------------------------------------- 1 | use serde::{Serialize, Deserialize}; 2 | 3 | #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] 4 | pub struct Axes { 5 | pub x: f64, 6 | pub y: f64, 7 | pub z: f64, 8 | } 9 | 10 | -------------------------------------------------------------------------------- /posidonius/integrator/__init__.py: -------------------------------------------------------------------------------- 1 | from posidonius.integrator.common import Integrator 2 | from posidonius.integrator.leapfrog import LeapFrog 3 | from posidonius.integrator.whfast import WHFast 4 | from posidonius.integrator.ias15 import Ias15 5 | 6 | -------------------------------------------------------------------------------- /posidonius/effects/__init__.py: -------------------------------------------------------------------------------- 1 | import posidonius.effects.disk 2 | import posidonius.effects.general_relativity 3 | import posidonius.effects.rotational_flattening 4 | import posidonius.effects.tides 5 | import posidonius.effects.wind 6 | import posidonius.effects.evolution 7 | -------------------------------------------------------------------------------- /src/particles/mod.rs: -------------------------------------------------------------------------------- 1 | mod particle; 2 | pub mod universe; 3 | mod axes; 4 | mod common; 5 | 6 | pub use self::particle::Particle; 7 | pub use self::particle::Reference; 8 | pub use self::universe::Universe; 9 | pub use self::universe::IgnoreGravityTerms; 10 | pub use self::universe::ConsiderEffects; 11 | pub use self::axes::Axes; 12 | -------------------------------------------------------------------------------- /posidonius/tests/test_base.py: -------------------------------------------------------------------------------- 1 | import os 2 | import inspect 3 | import unittest 4 | 5 | class TestBase(unittest.TestCase): 6 | 7 | def setUp(self): 8 | self.current_filename, ignore = os.path.splitext(os.path.basename(__file__)) # Filename without extension 9 | self.current_dirname = os.path.dirname(inspect.getfile(inspect.currentframe())) 10 | 11 | def tearDown(self): 12 | pass 13 | -------------------------------------------------------------------------------- /posidonius/integrator/leapfrog.py: -------------------------------------------------------------------------------- 1 | from posidonius.constants import * 2 | from posidonius.integrator.common import Integrator 3 | 4 | class LeapFrog(Integrator): 5 | def __init__(self, time_step, recovery_snapshot_period, historic_snapshot_period, universe): 6 | super(LeapFrog, self).__init__(time_step, recovery_snapshot_period, historic_snapshot_period, universe) 7 | self._data['half_time_step'] = self._data['time_step']*0.5 8 | 9 | -------------------------------------------------------------------------------- /tests/data/test_order-whfast_whds/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678748, 4 | "y": -4.475643284288014e-6, 5 | "z": -3.9156804936150955e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949246e-8, 9 | "y": -2.7499683995526696e-7, 10 | "z": -2.40591060016093e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 0.0, 14 | "y": 0.0, 15 | "z": 0.0 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_whds/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678748, 4 | "y": -4.475643284288014e-6, 5 | "z": -3.9156804936150955e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949246e-8, 9 | "y": -2.7499683995526696e-7, 10 | "z": -2.40591060016093e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 0.0, 14 | "y": 0.0, 15 | "z": 0.0 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_democraticheliocentric/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.00001736002119967412, 4 | "y": -4.475643284310706e-6, 5 | "z": -3.9156804936349765e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674960743e-8, 9 | "y": -2.7499683995521905e-7, 10 | "z": -2.4059106001605254e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 0.0, 14 | "y": 0.0, 15 | "z": 0.0 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_democraticheliocentric/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.00001736002119967412, 4 | "y": -4.475643284310706e-6, 5 | "z": -3.9156804936349765e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674960743e-8, 9 | "y": -2.7499683995521905e-7, 10 | "z": -2.4059106001605254e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 0.0, 14 | "y": 0.0, 15 | "z": 0.0 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499955149664214, 4 | "y": 0.016266477212581617, 5 | "z": 0.001423132352202466 6 | }, 7 | "inertial_velocity": { 8 | "x": -7.9234860581197e-6, 9 | "y": 0.0023921194545378395, 10 | "z": 0.00020928333433605534 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1652127816543221e-6, 14 | "y": -4.140636286286304e-9, 15 | "z": -3.6218235087402794e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-disabled_disk/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.28062354227084685, 4 | "y": 0.37178186642013694, 5 | "z": 0.03252669762394249 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.019509269298912744, 9 | "y": 0.0170455138670736, 10 | "z": 0.00149128905679467 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.203930132191626e-14, 14 | "y": -3.0746064695613144e-15, 15 | "z": -2.6899319460691404e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-disabled_disk/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.498153052217906, 4 | "y": 0.1346392301657165, 5 | "z": 0.011779406644948035 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00023182799951326438, 9 | "y": 0.008454925582880515, 10 | "z": 0.0007397102034537625 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.00001455665672601311, 14 | "y": -4.346154175465636e-7, 15 | "z": -3.802392311962944e-8 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-disabled_disk/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999537160023776, 4 | "y": 0.09521532767228306, 5 | "z": 0.008330261765231349 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000057965070845417774, 9 | "y": 0.005980657873521938, 10 | "z": 0.0005232397643603002 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.640852760903487e-6, 14 | "y": -3.84234772196572e-8, 15 | "z": -3.361618669966861e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-enabled_disk/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.28062299346313213, 4 | "y": 0.3717798105020147, 5 | "z": 0.032523885682402505 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.019509372967816893, 9 | "y": 0.017045203352651184, 10 | "z": 0.0014909740363804956 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.203929204121342e-14, 14 | "y": -3.074580289877235e-15, 15 | "z": -2.68958717499869e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-enabled_disk/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.49815305172624, 4 | "y": 0.1346391760097989, 5 | "z": 0.01177930717270784 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0002318280921968705, 9 | "y": 0.00845491877838193, 10 | "z": 0.0007396977084000415 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.000014556656747284205, 14 | "y": -4.3461524385698194e-7, 15 | "z": -3.802360289297129e-8 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-enabled_disk/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999537159963436, 4 | "y": 0.09521530852766397, 5 | "z": 0.00833022659277799 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00005796508222833096, 9 | "y": 0.005980655468368345, 10 | "z": 0.0005232353457654762 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.640852761235352e-6, 14 | "y": -3.842346951741749e-8, 15 | "z": -3.3616045125977786e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-enabled_disk/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999832459313152, 4 | "y": 0.07032177696632314, 5 | "z": 0.006152339957713734 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00002086777460335217, 9 | "y": 0.004417163777413581, 10 | "z": 0.0003864494532228644 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.3107793337369167e-6, 14 | "y": -6.129711256715419e-9, 15 | "z": -5.362786522904469e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-ias15/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499955149664214, 4 | "y": 0.016266477212581617, 5 | "z": 0.001423132352202466 6 | }, 7 | "inertial_velocity": { 8 | "x": -7.9234860581197e-6, 9 | "y": 0.0023921194545378395, 10 | "z": 0.00020928333433605534 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1652127816543221e-6, 14 | "y": -4.140636286286304e-9, 15 | "z": -3.6218235087402794e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.44729176131008785, 4 | "y": 0.05134182357181961, 5 | "z": 0.004491827527282492 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0007902477667813501, 9 | "y": 0.007520143484750205, 10 | "z": 0.0006579273030040742 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.00011564079211668068, 14 | "y": -0.00001304723119020229, 15 | "z": -1.1414848195174682e-6 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999975354710783, 4 | "y": 0.011501590354186027, 5 | "z": 0.0010062587685103943 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.9808352846680467e-6, 9 | "y": 0.001691409501882517, 10 | "z": 0.00014797915679475024 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129912617133716e-7, 14 | "y": -3.6595707957362465e-10, 15 | "z": -3.201709579912737e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999979665015989, 4 | "y": 0.008493983783738767, 5 | "z": 0.0007431272892501758 6 | }, 7 | "inertial_velocity": { 8 | "x": -7.130987630917667e-7, 9 | "y": 0.0012491151277162253, 10 | "z": 0.00010928341311390642 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486745431202935e-7, 14 | "y": -5.837653317762995e-11, 15 | "z": -5.1072848687864305e-12 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15_binary/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -71.99985101323622, 4 | "y": -0.02771433192238098, 5 | "z": -0.002424689860402943 6 | }, 7 | "inertial_velocity": { 8 | "x": 7.15866864091942e-7, 9 | "y": -0.001853169090129533, 10 | "z": -0.00016213128698298133 11 | }, 12 | "inertial_acceleration": { 13 | "x": 4.749510183868697e-8, 14 | "y": 1.9857087843130067e-9, 15 | "z": 1.737270082000441e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-leapfrog/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.4351746261131361, 4 | "y": 0.11971662915298618, 5 | "z": 0.010473847886426203 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018377193313774975, 9 | "y": 0.007317213447833653, 10 | "z": 0.0006401732252853968 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.00011159963245613377, 14 | "y": -0.00003062077932976712, 15 | "z": -2.6789710596209296e-6 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-leapfrog/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499832942264965, 4 | "y": 0.03827371755495473, 5 | "z": 0.0033485164048521307 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001864327664203725, 9 | "y": 0.002392054492284957, 10 | "z": 0.00020927765207375224 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651714873272631e-6, 14 | "y": -9.885484578356468e-9, 15 | "z": -8.64685473596988e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-leapfrog/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999944803262112, 4 | "y": 0.027062534912374137, 5 | "z": 0.0023676650111072724 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.6607820143023845e-6, 9 | "y": 0.0016914037603567664, 10 | "z": 0.00014797865447633567 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129783273339844e-7, 14 | "y": -8.737099658333293e-10, 15 | "z": -7.643971721855981e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_jacobi/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.435321279165581, 4 | "y": 0.11913116982581475, 5 | "z": 0.010422626832343159 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436267, 9 | "y": 0.007319663005067301, 10 | "z": 0.0006403875337739963 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548746e-14, 14 | "y": -1.162877341540284e-15, 15 | "z": -1.017385843604548e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_whds/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127916558133, 4 | "y": 0.1191311698258151, 5 | "z": 0.010422626832343133 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436144, 9 | "y": 0.007319663005067316, 10 | "z": 0.0006403875337739925 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363558251e-14, 14 | "y": -1.1628773415515947e-15, 15 | "z": -1.017385843614435e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_whds/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998405, 4 | "y": 0.03808235316950436, 5 | "z": 0.003331774190405913 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000018550062929088817, 9 | "y": 0.0023920552831236887, 10 | "z": 0.0002092777212485873 11 | }, 12 | "inertial_acceleration": { 13 | "x": -5.354038821981211e-11, 14 | "y": 1.0659120257912475e-12, 15 | "z": 9.32552184720955e-14 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-m_dwarf/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.4316919887937087, 4 | "y": 0.13283011140122913, 5 | "z": 0.01162112892249603 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.002277925298253258, 9 | "y": 0.008115875484267938, 10 | "z": 0.0007100470994619551 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.623842094324529e-14, 14 | "y": -1.2917008314505084e-15, 15 | "z": -1.1300917928584443e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-m_dwarf/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.99993952897914, 4 | "y": 0.030106551459960836, 5 | "z": 0.002633981950606433 6 | }, 7 | "inertial_velocity": { 8 | "x": -5.79679685948508e-6, 9 | "y": 0.0018911085775793575, 10 | "z": 0.00016545056203482903 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.6411792543848534e-7, 14 | "y": -1.214959556485423e-9, 15 | "z": -1.0629518783495904e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-solar_like/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.28062354227084685, 4 | "y": 0.37178186642013694, 5 | "z": 0.03252669762394249 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.019509269298912744, 9 | "y": 0.0170455138670736, 10 | "z": 0.00149128905679467 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.203930132191626e-14, 14 | "y": -3.0746064695613144e-15, 15 | "z": -2.6899319460691404e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-enabled_tides/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.435321279165581, 4 | "y": 0.11913116982581475, 5 | "z": 0.010422626832343159 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436267, 9 | "y": 0.007319663005067301, 10 | "z": 0.0006403875337739963 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548746e-14, 14 | "y": -1.162877341540284e-15, 15 | "z": -1.017385843604548e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-disabled_disk/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999832459295547, 4 | "y": 0.07032178743960706, 5 | "z": 0.006152359199845454 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000020867777911638492, 9 | "y": 0.004417165093152279, 10 | "z": 0.00038645187057328263 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.31077933372511e-6, 14 | "y": -6.1297121672594545e-9, 15 | "z": -5.362803253121502e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-enabled_disk/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -9.241606535757339e-7, 4 | "y": -1.1174932904303403e-6, 5 | "z": -9.776008568037993e-8 6 | }, 7 | "inertial_velocity": { 8 | "x": 5.8597085153207404e-8, 9 | "y": -5.1248883739291233e-8, 10 | "z": -4.482831214697891e-9 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.566310911642631e-14, 14 | "y": 1.367227743822701e-15, 15 | "z": 1.196160176900363e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-ias15/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.44729176131008785, 4 | "y": 0.05134182357181961, 5 | "z": 0.004491827527282492 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0007902477667813501, 9 | "y": 0.007520143484750205, 10 | "z": 0.0006579273030040742 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.00011564079211668068, 14 | "y": -0.00001304723119020229, 15 | "z": -1.1414848195174682e-6 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-ias15/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999975354710783, 4 | "y": 0.011501590354186027, 5 | "z": 0.0010062587685103943 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.9808352846680467e-6, 9 | "y": 0.001691409501882517, 10 | "z": 0.00014797915679475024 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129912617133716e-7, 14 | "y": -3.6595707957362465e-10, 15 | "z": -3.201709579912737e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-ias15/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999979665015989, 4 | "y": 0.008493983783738767, 5 | "z": 0.0007431272892501758 6 | }, 7 | "inertial_velocity": { 8 | "x": -7.130987630917667e-7, 9 | "y": 0.0012491151277162253, 10 | "z": 0.00010928341311390642 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486745431202935e-7, 14 | "y": -5.837653317762995e-11, 15 | "z": -5.1072848687864305e-12 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-leapfrog/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.4351746261131361, 4 | "y": 0.11971662915298618, 5 | "z": 0.010473847886426203 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018377193313774975, 9 | "y": 0.007317213447833653, 10 | "z": 0.0006401732252853968 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.00011159963245613377, 14 | "y": -0.00003062077932976712, 15 | "z": -2.6789710596209296e-6 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-leapfrog/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499832942264965, 4 | "y": 0.03827371755495473, 5 | "z": 0.0033485164048521307 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001864327664203725, 9 | "y": 0.002392054492284957, 10 | "z": 0.00020927765207375224 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651714873272631e-6, 14 | "y": -9.885484578356468e-9, 15 | "z": -8.64685473596988e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-leapfrog/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999944803262112, 4 | "y": 0.027062534912374137, 5 | "z": 0.0023676650111072724 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.6607820143023845e-6, 9 | "y": 0.0016914037603567664, 10 | "z": 0.00014797865447633567 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129783273339844e-7, 14 | "y": -8.737099658333293e-10, 15 | "z": -7.643971721855981e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_jacobi/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.435321279165581, 4 | "y": 0.11913116982581475, 5 | "z": 0.010422626832343159 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436267, 9 | "y": 0.007319663005067301, 10 | "z": 0.0006403875337739963 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548746e-14, 14 | "y": -1.162877341540284e-15, 15 | "z": -1.017385843604548e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_whds/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127916558133, 4 | "y": 0.1191311698258151, 5 | "z": 0.010422626832343133 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436144, 9 | "y": 0.007319663005067316, 10 | "z": 0.0006403875337739925 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363558251e-14, 14 | "y": -1.1628773415515947e-15, 15 | "z": -1.017385843614435e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_whds/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998405, 4 | "y": 0.03808235316950436, 5 | "z": 0.003331774190405913 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000018550062929088817, 9 | "y": 0.0023920552831236887, 10 | "z": 0.0002092777212485873 11 | }, 12 | "inertial_acceleration": { 13 | "x": -5.354038821981211e-11, 14 | "y": 1.0659120257912475e-12, 15 | "z": 9.32552184720955e-14 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017809442201516332, 4 | "y": -1.9288512501686403e-6, 5 | "z": -1.6875261801759139e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 2.9669140511133122e-8, 9 | "y": -2.8252360541600686e-7, 10 | "z": -2.4717612652384894e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 4.341629639254393e-9, 14 | "y": 4.898404520736586e-10, 15 | "z": 4.2855486489117764e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15_binary/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -71.59758625177638, 4 | "y": 0.18361532166169175, 5 | "z": 0.01606425909292641 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.006235749550549419, 9 | "y": 0.0112596139980853, 10 | "z": 0.0009850885800920621 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.00037972055298401053, 14 | "y": -0.00019668091828800295, 15 | "z": -0.000017207350734053084 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15_binary/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -67.50033956920866, 4 | "y": 0.04156814906809283, 5 | "z": 0.0036367418534692417 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00006461784378581381, 9 | "y": 0.002779209689091826, 10 | "z": 0.00024314935063576135 11 | }, 12 | "inertial_acceleration": { 13 | "x": -4.320416660720471e-6, 14 | "y": -6.646363616100599e-8, 15 | "z": -5.813589042230901e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15_binary/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -62.9999724969402, 4 | "y": 0.021277308896996146, 5 | "z": 0.0018615233188264439 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000015529155961077755, 9 | "y": 0.001422724072047617, 10 | "z": 0.00012447222762960634 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0383784775396837e-6, 14 | "y": -5.8824037586016955e-9, 15 | "z": -5.146436431641334e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15_binary/particle_5.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -56.999893316002066, 4 | "y": 0.008468500803770417, 5 | "z": 0.0007408978173900864 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.939988416807997e-6, 9 | "y": 0.0005662600802113165, 10 | "z": 0.000049541337625770575 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.303223449313935e-7, 14 | "y": -9.381616188074146e-10, 15 | "z": -8.207850620101927e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-leapfrog/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017354515242108843, 4 | "y": -4.4976387622764255e-6, 5 | "z": -3.9349240433433724e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.899552717618284e-8, 9 | "y": -2.749048746783348e-7, 10 | "z": -2.405106008244053e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 4.189909875263498e-9, 14 | "y": 1.1496152905663345e-9, 15 | "z": 1.0057830533175976e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-leapfrog/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968666517615, 4 | "y": 0.01998583931229624, 5 | "z": 0.0017485343708766694 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.677879028043233e-6, 9 | "y": 0.0012491142118420191, 10 | "z": 0.00010928333298529597 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486737649966706e-7, 14 | "y": -1.3937220053544276e-10, 15 | "z": -1.2193487557032503e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_jacobi/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.03808235316919792, 5 | "z": 0.003331774190379097 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292906306, 9 | "y": 0.002392055283123693, 10 | "z": 0.00020927772124858701 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983725e-6, 14 | "y": -9.835559289105885e-9, 15 | "z": -8.604999392085057e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_jacobi/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.026927222609214548, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187871386e-6, 9 | "y": 0.0016914038302535614, 10 | "z": 0.0001479786605915134 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.693284054451428e-10, 15 | "z": -7.605638035751815e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_jacobi/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379387627e-6, 9 | "y": 0.0012491142229917947, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.386734730047104e-10, 15 | "z": -1.2132356819680405e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_whds/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192433, 4 | "y": 0.026927222609520518, 5 | "z": 0.002355826718571994 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187874823e-6, 9 | "y": 0.0016914038302535655, 10 | "z": 0.00014797866059151324 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.209233308710515e-11, 14 | "y": 1.2974547804800389e-13, 15 | "z": 1.1351258473026145e-14 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_whds/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412304, 4 | "y": 0.01988591017528285, 5 | "z": 0.0017397917042320725 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379395155e-6, 9 | "y": 0.0012491142229917919, 10 | "z": 0.00010928333396077511 11 | }, 12 | "inertial_acceleration": { 13 | "x": -4.206577256853806e-12, 14 | "y": 2.842390832032198e-14, 15 | "z": 2.486769751134667e-15 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-brown_dwarf/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.435321279165581, 4 | "y": 0.11913116982581475, 5 | "z": 0.010422626832343159 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436267, 9 | "y": 0.007319663005067301, 10 | "z": 0.0006403875337739963 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548746e-14, 14 | "y": -1.162877341540284e-15, 15 | "z": -1.017385843604548e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-brown_dwarf/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.03808235316919792, 5 | "z": 0.003331774190379097 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292906306, 9 | "y": 0.002392055283123693, 10 | "z": 0.00020927772124858701 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983725e-6, 14 | "y": -9.835559289105885e-9, 15 | "z": -8.604999392085057e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-brown_dwarf/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.026927222609214548, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187871386e-6, 9 | "y": 0.0016914038302535614, 10 | "z": 0.0001479786605915134 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.693284054451428e-10, 15 | "z": -7.605638035751815e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-m_dwarf/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499801099129273, 4 | "y": 0.04257826038568373, 5 | "z": 0.0037251151071406017 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0000231872814983784, 9 | "y": 0.002674440711354545, 10 | "z": 0.00023398324553932626 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.4564093916505976e-6, 14 | "y": -1.3745846882024836e-8, 15 | "z": -1.2026057761898577e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-m_dwarf/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999969060243366, 4 | "y": 0.022234133511212638, 5 | "z": 0.001945234625552958 6 | }, 7 | "inertial_velocity": { 8 | "x": -2.0868451166653874e-6, 9 | "y": 0.0013966153955066755, 10 | "z": 0.00012218801441260922 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.3108302658340948e-7, 14 | "y": -1.9381012820374627e-10, 15 | "z": -1.695618909433378e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-solar_like/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.498153052217906, 4 | "y": 0.1346392301657165, 5 | "z": 0.011779406644948035 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00023182799951326438, 9 | "y": 0.008454925582880515, 10 | "z": 0.0007397102034537625 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.00001455665672601311, 14 | "y": -4.346154175465636e-7, 15 | "z": -3.802392311962944e-8 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-solar_like/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999537160023776, 4 | "y": 0.09521532767228306, 5 | "z": 0.008330261765231349 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000057965070845417774, 9 | "y": 0.005980657873521938, 10 | "z": 0.0005232397643603002 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.640852760903487e-6, 14 | "y": -3.84234772196572e-8, 15 | "z": -3.361618669966861e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-solar_like/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999832459295547, 4 | "y": 0.07032178743960706, 5 | "z": 0.006152359199845454 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000020867777911638492, 9 | "y": 0.004417165093152279, 10 | "z": 0.00038645187057328263 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.31077933372511e-6, 14 | "y": -6.1297121672594545e-9, 15 | "z": -5.362803253121502e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-disabled_tides/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.435321279165581, 4 | "y": 0.11913116982581475, 5 | "z": 0.010422626832343159 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436263, 9 | "y": 0.007319663005067301, 10 | "z": 0.0006403875337739963 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548746e-14, 14 | "y": -1.162877341540284e-15, 15 | "z": -1.017385843604548e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-disabled_tides/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.03808235316919792, 5 | "z": 0.003331774190379097 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000018550062929049697, 9 | "y": 0.002392055283123693, 10 | "z": 0.00020927772124858704 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983725e-6, 14 | "y": -9.835559289105885e-9, 15 | "z": -8.604999392085057e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-disabled_tides/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.026927222609214548, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187871335e-6, 9 | "y": 0.0016914038302535614, 10 | "z": 0.0001479786605915134 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.693284054451428e-10, 15 | "z": -7.605638035751815e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-disabled_tides/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.669489637938761e-6, 9 | "y": 0.0012491142229917947, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.386734730047104e-10, 15 | "z": -1.2132356819680405e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-enabled_tides/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.03808235316919792, 5 | "z": 0.003331774190379097 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292906306, 9 | "y": 0.002392055283123693, 10 | "z": 0.00020927772124858701 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983725e-6, 14 | "y": -9.835559289105885e-9, 15 | "z": -8.604999392085057e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-enabled_tides/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.026927222609214548, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187871386e-6, 9 | "y": 0.0016914038302535614, 10 | "z": 0.0001479786605915134 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.693284054451428e-10, 15 | "z": -7.605638035751815e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-enabled_tides/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379387627e-6, 9 | "y": 0.0012491142229917947, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.386734730047104e-10, 15 | "z": -1.2132356819680405e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_disk-disabled_disk/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -9.241623019155208e-7, 4 | "y": -1.1174994655980664e-6, 5 | "z": -9.776853175662834e-8 6 | }, 7 | "inertial_velocity": { 8 | "x": 5.859677378444471e-8, 9 | "y": -5.124981639616084e-8, 10 | "z": -4.483777430391935e-9 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5663109054724696e-14, 14 | "y": 1.3672282640674264e-15, 15 | "z": 1.1961697667024567e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-enabled_flattening/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.435321279165581, 4 | "y": 0.11913116982581475, 5 | "z": 0.010422626832343159 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436267, 9 | "y": 0.007319663005067301, 10 | "z": 0.0006403875337739963 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548746e-14, 14 | "y": -1.162877341540284e-15, 15 | "z": -1.017385843604548e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-kidder1995/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.435321279165581, 4 | "y": 0.11913116982581475, 5 | "z": 0.010422626832343159 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436267, 9 | "y": 0.007319663005067301, 10 | "z": 0.0006403875337739963 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548746e-14, 14 | "y": -1.162877341540284e-15, 15 | "z": -1.017385843604548e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-none/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127909057516, 4 | "y": 0.11913116981810395, 5 | "z": 0.010422626831668507 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919658800738, 9 | "y": 0.007319663003600806, 10 | "z": 0.0006403875336456896 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363338658e-14, 14 | "y": -1.1628773413728812e-15, 15 | "z": -1.017385843458083e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-none/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998393, 4 | "y": 0.038082353169197655, 5 | "z": 0.003331774190379074 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000018550062938416564, 9 | "y": 0.002392055283123648, 10 | "z": 0.00020927772124858325 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648984127e-6, 14 | "y": -9.835559289106438e-9, 15 | "z": -8.604999392085539e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-none/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192499, 4 | "y": 0.02692722260921454, 5 | "z": 0.002355826718545226 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.6374781890069665e-6, 9 | "y": 0.0016914038302535594, 10 | "z": 0.00014797866059151324 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307167e-7, 14 | "y": -8.693284054451509e-10, 15 | "z": -7.605638035751887e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-none/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896381716908e-6, 9 | "y": 0.0012491142229917945, 10 | "z": 0.00010928333396077518 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486728741582932e-7, 14 | "y": -1.3867347300471116e-10, 15 | "z": -1.213235681968047e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-ias15/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017809442201516332, 4 | "y": -1.9288512501686403e-6, 5 | "z": -1.6875261801759139e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 2.9669140511133122e-8, 9 | "y": -2.8252360541600686e-7, 10 | "z": -2.4717612652384894e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 4.341629639254393e-9, 14 | "y": 4.898404520736586e-10, 15 | "z": 4.2855486489117764e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-leapfrog/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017354515242108843, 4 | "y": -4.4976387622764255e-6, 5 | "z": -3.9349240433433724e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.899552717618284e-8, 9 | "y": -2.749048746783348e-7, 10 | "z": -2.405106008244053e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 4.189909875263498e-9, 14 | "y": 1.1496152905663345e-9, 15 | "z": 1.0057830533175976e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-leapfrog/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968666517615, 4 | "y": 0.01998583931229624, 5 | "z": 0.0017485343708766694 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.677879028043233e-6, 9 | "y": 0.0012491142118420191, 10 | "z": 0.00010928333298529597 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486737649966706e-7, 14 | "y": -1.3937220053544276e-10, 15 | "z": -1.2193487557032503e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_jacobi/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.03808235316919792, 5 | "z": 0.003331774190379097 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292906306, 9 | "y": 0.002392055283123693, 10 | "z": 0.00020927772124858701 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983725e-6, 14 | "y": -9.835559289105885e-9, 15 | "z": -8.604999392085057e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_jacobi/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.026927222609214548, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187871386e-6, 9 | "y": 0.0016914038302535614, 10 | "z": 0.0001479786605915134 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.693284054451428e-10, 15 | "z": -7.605638035751815e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_jacobi/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379387627e-6, 9 | "y": 0.0012491142229917947, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.386734730047104e-10, 15 | "z": -1.2132356819680405e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_whds/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192433, 4 | "y": 0.026927222609520518, 5 | "z": 0.002355826718571994 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187874823e-6, 9 | "y": 0.0016914038302535655, 10 | "z": 0.00014797866059151324 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.209233308710515e-11, 14 | "y": 1.2974547804800389e-13, 15 | "z": 1.1351258473026145e-14 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_whds/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412304, 4 | "y": 0.01988591017528285, 5 | "z": 0.0017397917042320725 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379395155e-6, 9 | "y": 0.0012491142229917919, 10 | "z": 0.00010928333396077511 11 | }, 12 | "inertial_acceleration": { 13 | "x": -4.206577256853806e-12, 14 | "y": 2.842390832032198e-14, 15 | "z": 2.486769751134667e-15 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-ias15_binary/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 18.000142401311248, 4 | "y": 0.006928123238770603, 5 | "z": 0.0006061322429029355 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6335900630712938e-7, 9 | "y": 0.0004632640794168244, 10 | "z": 0.00004053035516774544 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0923356324467034e-8, 14 | "y": -4.152779613586456e-12, 15 | "z": -3.6332113831589827e-13 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_jacobi/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678165, 4 | "y": -4.4756432842879e-6, 5 | "z": -3.9156804936150336e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949302e-8, 9 | "y": -2.7499683995526807e-7, 10 | "z": -2.4059106001609665e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900227898e-14, 14 | "y": 3.867948710768974e-16, 15 | "z": 3.384016639962479e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-brown_dwarf/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379387627e-6, 9 | "y": 0.0012491142229917947, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.386734730047104e-10, 15 | "z": -1.2132356819680405e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-solar_like/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -9.241623019155208e-7, 4 | "y": -1.1174994655980664e-6, 5 | "z": -9.776853175662834e-8 6 | }, 7 | "inertial_velocity": { 8 | "x": 5.859677378444471e-8, 9 | "y": -5.124981639616084e-8, 10 | "z": -4.483777430391935e-9 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5663109054724696e-14, 14 | "y": 1.3672282640674264e-15, 15 | "z": 1.1961697667024567e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-disabled_tides/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678165, 4 | "y": -4.4756432842879e-6, 5 | "z": -3.915680493615034e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949308e-8, 9 | "y": -2.7499683995526807e-7, 10 | "z": -2.4059106001609665e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900227898e-14, 14 | "y": 3.867948710768974e-16, 15 | "z": 3.384016639962479e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides-enabled_tides/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678165, 4 | "y": -4.4756432842879e-6, 5 | "z": -3.9156804936150336e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949302e-8, 9 | "y": -2.7499683995526807e-7, 10 | "z": -2.4059106001609665e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900227898e-14, 14 | "y": 3.867948710768974e-16, 15 | "z": 3.384016639962479e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_creep-enabled_tides/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127916615193, 4 | "y": 0.11913116982586863, 5 | "z": 0.01042262683234517 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919563718575, 9 | "y": 0.00731966300507755, 10 | "z": 0.0006403875337743875 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733356794444e-14, 14 | "y": -1.1628773393304462e-15, 15 | "z": -1.017385842626037e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_creep-enabled_tides/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.49983443270128, 4 | "y": 0.038082353185115485, 5 | "z": 0.003331774184087966 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000018549723388109774, 9 | "y": 0.0023920552861232563, 10 | "z": 0.00020927772006304528 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506635057512e-6, 14 | "y": -9.835559275563011e-9, 15 | "z": -8.604999360490123e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_creep-enabled_tides/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175280551, 4 | "y": 0.026927222609302366, 5 | "z": 0.0023558267185529126 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637467127008511e-6, 9 | "y": 0.0016914038302701107, 10 | "z": 0.0001479786605929613 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129715372504534e-7, 14 | "y": -8.693284054225784e-10, 15 | "z": -7.605638035554416e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_both_tides/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.99994517528055, 4 | "y": 0.026927222613232046, 5 | "z": 0.0023558267185529126 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637467127671108e-6, 9 | "y": 0.00169140383076374, 10 | "z": 0.0001479786605929613 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129715372504444e-7, 14 | "y": -8.69328405549114e-10, 15 | "z": -7.605638035554434e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_leconte2011/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.435321279165581, 4 | "y": 0.11913116982581475, 5 | "z": 0.010422626832343159 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564436267, 9 | "y": 0.007319663005067301, 10 | "z": 0.0006403875337739963 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548746e-14, 14 | "y": -1.162877341540284e-15, 15 | "z": -1.017385843604548e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe1998/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.4316919887937087, 4 | "y": 0.13283011140122913, 5 | "z": 0.01162112892249603 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.002277925298253258, 9 | "y": 0.008115875484267938, 10 | "z": 0.0007100470994619551 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.623842094324529e-14, 14 | "y": -1.2917008314505084e-15, 15 | "z": -1.1300917928584443e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe1998/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499801099129273, 4 | "y": 0.04257826038568373, 5 | "z": 0.0037251151071406017 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0000231872814983784, 9 | "y": 0.002674440711354545, 10 | "z": 0.00023398324553932626 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.4564093916505976e-6, 14 | "y": -1.3745846882024836e-8, 15 | "z": -1.2026057761898577e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe1998/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.99993952897914, 4 | "y": 0.030106551459960836, 5 | "z": 0.002633981950606433 6 | }, 7 | "inertial_velocity": { 8 | "x": -5.79679685948508e-6, 9 | "y": 0.0018911085775793575, 10 | "z": 0.00016545056203482903 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.6411792543848534e-7, 14 | "y": -1.214959556485423e-9, 15 | "z": -1.0629518783495904e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe2015/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.4298816620789415, 4 | "y": 0.13912362223973848, 5 | "z": 0.012171739774641196 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.002501298189648758, 9 | "y": 0.008476602419479801, 10 | "z": 0.0007416066169210801 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.618425972049011e-14, 14 | "y": -1.3503514336247043e-15, 15 | "z": -1.1814044206478132e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe2015/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499783945305191, 4 | "y": 0.04465678098646304, 5 | "z": 0.003906962098264234 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000025505878420211198, 9 | "y": 0.002804989810433116, 10 | "z": 0.00024540481205322643 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.6020364374836535e-6, 14 | "y": -1.5858529763680556e-8, 15 | "z": -1.387441578888107e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe2015/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999936217435302, 4 | "y": 0.031576397993011394, 5 | "z": 0.0027625768593712383 6 | }, 7 | "inertial_velocity": { 8 | "x": -6.376455808945751e-6, 9 | "y": 0.001983434627635589, 10 | "z": 0.00017352804476287675 11 | }, 12 | "inertial_acceleration": { 13 | "x": -4.0052823886785303e-7, 14 | "y": -1.401701418150132e-9, 15 | "z": -1.226329837363474e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_non_evolving/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127709093527, 4 | "y": 0.11913116963798379, 5 | "z": 0.01042262678395686 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287922175365288, 9 | "y": 0.007319662969288987, 10 | "z": 0.0006403875246680788 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733357731099e-14, 14 | "y": -1.16287733726515e-15, 15 | "z": -1.0173858353805785e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_non_evolving/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998256, 4 | "y": 0.03808235316919729, 5 | "z": 0.0033317741903789427 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0000185500629558459, 9 | "y": 0.0023920552831235794, 10 | "z": 0.00020927772124855853 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.16515066489847e-6, 14 | "y": -9.83555928910991e-9, 15 | "z": -8.604999392089422e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_non_evolving/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192494, 4 | "y": 0.02692722260921453, 5 | "z": 0.0023558267185452247 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.6374781900430495e-6, 9 | "y": 0.001691403830253558, 10 | "z": 0.00014797866059151289 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129715373071623e-7, 14 | "y": -8.693284054452988e-10, 15 | "z": -7.605638035753795e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe1998/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.28062354227084685, 4 | "y": 0.37178186642013694, 5 | "z": 0.03252669762394249 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.019509269298912744, 9 | "y": 0.0170455138670736, 10 | "z": 0.00149128905679467 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.203930132191626e-14, 14 | "y": -3.0746064695613144e-15, 15 | "z": -2.6899319460691404e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe1998/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.498153052217906, 4 | "y": 0.1346392301657165, 5 | "z": 0.011779406644948035 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00023182799951326438, 9 | "y": 0.008454925582880515, 10 | "z": 0.0007397102034537625 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.00001455665672601311, 14 | "y": -4.346154175465636e-7, 15 | "z": -3.802392311962944e-8 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe1998/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999537160023776, 4 | "y": 0.09521532767228306, 5 | "z": 0.008330261765231349 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000057965070845417774, 9 | "y": 0.005980657873521938, 10 | "z": 0.0005232397643603002 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.640852760903487e-6, 14 | "y": -3.84234772196572e-8, 15 | "z": -3.361618669966861e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe2015/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.2806235410453352, 4 | "y": 0.37178186596761426, 5 | "z": 0.03252669752521945 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.019509269447647443, 9 | "y": 0.01704551377591689, 10 | "z": 0.0014912890386568616 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.203930129200218e-14, 14 | "y": -3.074606461456388e-15, 15 | "z": -2.6899319315185566e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe2015/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.498153052217362, 4 | "y": 0.1346392301657109, 5 | "z": 0.011779406644948255 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00023182799958157193, 9 | "y": 0.008454925582879452, 10 | "z": 0.0007397102034538054 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.000014556656726016607, 14 | "y": -4.346154175467066e-7, 15 | "z": -3.8023923119644365e-8 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe2015/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999537160023491, 4 | "y": 0.09521532767228177, 5 | "z": 0.008330261765231474 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00005796507088374557, 9 | "y": 0.005980657873521725, 10 | "z": 0.0005232397643603248 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.6408527609037167e-6, 14 | "y": -3.842347721966058e-8, 15 | "z": -3.361618669967259e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_non_evolving/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.2806235271702982, 4 | "y": 0.3717818608445634, 5 | "z": 0.03252669640575418 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.019509271131575235, 9 | "y": 0.01704551274393378, 10 | "z": 0.0014912888330028957 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.203930095320002e-14, 14 | "y": -3.0746063696876627e-15, 15 | "z": -2.6899317665520844e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_non_evolving/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.4981530522161774, 4 | "y": 0.1346392301656991, 5 | "z": 0.011779406644944314 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00023182799972929275, 9 | "y": 0.008454925582877259, 10 | "z": 0.000739710203453063 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.000014556656726024194, 14 | "y": -4.346154175470595e-7, 15 | "z": -3.802392311966727e-8 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_non_evolving/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999537160023557, 4 | "y": 0.09521532767228201, 5 | "z": 0.008330261765231325 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00005796507087519406, 9 | "y": 0.005980657873521775, 10 | "z": 0.0005232397643602961 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.640852760903661e-6, 14 | "y": -3.8423477219662685e-8, 15 | "z": -3.3616186699674553e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-disabled_flattening/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127916615193, 4 | "y": 0.11913116982586863, 5 | "z": 0.01042262683234517 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919563718578, 9 | "y": 0.00731966300507755, 10 | "z": 0.0006403875337743875 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733356794444e-14, 14 | "y": -1.1628773393304462e-15, 15 | "z": -1.017385842626037e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-disabled_flattening/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.49983443270128, 4 | "y": 0.038082353185115485, 5 | "z": 0.003331774184087966 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001854972338812313, 9 | "y": 0.002392055286123256, 10 | "z": 0.00020927772006304528 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506635057512e-6, 14 | "y": -9.835559275563011e-9, 15 | "z": -8.604999360490123e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-disabled_flattening/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175280551, 4 | "y": 0.026927222609302366, 5 | "z": 0.0023558267185529126 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637467127008564e-6, 9 | "y": 0.0016914038302701107, 10 | "z": 0.0001479786605929613 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129715372504534e-7, 14 | "y": -8.693284054225784e-10, 15 | "z": -7.605638035554416e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-enabled_flattening/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.03808235316919792, 5 | "z": 0.003331774190379097 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292906306, 9 | "y": 0.002392055283123693, 10 | "z": 0.00020927772124858701 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983725e-6, 14 | "y": -9.835559289105885e-9, 15 | "z": -8.604999392085057e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-enabled_flattening/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.026927222609214548, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187871386e-6, 9 | "y": 0.0016914038302535614, 10 | "z": 0.0001479786605915134 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.693284054451428e-10, 15 | "z": -7.605638035751815e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-enabled_flattening/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379387627e-6, 9 | "y": 0.0012491142229917947, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.386734730047104e-10, 15 | "z": -1.2132356819680405e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-anderson1975/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.4353212791655819, 4 | "y": 0.11913116982581476, 5 | "z": 0.010422626832343148 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564435307, 9 | "y": 0.007319663005067303, 10 | "z": 0.0006403875337739942 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548745e-14, 14 | "y": -1.162877341540284e-15, 15 | "z": -1.0173858436045465e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-anderson1975/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.03808235316919792, 5 | "z": 0.003331774190379097 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292903608, 9 | "y": 0.002392055283123693, 10 | "z": 0.00020927772124858712 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983725e-6, 14 | "y": -9.835559289105885e-9, 15 | "z": -8.604999392085057e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-anderson1975/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.026927222609214548, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187834374e-6, 9 | "y": 0.0016914038302535614, 10 | "z": 0.0001479786605915134 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.693284054451428e-10, 15 | "z": -7.605638035751815e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-kidder1995/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.03808235316919792, 5 | "z": 0.003331774190379097 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292906306, 9 | "y": 0.002392055283123693, 10 | "z": 0.00020927772124858701 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983725e-6, 14 | "y": -9.835559289105885e-9, 15 | "z": -8.604999392085057e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-kidder1995/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.026927222609214548, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187871386e-6, 9 | "y": 0.0016914038302535614, 10 | "z": 0.0001479786605915134 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.693284054451428e-10, 15 | "z": -7.605638035751815e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-kidder1995/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379387627e-6, 9 | "y": 0.0012491142229917947, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.386734730047104e-10, 15 | "z": -1.2132356819680405e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-newhall1983/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127916559155, 4 | "y": 0.11913116982581565, 5 | "z": 0.010422626832343216 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919564423472, 9 | "y": 0.007319663005067471, 10 | "z": 0.0006403875337740086 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548769e-14, 14 | "y": -1.1628773415403035e-15, 15 | "z": -1.017385843604562e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-newhall1983/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.038082353169197926, 5 | "z": 0.0033317741903790984 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000018550062929012008, 9 | "y": 0.002392055283123693, 10 | "z": 0.0002092777212485871 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983719e-6, 14 | "y": -9.835559289105875e-9, 15 | "z": -8.604999392085048e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-newhall1983/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.02692722260921451, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187831982e-6, 9 | "y": 0.0016914038302535581, 10 | "z": 0.00014797866059151327 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.69328405445141e-10, 15 | "z": -7.605638035751808e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-none/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.0000173600211968622, 4 | "y": -4.475643283998412e-6, 5 | "z": -3.915680493361735e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035710377185e-8, 9 | "y": -2.7499683990021056e-7, 10 | "z": -2.4059105996792522e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900228052e-14, 14 | "y": 3.867948710769112e-16, 15 | "z": 3.3840166399625984e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_jacobi/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678165, 4 | "y": -4.4756432842879e-6, 5 | "z": -3.9156804936150336e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949302e-8, 9 | "y": -2.7499683995526807e-7, 10 | "z": -2.4059106001609665e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900227898e-14, 14 | "y": 3.867948710768974e-16, 15 | "z": 3.384016639962479e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-brown_dwarf/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678165, 4 | "y": -4.4756432842879e-6, 5 | "z": -3.9156804936150336e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949302e-8, 9 | "y": -2.7499683995526807e-7, 10 | "z": -2.4059106001609665e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900227898e-14, 14 | "y": 3.867948710768974e-16, 15 | "z": 3.384016639962479e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_star_types-m_dwarf/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000013779010496277665, 4 | "y": -3.9922469133365905e-6, 5 | "z": -3.4927634691370656e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.841813589640497e-8, 9 | "y": -2.4392959516673547e-7, 10 | "z": -2.134107427563146e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5683603487238907e-14, 14 | "y": 4.3244776144680735e-16, 15 | "z": 3.7834276792180326e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_creep-enabled_tides/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.00001736002119979955, 4 | "y": -4.475643284290503e-6, 5 | "z": -3.915680493613547e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035673424278e-8, 9 | "y": -2.749968399557613e-7, 10 | "z": -2.4059106001582153e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5684058952403746e-14, 14 | "y": 3.8679487059297366e-16, 15 | "z": 3.384016628686196e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_creep-enabled_tides/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.99996880042376, 4 | "y": 0.019885910174982094, 5 | "z": 0.0017397917042057567 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694882044515436e-6, 9 | "y": 0.001249114222992745, 10 | "z": 0.00010928333396085833 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486728741567052e-7, 14 | "y": -1.386734730044304e-10, 15 | "z": -1.2132356819655914e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_both_tides/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.4353212791683234, 4 | "y": 0.11913116985925848, 5 | "z": 0.010422626830463017 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919562175496, 9 | "y": 0.007319663009166372, 10 | "z": 0.0006403875334265322 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.63473335687452e-14, 14 | "y": -1.1628773272729027e-15, 15 | "z": -1.0173858431102859e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_both_tides/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834432700551, 4 | "y": 0.03808235419118793, 5 | "z": 0.003331774178185116 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000018549723525286848, 9 | "y": 0.0023920554124402414, 10 | "z": 0.00020927771895063075 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506634995662e-6, 14 | "y": -9.835559534711733e-9, 15 | "z": -8.604999345276128e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_planet_tides/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127916615193, 4 | "y": 0.11913116982586863, 5 | "z": 0.01042262683234517 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287919563718575, 9 | "y": 0.00731966300507755, 10 | "z": 0.0006403875337743875 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733356794444e-14, 14 | "y": -1.1628773393304462e-15, 15 | "z": -1.017385842626037e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_leconte2011/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998473, 4 | "y": 0.03808235316919792, 5 | "z": 0.003331774190379097 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292906306, 9 | "y": 0.002392055283123693, 10 | "z": 0.00020927772124858701 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506648983725e-6, 14 | "y": -9.835559289105885e-9, 15 | "z": -8.604999392085057e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_leconte2011/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192508, 4 | "y": 0.026927222609214548, 5 | "z": 0.0023558267185452265 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187871386e-6, 9 | "y": 0.0016914038302535614, 10 | "z": 0.0001479786605915134 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.912971537307161e-7, 14 | "y": -8.693284054451428e-10, 15 | "z": -7.605638035751815e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_leconte2011/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379387627e-6, 9 | "y": 0.0012491142229917947, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.386734730047104e-10, 15 | "z": -1.2132356819680405e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_non_evolving/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.435321277090936, 4 | "y": 0.11913116963798386, 5 | "z": 0.01042262678395685 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0018287922175364592, 9 | "y": 0.0073196629692889965, 10 | "z": 0.0006403875246680777 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733357731099e-14, 14 | "y": -1.1628773372651515e-15, 15 | "z": -1.0173858353805774e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_non_evolving/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.499834429998256, 4 | "y": 0.03808235316919729, 5 | "z": 0.003331774190378943 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000018550062955824622, 9 | "y": 0.0023920552831235794, 10 | "z": 0.00020927772124855855 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.16515066489847e-6, 14 | "y": -9.83555928910991e-9, 15 | "z": -8.604999392089423e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_non_evolving/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192494, 4 | "y": 0.02692722260921453, 5 | "z": 0.0023558267185452247 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.6374781900279995e-6, 9 | "y": 0.001691403830253558, 10 | "z": 0.00014797866059151289 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129715373071623e-7, 14 | "y": -8.693284054452988e-10, 15 | "z": -7.605638035753795e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe1998/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999969060243366, 4 | "y": 0.022234133511212638, 5 | "z": 0.001945234625552958 6 | }, 7 | "inertial_velocity": { 8 | "x": -2.0868451166653874e-6, 9 | "y": 0.0013966153955066755, 10 | "z": 0.00012218801441260922 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.3108302658340948e-7, 14 | "y": -1.9381012820374627e-10, 15 | "z": -1.695618909433378e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe2015/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000012476942661426797, 4 | "y": -3.8012764350104745e-6, 5 | "z": -3.3256859499200375e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.8297460091893e-8, 9 | "y": -2.316111783444575e-7, 10 | "z": -2.0263352451086536e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568337573107748e-14, 14 | "y": 4.535539632010065e-16, 15 | "z": 3.9680830190889754e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe2015/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968701720288, 4 | "y": 0.023319740938658923, 5 | "z": 0.0020402129684940463 6 | }, 7 | "inertial_velocity": { 8 | "x": -2.2955228329172593e-6, 9 | "y": 0.0014648066583447341, 10 | "z": 0.00012815397686245558 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.4419089183569438e-7, 14 | "y": -2.2360013319774518e-10, 15 | "z": -1.9562476817689315e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_non_evolving/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412343, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896385526962e-6, 9 | "y": 0.0012491142229917943, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486728741582926e-7, 14 | "y": -1.3867347300472926e-10, 15 | "z": -1.2132356819682819e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe1998/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999832459295547, 4 | "y": 0.07032178743960706, 5 | "z": 0.006152359199845454 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000020867777911638492, 9 | "y": 0.004417165093152279, 10 | "z": 0.00038645187057328263 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.31077933372511e-6, 14 | "y": -6.1297121672594545e-9, 15 | "z": -5.362803253121502e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe2015/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -9.241622982347035e-7, 4 | "y": -1.1174994642389152e-6, 5 | "z": -9.776853146011472e-8 6 | }, 7 | "inertial_velocity": { 8 | "x": 5.859677423116829e-8, 9 | "y": -5.124981612237238e-8, 10 | "z": -4.483777375915227e-9 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.566310905473551e-14, 14 | "y": 1.3672282640678203e-15, 15 | "z": 1.1961697667028506e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe2015/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999832459295344, 4 | "y": 0.0703217874396067, 5 | "z": 0.006152359199845509 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000020867777939356653, 9 | "y": 0.004417165093152214, 10 | "z": 0.00038645187057329103 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.3107793337251457e-6, 14 | "y": -6.129712167259703e-9, 15 | "z": -5.362803253121803e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_bolmontmathis2016/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.28062354199190137, 4 | "y": 0.371781866317142, 5 | "z": 0.03252669760143964 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.01950926933276672, 9 | "y": 0.017045513846326396, 10 | "z": 0.0014912890526606957 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.203930131510528e-14, 14 | "y": -3.074606467716408e-15, 15 | "z": -2.6899319427530373e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_bolmontmathis2016/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.4981530522178685, 4 | "y": 0.1346392301657161, 5 | "z": 0.011779406644947955 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.0002318279995173425, 9 | "y": 0.008454925582880454, 10 | "z": 0.0007397102034537497 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.00001455665672601335, 14 | "y": -4.3461541754657417e-7, 15 | "z": -3.802392311963026e-8 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_bolmontmathis2016/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999537160023769, 4 | "y": 0.09521532767228306, 5 | "z": 0.008330261765231349 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00005796507084602976, 9 | "y": 0.005980657873521935, 10 | "z": 0.0005232397643603002 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.6408527609034922e-6, 14 | "y": -3.842347721965734e-8, 15 | "z": -3.3616186699668746e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_galletbolmont2017/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.2806235420949451, 4 | "y": 0.37178186635518884, 5 | "z": 0.03252669760975232 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.01950926932026088, 9 | "y": 0.017045513853990522, 10 | "z": 0.0014912890541878094 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.203930131762131e-14, 14 | "y": -3.0746064683979276e-15, 15 | "z": -2.6899319439780274e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_galletbolmont2017/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.498153052217881, 4 | "y": 0.13463923016571624, 5 | "z": 0.011779406644947978 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00023182799951583624, 9 | "y": 0.008454925582880477, 10 | "z": 0.0007397102034537545 11 | }, 12 | "inertial_acceleration": { 13 | "x": -0.000014556656726013285, 14 | "y": -4.34615417546571e-7, 15 | "z": -3.802392311963e-8 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_galletbolmont2017/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999537160023769, 4 | "y": 0.09521532767228306, 5 | "z": 0.008330261765231349 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00005796507084580408, 9 | "y": 0.005980657873521936, 10 | "z": 0.0005232397643603002 11 | }, 12 | "inertial_acceleration": { 13 | "x": -3.6408527609034922e-6, 14 | "y": -3.8423477219657324e-8, 15 | "z": -3.361618669966872e-9 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_galletbolmont2017/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999832459295547, 4 | "y": 0.07032178743960706, 5 | "z": 0.006152359199845455 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000020867777911839175, 9 | "y": 0.004417165093152279, 10 | "z": 0.0003864518705732827 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.31077933372511e-6, 14 | "y": -6.129712167259458e-9, 15 | "z": -5.362803253121507e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_non_evolving/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999832459295437, 4 | "y": 0.07032178743960686, 5 | "z": 0.006152359199845477 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000020867777926369157, 9 | "y": 0.004417165093152244, 10 | "z": 0.0003864518705732857 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.3107793337251291e-6, 14 | "y": -6.1297121672599666e-9, 15 | "z": -5.362803253122094e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-disabled_flattening/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.00001736002119979955, 4 | "y": -4.475643284290503e-6, 5 | "z": -3.915680493613547e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035673424277e-8, 9 | "y": -2.749968399557613e-7, 10 | "z": -2.4059106001582153e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5684058952403746e-14, 14 | "y": 3.8679487059297366e-16, 15 | "z": 3.384016628686196e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-disabled_flattening/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.99996880042376, 4 | "y": 0.019885910174982094, 5 | "z": 0.0017397917042057567 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694882044515453e-6, 9 | "y": 0.001249114222992745, 10 | "z": 0.00010928333396085833 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486728741567052e-7, 14 | "y": -1.386734730044304e-10, 15 | "z": -1.2132356819655914e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_flattening-enabled_flattening/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678165, 4 | "y": -4.4756432842879e-6, 5 | "z": -3.9156804936150336e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949302e-8, 9 | "y": -2.7499683995526807e-7, 10 | "z": -2.4059106001609665e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900227898e-14, 14 | "y": 3.867948710768974e-16, 15 | "z": 3.384016639962479e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-anderson1975/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412345, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.669489637909634e-6, 9 | "y": 0.0012491142229917947, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.386734730047104e-10, 15 | "z": -1.2132356819680405e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-kidder1995/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678165, 4 | "y": -4.4756432842879e-6, 5 | "z": -3.9156804936150336e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949302e-8, 9 | "y": -2.7499683995526807e-7, 10 | "z": -2.4059106001609665e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900227898e-14, 14 | "y": 3.867948710768974e-16, 15 | "z": 3.384016639962479e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-newhall1983/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412347, 4 | "y": 0.019885910174977057, 5 | "z": 0.0017397917042053155 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379093048e-6, 9 | "y": 0.0012491142229917953, 10 | "z": 0.00010928333396077515 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.048672874158293e-7, 14 | "y": -1.3867347300471033e-10, 15 | "z": -1.21323568196804e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_democraticheliocentric/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127916545776, 4 | "y": 0.1191311698264197, 5 | "z": 0.010422626832396061 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.001828791956446675, 9 | "y": 0.007319663005066006, 10 | "z": 0.0006403875337738806 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548434e-14, 14 | "y": -1.1628773415444149e-15, 15 | "z": -1.0173858436081591e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_democraticheliocentric/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192437, 4 | "y": 0.02692722260952054, 5 | "z": 0.0023558267185719906 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187874815e-6, 9 | "y": 0.0016914038302535657, 10 | "z": 0.00014797866059151343 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.2092333087095354e-11, 14 | "y": 1.2974547804740594e-13, 15 | "z": 1.1351258472973885e-14 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_democraticheliocentric/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412297, 4 | "y": 0.019885910175282878, 5 | "z": 0.0017397917042320733 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379395197e-6, 9 | "y": 0.0012491142229917923, 10 | "z": 0.0001092833339607751 11 | }, 12 | "inertial_acceleration": { 13 | "x": -4.206577256851818e-12, 14 | "y": 2.842390832021222e-14, 15 | "z": 2.4867697511250746e-15 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_both_tides/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.99996880042376, 4 | "y": 0.019885910175017518, 5 | "z": 0.0017397917042057567 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694882044509803e-6, 9 | "y": 0.0012491142229941654, 10 | "z": 0.00010928333396085833 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486728741567052e-7, 14 | "y": -1.3867347300467632e-10, 15 | "z": -1.2132356819655963e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_planet_tides/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.49983443270128, 4 | "y": 0.038082353185115485, 5 | "z": 0.003331774184087966 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000018549723388109774, 9 | "y": 0.0023920552861232563, 10 | "z": 0.00020927772006304528 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.1651506635057512e-6, 14 | "y": -9.835559275563011e-9, 15 | "z": -8.604999360490123e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_planet_tides/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175280551, 4 | "y": 0.026927222609302366, 5 | "z": 0.0023558267185529126 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637467127008511e-6, 9 | "y": 0.0016914038302701107, 10 | "z": 0.0001479786605929613 11 | }, 12 | "inertial_acceleration": { 13 | "x": -2.9129715372504534e-7, 14 | "y": -8.693284054225784e-10, 15 | "z": -7.605638035554416e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_planet_tides/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.99996880042376, 4 | "y": 0.019885910174982094, 5 | "z": 0.0017397917042057567 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694882044515436e-6, 9 | "y": 0.001249114222992745, 10 | "z": 0.00010928333396085833 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486728741567052e-7, 14 | "y": -1.386734730044304e-10, 15 | "z": -1.2132356819655914e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_leconte2011/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199678165, 4 | "y": -4.4756432842879e-6, 5 | "z": -3.9156804936150336e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674949302e-8, 9 | "y": -2.7499683995526807e-7, 10 | "z": -2.4059106001609665e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900227898e-14, 14 | "y": 3.867948710768974e-16, 15 | "z": 3.384016639962479e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_non_evolving/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.00001736002112178847, 4 | "y": -4.4756432772360555e-6, 5 | "z": -3.915680475449062e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866036655186421e-8, 9 | "y": -2.74996838612021e-7, 10 | "z": -2.4059105659740524e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900228463e-14, 14 | "y": 3.8679487107688667e-16, 15 | "z": 3.3840166399610274e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-brown_dwarf_non_evolving/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412343, 4 | "y": 0.01988591017497705, 5 | "z": 0.0017397917042053148 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896385415814e-6, 9 | "y": 0.0012491142229917943, 10 | "z": 0.00010928333396077519 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.0486728741582926e-7, 14 | "y": -1.3867347300472926e-10, 15 | "z": -1.2132356819682819e-11 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_baraffe1998/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000013779010496277665, 4 | "y": -3.9922469133365905e-6, 5 | "z": -3.4927634691370656e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.841813589640497e-8, 9 | "y": -2.4392959516673547e-7, 10 | "z": -2.134107427563146e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5683603487238907e-14, 14 | "y": 4.3244776144680735e-16, 15 | "z": 3.7834276792180326e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-m_dwarf_non_evolving/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021121788444, 4 | "y": -4.475643277236052e-6, 5 | "z": -3.9156804754490695e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866036655186686e-8, 9 | "y": -2.7499683861202056e-7, 10 | "z": -2.405910565974055e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900228463e-14, 14 | "y": 3.8679487107688667e-16, 15 | "z": 3.384016639961027e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_baraffe1998/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -9.241623019155208e-7, 4 | "y": -1.1174994655980664e-6, 5 | "z": -9.776853175662834e-8 6 | }, 7 | "inertial_velocity": { 8 | "x": 5.859677378444471e-8, 9 | "y": -5.124981639616084e-8, 10 | "z": -4.483777430391935e-9 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5663109054724696e-14, 14 | "y": 1.3672282640674264e-15, 15 | "z": 1.1961697667024567e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_bolmontmathis2016/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999832459295545, 4 | "y": 0.07032178743960706, 5 | "z": 0.006152359199845457 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.000020867777911956302, 9 | "y": 0.004417165093152279, 10 | "z": 0.0003864518705732827 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.3107793337251103e-6, 14 | "y": -6.129712167259463e-9, 15 | "z": -5.362803253121513e-10 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_galletbolmont2017/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -9.241623013872013e-7, 4 | "y": -1.117499465402995e-6, 5 | "z": -9.776853171400833e-8 6 | }, 7 | "inertial_velocity": { 8 | "x": 5.859677384856366e-8, 9 | "y": -5.124981635686587e-8, 10 | "z": -4.48377742256225e-9 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.566310905472522e-14, 14 | "y": 1.3672282640674446e-15, 15 | "z": 1.1961697667024668e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_non_evolving/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -9.241622565611768e-7, 4 | "y": -1.1174994488518841e-6, 5 | "z": -9.776852809781248e-8 6 | }, 7 | "inertial_velocity": { 8 | "x": 5.8596779288828194e-8, 9 | "y": -5.124981302282182e-8, 10 | "z": -4.483776758235674e-9 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5663109054757973e-14, 14 | "y": 1.3672282640685585e-15, 15 | "z": 1.1961697667030153e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-anderson1975/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.00001736002119967822, 4 | "y": -4.475643284287897e-6, 5 | "z": -3.9156804936150415e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035674948957e-8, 9 | "y": -2.7499683995526765e-7, 10 | "z": -2.4059106001609708e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.568405900227898e-14, 14 | "y": 3.867948710768974e-16, 15 | "z": 3.384016639962479e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_general_relativity-newhall1983/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199583708, 4 | "y": -4.475643284270911e-6, 5 | "z": -3.915680493600165e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035676106264e-8, 9 | "y": -2.7499683995210313e-7, 10 | "z": -2.4059106001332702e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5684059002278953e-14, 14 | "y": 3.867948710768971e-16, 15 | "z": 3.384016639962476e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_democraticheliocentric/particle_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 0.43532127916545776, 4 | "y": 0.1191311698264197, 5 | "z": 0.010422626832396061 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.001828791956446675, 9 | "y": 0.007319663005066006, 10 | "z": 0.0006403875337738806 11 | }, 12 | "inertial_acceleration": { 13 | "x": 6.634733363548434e-14, 14 | "y": -1.1628773415444149e-15, 15 | "z": -1.0173858436081591e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_democraticheliocentric/particle_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 8.999945175192437, 4 | "y": 0.02692722260952054, 5 | "z": 0.0023558267185719906 6 | }, 7 | "inertial_velocity": { 8 | "x": -4.637478187874815e-6, 9 | "y": 0.0016914038302535657, 10 | "z": 0.00014797866059151343 11 | }, 12 | "inertial_acceleration": { 13 | "x": -1.2092333087095354e-11, 14 | "y": 1.2974547804740594e-13, 15 | "z": 1.1351258472973885e-14 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_democraticheliocentric/particle_4.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 14.999968800412297, 4 | "y": 0.019885910175282878, 5 | "z": 0.0017397917042320733 6 | }, 7 | "inertial_velocity": { 8 | "x": -1.6694896379395197e-6, 9 | "y": 0.0012491142229917923, 10 | "z": 0.0001092833339607751 11 | }, 12 | "inertial_acceleration": { 13 | "x": -4.206577256851818e-12, 14 | "y": 2.842390832021222e-14, 15 | "z": 2.4867697511250746e-15 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_order-whfast_democraticheliocentric/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.4998344299984145, 4 | "y": 0.03808235316950438, 5 | "z": 0.0033317741904059046 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292908883, 9 | "y": 0.0023920552831236904, 10 | "z": 0.00020927772124858685 11 | }, 12 | "inertial_acceleration": { 13 | "x": -5.354038821972056e-11, 14 | "y": 1.0659120257843974e-12, 15 | "z": 9.325521847149674e-14 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_both_tides/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.000017360021199880986, 4 | "y": -4.475643285580099e-6, 5 | "z": -3.9156804929048087e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035672845436e-8, 9 | "y": -2.749968401137935e-7, 10 | "z": -2.4059105988482653e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5684058952183086e-14, 14 | "y": 3.8679487983995474e-16, 15 | "z": 3.384016623260088e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_tides_kaula-enabled_planet_tides/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -0.00001736002119979955, 4 | "y": -4.475643284290503e-6, 5 | "z": -3.915680493613547e-7 6 | }, 7 | "inertial_velocity": { 8 | "x": 6.866035673424278e-8, 9 | "y": -2.749968399557613e-7, 10 | "z": -2.4059106001582153e-8 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5684058952403746e-14, 14 | "y": 3.8679487059297366e-16, 15 | "z": 3.384016628686196e-17 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_evolution-solar_like_bolmontmathis2016/particle_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": -9.241623010777086e-7, 4 | "y": -1.1174994652887156e-6, 5 | "z": -9.77685316890414e-8 6 | }, 7 | "inertial_velocity": { 8 | "x": 5.8596773886124863e-8, 9 | "y": -5.124981633384653e-8, 10 | "z": -4.483777417975601e-9 11 | }, 12 | "inertial_acceleration": { 13 | "x": 5.5663109054725416e-14, 14 | "y": 1.3672282640674513e-15, 15 | "z": 1.1961697667024702e-16 16 | } 17 | } -------------------------------------------------------------------------------- /tests/data/test_integrator-whfast_democraticheliocentric/particle_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "inertial_position": { 3 | "x": 4.4998344299984145, 4 | "y": 0.03808235316950438, 5 | "z": 0.0033317741904059046 6 | }, 7 | "inertial_velocity": { 8 | "x": -0.00001855006292908883, 9 | "y": 0.0023920552831236904, 10 | "z": 0.00020927772124858685 11 | }, 12 | "inertial_acceleration": { 13 | "x": -5.354038821972056e-11, 14 | "y": 1.0659120257843974e-12, 15 | "z": 9.325521847149674e-14 16 | } 17 | } -------------------------------------------------------------------------------- /scripts/clean_json.py: -------------------------------------------------------------------------------- 1 | import fnmatch 2 | import os 3 | import json 4 | from itertools import chain 5 | 6 | paths = ('tests/data', 'posidonius/tests/data',) 7 | for root, dirnames, filenames in chain.from_iterable(os.walk(path) for path in paths): 8 | for filename in fnmatch.filter(filenames, 'case.json'): 9 | full_path = os.path.join(root, filename) 10 | with open(full_path) as input_json_file: 11 | data = json.load(input_json_file) 12 | with open(full_path, "w") as output_json_file: 13 | json.dump(data, output_json_file, indent=2, sort_keys=True) 14 | print("Transformed: {}".format(full_path)) 15 | -------------------------------------------------------------------------------- /posidonius/__init__.py: -------------------------------------------------------------------------------- 1 | from posidonius.particles.axes import Axes 2 | from posidonius.particles.particle import Particle, ReferenceParticle 3 | from posidonius.particles.universe import Universe, ConsiderEffects 4 | from posidonius.effects.evolution import NonEvolving, Leconte2011, Baraffe2015, Baraffe1998, LeconteChabrier2013, BolmontMathis2016, GalletBolmont2017 5 | from posidonius.tools import calculate_cartesian_coordinates, calculate_keplerian_orbital_elements, calculate_spin, calculate_pseudo_synchronization_period, mass_radius_relation 6 | import posidonius.constants 7 | import posidonius.analysis 8 | import posidonius.effects 9 | import posidonius.integrator 10 | -------------------------------------------------------------------------------- /src/particles/common.rs: -------------------------------------------------------------------------------- 1 | use super::{Particle}; 2 | 3 | pub fn calculate_spin(particles: &mut [Particle]) { 4 | for (i, particle) in particles.iter_mut().enumerate() { 5 | if particle.moment_of_inertia == 0. { 6 | panic!("Moment of inertia for particle {} is zero!", i); 7 | } 8 | particle.spin.x = particle.angular_momentum.x/particle.moment_of_inertia; 9 | particle.spin.y = particle.angular_momentum.y/particle.moment_of_inertia; 10 | particle.spin.z = particle.angular_momentum.z/particle.moment_of_inertia; 11 | // norm needed for rotational flattening (torque and accelerations) and evolution 12 | particle.norm_spin_vector_2 = (particle.spin.x.powi(2)) + (particle.spin.y.powi(2)) + (particle.spin.z.powi(2)); 13 | } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /posidonius/integrator/common.py: -------------------------------------------------------------------------------- 1 | import json 2 | 3 | class Integrator(object): 4 | def __init__(self, time_step, recovery_snapshot_period, historic_snapshot_period, universe): 5 | self._data = {} 6 | self._data['time_step'] = float(time_step) 7 | self._data['universe'] = universe.get() 8 | self._data['current_time'] = 0.0 9 | self._data['current_iteration'] = 0 10 | self._data['recovery_snapshot_period'] = float(recovery_snapshot_period) 11 | self._data['historic_snapshot_period'] = float(historic_snapshot_period) 12 | self._data['last_recovery_snapshot_time'] = -1.0 13 | self._data['last_historic_snapshot_time'] = -1.0 14 | self._data['n_historic_snapshots'] = 0 15 | self._data['hash'] = 0 16 | 17 | def write(self, filename): 18 | json.dump(self._data, open(filename, "w"), indent=2, sort_keys=True) 19 | 20 | -------------------------------------------------------------------------------- /src/effects/rotational_flattening/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod common; 2 | pub mod oblate_spheroid; 3 | pub mod creep_coplanar; 4 | 5 | pub use self::common::RotationalFlattening; 6 | pub use self::common::RotationalFlatteningEffect; 7 | pub use self::common::RotationalFlatteningModel; 8 | 9 | pub use self::common::initialize; 10 | pub use self::common::inertial_to_heliocentric_coordinates; 11 | pub use self::common::copy_heliocentric_coordinates; 12 | pub use self::oblate_spheroid::OblateSpheroidParameters; 13 | pub use self::oblate_spheroid::calculate_orthogonal_component_of_the_force_induced_by_rotational_flattening; 14 | pub use self::oblate_spheroid::calculate_radial_component_of_the_force_induced_by_rotational_flattening; 15 | pub use self::common::calculate_dangular_momentum_dt_induced_by_rotational_flattening; 16 | pub use self::common::calculate_acceleration_induced_by_rotational_flattering; 17 | pub use self::creep_coplanar::calculate_creep_coplanar_shapes; 18 | -------------------------------------------------------------------------------- /src/integrator/mod.rs: -------------------------------------------------------------------------------- 1 | mod leapfrog; 2 | mod ias15; 3 | pub mod whfast; 4 | pub mod output; 5 | 6 | pub use self::leapfrog::*; 7 | pub use self::ias15::*; 8 | pub use self::whfast::WHFast; 9 | 10 | use std::io::{BufWriter}; 11 | use std::fs::File; 12 | use std::path::Path; 13 | use std::any::Any; 14 | 15 | 16 | pub trait Integrator { 17 | fn as_any(&self) -> &dyn Any; 18 | fn get_n_historic_snapshots(&self) -> usize; 19 | fn get_n_particles(&self) -> usize; 20 | fn get_current_time(&self) -> f64; 21 | fn set_time_limit(&mut self, time_limit: f64); 22 | fn set_snapshot_periods(&mut self, historic_snapshot_period: f64, recovery_snapshot_period: f64); 23 | fn initialize_physical_values(&mut self); 24 | fn iterate(&mut self, universe_history_writer: &mut BufWriter, silent_mode: bool) -> Result; 25 | fn write_recovery_snapshot(&mut self, snapshot_path: &Path, universe_history_writer: &mut BufWriter); 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/effects/tides/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod common; 2 | pub mod constant_time_lag; 3 | pub mod creep_coplanar; 4 | pub mod kaula; 5 | 6 | pub use self::common::Tides; 7 | pub use self::common::TidesEffect; 8 | pub use self::common::TidalModel; 9 | pub use self::common::initialize; 10 | pub use self::common::inertial_to_heliocentric_coordinates; 11 | pub use self::common::copy_heliocentric_coordinates; 12 | pub use self::common::calculate_dangular_momentum_dt_due_to_tides; 13 | pub use self::common::calculate_denergy_dt; 14 | pub use self::common::calculate_tidal_acceleration; 15 | pub use self::constant_time_lag::calculate_pair_dependent_scaled_dissipation_factors; 16 | pub use self::constant_time_lag::ConstantTimeLagParameters; 17 | pub use self::constant_time_lag::calculate_radial_component_of_the_tidal_force; 18 | pub use self::constant_time_lag::calculate_orthogonal_component_of_the_tidal_force; 19 | pub use self::creep_coplanar::CreepCoplanarParameters; 20 | pub use self::creep_coplanar::calculate_creep_coplanar_shapes; 21 | pub use self::kaula::KaulaParameters; 22 | pub use self::kaula::Polynomials; 23 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "posidonius" 3 | version = "0.0.1" 4 | authors = ["Sergi Blanco-Cuaresma "] 5 | homepage = "https://www.blancocuaresma.com/s/" 6 | repository = "https://github.com/marblestation/posidonius/" 7 | readme = "README.md" 8 | license = "AGPL-3.0-or-later" 9 | edition = "2018" 10 | 11 | [[bin]] 12 | path = "src/main.rs" 13 | name = "posidonius" 14 | bench = false 15 | 16 | [lib] 17 | path = "src/lib.rs" 18 | name = "posidonius" 19 | bench = false 20 | 21 | [profile.dev] 22 | opt-level = 0 23 | debug = true 24 | 25 | [profile.release] 26 | opt-level = 3 27 | debug = true 28 | 29 | [dependencies] 30 | time = { version = "0.3.*", features = ["formatting"] } 31 | serde = { version = "1.0.*", features = ["derive"] } 32 | serde_json = "1.0.*" 33 | serde_derive = "1.0.*" 34 | bincode = "1.3.*" 35 | csv = "1.3.*" 36 | clap = "4.5.*" 37 | assert_approx_eq = "1.1.*" 38 | libmath = "0.2.*" 39 | serde-big-array = "0.5.1" 40 | 41 | [dev-dependencies] 42 | criterion = "0.5.*" 43 | 44 | [[bench]] 45 | name = "simulation" 46 | harness = false 47 | 48 | -------------------------------------------------------------------------------- /src/effects/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod evolution; 2 | pub mod disk; 3 | pub mod wind; 4 | pub mod tides; 5 | pub mod rotational_flattening; 6 | pub mod general_relativity; 7 | 8 | pub use self::tides::Tides; 9 | pub use self::tides::TidesEffect; 10 | pub use self::tides::TidalModel; 11 | pub use self::tides::ConstantTimeLagParameters; 12 | pub use self::tides::CreepCoplanarParameters; 13 | pub use self::tides::KaulaParameters; 14 | pub use self::tides::Polynomials; 15 | pub use self::rotational_flattening::RotationalFlattening; 16 | pub use self::rotational_flattening::RotationalFlatteningEffect; 17 | pub use self::rotational_flattening::RotationalFlatteningModel; 18 | pub use self::rotational_flattening::OblateSpheroidParameters; 19 | pub use self::general_relativity::GeneralRelativity; 20 | pub use self::general_relativity::GeneralRelativityEffect; 21 | pub use self::general_relativity::GeneralRelativityImplementation; 22 | pub use self::wind::Wind; 23 | pub use self::wind::WindEffect; 24 | pub use self::disk::Disk; 25 | pub use self::disk::DiskEffect; 26 | pub use self::disk::DiskProperties; 27 | pub use self::evolution::Evolver; 28 | pub use self::evolution::EvolutionType; 29 | 30 | -------------------------------------------------------------------------------- /scripts/raw_history.py: -------------------------------------------------------------------------------- 1 | import os 2 | import numpy as np 3 | import pandas as pd 4 | import argparse 5 | import posidonius 6 | 7 | if __name__ == "__main__": 8 | parser = argparse.ArgumentParser() 9 | parser.add_argument('historic_snapshot_filename', action='store', help='Filename with the historic snapshots of the simulation (e.g., universe_integrator_history.bin)') 10 | 11 | args = parser.parse_args() 12 | 13 | filename = args.historic_snapshot_filename 14 | n_particles, data = posidonius.analysis.history.read(filename) 15 | 16 | output_text_dirname = os.path.dirname(filename) 17 | for particle in np.unique(data['particle']): 18 | subdata = data[data['particle'] == particle].copy() 19 | subdata = pd.DataFrame(subdata) 20 | del subdata['index'] 21 | del subdata['particle'] 22 | output_text_filename = os.path.join(output_text_dirname, os.path.splitext(os.path.basename(filename))[0] + "_{}.txt".format(particle)) 23 | subdata.to_csv(output_text_filename, sep="\t", index=False) 24 | print("> Raw output for particle '{}' written to plain text file: {}".format(particle, output_text_filename)) 25 | 26 | 27 | -------------------------------------------------------------------------------- /posidonius/analysis/computation.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | #------------------------------------------------------------------------------- 4 | # Main process 5 | #------------------------------------------------------------------------------- 6 | # The 2 eccentricity dependant factors in the equation in a 7 | def _Na1(e): 8 | return (1.0+31.0/2.0*(e*e)+255.0/8.0*np.power(e, 4) \ 9 | + 185.0/16.0* np.power(e, 6) + 25.0/64.0* np.power(e,8)) / np.power((1.0- (e*e)), (15.0/2.0)) 10 | 11 | def _Na2(e): 12 | return (1.+15./2.0*(e*e) + 45./8.0 * np.power(e, 4) + 5./16.0* np.power(e, 6)) / np.power((1.0- (e*e)), 6) 13 | 14 | def _No2(e): 15 | return (1.0 + 3.0 * (e*e) + 3.0/8.0 * np.power(e, 4)) / np.power((1.0- (e*e)), 5) 16 | 17 | # Mean orbital angular velocity without the a dependance (m^3/2.s-1) 18 | def _norb(G, Mp, Ms): 19 | return np.sqrt(G) * np.sqrt(Mp+Ms) 20 | 21 | # Jeremys Ki factor : 22 | def _Kplan(k2deltat_plan, G, Mp, Ms, Rp, a): 23 | return 3./2. * k2deltat_plan * (G*(Mp*Mp)/Rp) * np.power(Ms/Mp,2) \ 24 | * np.power(Rp/a, 6) * np.power(_norb(G,Mp,Ms) * np.power(a, -1.5), 2) 25 | 26 | def energydot(a, e, rotp, oblp, G, Mp, Ms, Rp, k2deltat_plan): 27 | return 2. * _Kplan(k2deltat_plan, G, Mp, Ms, Rp, a) \ 28 | * (_Na1(e) - 2.0*_Na2(e) * np.cos(oblp) * (rotp/(_norb(G, Mp, Ms)*np.power(a, -1.5))) \ 29 | + (1.0 + np.power(np.cos(oblp),2))/2.0 * _No2(e) * np.sqrt(1.0-(e*e)) * np.power(rotp/(_norb(G, Mp, Ms)* np.power(a, -1.5)), 2)) 30 | 31 | -------------------------------------------------------------------------------- /posidonius/tests/common/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import errno 3 | from posidonius.tests.common.stars import * 4 | from posidonius.tests.common.planets import * 5 | 6 | 7 | def _mkdir_p(path): 8 | """ 9 | Creates a directory. Same behaviour as 'mkdir -p'. 10 | """ 11 | try: 12 | os.makedirs(path) 13 | except OSError as exc: # Python >2.5 14 | if exc.errno == errno.EEXIST: 15 | pass 16 | else: 17 | raise 18 | 19 | def setup(current_dirname, current_filename, current_function_name): 20 | test_name = "{}-{}".format(current_filename, current_function_name) 21 | tmp_data_dirname = os.path.join(current_dirname, "data/tmp/{0}/".format(test_name)) 22 | expected_data_dirname = os.path.join(current_dirname, "data/{0}/".format(test_name)) 23 | _mkdir_p(expected_data_dirname) 24 | _mkdir_p(tmp_data_dirname) 25 | json_filename = os.path.join(tmp_data_dirname, "case.json") 26 | expected_json_filename = os.path.join(expected_data_dirname, "case.json") 27 | if os.path.exists(json_filename): 28 | os.remove(json_filename) 29 | return expected_json_filename, json_filename 30 | 31 | def simulation_properties(): 32 | initial_time = 1.6e8*365.25 # time [days] where simulation starts 33 | time_step = 0.08 # days 34 | time_limit = time_step*200. # days 35 | historic_snapshot_period = 100.*365.25 # days 36 | recovery_snapshot_period = 10.*historic_snapshot_period # days 37 | return initial_time, time_step, time_limit, historic_snapshot_period, recovery_snapshot_period 38 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | extern crate serde; 2 | //#[macro_use] 3 | //extern crate serde_derive; 4 | extern crate serde_json; 5 | extern crate serde_big_array; 6 | extern crate bincode; 7 | extern crate csv; 8 | extern crate time; 9 | extern crate math; 10 | 11 | pub mod constants; 12 | 13 | mod particles; 14 | pub use self::particles::Universe; 15 | pub use self::particles::ConsiderEffects; 16 | pub use self::particles::Particle; 17 | pub use self::particles::Reference; 18 | pub use self::particles::Axes; 19 | pub use self::particles::IgnoreGravityTerms; 20 | mod effects; 21 | pub use self::effects::Tides; 22 | pub use self::effects::TidesEffect; 23 | pub use self::effects::TidalModel; 24 | pub use self::effects::ConstantTimeLagParameters; 25 | pub use self::effects::CreepCoplanarParameters; 26 | pub use self::effects::KaulaParameters; 27 | pub use self::effects::Polynomials; 28 | pub use self::effects::RotationalFlattening; 29 | pub use self::effects::RotationalFlatteningEffect; 30 | pub use self::effects::RotationalFlatteningModel; 31 | pub use self::effects::OblateSpheroidParameters; 32 | pub use self::effects::GeneralRelativity; 33 | pub use self::effects::GeneralRelativityEffect; 34 | pub use self::effects::GeneralRelativityImplementation; 35 | pub use self::effects::Disk; 36 | pub use self::effects::DiskEffect; 37 | pub use self::effects::DiskProperties; 38 | pub use self::effects::Wind; 39 | pub use self::effects::WindEffect; 40 | pub use self::effects::Evolver; 41 | pub use self::effects::EvolutionType; 42 | 43 | mod integrator; 44 | pub use self::integrator::*; 45 | 46 | pub mod tools; 47 | 48 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools", "wheel", "setuptools_scm"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | dynamic = ["version", "dependencies", "optional-dependencies"] 7 | name = "posidonius" 8 | description = "Posidonius is a N-body code for simulating planetary and/or binary systems which implements the WHFAST integrator (Rein & Tamayo 2015), the IAS15 integrator (Rein & Spiegel, 2015) and the tidal model used in Mercury-T (Bolmont et al. 2015) plus newer effects. This Python package is the case generator for the Rust-based posidonius to run." 9 | license = {text = "GNU Affero General Public License v3"} 10 | authors = [ 11 | {name = "Sergi Blanco-Cuaresma", email = "marblestation@users.noreply.github.com"}, 12 | ] 13 | keywords = ["N-Body simulations", "exoplanets", "tides"] 14 | classifiers = [ 15 | "Development Status :: 5 - Production/Stable", 16 | "Programming Language :: Rust", 17 | "Programming Language :: Python", 18 | "Intended Audience :: Science/Research", 19 | "Environment :: Console", 20 | "Topic :: Scientific/Engineering :: Astronomy", 21 | "License :: OSI Approved :: GNU Affero General Public License v3", 22 | ] 23 | urls = {homepage = "https://www.blancocuaresma.com/s/"} 24 | 25 | [tool.setuptools.dynamic] 26 | dependencies = {file = ["requirements.txt"]} 27 | optional-dependencies = {dev = { file = ["dev-requirements.txt"] }} 28 | 29 | [tool.setuptools.packages.find] 30 | where = ["."] 31 | include = ["posidonius", ] 32 | 33 | [tool.setuptools_scm] 34 | version_scheme = "guess-next-dev" 35 | local_scheme = "node-and-date" 36 | 37 | -------------------------------------------------------------------------------- /posidonius/particles/axes.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | class Axes(object): 4 | def __init__(self, x, y, z): 5 | if type(x) is np.ndarray: 6 | if len(x) != len(y) or len(x) != len(z): 7 | raise Exception("Arrays length do not match!") 8 | self._data = {u'x': x, u'y': y, u'z': z} 9 | else: 10 | self._data = {u'x': float(x), u'y': float(y), u'z': float(z)} 11 | 12 | def get(self): 13 | return self._data.copy() 14 | 15 | def x(self): 16 | return self._data['x'] 17 | 18 | def y(self): 19 | return self._data['y'] 20 | 21 | def z(self): 22 | return self._data['z'] 23 | 24 | def set_x(self, x): 25 | if type(x) is np.ndarray: 26 | if len(x) != len(self._data['y']) or len(x) != len(self._data['z']): 27 | raise Exception("Arrays length do not match!") 28 | self._data['x'] = x 29 | else: 30 | self._data['x'] = float(x) 31 | 32 | def set_y(self, y): 33 | if type(y) is np.ndarray: 34 | if len(y) != len(self._data['x']) or len(y) != len(self._data['z']): 35 | raise Exception("Arrays length do not match!") 36 | self._data['y'] = y 37 | else: 38 | self._data['y'] = float(y) 39 | 40 | def set_z(self, z): 41 | if type(z) is np.ndarray: 42 | if len(z) != len(self._data['x']) or len(z) != len(self._data['y']): 43 | raise Exception("Arrays length do not match!") 44 | self._data['z'] = z 45 | else: 46 | self._data['z'] = float(z) 47 | 48 | -------------------------------------------------------------------------------- /posidonius/integrator/whfast.py: -------------------------------------------------------------------------------- 1 | from posidonius.constants import * 2 | from posidonius.integrator.common import Integrator 3 | 4 | class CoordinatesType(object): 5 | def __init__(self, variant): 6 | self._data = {} 7 | if variant in ("Jacobi", "DemocraticHeliocentric", "WHDS"): 8 | self._data = variant 9 | else: 10 | raise Exception("Unknown variant '{}'".format(variant)) 11 | 12 | def get(self): 13 | return self._data 14 | 15 | class WHFast(Integrator): 16 | 17 | def __init__(self, alternative_coordinates, time_step, recovery_snapshot_period, historic_snapshot_period, universe): 18 | super(WHFast, self).__init__(time_step, recovery_snapshot_period, historic_snapshot_period, universe) 19 | self._data['half_time_step'] = self._data['time_step']*0.5 20 | self._data['inertial_velocity_errors'] = [{u'x': 0.0, u'y': 0.0, u'z': 0.0}]*MAX_PARTICLES 21 | self._data['particle_angular_momentum_errors'] = [{u'x': 0.0, u'y': 0.0, u'z': 0.0}]*MAX_PARTICLES 22 | self._data['timestep_warning'] = 0 23 | self._data['alternative_coordinates_type'] = CoordinatesType(alternative_coordinates).get() 24 | self._data['particles_alternative_coordinates'] = [] 25 | particle_alternative_coordinates = {} 26 | particle_alternative_coordinates['mass'] = 0. 27 | particle_alternative_coordinates['mass_g'] = 0. 28 | particle_alternative_coordinates['position'] = {u'x': 0.0, u'y': 0.0, u'z': 0.0} 29 | particle_alternative_coordinates['velocity'] = {u'x': 0.0, u'y': 0.0, u'z': 0.0} 30 | particle_alternative_coordinates['acceleration'] = {u'x': 0.0, u'y': 0.0, u'z': 0.0} 31 | self._data['particles_alternative_coordinates'] = [particle_alternative_coordinates] * MAX_PARTICLES 32 | 33 | -------------------------------------------------------------------------------- /posidonius/effects/wind.py: -------------------------------------------------------------------------------- 1 | import six 2 | from posidonius.particles.axes import Axes 3 | 4 | class Wind(object): 5 | def __init__(self, variant, input_parameters=None): 6 | self._data = { 7 | "effect": "Disabled", 8 | "parameters": { 9 | "input": { 10 | "k_factor": 0.0, 11 | "rotation_saturation": 0.0, 12 | }, 13 | "internal": { 14 | "rotation_saturation_2": 0.0, 15 | }, 16 | "output": { 17 | "dangular_momentum_dt": Axes(0.0, 0.0, 0.0).get(), 18 | }, 19 | }, 20 | } 21 | if variant in ("Interaction", ): 22 | self._data["effect"] = variant 23 | # Update default values, ignore non-recognised keys 24 | for key, value in six.iteritems(input_parameters): 25 | if key in self._data["parameters"]["input"]: 26 | self._data["parameters"]["input"][key] = float(value) 27 | else: 28 | print("Ignored parameter: {}".format(key)) 29 | self._data["parameters"]["internal"]["rotation_saturation_2"] = self._data["parameters"]["input"]["rotation_saturation"]*self._data["parameters"]["input"]["rotation_saturation"] 30 | elif variant in ("Disabled", ): 31 | self._data["effect"] = variant 32 | else: 33 | raise Exception("Unknown variant '{}'".format(variant)) 34 | 35 | def get(self): 36 | if type(self._data) == str: 37 | return self._data 38 | else: 39 | return self._data.copy() 40 | 41 | class Disabled(Wind): 42 | def __init__(self): 43 | super(Disabled, self).__init__("Disabled") 44 | 45 | class Interaction(Wind): 46 | def __init__(self, input_parameters): 47 | super(Interaction, self).__init__("Interaction", input_parameters=input_parameters) 48 | 49 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import glob 3 | import shutil 4 | from subprocess import Popen, PIPE 5 | from setuptools import setup 6 | from setuptools.command.install import install 7 | 8 | class CustomInstallCommand(install): 9 | """ 10 | Copy input/ into the package. This is necessary because `package_data` or 11 | `include_package_data` (with `MANIFEST.in`) expect the data to be within the 12 | posidonius python package and not in the root. On the other hand, data_files 13 | can copy files outside the posidonius python package but they are copied 14 | directly at the "venv/" and not within the installed posidonius package. 15 | """ 16 | def run(self): 17 | install.run(self) 18 | # Copy the input directory to the desired location 19 | src_dir = 'input' 20 | dst_dir = os.path.join(self.install_lib, 'posidonius', 'input') 21 | shutil.copytree(src_dir, dst_dir) 22 | 23 | def remove_building_dirs(building_dirs): 24 | for dirname in ["build/", "posidonius.egg-info/"]: 25 | print("Removing {}".format(dirname)) 26 | try: 27 | shutil.rmtree(dirname) 28 | except OSError: 29 | pass 30 | 31 | def remove_older_wheels(dist_dir="dist"): 32 | # Get the list of wheel files and source files in the dist directory 33 | for pattern in ("*.whl", "*.tar.gz",): 34 | wheel_files = glob.glob(os.path.join(dist_dir, pattern)) 35 | 36 | # Sort the wheel files by modification time, newest first 37 | wheel_files.sort(key=os.path.getmtime, reverse=True) 38 | 39 | # Keep the latest wheel and remove the older ones 40 | for wheel_file in wheel_files[1:]: 41 | print(f"Removing older wheel: {wheel_file}") 42 | os.remove(wheel_file) 43 | 44 | # Setup configuration 45 | setup( 46 | cmdclass={'install': CustomInstallCommand}, # <= necessary to include "input/" given that it is outside the "posidonius/" package 47 | ) 48 | 49 | # Cleanup (it will only work with `pip install .`, since `python -m build` uses an isolated environment) 50 | remove_building_dirs(["build/", "posidonius.egg-info/"]) 51 | remove_older_wheels("dist/") 52 | -------------------------------------------------------------------------------- /posidonius/effects/general_relativity.py: -------------------------------------------------------------------------------- 1 | from posidonius.particles.axes import Axes 2 | 3 | class GeneralRelativity(object): 4 | def __init__(self, variant, implementation=None): 5 | self._data = { 6 | "effect": "Disabled", 7 | "parameters": { 8 | "internal": { 9 | "distance": 0.0, 10 | "factor": 0.0, 11 | "norm_velocity_vector": 0.0, 12 | "norm_velocity_vector_2": 0.0, 13 | "radial_velocity": 0.0, 14 | }, 15 | "output": { 16 | "acceleration": Axes(0.0, 0.0, 0.0).get(), 17 | "dangular_momentum_dt": Axes(0.0, 0.0, 0.0).get(), 18 | }, 19 | }, 20 | "coordinates": { 21 | "position": Axes(0.0, 0.0, 0.0).get(), 22 | "velocity": Axes(0.0, 0.0, 0.0).get(), 23 | }, 24 | } 25 | if variant in ("CentralBody",): 26 | if implementation is None: 27 | raise Exception("General relativity central body requires an implementation") 28 | self._data["effect"] = { 29 | variant: implementation, 30 | } 31 | elif variant in ("OrbitingBody", "Disabled", ): 32 | self._data["effect"] = variant 33 | else: 34 | raise Exception("Unknown variant '{}'".format(variant)) 35 | 36 | def implementation(self): 37 | return self._data['effect'].get('CentralBody') 38 | 39 | def get(self): 40 | if type(self._data) == str: 41 | return self._data 42 | else: 43 | return self._data.copy() 44 | 45 | class Disabled(GeneralRelativity): 46 | def __init__(self): 47 | super(Disabled, self).__init__("Disabled") 48 | 49 | class OrbitingBody(GeneralRelativity): 50 | def __init__(self): 51 | super(OrbitingBody, self).__init__("OrbitingBody") 52 | 53 | class CentralBody(GeneralRelativity): 54 | def __init__(self, implementation): 55 | if implementation not in ("Kidder1995", "Anderson1975", "Newhall1983"): 56 | raise Exception("Unknown general relativity implementation: {}".format(implementation)) 57 | super(CentralBody, self).__init__("CentralBody", implementation=implementation) 58 | 59 | -------------------------------------------------------------------------------- /posidonius/effects/disk.py: -------------------------------------------------------------------------------- 1 | import six 2 | from posidonius.particles.axes import Axes 3 | 4 | class Disk(object): 5 | def __init__(self, variant, properties=None): 6 | self._data = { 7 | "effect": "Disabled", 8 | "parameters": { 9 | "internal": { 10 | "distance": 0.0, 11 | "migration_timescale": 0.0, 12 | "norm_velocity_vector": 0.0, 13 | "norm_velocity_vector_2": 0.0, 14 | }, 15 | "output": { 16 | "acceleration": Axes(0.0, 0.0, 0.0).get(), 17 | }, 18 | }, 19 | "coordinates": { 20 | "position": Axes(0.0, 0.0, 0.0).get(), 21 | "velocity": Axes(0.0, 0.0, 0.0).get(), 22 | }, 23 | } 24 | if variant in ("CentralBody",): 25 | if properties is None: 26 | raise Exception("Disk central body requires properties") 27 | self._data["effect"] = { 28 | variant: properties, 29 | } 30 | elif variant in ("OrbitingBody", "Disabled", ): 31 | self._data["effect"] = variant 32 | else: 33 | raise Exception("Unknown variant '{}'".format(variant)) 34 | 35 | def get(self): 36 | if type(self._data) == str: 37 | return self._data 38 | else: 39 | return self._data.copy() 40 | 41 | class Disabled(Disk): 42 | def __init__(self): 43 | super(Disabled, self).__init__("Disabled", properties=None) 44 | 45 | class OrbitingBody(Disk): 46 | def __init__(self): 47 | super(OrbitingBody, self).__init__("OrbitingBody") 48 | 49 | class CentralBody(Disk): 50 | def __init__(self, input_properties): 51 | properties = { 52 | "alpha": 0.0, 53 | "inner_edge_distance": 0.0, 54 | "lifetime": 0.0, 55 | "mean_molecular_weight": 0.0, 56 | "outer_edge_distance": 0.0, 57 | "surface_density_normalization": 0.0, 58 | } 59 | # Update default values, ignore non-recognised keys 60 | for key, value in six.iteritems(input_properties): 61 | if key in properties: 62 | properties[key] = value 63 | super(CentralBody, self).__init__("CentralBody", properties) 64 | 65 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python 2 | # Byte-compiled / optimized / DLL files 3 | __pycache__/ 4 | *.py[cod] 5 | *$py.class 6 | 7 | # C extensions 8 | *.so 9 | 10 | # Distribution / packaging 11 | .Python 12 | env/ 13 | build/ 14 | develop-eggs/ 15 | dist/ 16 | downloads/ 17 | eggs/ 18 | .eggs/ 19 | lib/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .coverage 43 | .coverage.* 44 | .cache 45 | nosetests.xml 46 | coverage.xml 47 | *.cover 48 | .hypothesis/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | 58 | # Flask stuff: 59 | instance/ 60 | .webassets-cache 61 | 62 | # Scrapy stuff: 63 | .scrapy 64 | 65 | # Sphinx documentation 66 | docs/_build/ 67 | 68 | # PyBuilder 69 | target/ 70 | 71 | # Jupyter Notebook 72 | .ipynb_checkpoints 73 | 74 | # pyenv 75 | .python-version 76 | 77 | # celery beat schedule file 78 | celerybeat-schedule 79 | 80 | # SageMath parsed files 81 | *.sage.py 82 | 83 | # dotenv 84 | .env 85 | 86 | # virtualenv 87 | .venv 88 | venv/ 89 | ENV/ 90 | 91 | # Spyder project settings 92 | .spyderproject 93 | .spyproject 94 | 95 | # Rope project settings 96 | .ropeproject 97 | 98 | # mkdocs documentation 99 | /site 100 | 101 | # mypy 102 | .mypy_cache/ 103 | 104 | *.tsv 105 | *.dump 106 | python/ 107 | ######################## 108 | 109 | # Compiled Object files 110 | *.slo 111 | *.lo 112 | *.o 113 | *.obj 114 | 115 | # Precompiled Headers 116 | *.gch 117 | *.pch 118 | 119 | # Compiled Dynamic libraries 120 | *.so 121 | *.dylib 122 | *.dll 123 | 124 | # Fortran module files 125 | *.mod 126 | *.smod 127 | 128 | # Compiled Static libraries 129 | *.lai 130 | *.la 131 | *.a 132 | *.lib 133 | 134 | # Executables 135 | *.exe 136 | *.out 137 | *.app 138 | *.png 139 | fortran/mercury 140 | 141 | # OSX 142 | .DS_Store 143 | 144 | # Generated by Cargo 145 | # will have compiled files and executables 146 | rust/target 147 | 148 | # Virtualenv 149 | python/ 150 | 151 | # Temporary test data files 152 | posidonius/tests/data/tmp/ 153 | 154 | # Data 155 | input/ 156 | -------------------------------------------------------------------------------- /posidonius/constants.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import os 3 | 4 | MAX_PARTICLES = 10 5 | BASE_DIR = os.path.dirname(os.path.realpath(__file__)) 6 | if not os.path.exists(BASE_DIR+"/input/"): 7 | BASE_DIR = os.path.dirname(os.path.realpath(__file__)) + "/../" 8 | if not os.path.exists(BASE_DIR+"/input/"): 9 | raise Exception("Input directory with stellar models not found!") 10 | 11 | PI = np.pi 12 | TWO_PI = PI*2. 13 | DEG2RAD = PI / 180. # conversion factor from degrees to radians 14 | RAD2DEG = 180./PI 15 | 16 | ################################################################################ 17 | # The IAU 2009 system of astronomical constants: the report of the IAU working group on numerical standards for Fundamental Astronomy 18 | # https://en.wikipedia.org/wiki/Astronomical_constant 19 | M_SUN = 1.9818e30 # kg 20 | M2EARTH = 332946.050895 # ratio sun/earth mass 21 | #M_EARTH = M_SUN/M2EARTH # kg 22 | M_EARTH = 1./M2EARTH # 3.0034895963231186e-06 M_SUN 23 | G_SI = 6.67428e-11 # m^3.kg^-1.s^-2 (S.I. units) 24 | AU = 1.49597870700e11 # m 25 | M2AU = 1./AU # 6.684587122268445e-12 AU (1 meter in AU) 26 | 27 | ## Resolution B3 on recommended nominal conversion constants for selected solar and planetary properties 28 | # http://adsabs.harvard.edu/abs/2015arXiv151007674M 29 | R_SUN = 6.957e8 # m 30 | R_SUN = R_SUN/AU # 4.650467260962157e-3 AU 31 | R_EARTH = 6.3781e6 # m 32 | R_EARTH = R_EARTH/AU # 4.263496512454037e-05 AU 33 | ################################################################################ 34 | 35 | #------------------------------------------------------------------------------- 36 | # Constants in S.I. units 37 | #------------------------------------------------------------------------------- 38 | HOUR = 3600. # s 39 | DAY = 24.*HOUR # s 40 | YEAR = 365.25*DAY # s 41 | 42 | #------------------------------------------------------------------------------- 43 | # Constants in the units used in the Mercury code 44 | #------------------------------------------------------------------------------- 45 | G_MERCURY = G_SI/(np.power(AU,3))*M_SUN*(DAY*DAY) # Gravitational constant with Mercury units 46 | G = G_MERCURY 47 | K2 = G_MERCURY 48 | K = np.sqrt(G_MERCURY) # Gaussian constant (in Mercury is 0.01720209895 but it does not follow from the recommended IAU constants) 49 | 50 | # Boltzmann constant and mass of an hydrogen atom from CODATA 2017 51 | # Table 3 of Newell et al. 2018 (https://iopscience.iop.org/article/10.1088/1681-7575/aa950a/pdf) 52 | BOLTZMANN_CONSTANT_SI = 1.380649e-23 # J.K-1 53 | MASS_HYDROGEN_ATOM_SI = 1.672162841e-27 # kg 54 | BOLTZMANN_CONSTANT = BOLTZMANN_CONSTANT_SI/(M_SUN*AU*AU) * DAY*DAY # M_SUN.AU^2.DAY^-2.K-1 55 | MASS_HYDROGEN_ATOM = MASS_HYDROGEN_ATOM_SI/M_SUN # kg 56 | -------------------------------------------------------------------------------- /tests/common/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod stars; 2 | pub mod planets; 3 | pub mod universe; 4 | 5 | use std::error::Error; 6 | use std::fs::File; 7 | use std::io::{BufReader, BufRead}; 8 | 9 | #[allow(dead_code)] 10 | pub fn simulation_properties() -> (f64, f64, f64, f64, f64) { 11 | let time_step: f64 = 0.08; // in days 12 | let time_limit: f64 = time_step*200.; // days 13 | let initial_time: f64 = 1.6e8*365.25; // time [days] where simulation starts 14 | let historic_snapshot_period: f64 = 100.*365.25; // days 15 | let recovery_snapshot_period: f64 = 10.*historic_snapshot_period; // days 16 | (time_step, time_limit, initial_time, historic_snapshot_period, recovery_snapshot_period) 17 | } 18 | 19 | #[allow(dead_code)] 20 | pub fn get_data_dirname(test_name: &String) -> (String, String) { 21 | let rust_data_dirname = format!("tests/data/{0}/", test_name); 22 | let python_data_dirname = format!("posidonius/tests/data/{0}/", test_name); 23 | (rust_data_dirname, python_data_dirname) 24 | } 25 | 26 | #[allow(dead_code)] 27 | pub fn load_kaula_parameters(file_path: &str) -> Result> { 28 | // Open the file 29 | let file = File::open(file_path)?; 30 | let reader = BufReader::new(file); 31 | 32 | // Temporary vectors to hold the columns before assigning them to the struct 33 | let mut w_lm: Vec = Vec::new(); 34 | let mut im_k2: Vec = Vec::new(); 35 | let mut re_k2: Vec = Vec::new(); 36 | 37 | for line in reader.lines() { 38 | let line = line?; 39 | 40 | // Skip lines that are comments (starting with '#') 41 | if line.starts_with('#') { 42 | continue; 43 | } 44 | 45 | // Use split_whitespace() to handle any number of spaces between columns 46 | let parts: Vec<&str> = line.split_whitespace().collect(); 47 | 48 | // Ensure we have at least 3 columns 49 | if parts.len() >= 3 { 50 | w_lm.push(parts[0].parse()?); // Column 0 51 | im_k2.push(parts[1].parse()?); // Column 1 52 | re_k2.push(parts[2].parse()?); // Column 2 53 | } 54 | } 55 | 56 | // Create a zeroed out array for the Kaula parameters (size: 32*32 = 1024) 57 | let mut love_number_excitation_frequency = [0.0; 32 * 32]; 58 | let mut real_part_love_number = [0.0; 32 * 32]; 59 | let mut imaginary_part_love_number = [0.0; 32 * 32]; 60 | 61 | // Fill the arrays with data from the vectors, up to the size of 1024 or the length of the data 62 | let num_datapoints = w_lm.len().min(32 * 32); // Use the minimum of the two lengths 63 | 64 | // Copy data from the vectors into the fixed-size arrays 65 | love_number_excitation_frequency[..num_datapoints].copy_from_slice(&w_lm[..num_datapoints]); 66 | real_part_love_number[..num_datapoints].copy_from_slice(&re_k2[..num_datapoints]); 67 | imaginary_part_love_number[..num_datapoints].copy_from_slice(&im_k2[..num_datapoints]); 68 | 69 | // Build and return the KaulaParameters struct 70 | Ok(posidonius::KaulaParameters { 71 | love_number_excitation_frequency, 72 | real_part_love_number, 73 | imaginary_part_love_number, 74 | num_datapoints: num_datapoints as f64, 75 | polynomials: posidonius::Polynomials::new(), 76 | kaula_tidal_force: posidonius::Axes { x: 0.0, y: 0.0, z: 0.0 }, 77 | }) 78 | } 79 | -------------------------------------------------------------------------------- /posidonius/effects/rotational_flattening.py: -------------------------------------------------------------------------------- 1 | import six 2 | from posidonius.particles.axes import Axes 3 | 4 | class RotationalFlattening(object): 5 | def __init__(self, variant, rotational_flattening_model=None): 6 | self._model = rotational_flattening_model 7 | self._data = { 8 | "effect": "Disabled", 9 | "parameters": { 10 | "internal": { 11 | "distance": 0.0, 12 | "factor_for_the_force_induced_by_planet_rotation": 0.0, 13 | "factor_for_the_force_induced_by_star_rotation": 0.0, 14 | "orthogonal_component_of_the_force_induced_by_planet_rotation": 0.0, 15 | "orthogonal_component_of_the_force_induced_by_star_rotation": 0.0, 16 | "radial_component_of_the_force_induced_by_rotation": 0.0, 17 | "scalar_product_of_vector_position_with_planetary_spin": 0.0, 18 | "scalar_product_of_vector_position_with_stellar_spin": 0.0, 19 | "shape": Axes(0.0, 0.0, 0.0).get(), 20 | }, 21 | "output": { 22 | "acceleration": Axes(0.0, 0.0, 0.0).get(), 23 | "dangular_momentum_dt": Axes(0.0, 0.0, 0.0).get(), 24 | }, 25 | }, 26 | "coordinates": { 27 | "position": Axes(0.0, 0.0, 0.0).get(), 28 | "velocity": Axes(0.0, 0.0, 0.0).get(), 29 | }, 30 | } 31 | if variant in ("CentralBody", "OrbitingBody", ): 32 | self._data["effect"] = {variant: rotational_flattening_model.get()} 33 | elif variant in ("Disabled", ): 34 | self._data["effect"] = variant 35 | else: 36 | raise Exception("Unknown variant '{}'".format(variant)) 37 | 38 | def get(self): 39 | if type(self._data) == str: 40 | return self._data 41 | else: 42 | return self._data.copy() 43 | 44 | class Disabled(RotationalFlattening): 45 | def __init__(self): 46 | super(Disabled, self).__init__("Disabled") 47 | 48 | class OrbitingBody(RotationalFlattening): 49 | def __init__(self, rotational_flattening_model): 50 | super(OrbitingBody, self).__init__("OrbitingBody", rotational_flattening_model=rotational_flattening_model) 51 | 52 | class CentralBody(RotationalFlattening): 53 | def __init__(self, rotational_flattening_model): 54 | super(CentralBody, self).__init__("CentralBody", rotational_flattening_model=rotational_flattening_model) 55 | 56 | class OblateSpheroid(object): 57 | def __init__(self, input_parameters): 58 | self._data = { 59 | "OblateSpheroid": { 60 | "love_number": 0.0, 61 | }, 62 | } 63 | # Update default values, ignore non-recognised keys 64 | for key, value in six.iteritems(input_parameters): 65 | if key in self._data["OblateSpheroid"]: 66 | self._data["OblateSpheroid"][key] = float(value) 67 | else: 68 | print("Ignored parameter: {}".format(key)) 69 | 70 | def get(self): 71 | if type(self._data) == str: 72 | return self._data 73 | else: 74 | return self._data.copy() 75 | 76 | class CreepCoplanar(object): 77 | def __init__(self, input_parameters): 78 | self._data = { 79 | "CreepCoplanar": { 80 | "uniform_viscosity_coefficient": 0.0, 81 | }, 82 | } 83 | # Update default values, ignore non-recognised keys 84 | for key, value in six.iteritems(input_parameters): 85 | if key in self._data["CreepCoplanar"]: 86 | self._data["CreepCoplanar"][key] = float(value) 87 | else: 88 | print("Ignored parameter: {}".format(key)) 89 | 90 | def get(self): 91 | if type(self._data) == str: 92 | return self._data 93 | else: 94 | return self._data.copy() 95 | 96 | -------------------------------------------------------------------------------- /src/effects/wind.rs: -------------------------------------------------------------------------------- 1 | use serde::{Serialize, Deserialize}; 2 | use super::super::constants::{R_SUN}; 3 | use super::super::{Particle}; 4 | use super::super::{Axes}; 5 | 6 | #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] 7 | pub struct WindParticleInputParameters { 8 | pub k_factor: f64, 9 | pub rotation_saturation: f64, 10 | } 11 | 12 | #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] 13 | pub struct WindParticleInternalParameters { 14 | pub rotation_saturation_2: f64, 15 | } 16 | 17 | #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] 18 | pub struct WindParticleOutputParameters { 19 | pub dangular_momentum_dt: Axes, // Force 20 | } 21 | 22 | #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] 23 | pub struct WindParticleParameters { 24 | pub input: WindParticleInputParameters, 25 | pub internal: WindParticleInternalParameters, 26 | pub output: WindParticleOutputParameters, 27 | } 28 | 29 | #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] 30 | pub enum WindEffect { 31 | Interaction, 32 | Disabled, 33 | } 34 | 35 | #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] 36 | pub struct Wind { 37 | pub effect: WindEffect, 38 | pub parameters: WindParticleParameters, 39 | } 40 | 41 | impl Wind { 42 | pub fn new(effect: WindEffect, k_factor: f64, rotation_saturation: f64) -> Wind { 43 | Wind { 44 | effect: effect, 45 | parameters: WindParticleParameters { 46 | input: WindParticleInputParameters { 47 | k_factor: k_factor, 48 | rotation_saturation: rotation_saturation, 49 | }, 50 | internal: WindParticleInternalParameters { 51 | rotation_saturation_2: rotation_saturation.powi(2), 52 | }, 53 | output: WindParticleOutputParameters { 54 | dangular_momentum_dt: Axes{x: 0., y: 0., z: 0.}, 55 | }, 56 | }, 57 | } 58 | } 59 | } 60 | 61 | pub fn initialize(particles: &mut [Particle]) { 62 | for particle in particles.iter_mut() { 63 | if particle.wind.effect == WindEffect::Interaction { 64 | particle.wind.parameters.output.dangular_momentum_dt.x = 0.; 65 | particle.wind.parameters.output.dangular_momentum_dt.y = 0.; 66 | particle.wind.parameters.output.dangular_momentum_dt.z = 0.; 67 | } 68 | } 69 | } 70 | 71 | pub fn calculate_wind_factor(particles: &mut [Particle]) { 72 | // TODO: Verify wind factor 73 | for particle in particles.iter_mut() { 74 | if particle.wind.effect == WindEffect::Interaction { 75 | let threshold = particle.norm_spin_vector_2.sqrt(); 76 | // Eq. 14 from Bolmont & Mathis 2016 (adapted to be able to add to the rest of 77 | // dangular_momentum_dt) 78 | if threshold >= particle.wind.parameters.input.rotation_saturation { 79 | // Fast rotator 80 | particle.wind.parameters.output.dangular_momentum_dt.x = -1. * particle.wind.parameters.input.k_factor * particle.spin.x * particle.wind.parameters.internal.rotation_saturation_2 * (particle.radius/R_SUN * 1./particle.mass).sqrt(); 81 | particle.wind.parameters.output.dangular_momentum_dt.y = -1. * particle.wind.parameters.input.k_factor * particle.spin.y * particle.wind.parameters.internal.rotation_saturation_2 * (particle.radius/R_SUN * 1./particle.mass).sqrt(); 82 | particle.wind.parameters.output.dangular_momentum_dt.z = -1. * particle.wind.parameters.input.k_factor * particle.spin.z * particle.wind.parameters.internal.rotation_saturation_2 * (particle.radius/R_SUN * 1./particle.mass).sqrt(); 83 | } else { 84 | // Slow rotators 85 | particle.wind.parameters.output.dangular_momentum_dt.x = -1. * particle.wind.parameters.input.k_factor * particle.spin.x * particle.norm_spin_vector_2 * (particle.radius/R_SUN * 1./particle.mass).sqrt(); 86 | particle.wind.parameters.output.dangular_momentum_dt.y = -1. * particle.wind.parameters.input.k_factor * particle.spin.y * particle.norm_spin_vector_2 * (particle.radius/R_SUN * 1./particle.mass).sqrt(); 87 | particle.wind.parameters.output.dangular_momentum_dt.z = -1. * particle.wind.parameters.input.k_factor * particle.spin.z * particle.norm_spin_vector_2 * (particle.radius/R_SUN * 1./particle.mass).sqrt(); 88 | } 89 | }; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /posidonius/analysis/history.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pandas as pd 3 | import numpy as np 4 | from numpy.lib.recfunctions import append_fields 5 | import struct 6 | import posidonius.tools 7 | import posidonius.constants 8 | from posidonius.particles.axes import Axes 9 | 10 | #------------------------------------------------------------------------------- 11 | # Functions 12 | #------------------------------------------------------------------------------- 13 | 14 | def read(filename): 15 | f = open(filename, "rb") 16 | # (np.floor(np.log10(np.max((100., 10.)))) - 2.)*10. 17 | 18 | if not os.path.exists(filename): 19 | raise Exception("File does not exists!") 20 | 21 | fields = ('current_time', 'time_step', 'particle', 'position_x', 'position_y', 'position_z', 'spin_x', 'spin_y', 'spin_z', 'velocity_x', 'velocity_y', 'velocity_z', 'mass', 'radius', 'radius_of_gyration_2', 'love_number', 'scaled_dissipation_factor', 'lag_angle', 'denergy_dt', 'migration_timescale', ) 22 | 23 | data = [] 24 | while True: 25 | try: 26 | row = f.read(8+8+4+8*(len(fields)-3)) 27 | #vrow = struct.unpack('> d d i' + ' d'*(len(fields)-3), row) 28 | vrow = struct.unpack('< d d i' + ' d'*(len(fields)-3), row) 29 | except: 30 | break 31 | else: 32 | data.append(vrow) 33 | 34 | data = pd.DataFrame(data, columns=fields, index=np.arange(len(data))) 35 | if len(data) == 0: 36 | raise Exception("Empty file!") 37 | 38 | # Force to always have N lines per snapshot corresponding to N particles 39 | n_particles = int(data['particle'].max())+1 40 | outer_particles = n_particles-1 41 | last_particle = int(data.iloc[-1]['particle']) 42 | excess = (n_particles - (outer_particles - last_particle)) % n_particles 43 | if excess > 0: 44 | data = data[:-1*excess] 45 | data = data.to_records() 46 | return n_particles, data 47 | 48 | def classify(n_particles, data, reference_particle_index=0, discard_first_hundred_years=False): 49 | # Ignore first 100 years 50 | data['current_time'] /= 365.25 # From days to years 51 | if discard_first_hundred_years: 52 | data = data[data['current_time'] >= 100.] 53 | 54 | star = data['particle'] == reference_particle_index 55 | star_data = data[star] 56 | 57 | planets_data = {} 58 | planets_keys = [] # To ensure the order 59 | for i in range(n_particles-1): 60 | planets_data["{}".format(i+1)] = data[data['particle'] == i+1] 61 | planets_keys.append("{}".format(i+1)) 62 | 63 | # From inertial to heliocentric coordinates 64 | n_data_points = len(star_data['position_x']) 65 | zeros = Axes(np.zeros(n_data_points), np.zeros(n_data_points), np.zeros(n_data_points)) 66 | for key in planets_keys: 67 | planets_data[key]['position_x'] -= star_data['position_x'] 68 | planets_data[key]['position_y'] -= star_data['position_y'] 69 | planets_data[key]['position_z'] -= star_data['position_z'] 70 | planets_data[key]['velocity_x'] -= star_data['velocity_x'] 71 | planets_data[key]['velocity_y'] -= star_data['velocity_y'] 72 | planets_data[key]['velocity_z'] -= star_data['velocity_z'] 73 | semimajor_axis = [] 74 | eccentricity = [] 75 | inclination = [] 76 | target_mass = planets_data[key]['mass'] 77 | target_position = Axes(planets_data[key]['position_x'], planets_data[key]['position_y'], planets_data[key]['position_z']) 78 | target_velocity = Axes(planets_data[key]['velocity_x'], planets_data[key]['velocity_y'], planets_data[key]['velocity_z']) 79 | masses = [planets_data[k]['mass'] for k in planets_keys if k != key] 80 | masses.insert(0, star_data['mass']) 81 | positions = [Axes(planets_data[k]['position_x'], planets_data[k]['position_y'], planets_data[k]['position_z']) for k in planets_keys if k != key] 82 | positions.insert(0, zeros) # Star is at the center 83 | velocities = [Axes(planets_data[k]['velocity_x'], planets_data[k]['velocity_y'], planets_data[k]['velocity_z']) for k in planets_keys if k != key] 84 | velocities.insert(0, zeros) # Star is resting 85 | a, q, e, i, p, n, l, f = posidonius.tools.calculate_keplerian_orbital_elements(target_mass, target_position, target_velocity, masses=masses, positions=positions, velocities=velocities) 86 | #a, q, e, i, p, n, l, f = posidonius.tools.calculate_keplerian_orbital_elements(target_mass+star_data['mass'], target_position, target_velocity) 87 | planets_data[key] = append_fields(planets_data[key], ('semi-major_axis', 'eccentricity', 'inclination'), (a, e, i), usemask=False) 88 | star_data['position_x'] = 0. 89 | star_data['position_y'] = 0. 90 | star_data['position_z'] = 0. 91 | star_data['velocity_x'] = 0. 92 | star_data['velocity_y'] = 0. 93 | star_data['velocity_z'] = 0. 94 | return star_data, planets_data, planets_keys 95 | 96 | -------------------------------------------------------------------------------- /src/constants.rs: -------------------------------------------------------------------------------- 1 | use std; 2 | 3 | pub const MAX_PARTICLES : usize = 10; // The optimal value matches the real number of bodies (it will generate smaller snapshots), but a greater number will work too. 4 | pub const MAX_DISTANCE : f64 = 100.; // AU 5 | pub const MAX_DISTANCE_2 : f64 = MAX_DISTANCE*MAX_DISTANCE; // AU (use a negative value to disable) 6 | // 7 | pub const MIN_ORBITAL_PERIOD_TIME_STEP_RATIO : f64 = -1.0; // The orbital period should be 5.0 times greater than the time step to correctly integrate an orbit (use a negative value to disable) 8 | 9 | //// Constants for IAS15 integrator (to be ignored for others) 10 | pub const INTEGRATOR_FORCE_IS_VELOCITYDEPENDENT : bool = true; // Turn this off to safe some time if the force is not velocity dependent (i.e. radiation forces, tides depend on vel.). 11 | pub const INTEGRATOR_EPSILON_GLOBAL : bool = true; // if true: estimate the fractional error by max(acceleration_error)/max(acceleration), where max is take over all particles. 12 | // if false: estimate the fractional error by max(acceleration_error/acceleration). 13 | pub const INTEGRATOR_EPSILON : f64 = 1e-6; // Precision parameter (default: 1e-9) 14 | // If it is zero, then a constant timestep is used. 15 | pub const INTEGRATOR_MIN_DT : f64 = 0.; // Minimum timestep used as a floor when adaptive timestepping is enabled (default: 0.). 16 | pub const INTEGRATOR_MAX_DT : f64 = 0.; // Maximum timestep used as a ceiling when adaptive timestepping is enabled (default: 0. => disabled). 17 | pub const SAFETY_FACTOR : f64 = 0.25; // Maximum increase/deacrease of consecutve timesteps (default: 0.25). 18 | 19 | ///// Constants for WHFast 20 | pub const WHFAST_NMAX_QUART : usize = 64; // Maximum number of iterations for quartic solver 21 | pub const WHFAST_NMAX_NEWT : usize = 32; // Maximum number of iterations for Newton's method 22 | 23 | pub const DBL_EPSILON: f64 = 2.2204460492503131e-16; // https://en.wikipedia.org/wiki/Machine_epsilon 24 | pub const DBL_EPSILON_2 : f64 = DBL_EPSILON*DBL_EPSILON; 25 | 26 | ///// Constants for WHFast 27 | pub const IMPLICIT_MIDPOINT_MIN_ITER : usize = 3; // Minimum number of iterations for implicit midpoint integrator 28 | pub const IMPLICIT_MIDPOINT_MAX_ITER : usize = 10; // Maximum number of iterations for implicit midpoint integrator 29 | 30 | //// Physical constants 31 | pub const PI : f64 = std::f64::consts::PI; 32 | pub const TWO_PI : f64 = std::f64::consts::PI * 2.; 33 | pub const DEG2RAD : f64 = std::f64::consts::PI / 180.; // conversion factor from degrees to radians 34 | pub const HOUR: f64 = 3600.; // s 35 | pub const DAY: f64 = 24.*HOUR; // s 36 | 37 | //////////////////////////////////////////////////////////////////////////////// 38 | // The IAU 2009 system of astronomical constants: the report of the IAU working group on numerical standards for Fundamental Astronomy 39 | // https://en.wikipedia.org/wiki/Astronomical_constant 40 | pub const M_SUN : f64 = 1.9818e30; // Kg 41 | pub const M2EARTH : f64 = 332946.050895; // ratio sun/earth mass 42 | //pub const M_EARTH : f64 = M_SUN/M2EARTH; // kg 43 | pub const M_EARTH : f64 = 1./M2EARTH; // M_SUN 44 | pub const G_SI : f64 = 6.67428e-11; // m^3.kg^-1.s^-2 (S.I. units) 45 | pub const AU : f64 = 1.49597870700e11; // m 46 | pub const M2AU : f64 = 1./AU; // 6.684587122268445e-12 AU (1 meter in AU) 47 | pub const SPEED_OF_LIGHT : f64 = (2.99792458e8/AU)*DAY; // 173.14463267424034 AU/day 48 | pub const SPEED_OF_LIGHT_2 : f64 = SPEED_OF_LIGHT*SPEED_OF_LIGHT; 49 | 50 | // Resolution B3 on recommended nominal conversion constants for selected solar and planetary properties 51 | // http://adsabs.harvard.edu/abs/2015arXiv151007674M 52 | pub const R_SUN : f64 = 6.957e8/AU; // AU 53 | pub const R_EARTH : f64 = 6.3781e6/AU; // AU 54 | //////////////////////////////////////////////////////////////////////////////// 55 | 56 | //////////////////////////////////////////////////////////////////////////////// 57 | // Constants in the units used in the Mercury code 58 | //////////////////////////////////////////////////////////////////////////////// 59 | const G_MERCURY : f64 = G_SI/(AU*AU*AU) * M_SUN * (DAY*DAY); // Gravitational constant with Mercury units 60 | pub const G : f64 = G_MERCURY; 61 | pub const K2 : f64 = G_MERCURY; 62 | //const K : f64 = G_MERCURY.sqrt(); // Gaussian constant (in Mercury is 0.01720209895 but it does not follow from the recommended IAU constants) 63 | 64 | 65 | // Solar system 66 | pub const SUN_DYN_FREQ_2 : f64 = K2/(R_SUN*R_SUN*R_SUN); // Needed for MathisSolarLike 67 | pub const SMOOTHING_FACTOR_DYN_TIDE_COROTATION : f64 = 1.0e-5*86400.; // smoothing factor from Bolmont and Mathis 2016 (rho in Eq.11). Here rho = 1e-5 s-1. 68 | 69 | // Boltzmann constant and mass of an hydrogen atom from CODATA 2017 70 | // Table 3 of Newell et al. 2018 (https://iopscience.iop.org/article/10.1088/1681-7575/aa950a/pdf) 71 | pub const BOLTZMANN_CONSTANT_SI : f64 = 1.380649e-23; // J.K-1 72 | pub const MASS_HYDROGEN_ATOM_SI : f64 = 1.672162841e-27; // kg 73 | pub const BOLTZMANN_CONSTANT : f64 = BOLTZMANN_CONSTANT_SI/(M_SUN*AU*AU) * DAY*DAY; // M_SUN.AU^2.DAY^-2.K-1 74 | pub const MASS_HYDROGEN_ATOM : f64 = MASS_HYDROGEN_ATOM_SI/M_SUN; // kg 75 | -------------------------------------------------------------------------------- /posidonius/effects/tides.py: -------------------------------------------------------------------------------- 1 | import six 2 | from posidonius.particles.axes import Axes 3 | 4 | class Tides(object): 5 | def __init__(self, variant, tidal_model=None): 6 | self._model = tidal_model 7 | self._data = { 8 | "effect": "Disabled", 9 | "parameters": { 10 | "internal": { 11 | "denergy_dt": 0.0, 12 | "distance": 0.0, 13 | "lag_angle": 0.0, 14 | "orthogonal_component_of_the_tidal_force_due_to_planetary_tide": 0.0, 15 | "orthogonal_component_of_the_tidal_force_due_to_stellar_tide": 0.0, 16 | "radial_component_of_the_tidal_force": 0.0, 17 | "radial_component_of_the_tidal_force_dissipative_part_when_star_as_point_mass": 0.0, 18 | "radial_velocity": 0.0, 19 | "scalar_product_of_vector_position_with_planetary_spin": 0.0, 20 | "scalar_product_of_vector_position_with_stellar_spin": 0.0, 21 | "scaled_dissipation_factor": 0.0, 22 | "shape": Axes(0.0, 0.0, 0.0).get(), 23 | }, 24 | "output": { 25 | "acceleration": Axes(0.0, 0.0, 0.0).get(), 26 | "dangular_momentum_dt": Axes(0.0, 0.0, 0.0).get(), 27 | }, 28 | }, 29 | "coordinates": { 30 | "position": Axes(0.0, 0.0, 0.0).get(), 31 | "velocity": Axes(0.0, 0.0, 0.0).get(), 32 | }, 33 | } 34 | if variant in ("CentralBody", "OrbitingBody", ): 35 | self._data["effect"] = {variant: tidal_model.get()} 36 | if isinstance(tidal_model, ConstantTimeLag): 37 | self._data["parameters"]["internal"]["scaled_dissipation_factor"] = self._data["effect"][variant]["ConstantTimeLag"]["dissipation_factor"] * self._data["effect"][variant]["ConstantTimeLag"]["dissipation_factor_scale"] 38 | elif variant in ("Disabled", ): 39 | self._data["effect"] = variant 40 | else: 41 | raise Exception("Unknown variant '{}'".format(variant)) 42 | 43 | def get(self): 44 | if type(self._data) == str: 45 | return self._data 46 | else: 47 | return self._data.copy() 48 | 49 | class Disabled(Tides): 50 | def __init__(self): 51 | super(Disabled, self).__init__("Disabled") 52 | 53 | class OrbitingBody(Tides): 54 | def __init__(self, tidal_model): 55 | super(OrbitingBody, self).__init__("OrbitingBody", tidal_model=tidal_model) 56 | 57 | class CentralBody(Tides): 58 | def __init__(self, tidal_model): 59 | super(CentralBody, self).__init__("CentralBody", tidal_model=tidal_model) 60 | 61 | class ConstantTimeLag(object): 62 | def __init__(self, input_parameters): 63 | self._data = { 64 | "ConstantTimeLag": { 65 | "dissipation_factor_scale": 0.0, 66 | "dissipation_factor": 0.0, 67 | "love_number": 0.0, 68 | }, 69 | } 70 | # Update default values, ignore non-recognised keys 71 | for key, value in six.iteritems(input_parameters): 72 | if key in self._data["ConstantTimeLag"]: 73 | self._data["ConstantTimeLag"][key] = float(value) 74 | else: 75 | print("Ignored parameter: {}".format(key)) 76 | 77 | def get(self): 78 | if type(self._data) == str: 79 | return self._data 80 | else: 81 | return self._data.copy() 82 | 83 | class CreepCoplanar(object): 84 | def __init__(self, input_parameters): 85 | self._data = { 86 | "CreepCoplanar": { 87 | "uniform_viscosity_coefficient": 0.0, 88 | }, 89 | } 90 | # Update default values, ignore non-recognised keys 91 | for key, value in six.iteritems(input_parameters): 92 | if key in self._data["CreepCoplanar"]: 93 | self._data["CreepCoplanar"][key] = float(value) 94 | else: 95 | print("Ignored parameter: {}".format(key)) 96 | 97 | def get(self): 98 | if type(self._data) == str: 99 | return self._data 100 | else: 101 | return self._data.copy() 102 | 103 | class Kaula(object): 104 | def __init__(self, input_parameters): 105 | self._data = { 106 | "Kaula": { 107 | "love_number_excitation_frequency": [0.] * 1024, 108 | "imaginary_part_love_number": [0.] * 1024, 109 | "real_part_love_number": [0.] * 1024, 110 | "num_datapoints": 0.0, 111 | "kaula_tidal_force": Axes( 0.0, 0.0, 0.0).get(), 112 | }, 113 | } 114 | # Update default values, ignore non-recognised keys 115 | for key, value in six.iteritems(input_parameters): 116 | if key in self._data["Kaula"]: 117 | if isinstance(value, (tuple, list)): 118 | self._data["Kaula"][key] = [float(v) for v in value] 119 | else: 120 | self._data["Kaula"][key] = float(value) 121 | else: 122 | print("Ignored parameter: {}".format(key)) 123 | 124 | def get(self): 125 | if type(self._data) == str: 126 | return self._data 127 | else: 128 | return self._data.copy() 129 | -------------------------------------------------------------------------------- /posidonius/integrator/ias15.py: -------------------------------------------------------------------------------- 1 | from posidonius.constants import * 2 | from posidonius.integrator.common import Integrator 3 | 4 | class Ias15(Integrator): 5 | def __init__(self, time_step, recovery_snapshot_period, historic_snapshot_period, universe): 6 | super(Ias15, self).__init__(time_step, recovery_snapshot_period, historic_snapshot_period, universe) 7 | self._data['n_particles'] = universe._data['n_particles'] 8 | self._data['integrator_iterations_max_exceeded'] = 0 9 | self._data['time_step_last_success'] = 0. 10 | #self._data['b'] = [[0.,] * 3*MAX_PARTICLES,] * 7 11 | self._data['b_0'] = [0.,] * 3*MAX_PARTICLES 12 | self._data['b_1'] = [0.,] * 3*MAX_PARTICLES 13 | self._data['b_2'] = [0.,] * 3*MAX_PARTICLES 14 | self._data['b_3'] = [0.,] * 3*MAX_PARTICLES 15 | self._data['b_4'] = [0.,] * 3*MAX_PARTICLES 16 | self._data['b_5'] = [0.,] * 3*MAX_PARTICLES 17 | self._data['b_6'] = [0.,] * 3*MAX_PARTICLES 18 | #self._data['br'] = [[0.,] * 3*MAX_PARTICLES,] * 7 19 | self._data['br_0'] = [0.,] * 3*MAX_PARTICLES 20 | self._data['br_1'] = [0.,] * 3*MAX_PARTICLES 21 | self._data['br_2'] = [0.,] * 3*MAX_PARTICLES 22 | self._data['br_3'] = [0.,] * 3*MAX_PARTICLES 23 | self._data['br_4'] = [0.,] * 3*MAX_PARTICLES 24 | self._data['br_5'] = [0.,] * 3*MAX_PARTICLES 25 | self._data['br_6'] = [0.,] * 3*MAX_PARTICLES 26 | #self._data['g'] = [[0.,] * 3*MAX_PARTICLES,] * 7 27 | self._data['g_0'] = [0.,] * 3*MAX_PARTICLES 28 | self._data['g_1'] = [0.,] * 3*MAX_PARTICLES 29 | self._data['g_2'] = [0.,] * 3*MAX_PARTICLES 30 | self._data['g_3'] = [0.,] * 3*MAX_PARTICLES 31 | self._data['g_4'] = [0.,] * 3*MAX_PARTICLES 32 | self._data['g_5'] = [0.,] * 3*MAX_PARTICLES 33 | self._data['g_6'] = [0.,] * 3*MAX_PARTICLES 34 | #self._data['e'] = [[0.,] * 3*MAX_PARTICLES,] * 7 35 | self._data['e_0'] = [0.,] * 3*MAX_PARTICLES 36 | self._data['e_1'] = [0.,] * 3*MAX_PARTICLES 37 | self._data['e_2'] = [0.,] * 3*MAX_PARTICLES 38 | self._data['e_3'] = [0.,] * 3*MAX_PARTICLES 39 | self._data['e_4'] = [0.,] * 3*MAX_PARTICLES 40 | self._data['e_5'] = [0.,] * 3*MAX_PARTICLES 41 | self._data['e_6'] = [0.,] * 3*MAX_PARTICLES 42 | #self._data['er'] = [[0.,] * 3*MAX_PARTICLES,] * 7 43 | self._data['er_0'] = [0.,] * 3*MAX_PARTICLES 44 | self._data['er_1'] = [0.,] * 3*MAX_PARTICLES 45 | self._data['er_2'] = [0.,] * 3*MAX_PARTICLES 46 | self._data['er_3'] = [0.,] * 3*MAX_PARTICLES 47 | self._data['er_4'] = [0.,] * 3*MAX_PARTICLES 48 | self._data['er_5'] = [0.,] * 3*MAX_PARTICLES 49 | self._data['er_6'] = [0.,] * 3*MAX_PARTICLES 50 | self._data['at'] = [0.,] * 3*MAX_PARTICLES 51 | self._data['x0'] = [0.,] * 3*MAX_PARTICLES 52 | self._data['v0'] = [0.,] * 3*MAX_PARTICLES 53 | self._data['a0'] = [0.,] * 3*MAX_PARTICLES 54 | #self._data['sb'] = [[0.,] * 3*MAX_PARTICLES,] * 7 55 | self._data['sb_0'] = [0.,] * 3*MAX_PARTICLES 56 | self._data['sb_1'] = [0.,] * 3*MAX_PARTICLES 57 | self._data['sb_2'] = [0.,] * 3*MAX_PARTICLES 58 | self._data['sb_3'] = [0.,] * 3*MAX_PARTICLES 59 | self._data['sb_4'] = [0.,] * 3*MAX_PARTICLES 60 | self._data['sb_5'] = [0.,] * 3*MAX_PARTICLES 61 | self._data['sb_6'] = [0.,] * 3*MAX_PARTICLES 62 | #self._data['sbr'] = [[0.,] * 3*MAX_PARTICLES,] * 7 63 | self._data['sbr_0'] = [0.,] * 3*MAX_PARTICLES 64 | self._data['sbr_1'] = [0.,] * 3*MAX_PARTICLES 65 | self._data['sbr_2'] = [0.,] * 3*MAX_PARTICLES 66 | self._data['sbr_3'] = [0.,] * 3*MAX_PARTICLES 67 | self._data['sbr_4'] = [0.,] * 3*MAX_PARTICLES 68 | self._data['sbr_5'] = [0.,] * 3*MAX_PARTICLES 69 | self._data['sbr_6'] = [0.,] * 3*MAX_PARTICLES 70 | #self._data['sg'] = [[0.,] * 3*MAX_PARTICLES,] * 7 71 | self._data['sg_0'] = [0.,] * 3*MAX_PARTICLES 72 | self._data['sg_1'] = [0.,] * 3*MAX_PARTICLES 73 | self._data['sg_2'] = [0.,] * 3*MAX_PARTICLES 74 | self._data['sg_3'] = [0.,] * 3*MAX_PARTICLES 75 | self._data['sg_4'] = [0.,] * 3*MAX_PARTICLES 76 | self._data['sg_5'] = [0.,] * 3*MAX_PARTICLES 77 | self._data['sg_6'] = [0.,] * 3*MAX_PARTICLES 78 | #self._data['se'] = [[0.,] * 3*MAX_PARTICLES,] * 7 79 | self._data['se_0'] = [0.,] * 3*MAX_PARTICLES 80 | self._data['se_1'] = [0.,] * 3*MAX_PARTICLES 81 | self._data['se_2'] = [0.,] * 3*MAX_PARTICLES 82 | self._data['se_3'] = [0.,] * 3*MAX_PARTICLES 83 | self._data['se_4'] = [0.,] * 3*MAX_PARTICLES 84 | self._data['se_5'] = [0.,] * 3*MAX_PARTICLES 85 | self._data['se_6'] = [0.,] * 3*MAX_PARTICLES 86 | #self._data['ser'] = [[0.,] * 3*MAX_PARTICLES,] * 7 87 | self._data['ser_0'] = [0.,] * 3*MAX_PARTICLES 88 | self._data['ser_1'] = [0.,] * 3*MAX_PARTICLES 89 | self._data['ser_2'] = [0.,] * 3*MAX_PARTICLES 90 | self._data['ser_3'] = [0.,] * 3*MAX_PARTICLES 91 | self._data['ser_4'] = [0.,] * 3*MAX_PARTICLES 92 | self._data['ser_5'] = [0.,] * 3*MAX_PARTICLES 93 | self._data['ser_6'] = [0.,] * 3*MAX_PARTICLES 94 | self._data['dangular_momentum_dtt'] = [0.,] * 3*MAX_PARTICLES 95 | self._data['dangular_momentum_dt0'] = [0.,] * 3*MAX_PARTICLES 96 | self._data['angular_momentum0'] = [0.,] * 3*MAX_PARTICLES 97 | self._data['csx'] = [0.,] * 3*MAX_PARTICLES 98 | self._data['csv'] = [0.,] * 3*MAX_PARTICLES 99 | self._data['css'] = [0.,] * 3*MAX_PARTICLES 100 | self._data['s'] = [0.,] * 9 101 | 102 | -------------------------------------------------------------------------------- /src/effects/rotational_flattening/creep_coplanar.rs: -------------------------------------------------------------------------------- 1 | // Implemented by Gabriel Oliveira Gomes 2 | // Described in Gomes et al (2021): https://ui.adsabs.harvard.edu/abs/2021A%26A...651A..23G/abstract 3 | use super::super::super::constants::{K2}; 4 | use super::super::super::{Particle}; 5 | use super::super::super::{Axes}; 6 | use super::super::tides::creep_coplanar::calculate_creep_coplanar_shape; 7 | use super::super::rotational_flattening::RotationalFlatteningEffect; 8 | use super::super::rotational_flattening::RotationalFlatteningModel; 9 | 10 | pub fn calculate_creep_coplanar_shapes(rotational_flattening_host_particle: &mut Particle, particles: &mut [Particle], more_particles: &mut [Particle]) { 11 | for particle in particles.iter_mut().chain(more_particles.iter_mut()) { 12 | let particle_uniform_viscosity_coefficient = match particle.rotational_flattening.effect { 13 | RotationalFlatteningEffect::CentralBody(rotational_flattening_model) | RotationalFlatteningEffect::OrbitingBody(rotational_flattening_model) => { 14 | if let RotationalFlatteningModel::CreepCoplanar(params) = rotational_flattening_model { 15 | params.uniform_viscosity_coefficient 16 | } else { 17 | 0. 18 | } 19 | }, 20 | _ => 0., 21 | }; 22 | if particle_uniform_viscosity_coefficient == 0. { 23 | continue 24 | } 25 | let consider_tides = false; 26 | let consider_rotational_flattening = true; 27 | let central_body = false; 28 | let shape = calculate_creep_coplanar_shape(&rotational_flattening_host_particle, &particle, consider_tides, consider_rotational_flattening, central_body); 29 | particle.rotational_flattening.parameters.internal.shape = shape; 30 | } 31 | } 32 | 33 | 34 | pub fn calculate_torque_induced_by_rotational_flattening(rotational_flattening_host_particle: &Particle, particle: &Particle, central_body:bool) -> Axes { 35 | let torque_induced_by_rotational_flattening_x: f64 = 0.; 36 | let torque_induced_by_rotational_flattening_y: f64 = 0.; 37 | //let torque_induced_by_rotational_flattening_z: f64 = 0.0; 38 | 39 | // Torque expression for studying creep tide tidal despinning (use torque = 0 as above to study stat. rotation, makes code run faster) 40 | 41 | let torque_induced_by_rotational_flattening_z = match central_body { 42 | true => { 43 | // Host shape is planet dependent, it needs to be computed for each 44 | let consider_tides = false; 45 | let consider_rotational_flattening = true; 46 | let rotational_flattening_host_shape = calculate_creep_coplanar_shape(&rotational_flattening_host_particle, &particle, consider_tides, consider_rotational_flattening, central_body); 47 | 3.0 / 5.0 48 | * K2 49 | * rotational_flattening_host_particle.mass 50 | * particle.mass 51 | * rotational_flattening_host_particle.radius 52 | * rotational_flattening_host_particle.radius 53 | * rotational_flattening_host_shape.y 54 | / particle.rotational_flattening.parameters.internal.distance.powi(3) 55 | }, 56 | false => { 57 | // Planet shape is host dependent and it was already computed 58 | 3.0 / 5.0 59 | * K2 60 | * particle.mass 61 | * rotational_flattening_host_particle.mass 62 | * particle.radius 63 | * particle.radius 64 | * particle.rotational_flattening.parameters.internal.shape.y 65 | / particle.rotational_flattening.parameters.internal.distance.powi(3) 66 | } 67 | }; 68 | 69 | Axes{x: torque_induced_by_rotational_flattening_x, y: torque_induced_by_rotational_flattening_y, z: torque_induced_by_rotational_flattening_z} 70 | } 71 | 72 | pub fn calculate_acceleration_induced_by_rotational_flattering(rotational_flattening_host_particle: &Particle, particle: &Particle) -> Axes { 73 | let distance_4 = particle.rotational_flattening.parameters.internal.distance.powi(4); 74 | 75 | // Factorize common terms; 76 | 77 | // Expression for ONLY rotational flattenings 78 | let total_force_induced_by_rotational_flattening_x = particle.rotational_flattening.coordinates.position.x / particle.rotational_flattening.parameters.internal.distance 79 | * (-3.0 80 | * K2 81 | * particle.mass 82 | * rotational_flattening_host_particle.mass 83 | * particle.radius 84 | * particle.radius 85 | / (5.0 * distance_4) 86 | * particle.rotational_flattening.parameters.internal.shape.z); 87 | 88 | // Expression for ONLY rotational flattenings 89 | let total_force_induced_by_rotational_flattening_y = particle.rotational_flattening.coordinates.position.y / particle.rotational_flattening.parameters.internal.distance 90 | * (-3.0 91 | * K2 92 | * particle.mass 93 | * rotational_flattening_host_particle.mass 94 | * particle.radius 95 | * particle.radius 96 | / (5.0 * distance_4) 97 | * particle.rotational_flattening.parameters.internal.shape.z); 98 | 99 | let total_force_induced_by_rotational_flattening_z = 0.0; 100 | // println!("{} {} {}", particle.rotational_flattening.parameters.internal.shape.x, particle.rotational_flattening.parameters.internal.shape.y, particle.rotational_flattening.parameters.internal.shape.z); 101 | //println!("{}", total_force_induced_by_rotational_flattening_y); 102 | 103 | Axes{x: total_force_induced_by_rotational_flattening_x, y: total_force_induced_by_rotational_flattening_y, z: total_force_induced_by_rotational_flattening_z} 104 | } 105 | 106 | -------------------------------------------------------------------------------- /tests/test_tides_creep.rs: -------------------------------------------------------------------------------- 1 | extern crate posidonius; 2 | extern crate serde; 3 | #[macro_use] 4 | extern crate serde_derive; 5 | extern crate serde_json; 6 | 7 | mod common; 8 | use std::path::Path; 9 | 10 | fn enabled_tides_case() -> posidonius::WHFast { 11 | let (time_step, time_limit, initial_time, historic_snapshot_period, recovery_snapshot_period) = common::simulation_properties(); 12 | let consider_effects = posidonius::ConsiderEffects { 13 | tides: true, 14 | rotational_flattening: true, 15 | general_relativity: true, 16 | disk: true, 17 | wind: true, 18 | evolution: true, 19 | }; 20 | let general_relativity_implementation = posidonius::GeneralRelativityImplementation::Kidder1995; // Mercury-T 21 | //let general_relativity_implementation = posidonius::GeneralRelativityImplementation::Anderson1975; // REBOUNDx GR 22 | //let general_relativity_implementation = posidonius::GeneralRelativityImplementation::Newhall1983; // REBOUNDx GR full 23 | 24 | let star_mass: f64 = 0.08; // Solar masses 25 | //let star_evolution = posidonius::EvolutionType::Baraffe1998(star_mass); // M-Dwarf (mass = 0.10) or SolarLike ConstantDissipation (mass = 1.0) 26 | //let star_evolution = posidonius::EvolutionType::Baraffe2015(star_mass); // mass = 0.01 .. 1.40 27 | let star_evolution = posidonius::EvolutionType::Leconte2011(star_mass); // BrownDwarf (mass = 0.01 .. 0.08) 28 | //let star_evolution = posidonius::EvolutionType::BolmontMathis2016(star_mass); // SolarLike Evolving dissipation (mass = 0.40 .. 1.40) 29 | //let star_evolution = posidonius::EvolutionType::GalletBolmont2017(star_mass); // SolarLike Evolving dissipation (mass = 0.30 .. 1.40) 30 | //let star_evolution = posidonius::EvolutionType::LeconteChabrier2013; // Jupiter 31 | //let star_evolution = posidonius::EvolutionType::NonEvolving; 32 | let star = common::stars::brown_dwarf(star_mass, star_evolution, general_relativity_implementation); 33 | 34 | let mut particles = vec![star.clone()]; 35 | particles.extend(common::planets::basic_configuration(&star)); 36 | ////////////////////////////////////////////////////////////////////////////////// 37 | // Disable all first or `check_uniform_viscosity_coefficient` will fail 38 | let disabled_tides = posidonius::Tides::new(posidonius::TidesEffect::Disabled); 39 | let disabled_rotational_flattening = posidonius::RotationalFlattening::new(posidonius::RotationalFlatteningEffect::Disabled); 40 | for particle in particles.iter_mut() { 41 | particle.set_tides(disabled_tides); 42 | particle.set_rotational_flattening(disabled_rotational_flattening); 43 | } 44 | ////////////////////////////////////////////////////////////////////////////////// 45 | let star_tides = disabled_tides; 46 | let star_rotational_flattening = disabled_rotational_flattening; 47 | let uniform_viscosity_coefficient = 1.0e22 * posidonius::constants::AU * posidonius::constants::DAY / posidonius::constants::M_SUN; // value in kg s^-1 m^-1 => M_SUN day^-1 AU^-1 for the viscosity 48 | let planet_tidal_model_params = posidonius::CreepCoplanarParameters{uniform_viscosity_coefficient: uniform_viscosity_coefficient}; 49 | let planet_rotational_flattening = posidonius::RotationalFlattening::new(posidonius::RotationalFlatteningEffect::OrbitingBody(posidonius::RotationalFlatteningModel::CreepCoplanar(planet_tidal_model_params))); 50 | let planet_tides = posidonius::Tides::new(posidonius::TidesEffect::OrbitingBody(posidonius::TidalModel::CreepCoplanar(planet_tidal_model_params))); 51 | if let Some((star, planets)) = particles.split_first_mut() { 52 | // Change from constant time lag to disabled: 53 | star.set_tides(star_tides); 54 | star.set_rotational_flattening(star_rotational_flattening); 55 | // Change from constant time lag to creep: 56 | for planet in planets.iter_mut() { 57 | planet.set_rotational_flattening(planet_rotational_flattening); 58 | planet.set_tides(planet_tides); 59 | } 60 | } 61 | ////////////////////////////////////////////////////////////////////////////////// 62 | let universe = posidonius::Universe::new(initial_time, time_limit, particles, consider_effects); 63 | 64 | let alternative_coordinates_type = posidonius::whfast::CoordinatesType::Jacobi; 65 | //let alternative_coordinates_type = posidonius::whfast::CoordinatesType::DemocraticHeliocentric; 66 | //let alternative_coordinates_type = posidonius::whfast::CoordinatesType::WHDS; 67 | //let universe_integrator = posidonius::LeapFrog::new(time_step, recovery_snapshot_period, historic_snapshot_period, universe); 68 | //let universe_integrator = posidonius::Ias15::new(time_step, recovery_snapshot_period, historic_snapshot_period, universe); 69 | let universe_integrator = posidonius::WHFast::new(time_step, recovery_snapshot_period, historic_snapshot_period, universe, alternative_coordinates_type); 70 | universe_integrator 71 | } 72 | 73 | #[test] 74 | fn enabled_tides_rust() { 75 | let test_name = format!("{}-{}", Path::new(file!()).file_stem().unwrap().to_str().unwrap(), "enabled_tides"); 76 | let (rust_data_dirname, _python_data_dirname) = common::get_data_dirname(&test_name); 77 | // 78 | let mut universe_integrator = enabled_tides_case(); 79 | common::universe::iterate(&mut universe_integrator); 80 | common::universe::store_positions_unless_files_exist(&universe_integrator.universe, &rust_data_dirname); 81 | common::universe::assert_stored_positions(&universe_integrator.universe, &rust_data_dirname); 82 | } 83 | 84 | //// TODO: 85 | //#[test] 86 | //fn enabled_tides_rust_vs_python() { 87 | //let test_name = format!("{}-{}", Path::new(file!()).file_stem().unwrap().to_str().unwrap(), "enabled_tides"); 88 | //let (rust_data_dirname, python_data_dirname) = common::get_data_dirname(&test_name); 89 | //let mut universe_integrator = enabled_tides_case(); 90 | //common::universe::store_unless_files_exist(&universe_integrator, &rust_data_dirname); // Store just in case we want to inspect it/compare it to the python generated JSON 91 | //common::universe::one_step(&mut universe_integrator); 92 | //let parallel_universe_from_json = common::universe::one_step_from_json(&python_data_dirname); 93 | //common::universe::loosly_assert(&universe_integrator.universe, ¶llel_universe_from_json); // Built in situ vs Restored from JSON: it requires larger precision and only one step 94 | //let parallel_universe_from_json = common::universe::iterate_universe_from_json(&python_data_dirname); 95 | //let universe_from_json = common::universe::iterate_universe_from_json(&rust_data_dirname); 96 | //common::universe::assert(&universe_from_json, ¶llel_universe_from_json); 97 | //} 98 | 99 | //////////////////////////////////////////////////////////////////////////////// 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /posidonius/tests/test_tides.py: -------------------------------------------------------------------------------- 1 | import os 2 | import inspect 3 | import shutil 4 | import filecmp 5 | import posidonius 6 | from posidonius.tests import common 7 | from posidonius.tests.test_base import TestBase 8 | 9 | class Tides(TestBase): 10 | 11 | def setUp(self): 12 | TestBase.setUp(self) 13 | self.current_filename, ignore = os.path.splitext(os.path.basename(__file__)) # Filename without extension 14 | self.current_dirname = os.path.dirname(inspect.getfile(inspect.currentframe())) 15 | 16 | def tearDown(self): 17 | TestBase.tearDown(self) 18 | 19 | def test_enabled_tides(self): 20 | current_function_name = inspect.stack()[0][3][5:] # Remove first 5 characters "test_" 21 | expected_json_filename, json_filename = common.setup(self.current_dirname, self.current_filename, current_function_name) 22 | 23 | initial_time, time_step, time_limit, historic_snapshot_period, recovery_snapshot_period = common.simulation_properties() 24 | consider_effects = posidonius.ConsiderEffects({ 25 | "tides": True, 26 | "rotational_flattening": True, 27 | "general_relativity": True, 28 | "disk": True, 29 | "wind": True, 30 | "evolution": True, 31 | }) 32 | general_relativity_implementation = "Kidder1995" # Assumes one central massive body 33 | #general_relativity_implementation = "Anderson1975" # Assumes one central massive body 34 | #general_relativity_implementation = "Newhall1983" # Considers all bodies 35 | universe = posidonius.Universe(initial_time, time_limit, time_step, recovery_snapshot_period, historic_snapshot_period, consider_effects) 36 | 37 | star_mass = 0.08 # Solar masses 38 | star_dissipation_factor_scale = 1.0 39 | star_position = posidonius.Axes(0., 0., 0.) 40 | star_velocity = posidonius.Axes(0., 0., 0.) 41 | 42 | #star_evolution = posidonius.Baraffe1998(star_mass) # M-Dwarf (mass = 0.10) or SolarLike ConstantDissipation (mass = 1.0) 43 | #star_evolution = posidonius.Baraffe2015(star_mass) # mass = 0.01 .. 1.40 44 | star_evolution = posidonius.Leconte2011(star_mass) # BrownDwarf (mass = 0.01 .. 0.08) 45 | #star_evolution = posidonius.BolmontMathis2016(star_mass) # SolarLike Evolving dissipation (mass = 0.40 .. 1.40) 46 | #star_evolution = posidonius.GalletBolmont2017(star_mass) # SolarLike Evolving dissipation (mass = 0.30 .. 1.40) 47 | #star_evolution = posidonius.LeconteChabrier2013(False) # Jupiter without dissipation of dynamical tides 48 | #star_evolution = posidonius.LeconteChabrier2013(True) # Jupiter with dissipation of dynamical tides 49 | #star_evolution = posidonius.NonEvolving() 50 | star = common.brown_dwarf(star_mass, star_dissipation_factor_scale, star_position, star_velocity, general_relativity_implementation, star_evolution) 51 | universe.add_particle(star) 52 | common.basic_configuration(universe) 53 | 54 | ############################################################################ 55 | whfast_alternative_coordinates="Jacobi" 56 | #whfast_alternative_coordinates="DemocraticHeliocentric" 57 | #whfast_alternative_coordinates="WHDS" 58 | #universe.write(json_filename, integrator="LeapFrog") 59 | #universe.write(json_filename, integrator="IAS15") 60 | universe.write(json_filename, integrator="WHFast", whfast_alternative_coordinates=whfast_alternative_coordinates) 61 | 62 | if not os.path.exists(expected_json_filename): 63 | shutil.copyfile(json_filename, expected_json_filename) 64 | 65 | self.assertTrue(filecmp.cmp(json_filename, expected_json_filename, shallow=False), "Generated JSON case is not equal to the expected one: {} {}".format(json_filename, expected_json_filename)) 66 | shutil.rmtree(os.path.dirname(json_filename)) 67 | 68 | def test_disabled_tides(self): 69 | current_function_name = inspect.stack()[0][3][5:] # Remove first 5 characters "test_" 70 | expected_json_filename, json_filename = common.setup(self.current_dirname, self.current_filename, current_function_name) 71 | 72 | initial_time, time_step, time_limit, historic_snapshot_period, recovery_snapshot_period = common.simulation_properties() 73 | consider_effects = posidonius.ConsiderEffects({ 74 | "tides": False, 75 | "rotational_flattening": True, 76 | "general_relativity": True, 77 | "disk": True, 78 | "wind": True, 79 | "evolution": True, 80 | }) 81 | general_relativity_implementation = "Kidder1995" # Assumes one central massive body 82 | #general_relativity_implementation = "Anderson1975" # Assumes one central massive body 83 | #general_relativity_implementation = "Newhall1983" # Considers all bodies 84 | universe = posidonius.Universe(initial_time, time_limit, time_step, recovery_snapshot_period, historic_snapshot_period, consider_effects) 85 | 86 | star_mass = 0.08 # Solar masses 87 | star_dissipation_factor_scale = 1.0 88 | star_position = posidonius.Axes(0., 0., 0.) 89 | star_velocity = posidonius.Axes(0., 0., 0.) 90 | 91 | #star_evolution = posidonius.Baraffe1998(star_mass) # M-Dwarf (mass = 0.10) or SolarLike ConstantDissipation (mass = 1.0) 92 | #star_evolution = posidonius.Baraffe2015(star_mass) # mass = 0.01 .. 1.40 93 | star_evolution = posidonius.Leconte2011(star_mass) # BrownDwarf (mass = 0.01 .. 0.08) 94 | #star_evolution = posidonius.BolmontMathis2016(star_mass) # SolarLike Evolving dissipation (mass = 0.40 .. 1.40) 95 | #star_evolution = posidonius.GalletBolmont2017(star_mass) # SolarLike Evolving dissipation (mass = 0.30 .. 1.40) 96 | #star_evolution = posidonius.LeconteChabrier2013(False) # Jupiter without dissipation of dynamical tides 97 | #star_evolution = posidonius.LeconteChabrier2013(True) # Jupiter with dissipation of dynamical tides 98 | #star_evolution = posidonius.NonEvolving() 99 | star = common.brown_dwarf(star_mass, star_dissipation_factor_scale, star_position, star_velocity, general_relativity_implementation, star_evolution) 100 | universe.add_particle(star) 101 | common.basic_configuration(universe) 102 | 103 | ############################################################################ 104 | whfast_alternative_coordinates="Jacobi" 105 | #whfast_alternative_coordinates="DemocraticHeliocentric" 106 | #whfast_alternative_coordinates="WHDS" 107 | #universe.write(json_filename, integrator="LeapFrog") 108 | #universe.write(json_filename, integrator="IAS15") 109 | universe.write(json_filename, integrator="WHFast", whfast_alternative_coordinates=whfast_alternative_coordinates) 110 | 111 | if not os.path.exists(expected_json_filename): 112 | shutil.copyfile(json_filename, expected_json_filename) 113 | 114 | self.assertTrue(filecmp.cmp(json_filename, expected_json_filename, shallow=False), "Generated JSON case is not equal to the expected one: {} {}".format(json_filename, expected_json_filename)) 115 | shutil.rmtree(os.path.dirname(json_filename)) 116 | 117 | -------------------------------------------------------------------------------- /posidonius/tests/test_flattening.py: -------------------------------------------------------------------------------- 1 | import os 2 | import inspect 3 | import shutil 4 | import filecmp 5 | import posidonius 6 | from posidonius.tests import common 7 | from posidonius.tests.test_base import TestBase 8 | 9 | class Flattening(TestBase): 10 | 11 | def setUp(self): 12 | TestBase.setUp(self) 13 | self.current_filename, ignore = os.path.splitext(os.path.basename(__file__)) # Filename without extension 14 | self.current_dirname = os.path.dirname(inspect.getfile(inspect.currentframe())) 15 | 16 | def tearDown(self): 17 | TestBase.tearDown(self) 18 | 19 | def test_disabled_flattening(self): 20 | current_function_name = inspect.stack()[0][3][5:] # Remove first 5 characters "test_" 21 | expected_json_filename, json_filename = common.setup(self.current_dirname, self.current_filename, current_function_name) 22 | 23 | initial_time, time_step, time_limit, historic_snapshot_period, recovery_snapshot_period = common.simulation_properties() 24 | consider_effects = posidonius.ConsiderEffects({ 25 | "tides": True, 26 | "rotational_flattening": False, 27 | "general_relativity": True, 28 | "disk": True, 29 | "wind": True, 30 | "evolution": True, 31 | }) 32 | general_relativity_implementation = "Kidder1995" # Assumes one central massive body 33 | #general_relativity_implementation = "Anderson1975" # Assumes one central massive body 34 | #general_relativity_implementation = "Newhall1983" # Considers all bodies 35 | universe = posidonius.Universe(initial_time, time_limit, time_step, recovery_snapshot_period, historic_snapshot_period, consider_effects) 36 | 37 | star_mass = 0.08 # Solar masses 38 | star_dissipation_factor_scale = 1.0 39 | star_position = posidonius.Axes(0., 0., 0.) 40 | star_velocity = posidonius.Axes(0., 0., 0.) 41 | 42 | #star_evolution = posidonius.Baraffe1998(star_mass) # M-Dwarf (mass = 0.10) or SolarLike ConstantDissipation (mass = 1.0) 43 | #star_evolution = posidonius.Baraffe2015(star_mass) # mass = 0.01 .. 1.40 44 | star_evolution = posidonius.Leconte2011(star_mass) # BrownDwarf (mass = 0.01 .. 0.08) 45 | #star_evolution = posidonius.BolmontMathis2016(star_mass) # SolarLike Evolving dissipation (mass = 0.40 .. 1.40) 46 | #star_evolution = posidonius.GalletBolmont2017(star_mass) # SolarLike Evolving dissipation (mass = 0.30 .. 1.40) 47 | #star_evolution = posidonius.LeconteChabrier2013(False) # Jupiter without dissipation of dynamical tides 48 | #star_evolution = posidonius.LeconteChabrier2013(True) # Jupiter with dissipation of dynamical tides 49 | #star_evolution = posidonius.NonEvolving() 50 | star = common.brown_dwarf(star_mass, star_dissipation_factor_scale, star_position, star_velocity, general_relativity_implementation, star_evolution) 51 | universe.add_particle(star) 52 | common.basic_configuration(universe) 53 | 54 | ############################################################################ 55 | whfast_alternative_coordinates="Jacobi" 56 | #whfast_alternative_coordinates="DemocraticHeliocentric" 57 | #whfast_alternative_coordinates="WHDS" 58 | #universe.write(json_filename, integrator="LeapFrog") 59 | #universe.write(json_filename, integrator="IAS15") 60 | universe.write(json_filename, integrator="WHFast", whfast_alternative_coordinates=whfast_alternative_coordinates) 61 | 62 | if not os.path.exists(expected_json_filename): 63 | shutil.copyfile(json_filename, expected_json_filename) 64 | 65 | self.assertTrue(filecmp.cmp(json_filename, expected_json_filename, shallow=False), "Generated JSON case is not equal to the expected one: {} {}".format(json_filename, expected_json_filename)) 66 | shutil.rmtree(os.path.dirname(json_filename)) 67 | 68 | def test_enabled_flattening(self): 69 | current_function_name = inspect.stack()[0][3][5:] # Remove first 5 characters "test_" 70 | expected_json_filename, json_filename = common.setup(self.current_dirname, self.current_filename, current_function_name) 71 | 72 | initial_time, time_step, time_limit, historic_snapshot_period, recovery_snapshot_period = common.simulation_properties() 73 | consider_effects = posidonius.ConsiderEffects({ 74 | "tides": True, 75 | "rotational_flattening": True, 76 | "general_relativity": True, 77 | "disk": True, 78 | "wind": True, 79 | "evolution": True, 80 | }) 81 | general_relativity_implementation = "Kidder1995" # Assumes one central massive body 82 | #general_relativity_implementation = "Anderson1975" # Assumes one central massive body 83 | #general_relativity_implementation = "Newhall1983" # Considers all bodies 84 | universe = posidonius.Universe(initial_time, time_limit, time_step, recovery_snapshot_period, historic_snapshot_period, consider_effects) 85 | 86 | star_mass = 0.08 # Solar masses 87 | star_dissipation_factor_scale = 1.0 88 | star_position = posidonius.Axes(0., 0., 0.) 89 | star_velocity = posidonius.Axes(0., 0., 0.) 90 | 91 | #star_evolution = posidonius.Baraffe1998(star_mass) # M-Dwarf (mass = 0.10) or SolarLike ConstantDissipation (mass = 1.0) 92 | #star_evolution = posidonius.Baraffe2015(star_mass) # mass = 0.01 .. 1.40 93 | star_evolution = posidonius.Leconte2011(star_mass) # BrownDwarf (mass = 0.01 .. 0.08) 94 | #star_evolution = posidonius.BolmontMathis2016(star_mass) # SolarLike Evolving dissipation (mass = 0.40 .. 1.40) 95 | #star_evolution = posidonius.GalletBolmont2017(star_mass) # SolarLike Evolving dissipation (mass = 0.30 .. 1.40) 96 | #star_evolution = posidonius.LeconteChabrier2013(False) # Jupiter without dissipation of dynamical tides 97 | #star_evolution = posidonius.LeconteChabrier2013(True) # Jupiter with dissipation of dynamical tides 98 | #star_evolution = posidonius.NonEvolving() 99 | star = common.brown_dwarf(star_mass, star_dissipation_factor_scale, star_position, star_velocity, general_relativity_implementation, star_evolution) 100 | universe.add_particle(star) 101 | common.basic_configuration(universe) 102 | 103 | ############################################################################ 104 | whfast_alternative_coordinates="Jacobi" 105 | #whfast_alternative_coordinates="DemocraticHeliocentric" 106 | #whfast_alternative_coordinates="WHDS" 107 | #universe.write(json_filename, integrator="LeapFrog") 108 | #universe.write(json_filename, integrator="IAS15") 109 | universe.write(json_filename, integrator="WHFast", whfast_alternative_coordinates=whfast_alternative_coordinates) 110 | 111 | if not os.path.exists(expected_json_filename): 112 | shutil.copyfile(json_filename, expected_json_filename) 113 | 114 | self.assertTrue(filecmp.cmp(json_filename, expected_json_filename, shallow=False), "Generated JSON case is not equal to the expected one: {} {}".format(json_filename, expected_json_filename)) 115 | shutil.rmtree(os.path.dirname(json_filename)) 116 | 117 | -------------------------------------------------------------------------------- /scripts/explore_single_resonance.py: -------------------------------------------------------------------------------- 1 | """ 2 | Based on a script developed by Dr. Christophe Cossou 3 | """ 4 | import sys 5 | import os 6 | import numpy as np 7 | import pandas as pd 8 | import matplotlib as mpl 9 | mpl.use('Agg') 10 | import matplotlib.pyplot as plt 11 | from matplotlib.ticker import FormatStrFormatter, ScalarFormatter 12 | import struct 13 | import argparse 14 | import posidonius 15 | 16 | 17 | ANGLE_MIN = - 90. 18 | ANGLE_MAX = 270. 19 | 20 | if __name__ == "__main__": 21 | parser = argparse.ArgumentParser() 22 | parser.add_argument('historic_snapshot_filename', action='store', help='Filename with the historic snapshots of the simulation (e.g., universe_integrator_history.bin)') 23 | parser.add_argument('inner_planet', action='store', type=int, help='Inner planet number') 24 | parser.add_argument('outer_planet', action='store', type=int, help='Outer planet number') 25 | parser.add_argument('inner_period', action='store', type=int, help='Inner period') 26 | parser.add_argument('outer_period', action='store', type=int, help='Outer period') 27 | 28 | args = parser.parse_args() 29 | 30 | if args.inner_planet > args.outer_planet: 31 | raise Exception("Inner planet number should be always smaller than the outer planet number") 32 | 33 | if args.outer_period > args.inner_period: 34 | raise Exception("Outer period cannot be greater than the inner period!") 35 | 36 | 37 | filename = args.historic_snapshot_filename 38 | n_particles, data = posidonius.analysis.history.read(filename) 39 | star_data, planets_data, planets_keys = posidonius.analysis.history.classify(n_particles, data, discard_first_hundred_years=False) 40 | 41 | planet_names = planets_keys 42 | nb_planets = len(planet_names) 43 | 44 | # t: time in years 45 | # a: demi-grand axe en ua 46 | # e: eccentricity 47 | # g: argument of pericentre or argument of perihelion (degrees) 48 | # n: longitude of ascending node (degrees) 49 | # M: Mean anomaly (degrees) 50 | # q: periastron or perihelion (AU) 51 | # Q: apastron or aphelion (AU) 52 | t, a, e, g, n, M, q, Q = posidonius.analysis.resonances.calculate_resonance_data(star_data, planets_keys, planets_data) 53 | 54 | inner_planet = args.inner_planet 55 | outer_planet = args.outer_planet 56 | inner_period_nb = args.inner_period 57 | outer_period_nb = args.outer_period 58 | 59 | output_figure_dirname = os.path.dirname(filename) 60 | output_figure_filename = os.path.join(output_figure_dirname, os.path.splitext(os.path.basename(filename))[0] + "_resonance_{}_{}_between_{}_and_{}.png".format(inner_period_nb, outer_period_nb, inner_planet, outer_planet)) 61 | 62 | t = t[inner_planet] # time in years (== t[outer_planet]) 63 | a_inner = a[inner_planet - 1] # demi-grand axe en ua 64 | g_inner = g[inner_planet - 1] # argument of pericentre (degrees) 65 | n_inner = n[inner_planet - 1] # longitude of ascending node (degrees) 66 | M_inner = M[inner_planet - 1] # Mean anomaly (degrees) 67 | 68 | a_outer = a[outer_planet - 1] # demi-grand axe en ua 69 | g_outer = g[outer_planet - 1] # argument of pericentre (degrees) 70 | n_outer = n[outer_planet - 1] # longitude of ascending node (degrees) 71 | M_outer = M[outer_planet - 1] # Mean anomaly (degrees) 72 | 73 | sys.stdout.write("Calculating angles %5.1f %% \r" % (50.)) 74 | sys.stdout.flush() 75 | 76 | nb_times = len(t) 77 | 78 | # Resonances are usually displayed as (p+q):p where q is the order of 79 | # the resonance. We retreive thoses parameters 80 | p = outer_period_nb 81 | q = inner_period_nb - outer_period_nb 82 | 83 | # We calculate the resonant angles 84 | long_of_peri_inner = g_inner + n_inner 85 | mean_longitude_inner = M_inner + long_of_peri_inner 86 | 87 | long_of_peri_outer = g_outer + n_outer 88 | mean_longitude_outer = M_outer + long_of_peri_outer 89 | 90 | phi = np.empty((q+1, nb_times)) # we create an array, empty for the moment, that will contain all the resonant angles associated with the supposed resonance. 91 | 92 | temp_value = inner_period_nb * mean_longitude_outer - outer_period_nb * mean_longitude_inner 93 | 94 | for i in range(q+1): 95 | phi[i] = temp_value - i * long_of_peri_inner - (q - i) * long_of_peri_outer 96 | 97 | # We take modulo 2*pi of the resonant angle 98 | phi = phi%(360.) 99 | too_low = phi < ANGLE_MIN 100 | too_high = phi > ANGLE_MAX 101 | phi[too_low] = phi[too_low] + 360. 102 | phi[too_high] = phi[too_high] - 360. 103 | 104 | delta_longitude = long_of_peri_outer - long_of_peri_inner 105 | delta_longitude = delta_longitude%(360.) 106 | too_low = delta_longitude < ANGLE_MIN 107 | too_high = delta_longitude > ANGLE_MAX 108 | delta_longitude[too_low] = delta_longitude[too_low] + 360. 109 | delta_longitude[too_high] = delta_longitude[too_high] - 360. 110 | 111 | 112 | # We chose the number of plot in x and y axis for the p.multi 113 | # environment in order to plot ALL the resonant angles and have x and 114 | # y numbers as close on from another as possible. There are q+1 115 | # resonant angles, the period ratio and w1 - w2, i.e q+3 plots 116 | (nb_lines, nb_rows) = posidonius.analysis.resonances.get_subplot_shape(q+3) 117 | 118 | # on trace les plots 119 | myxfmt = ScalarFormatter(useOffset=True) 120 | #myxfmt._set_offset(1e5) 121 | myxfmt.set_scientific(True) 122 | myxfmt.set_powerlimits((-3, 3)) 123 | 124 | sys.stdout.write("Displaying %5.1f %% \r" % (75.)) 125 | sys.stdout.flush() 126 | 127 | fig = plt.figure(figsize=(12,12)) 128 | plt.clf() 129 | fig.subplots_adjust(left=0.12, bottom=0.1, right=0.96, top=0.95, wspace=0.26, hspace=0.26) 130 | 131 | # We create a variable to store the index of the subplot 132 | subplot_index = 0 133 | fig.suptitle("resonance "+str(inner_period_nb)+":"+str(outer_period_nb)+" between "+str(inner_planet)+" and "+str(outer_planet)) 134 | 135 | subplot_index += 1 136 | plot_period = fig.add_subplot(nb_lines, nb_rows, subplot_index) 137 | plot_period.plot(t, (a_outer / a_inner)**1.5) 138 | plot_period.set_xlabel("time [years]") 139 | plot_period.set_ylabel("period ratio") 140 | #~ plt.legend() 141 | plot_period.grid(True) 142 | 143 | # For each resonant angle, it is important to show only the points and not lines, 144 | # so that we do not mask interesting features by meaningless lines. 145 | subplot_index += 1 146 | plot_dl = fig.add_subplot(nb_lines, nb_rows, subplot_index, sharex=plot_period) 147 | plot_dl.plot(t, delta_longitude, '.') 148 | plot_dl.set_xlabel("time [years]") 149 | plot_dl.set_ylabel("w2 - w1") 150 | plot_dl.grid(True) 151 | 152 | for i in range(q+1): 153 | sys.stdout.write("Displaying %5.1f %% \r" % (75. + float((i+3) / (q+3)) * 25.)) 154 | sys.stdout.flush() 155 | subplot_index += 1 156 | plot_phi = fig.add_subplot(nb_lines, nb_rows, subplot_index, sharex=plot_period) 157 | plot_phi.plot(t, phi[i], '.') 158 | plot_phi.set_xlabel("time [years]") 159 | plot_phi.set_ylabel("phi %i" % i) 160 | plot_phi.grid(True) 161 | 162 | plot_period.xaxis.set_major_formatter(myxfmt) 163 | 164 | fig.savefig(output_figure_filename) 165 | print("Output figure file written to: {}".format(output_figure_filename)) 166 | 167 | #plt.show() # We display the plot 168 | --------------------------------------------------------------------------------