Collision Avoidance Maneuver design for conjunction assessment
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Test Cam.avoid with synthetic CDM

New test constructs a realistic CDM (ISS-like conjunction, crossing
orbits at 10.86 km/s, 100m miss, 30m/100m sigma) and calls Cam.avoid
with 6-hour lead time. Validates Pc is reduced below 1e-5 threshold.

+66
+66
test/test_cam.ml
··· 292 292 if ratio > 0.1 then 293 293 Alcotest.failf "huge sigma: burn should barely change Pc, ratio=%e" ratio 294 294 295 + (* Test Cam.avoid with a synthetic CDM *) 296 + let test_avoid_cdm () = 297 + let zero_cov : Cdm.covariance = 298 + { 299 + cr_r = 900.0; 300 + ct_r = 0.0; 301 + ct_t = 10000.0; 302 + cn_r = 0.0; 303 + cn_t = 0.0; 304 + cn_n = 900.0; 305 + } 306 + in 307 + let mk_state px py pz vx vy vz : Cdm.state_vector = 308 + { pos = { x = px; y = py; z = pz }; vel = { x = vx; y = vy; z = vz } } 309 + in 310 + let mk_obj id state : Cdm.object_data = 311 + { 312 + id; 313 + met_criteria = true; 314 + state; 315 + local = { x = 0.0; y = 0.0; z = 0.0 }; 316 + cov = zero_cov; 317 + velocity_cov = None; 318 + density_forecast_uncertainty = None; 319 + screening_data_source = None; 320 + dcp_sensitivity_vector_position = None; 321 + dcp_sensitivity_vector_velocity = None; 322 + user_defined = None; 323 + filename = ""; 324 + metadata = None; 325 + od_params = None; 326 + physical = None; 327 + } 328 + in 329 + let cdm : Cdm.t = 330 + { 331 + run_id = 1; 332 + conj_id = 1; 333 + obj1 = mk_obj 25544 (mk_state (-2974.0) 2974.0 5307.0 (-5.43) (-5.43) 0.0); 334 + obj2 = mk_obj 99999 (mk_state (-2974.05) 2974.05 5307.05 5.43 5.43 0.0); 335 + min_range = 0.1; 336 + rel_velocity = 10.86; 337 + probability = 1e-3; 338 + dilution = 1; 339 + miss_distance = 0.1; 340 + epoch = "2026-01-01T00:00:00.000"; 341 + jdate = 2461041.5; 342 + header = None; 343 + relative_metadata = None; 344 + } 345 + in 346 + match Cam.avoid cdm ~dt:21600.0 with 347 + | None -> 348 + (* If already safe, that's fine — check Pc *) 349 + let a = Collision.assess cdm in 350 + Fmt.pr " Cam.avoid returned None, Pc = %e (%a)\n" a.pc Collision.pp_risk 351 + (Collision.risk_level a) 352 + | Some result -> 353 + Printf.printf " Cam.avoid: burn %.4f m/s, Pc %e -> %e\n" result.delta_v 354 + result.pc_before result.pc_after; 355 + Alcotest.(check bool) 356 + "Pc reduced" true 357 + (result.pc_after < result.pc_before); 358 + Alcotest.(check bool) "Pc below threshold" true (result.pc_after <= 1e-5) 359 + 295 360 let suite = 296 361 ( "cam", 297 362 [ ··· 316 381 Alcotest.test_case "zero_dt" `Quick zero_dt; 317 382 Alcotest.test_case "very_small_sigma" `Quick very_small_sigma; 318 383 Alcotest.test_case "very_large_sigma" `Quick very_large_sigma; 384 + Alcotest.test_case "avoid_cdm" `Quick test_avoid_cdm; 319 385 ] )