Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

17. Project: planning a relief mission after an earthquake

School of Engineering, Nazarbayev University

In this fictional scenario, at 04:12 local time a Mw 7.1M_w\ 7.1 earthquake fractures valley highways with rockslides, knocks out 40%40\% of cellular relay towers stochastically, and triggers thousands of duplicate emergency SOS beacon bursts across a 100 km×100 km100\ \mathrm{km} \times 100\ \mathrm{km} alpine basin. Your engineering team has 30 minutes to size heavy-lift medical relief drones, identify cut-off survivor clusters, thread obstacle-aware mountain-pass flight corridors, optimize multi-site delivery tours, pack trauma payloads, schedule ground-crew launch turnarounds, and check the flight software before takeoff. This project combines all nine engthink modules and the 24 Mental Moves in one mission planner, with a check at every stage. All terrain, station and aircraft data are synthetic or assumed.

Learning objectives

  1. Nondimensionalize rotorcraft cruise/hover power via representation_scaling.buckingham_pi_nullspace and size minimum Li-Po battery mass fraction via divide_spatial.parametric_binary_search_min.

  2. Index surviving field relays in O(N)\mathcal{O}(N) (invariants_complexity.spatial_cell_list_neighbors), map connected survivor clusters (emergence_verification.site_percolation_2d), and deduplicate SOS bursts with zero false negatives (information_streams.bloom_filter_simulate).

  3. Thread minimum-energy mountain-pass corridors via greedy_heuristic_search.grid_shortest_path_search (method='astar') and optimize multi-target delivery tours via emergence_verification.simulated_annealing_tsp.

  4. Allocate trauma kits (dynamic_optimality.knapsack_01_dp), compress ground turnaround (reductions_constraints.critical_path_dag), audit mission code (emergence_verification.metamorphic_differential_audit), and benchmark against exact Held-Karp & Beasley multi-sortie Split DP.

Time: about 60 min

1. Phase I, Buckingham-Π\Pi Rotorcraft Scaling & Parametric Battery Sizing

Before routing a single drone across high-altitude mountain air (ρair=1.02 kg/m3\rho_{\mathrm{air}} = 1.02\ \mathrm{kg/m^3} at 1,800 m1{,}800\ \mathrm{m} elevation), we must relate rotorcraft aerodynamic power PP [W\mathrm{W}], total takeoff weight W=mtotgW = m_{\mathrm{tot}} g [N\mathrm{N}], air density ρ\rho [kg/m3\mathrm{kg/m^3}], total rotor disk area AA [m2\mathrm{m^2}], and forward cruise speed VV [m/s\mathrm{m/s}]. Applying Mental Move #5 (representation_scaling.buckingham_pi_nullspace) to (P,V,W,ρ,A)(P, V, W, \rho, A) over [M,L,T][M, L, T] collapses 5−3=25 - 3 = 2 dimensionless groups:

Π1=P ρ AW3/2(Momentum-theory power loading),Π2=Vρ AW(Advance speed ratio)(1.1)\Pi_1 = \frac{P\,\sqrt{\rho\,A}}{W^{3/2}} \quad \text{(Momentum-theory power loading)}, \qquad \Pi_2 = V\sqrt{\frac{\rho\,A}{W}} \quad \text{(Advance speed ratio)} \tag{1.1}

The null-space basis printed below gives the squares of these two groups, which are equivalent.

Hover power grows as Phover∝W3/2P_{\mathrm{hover}} \propto W^{3/2}: adding extra battery mass mbat=fbat mtotm_{\mathrm{bat}} = f_{\mathrm{bat}}\,m_{\mathrm{tot}} increases stored energy linearly (∝fbat\propto f_{\mathrm{bat}}), but the takeoff mass mtot=mstruct+mpayload1−fbatm_{\mathrm{tot}} = \frac{m_{\mathrm{struct}} + m_{\mathrm{payload}}}{1 - f_{\mathrm{bat}}} grows like (1−fbat)−1(1 - f_{\mathrm{bat}})^{-1}, so the hover power grows like (1−fbat)−3/2(1 - f_{\mathrm{bat}})^{-3/2}. Using Mental Move #11 (divide_spatial.parametric_binary_search_min), we find the exact minimum battery mass fraction fbat⋆f_{\mathrm{bat}}^\star achieving a 45 km45\ \mathrm{km} mountain range with a 20%20\% safety reserve.


Capstone phase 1: Buckingham-Pi drone power scaling and binary-searched battery sizing
======================================================================================
Rank(D) = 3 -> 2 dimensionless rotorcraft groups (residual = 0.0e+00):
  Pi_1 = rho * A * P^2 / (W^3)
  Pi_2 = rho * A * V^2 / (W)
Target 45.0 km mountain range (+20% reserve): f_bat* = 55.83% (22 evals)
  -> Battery mass = 12.64 kg, Total takeoff mass = 22.64 kg, Range check = 45.000 km
<Figure size 1254x440 with 2 Axes>

Figure 17.1. Battery sizing of the relief drone (assumed aircraft data). (a) Safe range against the battery mass fraction; the target of 45 km is reached at fbat⋆=55.8 %f_{\mathrm{bat}}^\star = 55.8\,\% (dashed). (b) Take-off mass against the battery fraction, with the selected design, 22.6 kg.

What Phase I shows. The range curve on the left bends over instead of growing without limit as fbat→1f_{\mathrm{bat}} \to 1: the stored energy grows like fbat mtotf_{\mathrm{bat}}\, m_{\mathrm{tot}} with mtot∝(1−fbat)−1m_{\mathrm{tot}} \propto (1 - f_{\mathrm{bat}})^{-1}, while the hover power grows like W3/2∝(1−fbat)−3/2W^{3/2} \propto (1 - f_{\mathrm{bat}})^{-3/2}, so beyond some fraction more battery mostly carries itself. For a 45 km range with a 20 % reserve the bisection gives fbat⋆=55.8 %f_{\mathrm{bat}}^\star = 55.8\,\%, a battery of 12.64 kg in a 22.64 kg drone. All aircraft parameters in this chapter are assumed values.


2. Phase II, Spatial Relay Indexing, Percolation & Zero-FN SOS Deduplication

Across the 100 km×100 km100\ \mathrm{km} \times 100\ \mathrm{km} earthquake zone, 60 solar emergency relay towers (constants_benchmarks.make_sensor_station_coords) attempt to form a multi-hop LoRa radio mesh (r_comm = 14.3 km).

  1. Cell-List Spatial Hashing (invariants_complexity.spatial_cell_list_neighbors): Finds all active LoRa links in O(N)\mathcal{O}(N) instead of testing all (602)=1,770\binom{60}{2} = 1{,}770 pairs.

  2. Road-Grid Rubble Percolation (emergence_verification.site_percolation_2d): Models ground-ambulance passability when 46 %46\,\% of the valley road intersections are blocked (popen=0.54<pc=0.5927p_{\mathrm{open}} = 0.54 < p_c = 0.5927, so ground vehicles are cut off and drones are needed).

  3. Edge SOS Deduplication (information_streams.bloom_filter_simulate): Suppresses duplicate SOS relays with 512 bytes512\ \mathrm{bytes} of memory on the drone, without missing any survivor ID.


Capstone phase 2: Spatial relay mesh, road percolation check and Bloom SOS deduplication
========================================================================================
LoRa Cell-List Indexing : 156 links found in 382 checks (4.6x faster than all-pairs)
Radio Mesh Connectivity : 51/60 stations reach Depot #0; 9 isolated stations require direct drone recon
Ground Road Percolation : p_open = 0.54 < p_c -> percolates_top_to_bottom = False (trucks blocked)
512-Byte SOS Bloom Filter: False Negatives = 0 (0 missed SOS), FPR = 0.30%, CMS min_err = 0
<Figure size 836x484 with 1 Axes>

Figure 17.2. Synthetic relay network after the earthquake. 51 stations (blue) connect to the command depot (star); 9 stations (triangles) are cut off and need a direct drone visit.

What Phase II shows. The cell list finds the 156 radio links with 382 distance checks instead of 1,770, and the connected components show that 9 of the 60 stations have no radio path to Command Depot #0, so they need a direct drone visit. The road lattice at p=0.54<0.593p = 0.54 < 0.593 does not percolate, and the 512-byte Bloom filter misses no SOS ID, with a false-positive rate of 0.30 %0.30\,\%.


3. Phase III, A* Mountain-Pass Corridors & Simulated Annealing Multi-Site Routing

Flying straight across the central ridge of the synthetic terrain drains the battery quickly (cost_grid elevation penalty in constants_benchmarks.make_topographic_terrain). We combine two search paradigms:

  1. Micro-Corridor Search (greedy_heuristic_search.grid_shortest_path_search, Mental Move #18): Threads minimum-energy terrain paths through low mountain saddle passes using admissible A* (method="astar", allow_diagonal=True), expanding fewer grid cells than Dijkstra and returning the same minimum corridor cost.

  2. Macro-Tour Optimization (emergence_verification.simulated_annealing_tsp): Orders 12 priority relief drop-zones (Command Depot + cut-off stations + high-triage beacons) into a minimum-length aerial loop.


Capstone phase 3: A* mountain-pass corridor threading and 12-site simulated annealing tour
==========================================================================================
Mountain Corridor (8, 8) -> (54, 55):
  Dijkstra cost = 105.179715 (2968 cells expanded)
  A*       cost = 105.179715 (1980 cells expanded -> 33.3% fewer)
12-Site Priority Relief Tour: initial = 524.98 km -> annealed = 272.65 km
<Figure size 1265x473 with 3 Axes>

Figure 17.3. Routing. (a) The A* corridor across the synthetic terrain around the no-fly zone. (b) The annealed tour through 12 sites, 272.7 km, starting from the command depot (star).

What Phase III shows. In the left map the A* corridor goes around the central peak and the no-fly zone instead of over them. It has the same cost as Dijkstra, 105.18, with 1,980 instead of 2,968 cell expansions (33 % fewer). Simulated annealing shortens the 12-site tour from 524.98 km to 272.65 km.


4. Phase IV, Knapsack Triage Packing, Launch CPM & Metamorphic Pre-Flight Audit

Before clearing the drone for launch, three final algorithmic modules close the loop:

  1. 0/1 Payload Knapsack (dynamic_optimality.knapsack_01_dp, Mental Move #15): Packs discrete medical modules into the 4,500 g4{,}500\ \mathrm{g} (45×100 g45 \times 100\ \mathrm{g} integer units) payload bay to maximize life-saving triage utility.

  2. Ground-Crew Critical Path (reductions_constraints.critical_path_dag, Mental Move #20): Schedules parallel battery charging, IMU calibration, corridor upload, and payload rigging to pinpoint zero-slack launch bottlenecks.

  3. Compensated Telemetry & Metamorphic Safety Gate (representation_scaling.kahan_babuska_sum, emergence_verification.metamorphic_differential_audit, Mental Move #24): Audits the flight-controller energy-summation routine against permutation, shift, and scaling laws prior to arming rotors.


Capstone phase 4: 0/1 medical knapsack, launch turnaround CPM and pre-flight metamorphic gate
=============================================================================================
Medical Payload Packed (4500g / 4500g, Triage Score = 282): ['Hemorrhage-Pack', 'Antibiotics', 'Insulin-Cooler', 'Splint-Set', 'Sat-Beacon', 'Thermal-Blankets']
Launch Turnaround Makespan = 13.0 min | Critical Path (slack=0) = ['Inspect_Frame', 'Swap_LiPo', 'IMU_Calib', 'Rotor_Arm_Test']
Neumaier Energy Sum Error = 0.00e+00 J | Pre-Flight Metamorphic Gate Passed = True (240 checks)
<Figure size 1265x451 with 2 Axes>

Figure 17.4. Payload and launch. (a) Value density of the medical modules; the green ones are packed, 4,500 g in all. (b) Launch schedule; red tasks are critical, light bars show slack. The turnaround takes 13 min.

Inside the algorithm

Phases I–IV used all nine modules of engthink. How good is the annealed tour of Phase III? For N≤15N \le 15 waypoints, Bellman–Held–Karp bitmask dynamic programming computes the exact minimum tour in O(N22N)\mathcal{O}(N^2 2^N) operations instead of (N−1)!/2(N-1)!/2. Below, we inspect constants_benchmarks.make_topographic_terrain and run a comprehensive verify_end_to_end_mission_invariants check of every phase of the mission.

Check against the library


Inside the algorithm: Topographic benchmark and end-to-end mission invariant certifier
======================================================================================
def make_topographic_terrain(nx: int = 64, ny: int = 64, seed: int = 42) -> dict:
    """Generate a smooth 2-D mountain/pass elevation field [m] and traversal cost grid for Dijkstra vs. A*."""
    if nx < 8 or ny < 8:
        raise ValueError("Require nx, ny >= 8.")
    rng = np.random.default_rng(seed)
    x = np.linspace(0.0, 1.0, nx)
    y = np.linspace(0.0, 1.0, ny)
    xx, yy = np.meshgrid(x, y, indexing="xy")

    # Multi-ridge mountain barrier with two saddle passes + gentle background roughness:
    pass_cut = 1.0 - 0.62 * np.exp(-((yy - 0.74) / 0.11) ** 2)
    ridge1 = 920.0 * np.exp(-(((xx - 0.48) + 0.22 * (yy - 0.5)) / 0.11) ** 2) * pass_cut
    ridge2 = 680.0 * np.exp(-(((xx - 0.72) ** 2 + (yy - 0.30) ** 2) / 0.032))
    basin = 240.0 * np.exp(-(((xx - 0.24) ** 2 + (yy - 0.68) ** 2) / 0.045))
    ripples = 35.0 * np.sin(4.0 * math.pi * xx + float(rng.uniform(0.0, 1.0))) * np.cos(3.0 * math.pi * yy)
    elev = 150.0 + ridge1 + ridge2 + basin + ripples

    # Strictly positive cell traversal cost >= 1.0 (base 1.0 + steep elevation penalty):
    cost_grid = 1.0 + 9.5 * ((elev - np.min(elev)) / (np.max(elev) - np.min(elev))) ** 2
    return {"x": x, "y": y, "elevation_m": elev, "cost_grid": cost_grid}

10-Target Sub-Mission: Held-Karp Exact Optimum = 264.414042 km | SA = 264.414042 km (gap = 0.0000%)
Knapsack DP == 2^8 Brute Force: True | Total Mental Moves Cataloged = 24

Exercises

Worked solutions are in 17_solutions.ipynb. The cell below the list is a short self-check to start from.

  1. Verify a result. Implement held_karp_exact_tsp(dist_matrix) in NumPy solving the exact asymmetric/symmetric Travelling Salesperson Problem on N=11N = 11 priority relief sites (11⋅210=11,26411 \cdot 2^{10} = 11{,}264 table entries) with exact backpointer tour reconstruction. Benchmark emergence_verification.simulated_annealing_tsp against held_karp_exact_tsp, proving SA achieves < 0.5% optimality gap while comparing state counts against (N−1)!/2=1,814,400(N-1)!/2 = 1{,}814{,}400 brute-force tours.

  2. Find how it fails. Perform a Mission-Wide Failure Audit quantifying two dangerous shortcuts: (a) Compare a naive flat-earth straight-line flight path from (10, 10) to (52, 52) on make_topographic_terrain(64, 64, seed=42) (assuming constant base cell cost 1.0, budgeting 1.75×1.75\times the flat cost for battery capacity) against the actual cumulative terrain-climb energy burned flying that straight ridge-crossing line vs. the elevation-aware A* saddle-pass detour. (b) Sweep LoRa communication range rcomm∈[8,34] kmr_{\mathrm{comm}} \in [8, 34]\ \mathrm{km} across the 60-station basin to expose the sharp continuum percolation blackout below the critical range (at rcomm=11 kmr_{\mathrm{comm}} = 11\ \mathrm{km}).

  3. Implement it yourself. Implement plan_battery_constrained_multi_drone_sorties(dist_matrix, depot_idx, max_range_km) in NumPy solving multi-sortie capacitated relief routing across a 16-site network (1 Command Depot + 15 survivor sites, or general NN-node dist_matrix). First order the non-depot sites using a 2-opt Simulated Annealing giant tour, then apply Beasley’s (1983) Shortest-Path DAG Split DP: construct an auxiliary (M+1)(M+1)-node DAG where directed edge (i→j)(i \to j) (0≤i<j≤M0 \le i < j \le M) represents feasible sortie depot -> seq[i] -> ... -> seq[j-1] -> depot iff its total distance ≤max_range_km\le \mathrm{max\_range\_km}, and find the exact minimum-total-distance partition. Verify 100% customer coverage, strict battery feasibility on every sortie, and exact optimality of the DAG Split step against exhaustive 2M−12^{M-1} cut enumeration.


Self-check for the exercises
============================
All checks passed.