From 59ea228ec60e883fc82b5f6928c5bca98d19499d Mon Sep 17 00:00:00 2001 From: David Minton Date: Tue, 27 Feb 2024 17:05:21 -0500 Subject: [PATCH] Updated test case to have self-consistent values of everything --- examples/spherical_harmonics_cb/J2_test_tp.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/examples/spherical_harmonics_cb/J2_test_tp.py b/examples/spherical_harmonics_cb/J2_test_tp.py index 4ce728461..b4d009b84 100644 --- a/examples/spherical_harmonics_cb/J2_test_tp.py +++ b/examples/spherical_harmonics_cb/J2_test_tp.py @@ -30,11 +30,10 @@ # Central Body Parameters (Chariklo parameters from Leiva, et al (2017) (Jacobi Ellipsoid model)) cb_mass = 6.1e18 # kg -cb_radius = 123 # km -cb_a = 157 # km -cb_b = 139 # km -cb_c = 86 # km -cb_volume = 4.0 / 3 * np.pi * cb_radius**3 # km^3 +cb_a = 160 # km +cb_b = 160 # km +cb_c = 90 # km +cb_volume = 4.0 / 3 * np.pi * cb_a*cb_b*cb_c**3 # km^3 cb_density = cb_mass / cb_volume cb_T_rotation = 7.004 / 24.0 # converting from hours to julian days (TU) cb_rot = [[0, 0, 360.0 / cb_T_rotation]] # degrees/d @@ -56,7 +55,7 @@ # calculates the reference radius. If lref_radius = True, the function returns the reference radius used. # We recommend setting passing and setting a reference radius. Coefficients are geodesy (4-pi) normalised. -c_lm, cb_radius = swiftest.clm_from_ellipsoid(mass = cb_mass, density = cb_density, a = cb_a, b = cb_b, c = cb_c, lmax = 6, lref_radius = True, ref_radius = cb_radius) +c_lm, cb_radius = swiftest.clm_from_ellipsoid(mass = cb_mass, density = cb_density, a = cb_a, b = cb_b, c = cb_c, lmax = 6, lref_radius = True) # extracting only the J2 terms tmp20 = c_lm[0, 2, 0] # c_20 = -J2 @@ -71,16 +70,16 @@ sim_shgrav.clean() # Use the shgrav version where you input a set of spherical harmonics coefficients -sim_shgrav.add_body(name = 'Chariklo', mass = cb_mass, rot = cb_rot, radius = cb_radius, c_lm = c_lm) +sim_shgrav.add_body(name = 'OblateBody', mass = cb_mass, rot = cb_rot, radius = cb_radius, c_lm = c_lm) sim_shgrav.add_body(name=name_tp, a=a_tp, e=e_tp, inc=inc_tp, capom=capom_tp, omega=omega_tp, capm=capm_tp) -sim_shgrav.run(tstart=0.0, tstop=10.0, dt=0.001, tstep_out=10.0, dump_cadence=0, integrator='whm') +sim_shgrav.run(tstart=0.0, tstop=10.0, dt=0.01, tstep_out=10.0, dump_cadence=0, integrator='whm') # Use the original "oblate" version where you pass J2 (and/or J4) sim_obl = swiftest.Simulation(simdir="obl", DU2M = 1e3, TU='d', MU='kg') sim_obl.clean() -sim_obl.add_body(name = 'Chariklo', mass = cb_mass, rot = cb_rot, radius = cb_radius, J2 = j2rp2) +sim_obl.add_body(name = 'OblateBody', mass = cb_mass, rot = cb_rot, radius = cb_radius, J2 = j2rp2) sim_obl.add_body(name=name_tp, a=a_tp, e=e_tp, inc=inc_tp, capom=capom_tp, omega=omega_tp, capm=capm_tp) -sim_obl.run(tstart=0.0, tstop=10.0, dt=0.001, tstep_out=10.0, dump_cadence=0, integrator='whm') +sim_obl.run(tstart=0.0, tstop=10.0, dt=0.01, tstep_out=10.0, dump_cadence=0, integrator='whm') diff_vars = ['a','e','inc','capom','omega','capm','rh','vh'] ds_diff = sim_shgrav.data[diff_vars] - sim_obl.data[diff_vars]