Skip to content

Commit 3b8f93d

Browse files
committed
fix(perturbation-sim): weakest_links prints sens/λ₂ in scientific notation
Susceptances are ~6e-5 (estimated from line length in metres), so the Fiedler sensitivities are ~1e-8 and printed as 0.00000 in fixed notation — misleading. Switched to {:.3e}; the ranking (line 150 top, sens 2.07e-8 / λ₂-loss 39%) and base λ₂ = 3.15e-7 (the OSM ES core is very weakly connected) now read correctly.
1 parent 50a005c commit 3b8f93d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

crates/perturbation-sim/examples/weakest_links.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn main() {
8282
struct_rank.sort_by(|x, y| y.1.partial_cmp(&x.1).unwrap());
8383

8484
println!("== 1. Structural weakest links (first-order Fiedler sensitivity ∂λ₂/∂wₑ) ==");
85-
println!(" base λ₂ = {lam2:.6}");
85+
println!(" base λ₂ = {lam2:.3e}");
8686
let mut bridges = 0usize;
8787
for (e, sens) in struct_rank.iter().take(10) {
8888
// Exact recompute for the top lines only.
@@ -99,7 +99,7 @@ fn main() {
9999
bridges += 1;
100100
}
101101
println!(
102-
" line {e:>4} {:<16} sens {:>8.5} exact λ₂-loss {:>6.2}%{}",
102+
" line {e:>4} {:<16} sens {:>10.3e} exact λ₂-loss {:>6.2}%{}",
103103
lbl(*e),
104104
sens,
105105
100.0 * loss,

0 commit comments

Comments
 (0)