Mathematical modelling of system resilience. (2022)