abdessamad-bourkibate's picture
Update engine/regimes.py
1184bdc verified
raw
history blame contribute delete
382 Bytes
def classify_regime(lam: float, tol: float) -> str:
# Near-boundary if |λ| ≤ tol
if abs(lam) <= tol:
return "Near-boundary"
return "Stable" if lam < 0 else "Unstable"
def fragility_level(F: float) -> str:
# Smaller F => closer to boundary => more fragile
if F < 0.05:
return "High"
if F < 0.15:
return "Moderate"
return "Low"