@@ -466,13 +466,14 @@ def test_3dof_flight_different_weathercock_coefficients(
466466 # Verify that different coefficients produce different results
467467 # This confirms the weathercocking physics is being applied
468468 apogees = [f .apogee for f in flights ]
469- unique_apogees = set (apogees )
470469
471- # At least some coefficients should produce different apogees
472- # (not all will necessarily be different, but there should be variation)
473- assert len (unique_apogees ) > 1 , (
470+ # Check if there's meaningful variation in apogees (use range instead of set
471+ # to avoid floating-point precision issues)
472+ apogee_range = max (apogees ) - min (apogees )
473+ apogee_tolerance = 0.01 # meters - meaningful physical difference
474+ assert apogee_range > apogee_tolerance , (
474475 f"Different weathercock coefficients should produce different apogees. "
475- f"All simulations resulted in the same apogee : { apogees [ 0 ]:.2f } m"
476+ f"Range of apogees: { apogee_range :.4f } m (threshold : { apogee_tolerance } m) "
476477 )
477478
478479 # Verify lateral displacements also vary with coefficients
@@ -483,8 +484,10 @@ def test_3dof_flight_different_weathercock_coefficients(
483484 lateral = (x ** 2 + y ** 2 ) ** 0.5
484485 lateral_displacements .append (lateral )
485486
486- unique_laterals = set (lateral_displacements )
487- assert len (unique_laterals ) > 1 , (
487+ # Check if there's meaningful variation in lateral displacements
488+ lateral_tolerance = 0.001 # meters - meaningful physical difference
489+ lateral_range = max (lateral_displacements ) - min (lateral_displacements )
490+ assert lateral_range > lateral_tolerance , (
488491 "Different weathercock coefficients should produce different lateral displacements. "
489- f"All simulations resulted in the same lateral displacement : { lateral_displacements [ 0 ]:.2f } m"
492+ f"Range of lateral displacements : { lateral_range :.4f } m (threshold: { lateral_tolerance } m) "
490493 )
0 commit comments