# Exercise 3: radar and racon arithmetic. C = 299_792_458 NM = 1852 # Part 1: echo delay for ships at various ranges, in microseconds, and the delay per nautical mile. for nm in (0.5, 1, 6, 12): print(nm, "nm ->", round(2 * nm * NM / C * 1e6, 1), "us") per_nm = 2 * NM / C * 1e6 print("per nautical mile:", round(per_nm, 3), "us") # Part 2: how long a racon reply of 25 us is, in metres of pulse and as a radar range. length_m = 25e-6 * C print("pulse length:", round(length_m), "m; as range:", round(length_m / 2), "m") # Part 3: UK racon duty cycles. Seconds silent in an hour, and the longest silence a ship could sit through. for on, off in ((20, 40), (9, 21)): cycle = on + off print(on, "on /", off, "off: cycle", cycle, "s,", 3600 // cycle, "cycles an hour, silent", 3600 // cycle * off, "s an hour, longest wait", off, "s") # 0.5 nm -> 6.2 us # 1 nm -> 12.4 us # 6 nm -> 74.1 us # 12 nm -> 148.3 us # per nautical mile: 12.355 us # pulse length: 7495 m; as range: 3747 m # 20 on / 40 off: cycle 60 s, 60 cycles an hour, silent 2400 s an hour, longest wait 40 s # 9 on / 21 off: cycle 30 s, 120 cycles an hour, silent 2520 s an hour, longest wait 21 s