WS 2.8: Dirty Water¶

No description has been provided for this image No description has been provided for this image

CEGM1000 MUDE: Week 2.8. Wednesday January 15, 2024.

Introduction¶

In this exercise we apply a few simple concepts from the textbook to derive a safety standard to regulate spills in a chemical factory. You are asked to consider an economic and societal standard, then make a recommendation to the city council.

Case Study¶

A city with population 10,000 uses an aquifer for its water supply, as illustrated in the figure. The city owns a factory in the region that manufactures hazardous chemicals, and recently a chemical spill occurred that resulted in 10 residents getting sick and total damages of €7,000M*. The city is going to enforce stricter regulations on the factory, and you have been hired to advise the city council on the maximum allowable probability of a spill occurring (per year). You will make a recommendation based on the more stringent criteria between economic and societal risk limits.

sketch of factory, houses and contamination plume

Experts have been consulted and it appears under the current plan the probability of a spill is 1/100 per year. The city council is considering two strategies to upgrade the spill prevention system. A small upgrade would cost €25M and can reduce spill probability by a factor 10; a large upgrade with investment costs of €50M would reduce the probability by factor 100.

The city has also considered the regulations in a nearby region which uses a maximum allowable probability of 1 person getting sick as $p_f=0.01$. The city agrees with this, however, they are very much risk averse (that's a hint!), regarding spills with more significant consequences.

*M = million, so 7,000M is 7e9, or 7 billion. All costs in this exercise are expressed in units €M.

In [1]:
import numpy as np
import matplotlib.pyplot as plt

Task 1:

What is best strategy in terms of total cost of the system?

Your answer here.

Task 2: Assuming that the number of people in a future spill would also be 10 people, what is the maximum allowable spill probability based on societal risk standards?

Make a plot of the societal risk limit and add a point for the case of the city factory.

In [ ]:
C = YOUR_CODE_HERE
alpha = YOUR_CODE_HERE

pf_societal = YOUR_CODE_HERE
print(pf_societal)

N_values = YOUR_CODE_HERE
limit_line = YOUR_CODE_HERE

fig, ax = plt.subplots(figsize=(8, 6))
YOUR_CODE_HERE
YOUR_CODE_HERE
ax.set_title('YOUR_CODE_HERE')
ax.set_xlabel('YOUR_CODE_HERE')
ax.set_ylabel('YOUR_CODE_HERE')
ax.legend(fontsize=14)
plt.yscale('log')
plt.xscale('log')
ax.grid(True)
plt.show()

Task 3:

Provide your advice to the polder’s authorities for the safety standard based on the outcomes of the economic analysis (Task 1) and societal risk (Task 2).

Your answer here.

Additional Risk Analysis¶

It turns out that since the spill occurred an evaluation was completed by a third party company, where they identified the following scenarios, along with estimated a probability of each event occurring. The city would like you to see if it would conflict with your safety recommendations. The results of the risk analysis are provided as the probability associated with a specific number of people getting sick; that is:

$$ p_i = P[n_{i-1} < N \leq n_i] $$

For $i=1:N_s$, where $N_s$ is the number of scenarios; specific values of the consequence, $n_i$, of each scenario $i$ are provided in the Python code cell below, along with the associated probability. Note that the intervals of $N$ are used to simplify the analysis, rather than provide a specific value for every possible number of people getting sick.

Task 4:

Create the FN curve for the factory and compare it with the societal risk limit you determined above.

Hint: you may find it useful to use np.cumsum as well as Matplotlib's step function (in particular, consider whether to use pre, post or mid for keyword argument where).

In [ ]:
n_and_p = np.array([[1,   0.099],
                    [2,   7e-4],
                    [5,   2e-4],
                    [10,  9e-5],
                    [20,  5e-6],
                    [60,  3e-6],
                    [80,  6e-7],
                    [100,  4e-7],
                    [150, 8e-8]])

N_plot = n_and_p[:, 0]

p_cumulative = YOUR_CODE_HERE

fig, ax = plt.subplots(figsize=(8, 6))
YOUR_CODE_HERE
YOUR_CODE_HERE
YOUR_CODE_HERE
ax.set_title('YOUR_CODE_HERE')
ax.set_xlabel('YOUR_CODE_HERE')
ax.set_ylabel('YOUR_CODE_HERE')
ax.legend(fontsize=14)
plt.yscale('log')
plt.xscale('log')
# plt.xlim(YOUR_CODE_HERE, YOUR_CODE_HERE)
# plt.ylim(YOUR_CODE_HERE, YOUR_CODE_HERE
ax.grid(True)
plt.show()

Task 5:

As you may have noticed, the risk in the system does not satisfy your recommendation. Play with the values of $n$ and $p$ to see how you can satisfy the safety standard. Then, select a few "modifications" to the $n$ and/or $p$ values and describe how you might be able to make that change in reality. Keep in mind that making interventions to the system is expensive, so to be realistic you should try to do this by making the smallest change possible; in other words, find the smallest change in $n$ or $p$ separately; don't change many values all at once.

Report your findings as if they were a recommendation to the city. For example: if one were to reduce $p$ of something from value to value by implementing your plan here, the FN curve would shift specify direction, and the safety standard would be satisfied.

Yes, this is an overly simplistic exercise exercise, but it is a good way to think about how to apply the concepts of risk analysis to real-world problems, and to make sure you understand the mathematics of how they are constructed. Also note that each "point" comes from a scenario; in real risk applications it can be quite involved to decide on and carry out the computations required for each scenario.

In [ ]:
n_and_p_modified = n_and_p.copy()
n_and_p_modified[YOUR_CODE_HERE, YOUR_CODE_HERE] = YOUR_CODE_HERE

DUPLICATE_ANALYSIS_FROM_ABOVE_WITH_MODIFIED_VALUES

Task 6:

Calculate the expected number of people getting sick per year for the factory under the current conditions.

Note that we don't do anything with this calculation in this assignment, but it is often a useful way to quantify the risk of a system, or, for example, comparing two or more types of systemts; various factories, in this case.

In [ ]:
YOUR_CODE_HERE

End of notebook.

MUDE TU Delft Creative Commons License
© Copyright 2024 MUDE TU Delft. This work is licensed under a CC BY 4.0 License.