Aanpassen van geïntegreerde faalkans
Voor de module impactanalyse kan een totale of geïntegreerde faalkans worden berekend. Dit is een combinatie van een overschrijdingsfrequentielijn en een fragility curve. Om het mogelijk te maken om de fragility curve aan te passen kan de functie FragilityCurve.reliability_update()
worden gebruikt. Het process van combineren, aanpassen en weer combineren wordt hier weergegeven.
from pathlib import Path
import matplotlib.pyplot as plt
from toolbox_continu_inzicht import Config, DataAdapter
= Path.cwd() / "data_sets"
path = Config(config_path=path / "integrate_statistics.yaml")
config
config.lees_config()= DataAdapter(config=config) data_adapter
from toolbox_continu_inzicht.fragility_curves import IntegrateFragilityCurve
Voor het bepalen van een totale jaarlijkse kans combineren we een conditionele kans (fragility curve, wat iets zegt over de sterkte) met een kans dat die belasting optreedt (waterstands frequentiecurve). Hiervoor maken we gebruik van de functie IntegrateFragilityCurve
.
= plt.subplots(1)
fig, ax = data_adapter.input("fragility_curve_csv")
fragility_curve_df = data_adapter.input("exceedance_curve_csv")
exceedance_curve_df
="hydraulicload", ax=ax)
fragility_curve_df.plot(x"Failure probability")
ax.set_ylabel(= ax.twinx()
ax2 ="hydraulicload", ax=ax2, color="C1")
exceedance_curve_df.plot(x
# maak een mooie legenda
ax2.legend().remove()= ax.get_legend_handles_labels()
handles, labels = ax2.get_legend_handles_labels()
handles_, labels_ + handles_, labels + labels_); ax.legend(handles
Met de functie IntegrateFragilityCurve
integreren we de fragility curve uit
= IntegrateFragilityCurve(data_adapter=data_adapter)
integrate_statistics_per_section
integrate_statistics_per_section.run(input=["exceedance_curve_csv", "fragility_curve_csv"], output="result"
)
Deze kans voor een gegeven waterstand kunnen we weergeven in een grafiek
= integrate_statistics_per_section.df_out
initial_integrated_curve = plt.subplots()
fig, ax
ax.bar("hydraulicload"],
initial_integrated_curve["probability_contribution"],
initial_integrated_curve[=0.1,
width
)0, 10])
ax.set_xlim(["Water level")
ax.set_xlabel("Probability contribution"); ax.set_ylabel(
In sommige gevallen wil een beheerder dit aanpassen, bijvoorbeeld omdat hij weet dat een bepaalde waterstand al is opgetreden. Dit aanpassen kan met de functie FragilityCurve.reliability_update()
from toolbox_continu_inzicht.base.fragility_curve import FragilityCurve
= 4.3
update_level = 1
trust_factor
= FragilityCurve(data_adapter=data_adapter)
fragility_curve "fragility_curve_csv")
fragility_curve.load(=update_level, trust_factor=trust_factor) fragility_curve.reliability_update(update_level
Hier komt een nieuwe curve uit
data_adapter.set_dataframe_adapter("updated_fragility_curve", fragility_curve.as_dataframe(), if_not_exist="create"
)
Hier kunnen we opnieuw voor integreren en en we zien dat de curve naar rechts is opgeschoven.
= IntegrateFragilityCurve(data_adapter=data_adapter)
integrate_statistics_per_section
integrate_statistics_per_section.run(input=["exceedance_curve_csv", "updated_fragility_curve"], output="result"
)
= integrate_statistics_per_section.df_out
df_out = plt.subplots()
fig, ax
ax.bar("hydraulicload"],
initial_integrated_curve["probability_contribution"],
initial_integrated_curve[=0.1,
width
)"hydraulicload"], df_out["probability_contribution"], width=0.1)
ax.bar(df_out[0, 10])
ax.set_xlim(["Water level")
ax.set_xlabel("Probability contribution"); ax.set_ylabel(