Run-time monitoring for the diagnosis and recovery of complex physical systems