14 const double abs_tolerance=1e-6;
15 std::valarray<double> one_poly(1.0, 1);
34 for(
double e = 0.0; e <= 0.0075; e += 0.0001) {
44 double factor = 1.2 * M_PI,
45 expected_tidal_power = factor * (1.0 + 14.25 * e * e),
46 expected_z_torque = factor * (1.0 + 7.5 * e * e),
51 std::ostringstream message;
52 message <<
"For e = " << e
53 <<
" tidal power = " << got_tidal_power
54 <<
", expected: " << expected_tidal_power
55 <<
"; difference: " << (got_tidal_power
58 <<
" > " << abs_tolerance;
71 "Non-zero x-torque for aligned zone!" 78 "Non-zero y-torque for aligned zone!" 81 message <<
"For e = " << e
82 <<
" tidal Z torque = " << got_z_torque
83 <<
", expected: " << expected_z_torque
84 <<
"; difference: " << (got_z_torque
87 <<
" > " << abs_tolerance;
100 const unsigned MAX_E_ORDER=100;
102 std::cout << std::setw(25) <<
"e";
103 for(
unsigned e_order = 0; e_order <= MAX_E_ORDER; e_order += 10) {
104 std::ostringstream order_str;
105 order_str <<
"[O(e^" << e_order <<
")]";
106 std::cout << std::setw(25) <<
"dE_dt" + order_str.str()
107 << std::setw(25) <<
"dLz_dt" + order_str.str();
109 std::cout << std::endl;
111 std::valarray<double> one_poly(1.0, 1);
128 for(
double e = 0.0; e <= 0.99; e += 0.01) {
129 std::cout << std::setw(25) << e;
130 for(
unsigned e_order = 0; e_order <= MAX_E_ORDER; e_order += 10) {
142 std::cout << std::setw(25) << zone.
tidal_power(
true)
146 std::cout << std::endl;
double tidal_power(bool above, Dissipation::QuantityEntry entry=Dissipation::NO_DERIV) const
The dimensionless tidal power or one of its derivatives.
A zone with constant phase lag for all tidal terms.
void test_aligned_orbit()
Test the dimensionless tidal torque and power for an equatorial orbit, as a function of eccentricity ...
Declare a unit tests class that check the calculations of tidal torque and power. ...
Single zone non-evolving planets with huge dissipation, so they always remain locked to the disk...
Orientations of zones of bodies in a binary system.
double tidal_torque_y(bool above, Dissipation::QuantityEntry entry=Dissipation::NO_DERIV) const
The dimensionless torque along y.
virtual void configure(bool initialize, double age, double orbital_frequency, double eccentricity, double orbital_angmom, double spin, double inclination, double periapsis, bool spin_is_frequency)
See DissipatingZone::configure().
void test_convergence()
Output a table showing the convergence as e-order is increased for aligned orbit and const phase lag...
test_TidalTorquePower()
Create the test suite.
bool check_diff(double x, double y, double frac_tolerance, double abs_tolerance)
Returns true iff .
double tidal_torque_z(bool above, Dissipation::QuantityEntry entry=Dissipation::NO_DERIV) const
The dimensionless tidal torque along z.
virtual void change_e_order(unsigned new_e_order, BinarySystem &system, bool primary, unsigned zone_index)
Changes the order of the eccentricity expansion performed.
double tidal_torque_x(bool above, Dissipation::QuantityEntry entry=Dissipation::NO_DERIV) const
The dimensionless tidal torque along x.
Describes a system of two bodies orbiting each other.