Collision Avoidance Maneuver design for conjunction assessment
0
fork

Configure Feed

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

ocaml-linkedin: apply dune fmt

Pure formatting changes from `dune fmt`: doc comment placement moves
from above the binding to below it for `type`s, multi-line `match`
expressions collapse onto one line where they fit, and infix operator
applications pick up spaces (`Soup.($?)` -> `Soup.( $? )`). No
semantic changes.

+41 -15
+34 -15
README.md
··· 6 6 7 7 ## Installation 8 8 9 + Install with opam: 10 + 11 + ```sh 12 + $ opam install cam 9 13 ``` 10 - opam install cam 14 + 15 + If opam cannot find the package, it may not yet be released in the public 16 + `opam-repository`. Add the overlay repository, then install it: 17 + 18 + ```sh 19 + $ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git 20 + $ opam update 21 + $ opam install cam 11 22 ``` 12 23 13 24 ## Usage 14 25 15 26 ```ocaml 16 27 (* Evaluate a tangential burn 6 hours before TCA *) 17 - let maneuver = Cam.{ dt = 21600.; dv = 0.01; direction = `Tangential } in 18 - let result = 19 - Cam.evaluate ~miss_r:50. ~miss_t:200. ~miss_n:0. ~sigma_r:30. ~sigma_t:100. 20 - ~hbr:10. maneuver 21 - in 22 - Printf.printf "Pc before: %e, after: %e\n" result.pc_before result.pc_after 28 + let maneuver : Cam.maneuver = 29 + { dt = 21600.; dv = 0.01; direction = `Tangential } 30 + 31 + let () = 32 + let result = 33 + Cam.evaluate ~miss_r:50. ~miss_t:200. ~miss_n:0. 34 + ~sigma_r:30. ~sigma_t:100. ~hbr:10. maneuver 35 + in 36 + Printf.printf "Pc before: %e, after: %e\n" 37 + result.pc_before result.pc_after 23 38 24 - (* Find minimum delta-v to achieve target Pc *) 25 39 (* Simple API: compute avoidance burn directly from a CDM *) 26 - match Cam.avoid cdm ~dt:21600. with 27 - | Some result -> Printf.printf "Burn: %.4f km/s\n" result.dv 28 - | None -> print_endline "Already safe or no solution" 40 + let avoid_from_cdm cdm = 41 + match Cam.avoid cdm ~dt:21600. with 42 + | Some (result : Cam.result) -> 43 + Printf.printf "Burn: %.4f m/s\n" result.delta_v 44 + | None -> print_endline "Already safe or no solution" 29 45 30 46 (* Find minimum delta-v to achieve target Pc *) 31 - match Cam.min_dv ~miss_r:50. ~miss_t:200. ~miss_n:0. ~sigma_r:30. ~sigma_t:100. 32 - ~hbr:10. ~dt:21600. ~target_pc:1e-5 with 33 - | Some dv -> Printf.printf "Min dv: %.6f km/s\n" dv 34 - | None -> print_endline "No solution" 47 + let () = 48 + match 49 + Cam.min_dv ~miss_r:50. ~miss_t:200. ~miss_n:0. 50 + ~sigma_r:30. ~sigma_t:100. ~hbr:10. ~dt:21600. ~target_pc:1e-5 () 51 + with 52 + | Some dv -> Printf.printf "Min dv: %.6f km/s\n" dv 53 + | None -> print_endline "No solution" 35 54 ``` 36 55 37 56 ## API Overview
+1
cam.opam
··· 18 18 "fmt" 19 19 "kepler" 20 20 "vec3" 21 + "mdx" {with-test} 21 22 "alcotest" {with-test} 22 23 "odoc" {with-doc} 23 24 ]
+4
dune
··· 1 1 (env 2 2 (dev 3 3 (flags :standard %{dune-warnings}))) 4 + 5 + (mdx 6 + (files README.md) 7 + (libraries cam))
+2
dune-project
··· 1 1 (lang dune 3.21) 2 + (using mdx 0.4) 2 3 (name cam) 3 4 (source (tangled gazagnaire.org/ocaml-cam)) 4 5 ··· 25 26 fmt 26 27 kepler 27 28 vec3 29 + (mdx :with-test) 28 30 (alcotest :with-test)))