fragility¶
Hazus 6.1 equivalent-PGA damage at bracketing design levels.
quakecascade.fragility
¶
Hazus 6.1 equivalent-PGA building fragility.
Damage is driven by peak ground acceleration and evaluated with the Hazus lognormal fragility function (FEMA 2024, Hazus 6.1 Earthquake Model Technical Manual, Section 5.4, Equation 5-2)::
P(DS >= ds | PGA) = Phi( ln(PGA / theta_ds) / beta_ds )
with theta_ds the median equivalent PGA of damage state ds and
beta_ds the dispersion of its natural logarithm. Discrete damage-state
probabilities follow by differencing the exceedance curves.
Calibration
The curves are calibrated for US construction practice: Hazus maps its design
levels onto US code eras and its reference demand spectrum onto a large
magnitude western-US earthquake at a soil site. Mapping a building stock
outside the US onto these design levels is an analyst's assumption, so the
year-to-level mapping (design_level_from_year) has no default: the
caller supplies the tiers and their source. Bracketing a scenario with several
design levels (damage does this by default) shows how much of the
answer rests on that assumption.
Source of the arithmetic: PlanX engine/seismic.py (same author), ported
without change to the arithmetic. One deliberate change: a non-finite PGA now
propagates NaN instead of reading as "no damage" (missing is never zero).
DAMAGE_STATES
module-attribute
¶
Damage-state ladder, lightest first. Index into every per-state array.
HAZUS_DAMAGE_STATES
module-attribute
¶
The four damage states Hazus tabulates, in its own order.
HAZUS_PGA_BETA
module-attribute
¶
Total dispersion of the equivalent-PGA structural curves (FEMA 2024, Section 5.4.3, Tables 5-37 to 5-40): the SRSS of the damage-state threshold uncertainty beta_M(SPGA) = 0.4 and the spatial variability of long-period demand beta_D(V) = 0.5; sqrt(0.4^2 + 0.5^2) = 0.64, the value printed in all four tables (manual p. 5-65 to 5-66).
HAZUS_PGA_BETA_THRESHOLD
module-attribute
¶
The two components of HAZUS_PGA_BETA (same source), kept separately so a simulation can tell the building-specific part (threshold) from the part shared by neighbours through the shaking (demand).
HAZUS_PGA_BETA_DEMAND
module-attribute
¶
The two components of HAZUS_PGA_BETA (same source), kept separately so a simulation can tell the building-specific part (threshold) from the part shared by neighbours through the shaking (demand).
HAZUS_EQUIVALENT_PGA_FRAGILITY
module-attribute
¶
Equivalent-PGA structural fragility medians, in g, taken VERBATIM from the Hazus Earthquake Model Technical Manual 6.1 (FEMA, 2024) Section 5.4.3, Tables 5-37 to 5-40. Transcribed from the published PDF, not recalled. Every tabulated dispersion is beta_SPGA = 0.64 = sqrt(0.4^2 + 0.5^2), the SRSS of the damage-state threshold uncertainty and the spatial variability of long-period ground-motion demand (manual p. 5-65). Order within each tuple: (slight, moderate, extensive, complete). None = the manual marks the type as not permitted at that design level.
HAZUS_DESIGN_LEVELS
module-attribute
¶
Hazus design levels, weakest first. The manual's own terms are Pre-Code, Low-Code, Moderate-Code and High-Code (FEMA 2024, Section 5.4.3).
BUILDING_TYPES
module-attribute
¶
Hazus base building types offered for height resolution, with the manual's
short description (FEMA 2024, Table 5-1). C3, S5 and URM are not listed
here because Hazus prints no Moderate-Code or High-Code curve for them; their
height-resolved labels (C3L ...) can still be passed directly and are
evaluated where the manual tabulates them.
HEIGHT_CLASS_BOUNDARIES
module-attribute
¶
Height-class boundaries in storeys (FEMA 2024, Table 5-1): low-rise 1-3 storeys, mid-rise 4-7, high-rise 8 or more.
normal_cdf
¶
Standard normal cumulative distribution function, elementwise.
Uses scipy.special.ndtr when SciPy is installed and
0.5 * (1 + erf(z / sqrt(2))) otherwise.
height_class
¶
Height class letter ("L", "M" or "H") for each storey count.
Boundaries from FEMA (2024) Table 5-1. A non-finite storey count gets
default; mid-rise is the PlanX screening convention, not a Hazus value,
and damage reports every row where it was used.
resolve_building_type
¶
Hazus label for a base type and storey count, e.g. C1 + 5 -> C1M.
Types Hazus does not split by height (W1, W2, S3, PC1, MH) are returned
unchanged, as is a label that already carries its height class (C1L).
RM1 and URM have no high-rise class, so tall ones stay mid-rise. When no
floor count is available default_height is used.
Raises:
| Type | Description |
|---|---|
ValueError
|
For an empty or unknown type, so a typo cannot reach the fragility tables as a silent default. |
damage_medians
¶
Median equivalent PGA (g) per damage state, state on axis 0.
Returns an array of shape (4,) + input_shape holding the Slight,
Moderate, Extensive and Complete medians (FEMA 2024, Tables 5-37 to 5-40).
Raises:
| Type | Description |
|---|---|
ValueError
|
For a type the manual does not tabulate at that design level. |
damage_probabilities
¶
Discrete damage-state probabilities for each building.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
im
|
float or array_like
|
Peak ground acceleration in g, broadcastable against the level and type arrays. Zero or negative PGA means no demand (P(none) = 1); a non-finite PGA gives NaN in every state. |
required |
design_levels
|
str or array_like
|
Hazus design level(s) and height-resolved label(s). |
required |
building_types
|
str or array_like
|
Hazus design level(s) and height-resolved label(s). |
required |
beta
|
float
|
Lognormal dispersion; default 0.64 (FEMA 2024, Tables 5-37 to 5-40). |
HAZUS_PGA_BETA
|
Returns:
| Type | Description |
|---|---|
dict
|
Keyed by every entry of |
design_level_from_year
¶
Hazus design level for each construction year, from caller-supplied tiers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
years
|
array_like
|
Construction years. |
required |
tiers
|
sequence of (max_year, level)
|
Oldest first, cutoffs strictly increasing. A year at or below a cutoff
gets that level. There is no default: which local code era corresponds
to which Hazus level is an analyst's judgement that must carry its own
source. Use |
required |
Returns:
| Type | Description |
|---|---|
numpy.ndarray of object
|
Level names; |
damage
¶
damage(
pga_g,
building_type,
floors=None,
design_levels=HAZUS_DESIGN_LEVELS,
beta=HAZUS_PGA_BETA,
default_height="M",
)
Damage-state table for a building stock.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pga_g
|
array_like or Series
|
PGA in g per building. A Series index becomes |
required |
building_type
|
str or array_like
|
Hazus base type ( |
required |
floors
|
array_like
|
Storey counts used to resolve the height class (FEMA 2024, Table 5-1). |
None
|
design_levels
|
str, sequence of str, or array/Series
|
A string or a list/tuple of level names brackets the scenario: every
building is evaluated at each listed level and the table is long, with
a |
HAZUS_DESIGN_LEVELS
|
beta
|
float
|
Lognormal dispersion, default 0.64 (FEMA 2024). |
HAZUS_PGA_BETA
|
default_height
|
('L', 'M', 'H')
|
Height class used where |
"L"
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
|