abdessamad-bourkibate commited on
Commit
1184bdc
·
verified ·
1 Parent(s): beb6deb

Update engine/regimes.py

Browse files
Files changed (1) hide show
  1. engine/regimes.py +14 -0
engine/regimes.py CHANGED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def classify_regime(lam: float, tol: float) -> str:
2
+ # Near-boundary if |λ| ≤ tol
3
+ if abs(lam) <= tol:
4
+ return "Near-boundary"
5
+ return "Stable" if lam < 0 else "Unstable"
6
+
7
+
8
+ def fragility_level(F: float) -> str:
9
+ # Smaller F => closer to boundary => more fragile
10
+ if F < 0.05:
11
+ return "High"
12
+ if F < 0.15:
13
+ return "Moderate"
14
+ return "Low"