Q Oc

Equivalent resistance and capacitance due to inertia C p , R

Temperatures inside, with outside φ o , φ a , φ p , Total indoor energy gains respectively for φ c , φ k office, Anna, parent, kitchen

C i J.K -1
Capacity of the fictive wall

Q cor m 3 .s -1
Airflow with the corridor

Q D m 3 .s -1
Airflow by the door

Q out m 3 .s -1
Airflow with the outside

Q W m 3 .s -1
Airflow by the window

R D K.W -1
Thermal resistance of the door

R i K.W -1
Thermal resistance of the fictive wall

R n K.W -1
Thermal resistance of the interior wall

R out K.W -1
Thermal resistance of the exterior wall

R w K.W -1
Thermal resistance of the window S CO 2 ppm.m 3 .s -1 .per

General Introduction

Under the sustainable development focus of European Horizon 2020, the importance of building sector deserve a special attention. A part from the envelops, it includes the Standard EN 15232:2007[START_REF] Uni En | Energy performance of buildings-economic evaluation procedure for energy systems in buildings[END_REF] i.e the introduction of the concept of nearly zero-energy building as well as hightech building materials i.e use of eco-efficient thermal insulators, materials with lower embodied energy and many more. Indeed, the influence of resource efficiency on building sector is clearly expressed by the milestone below: "By 2020 the renovation and construction of buildings and infrastructure will be made to high resource efficiency levels. The lifecycle approach will be widely applied; all new buildings will be nearly zero-energy and highly material efficient and policies for renovating the existing building stock will be in place" [START_REF] Herczeg | Resource efficiency in the building sector[END_REF]. However, Fault Detection and Diagnosis is much more treated by industry than Life cycle analysis in buildings. In fact, the whole building system is highly vulnerable to different kinds of faults, failures and human misbehavior that could affect the building performance. The detection of faults in buildings has become a major issue. Until now, the literature is extremely large on each item mentioned below.

1. Modeling and optimization of HVAC energy consumption [START_REF] Kusiak | Modeling and optimization of hvac energy consumption[END_REF] 2. Improving energy efficiency via smart building energy management systems [START_REF] Rocha | Improving energy efficiency via smart building energy management systems: A comparison with policy measures[END_REF] 3. Estimating the number of occupancy and their activities in buildings. [START_REF] Amayri | Estimating occupancy in heterogeneous sensor environment[END_REF] identifies the most relevant calculation from the sensor data in order to classify the number of people in a zone and their activities in offices/homes at a given time period.

4. Modeling physical part of the building. In [START_REF] Scanu | Model tuning approach for energy management of office and apartment settings[END_REF], different kinds of models are implemented as well as different estimation methods. A selection methodology is set up in order to identify and validate the best model structure for the energy services. Finally, an automatic procedure to generate the model and services from only the informations provided by the end-user.

5. Explanations for energy in buildings i.e. to put the occupants in the loop of usage energy efficiency, to help them to understand their energy management system and to support them to achieve their objectives [START_REF] Alzouhri Alyafi | Differential explanations for energy management in buildings[END_REF] 6. Energy performance guarantee [START_REF] Ligier | Développement d'une méthodologie pour la garantie de performance énergétique associant la simulation à un protocole de mesure et vérification[END_REF].

7. Operating performance in green buildings: occupant satisfaction, energy use and environmental quality [START_REF] Geng | A review of operating performance in green buildings: Energy use, indoor environmental quality and occupant satisfaction[END_REF] 8. Mirror and key performance indicators which depict the performance of energy efficiency in buildings. Indicators are means of communication which interact with the occupants so that they can take informed decisions regarding their everyday customs and uses (Amayri et al., 2019a) The thesis of Mahendra Pratap Singh [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF] proposes the concept of heterogeneous tests with validity constraints in the context of building fault diagnosis but the proposed approach assumes that the sensors are reliable and are only interested in thermo-aeraulic processes and heating systems. However, the combination of sensor and actuator faults increases the complexity in the building and existing diagnostic techniques so far don't solve them and there is a need to apprehend the complexity.

The validity constraints are measured with sensors. If these sensors are faulty, the diagnostic result is not guaranteed and there is a need for a method to prove the test as well as global diagnosis.

To make a test, data are required from different physical parts of the building. However, the data gaps is the main sensor fault in buildings. Sensor values are not uniformly sampled and there is a need to decide from which delay the sensor becomes faulty? In addition, the knowledge of the expert could facilitate the fault diagnosis.

The objective of this work is to highlight these challenges as well as to provide a strategy about how to solve them. The presentation of this work is structured in the following way.

Chapter 1 deals with new challenges for fault detection and diagnosis in buildings illustrated by an application.

Chapter 2 discusses the problem statement and research objective for this work. The following points are to be solved in this work: complexity, modeling problem, no universal model, need for testing in specific context, need for an indicator to prove diagnosis and unreliable instrumentation in building.

Chapter 3 highlights the problem of complexity in building. At the beginning, diagnosability challenges in building are discussed. Then, a framework for a global diagnostic approach based on detection tests and diagnosis for first principle is presented. Two real case studies have been studied to exemplify the complexity due to the model and the number of sensors: an office setting and an apartment. Chapter 4 presents the first step to apprehend the problem of complexity. This step consists on improving decision making in building diagnosis using heterogeneous tests with constraints of validity. The knowledge from heterogeneous tests proposed in [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF] solve the whole-building modeling difficulty. The contribution is that the sensor level is emphasized in this work. The difficulties encountered the validity are highlighted. A level of completeness is proposed as a method for better formalizing validity. In this work, we make the hypothesis that there is no precise global model for a building system but there are contextual models with limited validity. The validity is measured with potentially faulty sensors. The problem is how to prove the test and the global diagnosis in the case of a set of tests. The test space consists of a set of measurements. The completeness level is proposed as a method to prove if a test space is fully covered or not i.e to assess a level of validity for a test.

Chapter 5 presents the concept of confidence level for diagnosis in order to compute test validities in spit of unreliable sensors. The diagnostic result is calculated from a set of tests, each one defined by its completeness level. The question that arise is how to conclude about global diagnosis? To overcome this problem, a method based on fuzzy logic reasoning is used to compute the confidence level of global diagnosis deduced from a set of tests whose some of them have a completeness level lower than 1. An office has been used for validation.

Chapter 6 deals with the problem of unreliable instrumentation in buildings. The sensor data gaps is the most important fault type in buildings. In fact, sensor measurements are not uniformly sampled. The delay depends on the measured variable and the type of sensor.

The question that arises is from which delay a sensor becomes faulty? To overcome this problem, two algorithms for automatic thresholding for data gap detection for a set of sensors are proposed (time series analysis and statistical approaches). An office has been used for testing.

Chapter 1

Diagnosis in buildings: new challenges illustrated by an application

Introduction

Smart buildings and their appliances are becoming more and more efficient as well as they deliver useful building services that make occupants comfortable by providing them thermal comfort, air quality and many more. They are an important provider of technology systems as well as they include HVAC systems, sophisticated controllers, energy management systems and a large number of sensors. However, buildings are vulnerable to various faults, failures and various events that could cause a discrepancy in building performance and consequently a discomfort to occupants. In International Energy Agency Annex on Fault Detection and Diagnosis about 25 years ago (Annex, 1996), diagnosis in buildings became an interesting field of research. Different techniques have been developed in the literature to determine the faults that can affect the whole building performance. A smart building is defined by the group of the European Intelligent Building as "one that creates an environment which maximizes the effectiveness of the building's occupants while at the same time enabling efficient management of resources with minimum lifetime costs of hardware and facilities" [START_REF] Ghaffarianhoseini | What is an intelligent building? analysis of recent interpretations from an international perspective[END_REF]. However, the number of occupants and their activities, the building envelope, the building interaction with the outside environment, the number of sensors and the presence or absence of HVAC systems makes each building unique. From this definition, we conclude that a building system is complex. It is decomposed into two parts: the physics with the building envelop, devices for energy management and various appliances, as well as human part. These two parts interact and it is difficult to model this interaction and to elaborate a global building model. In fact, it is difficult to predict the inputs. The models are rather good +/ -1 • C error. In order to define the model of the building, data are required from different parts: meteorological (i.e. outdoor temperature), human (i.e. occupancy) and physical (i.e. airflow) parts. Measuring theses variables need reliable sensors. However, these data are not always accurate: they may be biased, random or subject to outliers. Extracting sensor measurements will open the gate to develop new tools in the diagnosis of unreliable sensors in smart buildings. A conventional rule-based building automation system (BAS) provides alarms based on thresholds. In the domain of diagnosis, these thresholds are known as fault detection and measure the abnormality in building performance. Indeed, alarms require further analysis by the facility manager to identify the fault type and their consequences. The corrective actions could be online, maintenance, feedback or personalized recommendation. The fault diagnosis analysis is generated from the modeled behavioral of the system thanks to detection tests. Conversely, there are several situations in which diagnosed faults are not correct due to change in the local context of the tested building site because underlying tests are not context independent. These local contexts are hard to model and lead to invalid diagnosis results. In more general term, the validity of diagnosed fault and the confidence level for diagnosis are always questioned. The growing interest in the effective concretization of performance objectives and thus in the verification of real building performances has given rise to a large number of test projects related to research work but also with a view to making these practices easier. This theme, which deals with the "performance gap" and the gap between actual building performance and the prior estimates, is concerned with the characterization of this gap, the search for causes and the development of methodological or operational solutions for reducing it. The performance gap is a problem of fault detection and diagnosis because of the unavailability of a complete model valid in all contexts. In fact, it is difficult to obtain a complete model. For example, variables like the blinds position are neglected in the modeling. The major difficulties faced during modeling include the lack of detailed information on the constitution of the building, the uncertainty about occupant use and behavior and many more. In addition, a universal valid model i.e., valid whatever the context, is difficult to set up. Diagnosis reasoning must differ in different scenarios, e.g., fault detection and diagnosis approaches should be different for normal working days and a vacation period. In [START_REF] Ligier | Développement d'une méthodologie pour la garantie de performance énergétique associant la simulation à un protocole de mesure et vérification[END_REF], a global and innovating methodology allowing to implement contracts of performance guarantee of the buildings is proposed. The characterization of observed performance differences and the study of associated causes aim at developing methods to limit these differences. This involves more realistic and representative simulations of future operational conditions, by monitoring and accompanying the implementation and by increasing control of the building's operation. Achievement of these objectives may include actors in the building sector better control of risks and the implementation of energy performance contracts; we talk about energy performance guarantee (EPG). The energy performance guarantee is naturally leading to fault detection and diagnosis. In fact, if we doesn't meet a performance criterion, for example, the year energy need of a building, and which is not verified, we need a diagnostic analysis to know the causes of the non-satisfaction for this criterion. One of the main objectives related to methods for EPG is to quantify the risk of fault associated with a guaranteed value of consumption. This is directly related to the knowledge of the risks related to construction or renovation projects but also to the exploitation. These are linked to several problems: an imperfect diagnosis of the existing building, a bad operation and maintenance of energy systems and many more. The conclusion to be drawn is when we exceed the guaranteed thresholds, we do not know how to find causes. This chapter is motivated by new challenges in buildings illustrated by an application. A state of the art about diagnosis in buildings is presented in section 1.2. In section 1.3, the major challenges that lie in this problem domain are identified. Finally, an overview of diagnosis methods and their limitations are reviewed in section 1.4.

1.2 Fault diagnosis in buildings: state-of-the-art

Faults in buildings

It is difficult to obtain detailed information on energy consumption in buildings since it requires more detailed monitoring and measurements than what is usually available. However, the energy consumption yearly report USDOE (2010) shows how the total energy consumption can be divided into different end-uses in commercial buildings (Figure 1.1). The statistics show that the energy end-use of commercial building are as follows: lighting 20.2%, spacing heating 16.0%, spacing cooling 14.5%, ventilation 9.1%, refrigeration 6.6%, other end-uses 33.6% (USDOE, 2010;[START_REF] Treado | Saving building energy through advanced control strategies[END_REF]. The faults in the system can occur in connection with each of these end-uses. This figure reveals how costly a fault could be in terms of its energy use. Studies show that 25%-45% of energy HVAC energy consumptions are wasted due to faults, i.e to a difference between the characteristic observed on the device and the reference characteristic when it is out of specification, including improper control logic and strategy, malfunction of controllers and controlled devices, etc. [START_REF] Akinci | Identification of functional requirements and possible approaches for self-configuring intelligent building systems[END_REF]. In addition, the waste of energy is also due to a non optimal control. In fact, a number of studies [START_REF] Moroşan | Building temperature regulation using a distributed model predictive control[END_REF][START_REF] May-Ostendorp | Model-predictive control of mixed-mode buildings with rule extraction[END_REF] indicated that optimal control strategies can reduce the energy waste and improve the overall building energy efficiency. The assets within buildings may be classified as parts of several systems according to the services they provide to owners. For example, HVAC systems provide hot water and heat and electrical systems provide electric power and possibly heat. However, each building system breaks down over time, and regular maintenance, repairs, and renewals are required to keep a building in working order. For example, items such as light fixtures and control panels in electrical part in building are subject to breakdown. In addition, the HVAC system in building is responsible for the heating, domestic hot water, ventilation, and cooling of a building. It consists of assets such as pumps, filters, boilers, fans, and air conditioning equipment. These assets tend to have short to medium service lives, breaking down due to regular wear.

Misusage:

Another important type of faults in buildings is misusage but it has not yet received much attention in the scientific literature. Usage in general refers to the function of serving or using something. We must think and conceive quality, not only from techniques and standards, but also from the user as a human and social being. When users occupy a building, they appropriate these three entities: envelope, equipment and internal organization, and adjusts them as much as possible to their own comfort level. Occupants interact with the environment around them. One of the main criteria of the confort of occupants is the control of these interactions. In general, users prefer simple and modular equipment and systems. All stages of the project life influence the final quality of the building. Therefore, even if the use of a building is only effective during its operational phase, it is important to ensure that certain good practices are followed during each stage of the building's life in order to guarantee good quality of use. The notion of quality of use is a factor that must be integrated when planning the building. About 65% of the discomfort encountered during the follow-up are due to errors made during the programming and design phases. The evolution of home automation in buildings certainly requires a new grip on the part of the user, but it must not be forgotten that this is the building that must adapt to the needs of the user and not the other way around. Misuse of the building may have effects harmful to:

-the comfort of the user -the health of the user -the durability of the building -the environment with overconsumption linked to poor control of the equipment.

The bad uses are almost the same in any residential dwelling. The consideration of human behavior is essential in the application of diagnosis in buildings. Let's take the following examples: frequent door opening and use of an important number of appliances.

Human mistake:

Human mistake is another important type of faults in buildings which has not received an adequate level of attention. Beyond the construction literature it is common ground that human error, not technology, predominates in failures of all types [START_REF] Raymond | Pavement failures: oversights, omissions and wishful thinking[END_REF]Health et al., 1993). Examples of such faults are HVAC left on when space is unoccupied. Human mistake is a very known fault type in diagnosis domain. A lot of studies like [START_REF] Atkinson | Human error in the management of building projects[END_REF] shows the role of early detection of human errors in building projects.

Wrong configuration:

Further investigation shows that faults due to the wrong configuration are also a typical fault in new buildings, which has not received an adequate level of attention [START_REF] Mickens | Snitch: Interactive decision trees for troubleshooting misconfigurations[END_REF]; [START_REF] Lazarova-Molnar | Fault detection and diagnosis for smart buildings: State of the art, trends and challenges[END_REF]. Examples of such faults are: wrongly configured building equipment, where the setting of the equipment is wrong and misplaced or wrongly wired sensors and actuators.

Data failure:

Data failure is another important type of faults in buildings. The applications for sensor technology are increasing rapidly. Sensors are currently being used for applications in buildings. Sensors are continually being developed with advanced capabilities, such as more reliable data extracting. These sensors can also be used to better control the building but also to estimate occupant practices essential for energy consumption by estimating the number of occupants per area and their metabolic contribution, their activities and their routines [START_REF] Amayri | Estimating occupancy in heterogeneous sensor environment[END_REF]. With the cost and size of sensors becoming cheaper and smaller at a fast rate, it has been forecasted that sensors in the near future will be installed in dense arrays to eventually monitor the entire built environment [START_REF] Estrin | Instrumenting the world with wireless sensor networks[END_REF]. There is currently a gap between modern sensing technologies and their application and applicability in the field for monitoring the performance of buildings. Research and experimental validation tests are required to assess the limitations, challenges and performance of installing new sensor technologies to monitor certain aspects of concrete structures [START_REF] Simkin | Digital buildings: Using sensors to monitor the performance of concrete buildings during the christchurch earthquake rebuild[END_REF]. The concept of healthy sensors is known in the literature. Authors like [START_REF] Li | A routing protocol for balancing energy consumption in heterogeneous wireless sensor networks[END_REF] assumed that there are two groups of sensors: sensors that correctly measure structural responses (termed as "reference sensors") and failed (or uncertain) sensors [START_REF] Roth | Energy impact of commercial building controls and performance diagnostics: market characterization, energy impact of building faults and energy savings potential[END_REF] concluded that typical faults in commercial buildings consist of 13 types of faults. The annual impact of each of them in terms of energy consumption is presented in Figure 1.2.

Figure 1.2 -The annual impact of faults in terms of energy consumption [START_REF] Roth | Energy impact of commercial building controls and performance diagnostics: market characterization, energy impact of building faults and energy savings potential[END_REF] All the types of faults mentioned above are faults of the type "normal faults", i.e. easy to reveal. On the other hand, there are other insidious types of faults. For example, there is no noise in the ventilation system does not imply no fault but no fault has been revealed. A few studies like Ilozor et al. ( 2004) defined the concept of insidious faults. In this study, authors show that rising damp refers to ground water seeping up through the footings and base walling of houses due to the absence of damp proof courses, or these being poorly edited or dislodged. It is an insidious fault that can be difficult to address, without understanding scientific concepts such as capillary action of water, drainage and hydrostatic pressure of ground water.

Application examples

This section demonstrates new challenges in buildings illustrated by applications. Different case studies have been investigated with diversity according to their context (available sensors, occupancy or activities feedback, complexity of the environment...) to exemplify the new trends in buildings. The following applications are going to be discussed (see Table 1.2).

Monozone building application:

An office environment is firstly used: an office at Grenoble Institute of Technology, which accommodates a professor and 3 PhD students. It is considered as a simple and basic one-zone applications with lots of sensors (30 sensors). The office has frequent visitors with a lot of meetings and presentations all through the week. The setup for the sensor network includes (see Figure 1.3):

-2 video cameras for recording real occupancy and activities. Occupants behavior is one of the major influence on building energy consumption. According to [START_REF] Burak | A critical review of observation studies, modeling, and simulation of adaptive occupant behaviors in offices[END_REF], occupants behaviors account for significant uncertainty in building energy use. A better understanding of occupant behavior is needed in order to manage this uncertainty. Occupants have influence due to their presence and activities in the building and due to their control actions which aim to improve indoor environmental conditions (thermal, air quality, light, noise).

A building model requires the determination of the number of occupants, the kind of activities in the office (computer work, presentation, skype meeting, ...) and the frequency of discussions between the colleagues during the working day. The diagnosis is based on information about a building (devices, interconnected sub-systems, occupancy ...) and expected behavior (equation, rules or procedures that relate the inputs and outputs) and consists on checking the consistency between the model and the available information.

The building envelope is a total system of construction materials and design components that control the temperature, movement of air, and moisture both into and out of the building. A building's insulation, air barrier and vapor barrier all need to work together to achieve a more stable, comfortable and healthier indoor environment. Nowadays, modeling the building envelop is a challenging one. Different parameters are difficult to know and to model like the insulation thickness, the heat transfer coefficient of external wall, the insulation thermal resistance, the heat transfer through the wall, the thermal conductivity of insulation material and many more [START_REF] Af Elsafty | Case study analysis for building envelop and its effect on environment[END_REF]. About 30 sensors have been installed in the office to monitor the power consumption, the indoor temperature, the indoor CO 2 concentrations, the number of occupants and many more. Figure 1.4 shows the complete sensor configuration for the office. Sensor management is performed in order to record changes in CO 2 concentrations, temperature, electric power and many more in the different part of the platform. Sensor values are not uniformly sampled. The question that arises is from which delay each sensor become faulty? Hence, the need to determine a threshold from which the sensor become faulty.

Multizone building application

The thermodynamic state of a multi-zone building consists of temperature variables associated with many subsystems that are geographically distributed. Each subsystem corresponds to the thermodynamic interactions between adjacent zones [START_REF] Goyal | Identification of multi-zone building thermal interaction model from data[END_REF]. A multizone building system includes a split ductless air-conditioning system to provide cooling to all four rooms of a building, ventilation system that provide outdoor air for each of the spaces: a fan-only system, an energy recovery ventilation system, a dedicated outdoor air system and many more. Each of these subsystems (building, air-conditioning system, ventilation system) is represented by a high-order system model, and these system models are interconnected to form a description of the heterogeneous building dynamics. This is a challenge.

Three main categories of multi-zone models can be defined:

-energetic: modeling the thermal behavior. They provide the temperatures in each zone and allow to estimate the power consumed to heat or cool the building. Energy flows infiltrated or exchanged between parts can be integrated into the calculation as parameters.

-aeraulic: describing the movements of air. The main variable is pressure. Accurate data on the permeability of the different walls, the ventilation system, the geometry of the openings and the temperatures in each zone, allow to calculate the flow of air entering and leaving each zone. These models are necessary for representing variable effects such as wind or natural convection. They are also required to analyze the impact of the coupling of two zones through large openings (doors for example).

-hygric: representing moisture in the air and / or materials. They take not only the sources of steam, but also its transport by air and its absorption by solid materials.

Often simulation codes combine several aspects. Thus, for example, we have thermo-aeraulic or thermo-hygric models. The mathematical description of the multizone building will successively address: the thermal balance within a zone, the thermal balance through a wall, the aeraulic balance of the building and many more in a single simulation. This is another challenge.

Occupant interaction in building is also challenging one. In fact, building interaction design is presented as the interface between the end users and building systems that defines the level and method of control over the building environment and operation systems.

In [START_REF] Federspiel | Design of an energy and maintenance system user interface for building occupants[END_REF], the user interface is designed for use by occupants of commercial buildings. Allowing occupants accessing to information from the energy and maintenance systems and by given them some control over theses systems, improving task performance. Interaction with occupants could take another direction by involving them in an energy management process. This can be done by collecting information about their current state to be used in occupancy and activities estimation process.

Achieving the balance between energy consumption and occupant confort is a very complicated issue faced in addressing building performance due to an inverse relation between them [START_REF] Hailemariam | Real-time occupancy detection using decision trees with multiple sensor types[END_REF]. It also mentioned that occupancy should be taken into account besides the occupant behavior.

A first case study is about sensor placement and the issue with existing building energy management system (BEMS) in Predis/MHI located at the ENSE3 school in Grenoble-INP campus. The platform has two large rooms for users. A room is used as conference room for students while the other is an open space for building researchers. Classrooms are equipped with 15 computers and connected to the grid and the solar panels. Two other small rooms are connected to the Air Handling Units (AHU) and Building Energy Management System (BEMS). In Building Predis, more than 100 sensors are installed to monitor the total power, the indoor temperature, the indoor CO 2 concentrations and the number of occupants (see Figure 1.6).

Figure 1.6 -Sensor configuration at Predis/MHI

Sensor management is done in order to record variations of CO 2 concentrations, temperature, humidity and many more in the different parts of the platform. Figure 1.6 shows the complete sensor configuration for Predis. A thermal model and a model of air quality are validated using a sensor placement. In addition, about 40 actuators are connected to sensors and controllers. Motion detectors are able to detect the presence of occupants by their movement, In addition to natural lighting in the platform, a number of lamps are installed. Manual switches are also available to control lights in standby mode that turn them off after 15 minutes of no presence detection.

A second case study is about estimating the number of occupants and activities in a residential building context: an apartment situated in Rue Cuvier, Grenoble. It is a more complex application as compared to H358 with multi-zones and many activities. The apartment is equipped with about 62 sensors.

-temperature sensor in each room -motion sensor in each room -windows contact sensor in each room -door contact sensor in each room -kettle, microwave, dishwasher, expresso, steam cooker, fridge and oven power consumption sensors in the kitchen -appliances power consumption sensors in each room -humidity sensor in each room -luminosity sensor in each room It consists of two bedrooms, a common room, a kitchen, an office and a separate bathroom and toilets (see Figure 1.7).

Figure 1.7 -"Rue Cuvier" apartment

Tracking user activities in the daily life and estimating occupant activities are important in different areas. In [START_REF] Amayri | Estimating occupancy in heterogeneous sensor environment[END_REF], two categories have been defined in order to classify the activities: firstly, activities with possibility to interact with occupants (activities 1), secondly, when it is annoying to interact with occupants (activities 2), see A third case study is about how to track real-time ventilation fan performance using measured flow-rate in a highly energy efficient called OU44: an academic building located in the campus of University of Southern Denmark, SDU, shown in Figure 1.8 Figure 1.8 -Building OU44

The succinct description about the building OU44 is given below.

-Building Name: OU44 Several sensors and communication protocols were installed to access the efficient data measurements and performance monitoring. Moreover, 11 performance monitoring tests were also implemented to assure the continuous performance of OU44. Ventilation unit VE01, VE02, VE03 and VE04 cover most of the premise in SDU OU44. The ventilation systems are equipped with rotatory heat exchanger, which recovers heat and cooling.

The ventilation systems at OU44 are of the type VAV (Variable Air Volume) which serves three floors called the ground floor, living room and 1st floor. Living room and ground floor are divided into zones with one or more VAV dampers. In the first floor, there is an office area where the offices are provided with VAV dampers and common exhaust with a pressure holding damper which regulates the total extraction in relation to the total supplied air. Each AHU unit has an exhaust fan, outside and supply airflow measuring stations, mixing box, pre-filter, final filter, heating hot water coil, chilled water coil, and supply fan. A centrifugal fan provided by NK Industri (NKI) is installed in the ventilation unit. NKI climate control units are integrated with either centrifugal fans, axial fans or chamber fans. The centrifugal fans can include 2 more variants:

-BK wheels are provided with backward curved blades which are used at pressures up to 1600 Pa. The fans have a high efficiency and thus good operating economy. This fan type is suitable for plants with changes in air performance and energy consumption.

-BK/K wheels are equipped with rear curved blades in extra reinforced version for pressures up to 3000 Pa. The work area is indicated on the fan curves with colors.

The BK and BK/K wheels are driven by a jacket-cooled norm motor via an adjustable V-belt drive, which is mounted on the mounting frame, separated from the panel construction via elastic connections and vibration dampers. These fans have a high efficiency and thus economical. The fan type is suitable for installations, with changes in air performance and energy consumption. At the start of the HVAC system, the main damper is opened. The airflow for each fan is calculated in CTS (Clear-to-send) programs based on pressure measurements at the input rings for supply and return fan, respectively. Fan electricity consumption (absorbed electrical power) should be provided in the CTS system with a continuous exercising. Airflow sensors are installed inside the airflow measuring stations in the Schneider BMS system to record the airflow rate for three ventilation fan units. Accuracy of the airflow measuring satiation is marked as ± 2% at 6000 feet per minute± 0.5% at 2000 feet per minute. A graphical user interface sMAP 2.0 is a plotting engine to display the raw data. In order to deal with missing data and ambiguity in measurements, the measured data is re-sampled with the one minute sample period.

Two types of heating are installed in the platform: hydraulic heating and forced air heating from the ventilation system (see Fig. 1.9) Figure 1.9 -Heating in SDU OU44 office Ventilation fans are an essential component of any HVAC system. A considerable amount of energy goes to fan consumption. Tracking fan energy performance could also give an indication about different faults and failures in buildings. For instance, over consumption from fan could indicate partially or fully blocked duct or filter, a very poor efficiency due to the degradation of performance such as a dirty blade can reduce the rotation speed of the fan. On the other hand, under consumption might report a window or door opening, issue with speed regulator or fan is out of order etc. The proposed methodology for this problematic is the following: measured electricity consumption has been compared against the estimated fan consumption. Estimated fan consumption is derived with the help of measured air flow-rate, total pressure and efficiency. Moreover, total pressure and efficiency are obtained from ideal fan performance curve which represents the fan performance under certain conditions such as flow-rate and total pressure.

Diagnosis in buildings: new challenges

The key challenges in building diagnosis are summarized below.

Complexity

The first challenge is complexity in testing a whole building system using both rule and pure model-based test. Buildings are complex systems and the relations among the different sub-system is intricated.

Buildings are becoming more complex because of the higher expectations of users. as well as the ongoing integration of many technologies. They are equipped with HVAC systems, sensors, building automation system and supervisory controllers. According to [START_REF] Nancy G Leveson | Software engineering: Stretching the limits of complexity[END_REF], the problems in building complex systems often arise in the interfaces between the various elements such as hardware, software, and human components. Complexity is defined as uncertainty in [START_REF] Donald | Task complexity: A review and analysis[END_REF][START_REF] Terry | The need for new paradigms for complex projects[END_REF]), ambiguity in McKeen et al. (1994), variability in Ribbers and Schoo (2002), and dynamism in Wood (1986); [START_REF] Marc | An applied framework for classifying the complexity of knowledge-based systems[END_REF], which are caused by changes in organizational and technological project environments. Changes may result from either the stochastic nature of the environment or a lack of information and knowledge about the project environment.

No universal model

In connection with buildings, it is tough to develop a physical model that match precisely the reality. The various phenomenon like heat transfer from facade or unplanned occupancy are challenging jobs to model. [START_REF] Ja Clarke | Simulation-assisted control in building energy management systems[END_REF] shows that models simulate reality within +/ -1 • C (well enough). The problem is the inputs. The IEA EBC Annex 58-project "Reliable Building Energy Performance Characterisation Based on Full Scale Dynamic Measurements" [START_REF] Roels | Characterising the actual thermal performance of buildings: Current results of common exercises performed in the framework of the iea ebc annex 58-project[END_REF] is developing the necessary knowledge and tools to achieve reliable in-situ dynamic testing and data analysis methods that can be used to characterise the actual thermal performance and energy efficiency of building components and whole buildings. For identifying systems, ARX-models are one of the standard tools. ARX model structure is a linear difference equation which relates the current output at time t to a finite number of past outputs and inputs. The main problem when applying ARX-models is the inputs which are obtained from potentially faulty sensors. [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF] proposed the concept of contextual model i.e a model valid under specific contexts. These local contexts define the validity constraints. For example, for testing the indoor temperature, we should take into account several factors such as occupancy, the door and window positions and weather conditions. The validity is measured with possibly faulty sensors. In fact, these sensors are subject to bias, outliers or could be missed. The problem is how to conclude about a test that can be valid or not knowing that validity can only be tested with possibly faulty sensors? This is a challenge.

Unreliable sensors in buildings

In buildings, an important amount of data is available from sensors. Sensor values are not necessarily uniformly sampled. While after pre-processing the sensors report values regularly, reality shows that quite many values are missing. The gaps that as a result exist, are sometimes too small to be visible on a graph.

Overview of general diagnosis methods

Over recent years, FDD became an appealing area of research for building researchers. Various methodologies and tools have been developed to identify the faults in buildings to track the whole building performance. Plenty of published research and survey papers are available to classify the building diagnostic techniques [START_REF] Katipamula | Methods for fault detection, diagnostics, and prognostics for building systems-a review, part i[END_REF][START_REF] Lazarova-Molnar | Fault detection and diagnosis for smart buildings: State of the art, trends and challenges[END_REF]. Lately, building's faults and failures are covered at more granular level with an impact analysis in the terms of energy consumption and financial consequences [START_REF] Roth | Energy impact of commercial building controls and performance diagnostics: market characterization, energy impact of building faults and energy savings potential[END_REF][START_REF] Friedman | The building performance tracking handbook[END_REF]. Hybrid diagnosis approaches have shown an improved result over the conventional model-based diagnosis approaches [START_REF] Du | Fault diagnosis for temperature, flow rate and pressure sensors in vav systems using wavelet neural network[END_REF][START_REF] Li | A model-based fault detection and diagnostic methodology based on pca method and wavelet transform[END_REF]. [START_REF] Katipamula | Methods for fault detection, diagnostics, and prognostics for building systems-a review, part i[END_REF] presents a detailed review for fault detection and diagnosis techniques in buildings.

In August 1996(Revised in 2001), International energy agency (IEA) published Annex-25, "Building optimization and fault diagnosis source book" [START_REF] Hyvärinen | Simple neuron models for independent component analysis[END_REF][START_REF] Arthur | Fault diagnosis in air-conditioning systems: a multi-step fuzzy model-based approach[END_REF]. This work is considered as a beginning of fault detection and diagnosis in smart buildings. The aim of this work is to highlight the major faults that affect HVAC systems and controllers. In 2002, a technical report called NBCIP1 was published by Iowa energy center and United states environmental protection agency (USEPA) [START_REF] Ardehali | Literature review to identify existing case studies of controlsrelated energy-inefficiencies in buildings. Prepared for the National Building Controls Information Program[END_REF]. The report articulates 67 case studies with 110 field studies for buildings. The aim of this work is to highlight the main source of faults in buildings coming from humans, software and hardware. In more recent works, the Automatic Building Commissioning Analysis Tool (ABCAT), and Whole Building Diagnostician (WBD) developed by Texas A& M University and Pacific Northwest National Laboratory (PNNL) have been developed as new tools for identifying the whole building level faults [START_REF] Katipamula | Enhancing building operations through automated diagnostics: Field test results[END_REF][START_REF] Bynum | Development and testing of an automated building commissioning analysis tool (abcat)[END_REF]. Recently, the Lawrence Berkeley National Laboratory and Simulation a model-based diagnostic tool has been developed [START_REF] Bonvini | Bridging the gap between simulation and the real world an application to fdd[END_REF]. In general, all the major approaches have been used for building diagnoses are quantitative (model-based), qualitative (rule-based) or signal-based methods.

Building fault diagnosis using model-based techniques

Model-based diagnosis (MBD) uses an explicit model of the system under diagnosis. It can be qualitative or quantitative models. In general, all the model-based diagnosis approaches consist of three important stages: symptom generation, symptom evaluation, and fault isolation.

Quantitative model-based approaches are based on physical models and require detailed mathematical relations among all the operating variables with the characteristic of all components within the system. Mostly, these models are in form of differential equation or state-space model and presume to have additional knowledge of the normal operation of system under the investigation. Unlike, the quantitative model-based diagnosis, qualitative model-based uses qualitative reasoning or knowledge-based information to conclude whether system or its components are in the faulty or normal state. [START_REF] Arthur | Fault diagnosis in air-conditioning systems: a multi-step fuzzy model-based approach[END_REF] presented a fuzzy model to diagnose several faults in the air handling unit. Through comparing the outputs of the fuzzy model with those of the reference model, the faults occurred in the air handling unit can be diagnosed. [START_REF] Leslie K Norford | Demonstration of fault detection and diagnosis methods for air-handling units[END_REF] developed a physical model to detect commonly occurred faults in the air handling unit. [START_REF] Natascha | Performance evaluation of a reciprocating chiller using experimental data and model predictions for fault detection and diagnosis/discussion[END_REF] presented a physical model to detect the faults in the chillers. [START_REF] Wang | Fault-tolerant control for outdoor ventilation air flow rate in buildings based on neural network[END_REF]) also presented the model-based strategy to diagnose the sensor faults in the chilling plant system. [START_REF] Yu | A virtual supply airflow rate meter for rooftop airconditioning units[END_REF] presented a virtual model to estimate the supply air flow rate in the rooftop airconditioning units. Employing the mass balance and energy balance, the physical residues can be calculated through comparing the outputs of the models with real measurements. Besides the physical diagnosis models, the gray-box [START_REF] Jia | Characteristic physical parameter approach to modeling chillers suitable for fault detection, diagnosis, and evaluation[END_REF] and black-box (Andersen and Reddy, 2002) models have also been developed to diagnose the chiller faults. Generally, the model-based methods [START_REF] Yu | General modeling for model-based fdd on building hvac system[END_REF] have been most widely developed in the HVAC systems. The well application of the model-based FDD method relies on the accurate mathematic physical models.

Qualitative model-based approach uses a set of rules to diagnose the system abnormality. For example, [START_REF] Ghiaus | Fault diagnosis of air conditioning systems based on qualitative bond graph[END_REF] proposed a fault diagnosis of air conditioning systems based on qualitative bond graph. The main privilege of model-based techniques is that they require only a knowledge of normal operation and a reasoning method based on consistency. The modelbased diagnosis has been developed by two communities: fault detection and isolation (FDI) community in the field of automatic control and Logical Diagnosis (DX) in the field of artificial intelligence (AI).

Model-based methods rely on analytical model, derived from a physical relation. In connection with buildings, it is really impossible to develop a complete physical-model matching accurately the reality for a whole building system. The various phenomenon like heat transfer from facade or unplanned occupancy is challenging jobs to model. Model-based diagnosis believe in behavioral constraints only and assumed to be true in all circumstances. However, universally valid behavioral models i.e valid whatever the context are difficult to set up.

Model-based fault diagnosis and isolation techniques (FDI) assumes that model represents the reality of building operation independately of the current context and any fault can be detected by measuring the physical variables and checking the consistency with a reference model. A physical variable is a potentially observable element of information about the actual state of a building system. Nevertheless, behavioral models always valid i.e. universal are difficult to set up. Erroneous all-context models might lead to invalid diagnoses [START_REF] Ploix | Automatic design of detection tests in complex dynamic systems[END_REF].

These approaches are relevant for data failure, human mistake and breakdown type faults but they augmented full analytical model.

Building fault diagnosis using rule-based techniques

Knowledge-Based FDD methods require sufficient amount of historic data. These methods use methods from artificial intelligence to extract the knowledge based from the historic data reflecting the relationship between system variables. The behaviour of the system is monitored in real-time and is compared with the knowledge base to detect possible deviations and make fault diagnosis decisions. Depending on the knowledge extraction process in this category, the methods could be divided into qualitative methods [START_REF] Henley | Application of expert systems to fault diagnosis[END_REF][START_REF] Salama A Mostafa | Implementing an expert diagnostic assistance system for car failure and malfunction[END_REF] and quantitative methods [START_REF] Ma | Fault detection based on statistical multivariate analysis and microarray visualization[END_REF][START_REF] Zhang | Fault detection and diagnosis based on extensions of pca[END_REF]. Some of the most popular qualitative knowledge-based FDD methods are those that are based on expert systems. This approach basically evaluates real-time data according to a set of rules, which are derived from the knowledge of an expert human operator.

There are a number of papers that discuss expert system applications for fault diagnosis of specific systems. Initial attempts at the application of expert systems for fault diagnosis can be found in [START_REF] Chester | Rule-based computer alarm analysis in chemical process plants[END_REF]; [START_REF] Niida | Some expert system experiments in process engineering[END_REF]. The objectives of this expert system were twofold. First, the system classifies the reasons for the observed problem as an operator error, equipment failure or system disturbance. Second, the expert system offers prescriptive remedies to restore the process to normal operation.

In parallel, a contemporary group of researchers also focused on qualitative models for fault diagnosis analysis. In buildings, rule-based qualitative models are used to diagnose faults in air handling units or other part of HVAC [START_REF] Glass | Qualitative model-based fault detection in airhandling units[END_REF][START_REF] Katipamula | Automated fault detection and diagnostics for outdoor-air ventilation systems and economizers: Methodology and results from field testing[END_REF][START_REF] Schein | A rule-based fault detection method for air handling units[END_REF]. With a set of rules, the faults occurred in the air handling unit can be diagnosed successfully. Also, rule-based diagnosis methods are also adopted in the literature to manage the whole building [START_REF] Doukas | Intelligent building energy management system using rule sets[END_REF]. In this works, authors present an intelligent decision support model using rule sets based on a typical building energy management system. In addition, the model's impact on the energy consumption and indoor quality of a typical office building in Greece is presented. The model can control how the building operational data deviates from the settings as well as carry out diagnosis of internal conditions and optimize building's energy operation. In this context, the integrated "decision support model" can contribute to the management of the daily energy operations of a typical building, related to the energy consumption, by incorporating the following requirements in the best possible way: the guarantee of the desirable levels of living quality in all building's rooms and the necessity for energy savings.

Qualitative models are not enough to cover all the possible actions by following rules. Moreover, tests derived from rules are challenged by their validity. For instance, testing indoor temperature without validating door or window position might lead to a false alarm. In addition, the application of rule-based FDD methods depends on the rules constructed. For example, for testing a HVAC system using a set of rules, if the rules are not detailed enough, the diagnosis efficiency may be limited. These approaches are relevant for human mistake and breakdown type faults.

Building fault diagnosis using signal based techniques

Signal-based FDD methods mainly use signals, which are obtained from measurements for diagnostics [START_REF] Giantomassi | Signal based fault detection and diagnosis for rotating electrical machines: issues and solutions[END_REF]. The algorithms within this category derive symptoms of a healthy system as an output of the symptom analysis and the knowledge of the system, which are at disposal. When a system is faulty, symptoms that appear in the measured signal differ from those of healthy systems. Typically, these methods analyse signals in either time-domain or frequency-domain. However, there are also methods in this category which use both time and frequency domain. The difference between signal-based and rule-based diagnostic methods is explained by the fact that signal-based methods are based on signal processing techniques, whereas rule-based methods are based on rules coded in the form of if-then-else statements.

As a new FDD method, recently, the data-driven methods have been paid more attention in HVAC field. The data-driven method such as principal component analysis [START_REF] Du | Fault detection and diagnosis based on improved pca with jaa method in vav systems[END_REF], neural network [START_REF] Zhu | Fault diagnosis for sensors in air handling unit based on neural network pre-processed by wavelet and fractal[END_REF] etc... never need to build the accurate mathematic physical models or detailed experience rules. Authors in [START_REF] Lee | Subsystem level fault diagnosis of a building's air-handling unit using general regression neural networks[END_REF] presented a general regression neural network in the air handling unit. It can be used to diagnose the abrupt and performance degradation faults. [START_REF] Wang | Fault-tolerant control for outdoor ventilation air flow rate in buildings based on neural network[END_REF] developed a detection model based on neural network in the variable air volume systems. The neural network can be used to diagnose the faults of outdoor air, supply air and return air flow rate sensors after training using operation data. A fault detection and diagnosis strategy using combined neural networks and subtractive clustering analysis is presented in [START_REF] Du | Fault detection and diagnosis for buildings and hvac systems using combined neural networks and subtractive clustering analysis[END_REF]. Actually, the data-driven FDD methods usually take advantage of the intrinsic relations among the various data. Through calculating the deep intrinsic mathematic relations of the variables, the normal and abnormal operation can be distinguished. When faults occur, the intrinsic relations among variables will be broken, which is different with that under normal conditions. These methods are relevant for data failure and might detect fault signature for breakdown type fault.

Most signal-based techniques in the literature are interested only by the following known fault types: drift, outliers and bias. Occurrence of data gap faults have also not been given an adequate span of attention in the academia.

Conclusion

Accurate diagnosis of faults in buildings present a significant building operation cost saving opportunity. With the needs of new retrofitting and building intelligence solutions, diagnosis has became significantly more important and, thus, requires new approaches to be designed, as well as further enhancement of the existing ones. In this chapter, we have summarized the efforts in the area of fault detection and diagnosis for smart buildings with the aim of identifying the gaps and challenges that have not yet been given an adequate span of attention. This also highlights the scope of our research and has yielded an initial framework for addressing these issues. The majority of existing building fault diagnosis techniques rely on behavioral knowledge. Model-based fault diagnosis and isolation techniques (FDI) assumes that model represents the reality of building operation independately of the current context and any fault can be detected by measuring the physical variables and checking the consistency with a reference model. A physical variable is a potentially observable element of information about the actual state of a building system. Nevertheless, behavioral models always valid in any context are difficult to set up. Erroneous all-context models might lead to invalid diagnoses. This is a challenge. Complexity in testing a whole building system using both rule and pure model-based test, insidious faults and unreliable sensors are also challenging one. Thus, this work on building diagnosis differs from previous approaches since we are proposing some solutions for modeling, complexity, testing in specific context taking account that the validity is measured with possibly faulty sensors, confidence level for diagnosis and unreliable instrumentation in buildings. The work in chapter 1 is published in (Najeh et al., 2018b) and (Najeh et al., 2019b) Next chapter highlights the problem statement and research objectives of this work.

Chapter 2

Problem statement and research objective

Introduction

Buildings are going to be more complex due to continuous integration of substantial amount of emerging technologies and higher user expectations. In this context, the whole building system is highly vulnerable to different kinds of faults and failures. Unbeknownst to many, discrepancies from different sources could cause a big penalty over cost and comfort. Energy efficiency and user comfort are directly targeted due to an abnormality in building operation. So, to make a resilient building management system, it is important to identify the severity, cause, and type of each fault. The available fault diagnosis tools and methodologies particularly rely on rules or pure modelbased approaches. It is assumed that model or rule-based test could be applied to any situation without taking into account actual testing contexts. These contexts are measured with possibly faulty sensors. If these sensors are in ok state, the diagnostic result is always guaranteed. If these sensors are faulty, the diagnostic result is not guaranteed, this is a challenge. Unreliable sensors is also challenging one. These issues are introduced in the context of building diagnosis.

Problem statement

Current work highlights the following key challenges in building fault diagnosis.

-complexity -modeling difficulty -no universal model -unreliable sensors in buildings Following sub-sections explain these issues and proposed methodology in detail.

Need for heterogeneous tests

Modeling the whole building system including building components require a huge effort and there are various practical limitations. For instance, there are several variables shared among the building sub-systems and difficult to model because of their intricate relations. Qualitative models like expert knowledge are not enough to cover all the possible discrepancies with the set of rules. Rule-based tests are not systematic; in fact it is a guess of all kinds of possible faults based on experience and rules. Further, these tests are limited to certain rules and unable to check the building performance at zonal-level. Building system encompasses several zones with different zonal properties. In order to develop a global diagnosis approach, the model-based zonal test is required. These models helps to model building sub-systems such as ventilation, heating system, appliances and many more. Taking into account the limitations of pure model-based and rule-based approaches, it is a challenging job to test the whole building system. Hence, the need for heterogeneous tests. This concept is introduced in Singh (2017). Heterogeneous tests are the combination of the rulebased, range-based and model-based tests. Range-based tests are designed with the help of an upper and lower limit of tested variable. Diagnosis process starts when an observation violates the pre-defined threshold. However, in a building system, certain performance indicators do not require explicit ranges for diagnostic analysis. For instance, a ventilation fan must be consuming less power than the maximum rating. Such variables could be tested with the help of a rule-based test. HAZOP concludes only range and rule-based tests. Rule-based tests are limited to certain rules and unable to check the building performance at zonal-level. Building system encompasses several zones with different zonal properties. In order to develop a global diagnosis,the model-based zonal test is introduced. The proposed method uses a heuristic HAZOP (Hazards and Operability Analysis) based approach to overcome the modeling limitation [START_REF] Németh | Fault diagnosis based on hazard identification results[END_REF]. HAZOP is going to be used to discover possible detection tests. The limitation of the proposed concept is that it relies on an assumption which is nonfaulty sensors and actuators. Moreover, a faulty sensor or measurement could disturb the applicability of proposed methodology. The contribution in this work is that the sensor level in emphasized.

Need for testing in specific context under the hypothesis of fault modeling

In the domain of fault diagnosis, a symptom is defined as a measurable change in the behavior of a system from its normal behavior i.e. an indication of fault. Conventional model or rule-based behavioral tests are used to generate only symptoms. These models appear in the behavioral constraints and it is assumed that the behavioral test could be applied to any situation without taking into account different contexts. These tests can be more or less valid due the difficulty of getting good data sets in building and to the sensors ageing. If the validity is not taken into account during the conception of tests, false symptoms may be produced and consequently a false diagnosis. The aim of this work is to explicitly take into account the validity of the tests to make the diagnostic decision. However, a model valid for all context is difficult to design and the validity of a test result is always questioned in fault diagnosis. The difficulties encountered are the following -validity is measured with potentially faulty sensors -prove validity. The test of the space of validity consists of observation points given either by the sensors or by an expert. If the sensors are in operating mode, then the performance guarantee is assured. Otherwise, there is no guarantee. The question is: Is the test space always covered or not? Hence the need for an indicator to assess the level of validity for each test.

An example of contextual test considering the building thermal performance test is given in Consider a range-based test that checks the indoor temperature T in for the building shown in Figure 2.1 is estimating and testing the indoor temperature with a behavioral constraint i.e T in lies between the maximum temperature (T max ) and minimum temperature (T min ). This model-based thermal test only consider the behavioral constraint and evaluate symptoms under the predetermined thermal bounds for a specific building. However, no validity constraints are integrated with the test. Figure 2.1 illustrates the significance of behavioral and contextual test along with an example of invalid event i.e., open window. In this case the following validity constraints are needed to be combined with behavioral constraints:

-Testing indoor temperature without verifying occupancy level for all times might lead to a false alarm -The door and window position need to be verified for all times because these inputs are not easy to model -Similarly, outdoor weather condition needs to be verified for all times

These validity constraints are difficult to model and due to the lack of knowledge about the validity. Pure model-based test might lead to an ambiguous test result. In conclusion, model validity is another kind knowledge about the behavior. In order to launch a valid diagnosis analysis, each test needs to satisfy the validity constraints V and behavioral constraints B simultaneously (see Table 2.1).

Need for indicators to assess a level of validity of a test and a confidence level for global diagnosis

A test is performed in a period of time considering behavioral and validity constraints. Validity constraints evaluate whether the tests can be performed or not. However, the validity is measured with potentially faulty sensors. If the sensors are in OK state, the test result is always guaranteed. If the sensors are faulty, there is no longer guarantee and the question that arises is how to evaluate the level of validity of a test in the presence of sensor faults? Hence, there is a need for an indicator to assess a level of validity for each test. The diagnostic result is calculated from a set of tests, each defined by its level of validity. The problem is how to evaluate the confidence level of diagnoses in the presence of partially valid tests? Hence, there is a need for a confidence level for global diagnosis.

Need to know the periods of good operation of sensors

After receiving signals from a sensor, these signals need to be processed. An acceptable and accurate process of these signals requires:

1. Full knowledge regarding the operation of the sensors and nature of signals:

In order to be able to use signals' information correctly, the operation of a sensor, and the nature of signals they produce, should be well understood. By having this knowledge, we are able to choose the right tools for the acquisition of data from the sensor. For instance, if the sensor produces a time varying signal where the information is embedded in its frequency signatures, then a frequency counter and possibly a frequency analyzer are needed.

Posteriori knowledge regarding the received signals:

A posteriori knowledge about the received signals is important in order to assure that the data will be interpreted correctly and that the right device is used in the measurement process. We need to have a good understanding for what is expected from the sensor and system. The measured value can be significantly different from the real measurand.

A posteriori knowledge is dependent on experience.

3. Information about the dynamic and static characteristics of the sensing systems:

The characteristics of a sensor can be classified into two groups: static and dynamic. Understanding the dynamic and static characteristics behaviors are imperative in correctly mapping the output versus input of a system (measurand).

With the increasing number of sensor devices, as well as sensor data types, the acquisition of the sensor data samples becomes time and energy consuming, which is undesirable on low power wearable devices. Sensor values are not necessarily uniformly sampled. While after pre-processing the sensors report values regularly, reality shows that quite many values are missing. The gaps that as a result exist, are sometimes too small to be visible on a graph. Hence, the need to know the periods of good operation of sensors.

Proposed methodology 2.3.1 Highlighting the problem of complexity in buildings

Nowadays, buildings are considered as highly dynamics and complex systems as well. They include HVAC systems, sophisticated controllers, energy management systems and a large number of sensors. Let's consider a practical situation in a building system: three sensors measure the internal temperature and are distributed in three different places of the zone. The alarm has detected that the indoor temperature is below the desired setpoint and the most probable, the faults could come from one of these three sensors. In this case, there is a lack of information to construct a diagnostic system to decide the right source of fault. Another task may be mentioned: The comments of the occupants can not indicate that such a sensor is failing which is insufficient to solve the other problem, whereas the measured data are not sufficient to capture every type of faults.

The limitation of existing building diagnostic techniques encourages the development of a new diagnostic tool for the sensor grids in a building system that could detect the source sensor of faults. In the present work, a diagnosis methodology has been developed to tackle the limitation of existing building diagnostic solution. The following key points define the important terminology for proposed method.

-sensor grids: to look for all variables -diagnosis: to isolate the conflicting causes that frequently occur due to equipment failure and inappropriate human behavior -test: is a processing yielding a symptom

This approach highlights the problem of complexity in buildings. It is developed in chapter 3 and published in Najeh et al. (2018a). Then, new services for diagnosis in building are proposed:

-service 1: a level of completeness for better formalizing validity.

-service 2: a confidence level to prove diagnosis -service 3: detection of sensor data gaps

2.3.2

The completeness level: an indicator to assess a level of validity for a test [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF] developed the concept of contextual test i.e a test valid under specific context. The limitation of the proposed methodology is that it relies on a non-faulty sensors assumption. In fact, the validity is measured using sensors that can be faulty: a faulty measurement could disturb the applicability of the proposed methodology. The question raised is how to conclude about a test that can be valid or not knowing that validity can only be tested with sensors possibly faulty? In this work, a level of completeness is proposed as a method for better formalizing validity in presence of possibly faulty sensors i.e to assess a level of validity for each test. The test space consists of a set of measurements. The completeness level is proposed as a method to assess if a test space is fully covered or not. This tool highlights the problems of modeling difficulty. It is developed in chapter 4. The following key points define the important terminology for proposed method.

-validity: means testing in specific context -fault validity: means taking into account that the validity is measured through a sensor that it can be itself faulty -completeness level: an indicator to assess a level of validity for a test

The confidence level: an indicator to prove global diagnosis

The completeness level is an indicator to assess the level of validity for each test. A test could be complete if its completeness level is equal to 1 or incomplete if its completeness level belongs to the interval ]0, 1[. Nevertheless, the diagnostic result is calculated from a set of tests, each defined by its completeness level. In this work, the confidence level is proposed as a method to conclude about diagnosis. This method is developed in chapter 5.

Automatic thresholding for data gap detection for heterogeneous sensors

Different literature surveys on diagnosis techniques for sensor grids in buildings have been published but all of them treat only bias and outliers. Occurrence of data gaps have also not been given an adequate span of attention in the academia. In the present work, a new methodology for automatic thresholding has been developed to tackle the limitation of unreliable sensors in buildings. The following key points define the important terminology for proposed method:

-sensor grids: to look for all raw measurements of sensors -data gap: means an abnormal change in the data delays sending by a sensor.

-threshold: boundary beyond which the delay between two consecutive samples is abnormal.

-statistic approach: the delay a stochastic variable that follows a defined probability distribution function

This approach highlights the problem of unreliable sensors in buildings. It is developed in chapter 6.

Conclusion

In general, a fault diagnosis algorithms that fully exploits all the available information coming from sensors are an important tool to solve problems in smart buildings. Challenges still remain to obtain robust methods in building fault diagnosis. The objective of this chapter was to provide an overview of the limitations and challenges to clearly place the contribution of this thesis. Diagnosis in building is widely studied, and remarkable research achievements and collaborations have been developed. There are some existing solutions and ongoing researchers addressing the problem of diagnosis in building. This PhD extends existing studies by increasing the level of detail for defining the need of new concepts to diagnose the whole building system.

The majority of existing building fault diagnosis techniques rely on behavioral knowledge. Model-based fault diagnosis and isolation techniques (FDI) assumes that the model represents the reality of building operation independently of the current context and any fault can be detected by measuring the physical variables and checking the consistency with a reference model. A physical variable is a potentially observable element of information about the actual state of a building system. Nevertheless, behavioral models always valid are difficult to set up. Erroneous all-context models might lead to invalid diagnoses. Other challenges are complexity in testing a whole building system using both rule and pure model-based test and unreliable sensors. Thus, this work on building diagnosis differs from previous approaches since we are proposing some solutions, depending on:

-Contextual heterogeneous tests with a level of completeness on validity constraints.

-Confidence level to prove global diagnosis -Automatic thresholding for data gaps detection for a set of sensors in instrumented buildings.

Next chapter highlights the problem of complexity in buildings.

Chapter 3

Diagnosis in building: the complexity issue

Introduction

Intelligent building design is entering its third generation [START_REF] Shao | A framework for incorporating demand response of smart buildings into the integrated heat and electricity energy system[END_REF], in which different control systems are exchanging data to assist a variety of building management systems. The first generation of intelligent buildings deals with independent systems. The second generation deals with interconnected systems. The key phenomenon behind the third generation is the increase in the number and variety of sensors distributed throughout functionalities buildings.

There is a fundamental need with existing building management fault diagnosis. In fact, different energy management tools have been proposed in the literature. All of them are based on sensors and are particularly sensitive to faults on a building system. The thesis of Mahendra Pratap Singh [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF] proposes the concept of heterogeneous tests. Rule, range and model-based tests can be combined in the same diagnostic analysis that reduces the whole-building modeling effort but the proposed approach assumes that the sensors are reliable and are only interested in thermo-aeraulic processes and heating systems. However, the combination of sensor and actuator faults causes complexity in the building and the methods used until now do not solve it. Testing exhaustively is not realistic because the number of detection tests becomes usually huge. This work aims at designing a diagnosis tool that shall be used to support maintenance operators for detecting and localizing faults in sensor grids of a building system as well as highlighting the problem of complexity due the model and the number of sensors. It is based on detection tests and logical diagnosis analysis for the first principle. Two real case studies have been investigated with different characteristics (available sensors, occupancy and complexity of the environment) to exemplify the complexity in buildings: H358 office (simple complexity) and RueCuvier apartment (a more complex case). This chapter is organized as follow: section 3.2 presents a problem statement. Section 3.3 is devoted to the description of the proposed approach. To assess the efficiency of the proposed methodology, simulation results for two real case studies are presented in section 3.4. Section 3.5 discusses the findings of the literature review, the proposed methodologies, their limits and the results. Finally, concluding remarks are given in section 3.6.

Problem statement

Sensor grids in buildings increase diagnosis complexity

With the massive arrival of inexpensive communicating sensors, the building sector is undergoing an unprecedent revolution: the building is becoming smart, which means it offers new services to occupants related to safety, energy management, comfort. Article 23 of the thermal regulation 2012 (France) requires the measurement of certain variables, which promotes the deployment of sensor grids in new buildings. In addition, research projects such as the ANR OMEGA show the interest of public institutions (CSTB, CEREMA) and companies (COFELY AXIMA) to guarantee overall performances (total real consumption, interior comfort, ...) after refurbishment. In addition to the different aspects of comfort and energy consumption, these sensors can also be used to estimate occupant practices essential for energy consumption by estimating the number of occupants per area and their metabolic contribution, their activities and their routines. Let's consider a practical situation in a building system: three sensors measure the indoor temperature and are distributed in three different places in the H358 office (Toffice-reference sensor, Toffice-wall sensor and Theater sensor). The period under study is from June 1st, 2016 to June 30th, 2016. In the summer, Theater sensor measure the indoor temperature. Figure 3.1 shows the different measurements from the three sensors. An alarm has revealed that the indoor temperature is below the desired setpoint. In this case, there is a lack of information to construct a diagnostic system to decide the right source of fault. With one test (Toffice-wall and Toffice-reference sensors for example), it is difficult to conclude about the source of fault. That's why, we should test the three combinations -Test1: Toffice-wall and Toffice-reference sensors -Test2: Toffice-wall and Theater sensors -Test3: Toffice-reference and Theater sensors Also, Toffice-wall sensor is involved 2 times in the tests. Let's consider a second case: 4 sensors that measure the indoor temperature and placed in four different places in the H358 office. In this case, the number of tests is equal to 2 4 = 16 We conclude that the number of sensors increase the number of tests but not exponentially; it depends on the system and consequently it increases the diagnosis complexity.

Needs for clear explanations to support maintenance operators

Let's consider a practical example: an alarm is revealed because the indoor temperature is below a set-point. Such possible fault explanations for this symptom are:

-the temperature sensor is faulty -the set point temperature is faulty -the number of appliances is abnormal -the number of occupants is abnormal -the heating system is not working well In this case, there is a lack of data to decide the source of fault. Hence, there is a need for a diagnostic tool that offer clear explanations to support maintenance operators.

Modeling difficulty

The difficulties encountered the building modeling include.

Parameter estimation

The physical models of buildings combine a part of physical knowledge formalized by structures of equations and a part of parameters learnt thanks to an estimation procedure. The parameters of these models are however difficult to estimate because their structure is not suited for calibration (non-linearity with respect to parameters for example). Different parameters are difficult to set up in the framework of the building such as the thickness of the walls, the thermal heat loss/gain through material and many more. In addition, variables such as the thermal resistance qualifying the convective and radiative exchanges are considered always as a constant value. This is an approximation because in reality the exchange coefficient varies with temperature difference between the exchange surface and the ambient air. It is therefore necessary to determine whether taking into account this variation is of interest in terms of quality of the model or if a constant value is sufficient. Also, convective exchanges are characterized by a convective exchange coefficient that is commonly correlated with the wind speed and the orientation of the surface with respect to the wind direction. On the other hand, the increase of the number of estimated parameters cost the estimation in terms of computation time and necessary data.

Forecasting the human practices for long term

The more efficient a building is, the more significant the impact of human practices are. However, it is very difficult to forecast human practices on a long term.

Inertia and model's order

Most authors in the literature consider that the inertia is located only in the exterior walls and the air with only a few exceptions. However, [START_REF] Hazyuk | Optimal temperature control of intermittently heated buildings using model predictive control: Part i-building modeling[END_REF] take into consideration the impact of the slab in their modelling. [START_REF] Bacher | Identifying suitable models for the heat dynamics of buildings[END_REF] carried out a study aiming at comparing models with different orders. The study conducted by Del [START_REF] Palomo | Using model size reduction techniques for thermal control applications in buildings[END_REF] highlights the fact that the choice of the order also depends on the objective of the model and so on the requirements in terms of accuracy but also of the controller used. It seems thus difficult to choose a model order a priori.

Sub-systems interaction

A building is subject to a very large number of interacting elements. In fact, we can not speak of air conditioning without indicating the variations of the external temperatures, the level of insulation, the internal charges and many more. Such examples of sub-systems interaction are the following:

-Interaction of the occupants with the building environment thanks to sensors, smartphone applications etc...

-Interaction of buildings between them: the smart building interacts with other buildings (connectivity sharing, integration to the same smart grid, data sharing etc ...)

Taking into account several interaction increase the complexity. In fact, the model of a building system touches many aspects and it is thus necessary to have a thermal description of the envelope, a technical-physical description of the equipment, an economic description of the reaction of these appliances and a description of the comfort of the occupants in addition to their schedule and other sizes involved in the system. Control space is also an element that can add complexity because all systems must be modeled so that the BEMS can take into account the different influences.

Sensor fault not easy to find

The detection and isolation of a faulty sensor is not an easy problem. The measurements of a sensor depict characteristics of the system and the sensor. Consequently, any abnormal deviation in the measurements of a sensor could be caused by a change either in the system or in the sensor itself. In addition, as a building system becomes more complex, the number of its interconnected subsystems and the associated sensors increases, in which various failures may occur. The disturbances of the system could add noise to the sensor measurements. All these challenges raise the difficulty of detection and isolation of a sensor fault from a failure occurred in the system. Furthermore, a proposed methodology developed for the detection of sensor fault should satisfy the following characteristics and be able to:

-distinguish if the source of fault is in the sensor or in the system itself.

-able to detect and isolate a sensor fault even in the case of multiple sensors faults -able to validate the sensor measurements without the use of redundant sensors and the requirement of a detailed physical model of building.

-applicable to a wide range of sensors

Limits for fault diagnosis techniques

Energy management tools have been proposed in the scientific literature: they are based either on control heuristics, on emergent strategies of multi-agent systems, or on predictive control. All these approaches are based on sensors and are therefore particularly sensitive to faults on a building system. The thesis of Mahendra Pratap Singh [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF] proposes a diagnostic analysis strategy combining a logical reasoning approach based on the first principles of diagnosis and an FDI approach separating the test phase from the analysis or location phase. However, the proposed approach assumes that the sensors are reliable and are only interested in thermo-aeraulic processes and heating systems. This work deals with highlighting the complexity due the model and the number of sensors in building. A methodology for diagnosis of sensor grids in building system is proposed. The proposed approach should make it possible to determine automatically the different possibilities of faults, including multiple faults. Next section details the methodology.

Followed methodology

This section deals with the description, of the methodology proposed by [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF] for fault detection and diagnosis. It is based on detection tests and diagnosis using BRIDGE approach. BRIDGE approach is a combination between Fault Detection and Isolation (FDI) and Logical Diagnosis (DX) methodologies. Fault Detection and Isolation believes that the abnormality in the system behavior implies the presence of fault and considers that no symptoms implies no faults. DX is a component oriented referred as diagnosis from the first principle De [START_REF] De | Diagnosing multiple faults[END_REF] and it assumes that faulty behavior cannot be determined only from behavior, it should involve a component level. The BRIDGE approach is used because it is capable to find the diagnosis with the component level explanation.

The design phase

The first phase of the proposed framework is the design phase. It includes:

-Step 1: formalizing the reference behaviors which can be modeled by behavioral constraints (Definition 3.1) Definition 3.1. Let X (t,t+h) be a set of data covering a time horizon h. Let τ be a test of a system Σ. If the test τ is true, then the system Σ is an ok state i.e τ true ↔ ok(Σ)

The test τ is true can be modeled by a behavioral constraint. Modelling the normal behavior (ok) is defined by: Let B(X (t,t+h) ): dom(X (t,t+h) ) → R m ; m ∈ N + * be a behavioral constraint of test τ . I is defined as following.

Σ is said consistent if it exists a subspace B ⊂ R m such as

B(X (t,t+h) ) ∈ B ↔ ok(Σ) (3.1)
Therefore, the test τ for Σ is inconsistent if

B(X (t,t+h) ) / ∈ B ↔ ¬ok(Σ) (3.2)
In the literature, different techniques could be used for the test of behavioral constraints such as residual generation [START_REF] Nyberg | Residual generation for fault diagnosis of systems described by linear differential-algebraic equations[END_REF], cause-effect relationships (Bossen and Hong, 1971), ... The following example shows the use of residual generation for testing two sensors measuring the indoor temperature inside a room, in Equation 3.3, a residue r is expressed in term of difference between the measurements from the different sensors.

r = T 1 (t) -T 2 (t) (3.3)
The behavioral constraint for this test is B(X (t,t+h) ) ∈ B with B = T 1 (t) -T 2 (t) = 0 where T 1 and T 2 are two time series of temperature measured by the two sensors respectively [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF] proposed the concept of contextual test i.e a test valid under specific contexts. The contextual test is based on validity constraints (Definition 3.2).

Definition 3.2. Validity constraints:

Let's introduce another set of constraints V (X (t,t+h) ) ∈ V where V is a bound domain to define the validity of a behavior constraint set.

A behavior constraint modeling the normal behavior under validity conditions is defined by Equation 3.4 or Equation 3.5

B(X (t,t+h) ) ∈ B ∧ V (X (t,t+h) ) ∈ V ↔ ok(Σ) (3.4) B(X (t,t+h) ) / ∈ B ∧ V (X (t,t+h) ) ∈ V ↔ ¬ok(Σ) (3.5)
The determination of behavioral and validity constraints is usually done on the basis of prior knowledge of input-output or cause-consequences relations between the variables and sub-systems. The following example shows how to select behavioral and validity constraints for a test of lighting system. A lighting system is ok if the lamp is ON (i.e lamp position=1) and the switch position=1 i.e (there is an electric current). However, we can not conclude about a test in absence of electricity during the period of test. Hence, the behavioral and the validity constraints are the following: Behavioral constraints: B(X (t,t+h) ) :

switch position (t) = 1 ∧ light position (t) = 1, ∀t ∈ (t, t + h) Validity constraints: V (X (t,t+h) ) : electricity(t) > 0, ∀t ∈ (t, t + h)
In this work, the office and the apartment, where details are presented in Chapter 1, are analysed. The evolution of indoor temperature and CO2 concentration are modeled using building physics. Sensors are modeled by a model assuming that the actual value is equal to the measured value under the assumption that the sensor is working well.

-Step 2: designing detection tests BRIDGE approach yields all the analytical redundancy relationships of a system to be diagnosed and allows the calculation of diagnosability from constraints. The algorithm is based on a join operator coming from the relational algebra [START_REF] Ploix | A new efficient and flexible algorithm for the design of testable subsystems[END_REF]. It also relies on a structural abstraction of the constraints and trace all the constraints involved in the obtained testable sub-systems. This point is crucial in diagnosis analysis or it is to understand the possible causes of a test revealing an anomaly. These tests analyze the faults in sensors with multiple fault scenarios.

In general, a test (Definition 3.3) is a process yielding a symptom and possible explanations.

Definition 3.3. A detection test is defined by:

-a bunch of data, X (t,t+h) related to the variables X = {x 1 , x 2 , ...} covering a possibly discontinuous time period from t to t+h. It satisfies:

B(X (t,t+h) ) / ∈ B ↔ Expl (3.6) -a behavioral constraint: B(X (t,t+h) ) ∈ B -a validity constraint: V (X (t,t+h) ) ∈ V
-a test support: a set of possible explanations for when behavioral constraints is not satisfied in terms of component or item states like Expl = ¬ok(item 1 )∨¬ok(item 2 )∨ ... where ¬ is negation that implies ¬ ok= not ok and ∨ is the logical operator OR

A practical example for testing the indoor temperature in building with behavioral and validity constraints is given below.

T est(T in ) generates test results for the deviation of the indoor temperature comfort in building.

T est(T in ) = B(X (t,t+h) ) ∈ B ∧ V (X (t,t+h) ) ∈ V → ok(Σ) B(X (t,t+h) ) / ∈ B ∧ V (X (t,t+h) ) ∈ V → ¬ok(Σ)
where B(X (t,t+h)

) ∈ B → T in (t) ∈ [T min , T max ], ∀t ∈ (September 1st, 2016, September 30th, 2016) and V (X (t,t+h) ) ∈ V → occupancy(t) > 0 ∧ ζ D (t) = 0 ∧ ζ W (t) = 0 ∧ T out (t) ∈ [T min out , T max out ], ∀t ∈ (September 1st, 2016, September 30th, 2016)
The behavior of the building is dependant of the season, a period of validation from September 1st, 2016 to September 30th, 2016 is chosen. T in is a time series of indoor temperature measured by "Toffice-reference" sensor in the H358 office, time range is continuous and corresponds to 720 hours (1 month). To set the upper and lower values for indoor temperature, a behavior representative of the normal behavior is firstly recorded. 2016) When a behavioral constraint is not satisfied, the possible fault explanations for such symptom include: ¬ ok(temperature sensor) ∨ ¬ ok(heating system) ∨ ¬ ok(appliances) A symptom is detected when a test result violates behavioral constraints. Figure 3.3 represents the behavioral constraint for the case of consistent test dealing with indoor temperature. -Step 3: deducing signature table after merging non-discriminable components (i.e components with same signature). All the detection tests are merged into a single table for further analysis.

The run phase

The outcome of run phase gives a set of minimum possible diagnosis taking into account BRIDGE diagnosis analysis. The following tasks can be distinguished: symptom generation and diagnostic analysis.

Symptom generation

Symptoms are generated thanks to a threshold applied to residuals. If the value of the residue is higher than the given threshold value, a symptom is detected.

Diagnostic analysis

Based on tests and their results, the BRIDGE approach identifies the faults of the system. A test is defined by the components that might explain a symptom when faulty in the test.

In practice, tests are performed to see how the system responds to given situations or inputs. A symptom is what the user observes when comparing the behavior of the system during a test with the results that were expected. A symptoms could be:

-Negative: if the system does not behave as expected, the test will be considered as failed and the symptom will be negative.

-Positive: if the system behavior is consistent with the reaction that was expected, the test is considered successful and the symptom will be positive.

BRIDGE approach analyzes all kind of possible faults based on: In order to compute logical diagnosis, BRIDGE approach uses the concept of conflict analysis and HS tree. A conflict is a set of component states {component 1 , component 2 , ..., component n } that cannot be all true at the same time i.e. not ok(component 1) or not ok(component 2) or ... For example, in case of inconsistency related to a test, possible fault explanations are non empty subsets of Expl(Test)={ ¬ ok(component 1), ¬ ok(component 2) ...¬ ok(component n)}. In a diagnostic problem, all the component states are potentially faulty. To overcome this problem, diagnosis approach based on first principle search only for minimal possible explanations for all conflicts related to inconsistent test. In order to examine minimum diagnosis, [START_REF] Reiter | A theory of diagnosis from first principles[END_REF] proposes to use a Hitting set Tree (HS-Tree) based algorithm (Definition 3.5).

Definition 3.5. Hitting Set

H is a Hitting Set for the {¬ok(c 1 ), ..., ¬ok(c n )} if H ∩ ¬ok(c 1≤k≤n ) = 0 Let's consider two tests Test 1 and Test 2, defined by the following explanations in case of inconsistency:

Expl(Test 1)= ¬ ok(component 1) ∨ ¬ ok(component 2)∨ ¬ ok(component 3) Expl(Test 2)= ¬ ok(component 1) ∨ ¬ ok(component 3)∨ ¬ ok(component 4)
The hitting set for this example is the following: A practical example for diagnosis analysis using hamming distance and hitting set algorithm is given below. A test signature table below (Table 3.1) contains all the possible explanations for 3 tests. These explanations have conflicting components (i.e it exists at least two explanations for a symptom) and require further analysis. Let's take the following symptom: Using hamming distance, it is obvious that ventilation system is faulty because he has the lowest Hamming distance. However, the bridge method goes to the next level of analysis based on test explanations and tries to find a minimum possible explanation for all symptoms. Although, ventilation is present in all test explanations, i.e. diagnosed in the beginning of HS-tree (Figure 3.6). Now, the other nodes follow an expansion considering the next set of explanations. The minimum diagnostic explanation shows that ventilation system, heating system and duct are the most possibly faulty components. In this example, diagnosis detects the problem in the ventilation, duct, and heating system. Hence, it will be easy to detect multiple faults in one diagnostic explanation. The approach proposed by [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF] assumes that the sensors are reliable and are only interested in thermo-aeraulic processes and heating systems. However, a faulty sensor could disturb the efficiency of the proposed methodology. In the following, we investigate a fault diagnostic tool that incorporates sensor faults and that support maintenance operators for detecting and localizing faults in sensor grids of a building system.

   test1 test2 test3    =    1 1 1    Where    1 1 1    means that

A case study for a building system

This section deals with highlighting the complexity. For this purpose, two case studies have been investigated with diversity according to their context (available sensors, occupancy and complexity of the environment) to exemplify the complexity in buildings.

Case 1: H358 office

The first case study is a monozone building which is the office setting H358 where details are presented in chapter 1. This example is interesting because the model of the office is not very complex and the number of sensors is not very high (30 sensors)

Thermal model

Several thermal models for this office have been studied in Scanu ( 2017) from which the model with one capacitor is used for this work. The equivalent model is represented in Figure 3.7(a) and is described by Equations 3.8 and 3.9. The parameters of which are mentioned in Table 3.2. Thus, besides the physical context, the indoor temperature (T in ) heavily relies on occupant actions of opening or closing of doors (ζ D ) and windows (ζ W ).

(room) → dτ dt = R -R i R 2 i C i τ + R R i C i φ in + R R i C i ( 1 R out + ζ w R w )T out + R R i C i ( 1 R n + ζ D R D )T n (3.8) ok(room) → T in = R R i τ + R i φ in + R( 1 R out + ζ w R w )T out + R( 1 R n + ζ D R D )T n (3.9)
where

R D = 1 ρ air C p,air Q D , R W = 1 ρ air C p,air Q W and 1 Req = 1 R i + 1 Rout + ζ W R W + ζ D R D + 1 Rn with time-invariant R n , R out , R i and C i
n , Q out , Q W , Q D
Air flow with adjacent corridor, outdoor, through window, through door S CO2

Breath production in CO 2 from each occupant P elec , φ appliances Power drawn from electric supply or net heat flow from appliances

CO 2 based air quality model

Several factors influence the indoor air quality like number of occupants, door and window positions. This work concentrates on the CO 2 based air quality and uses the aeraulic model recognized in [START_REF] Scanu | Model tuning approach for energy management of office and apartment settings[END_REF]. The equivalent model of the office is represented in Figure 3.7(b) and is described by Equations 3.10, 3.11 and 3.12. The parameters of which are mentioned in Table 3.6. Given the physical context, the occupancy (n(t)) estimation approach of [START_REF] Amayri | Estimating occupancy in heterogeneous sensor environment[END_REF] is considered. This aeraulic model can simulate the indoor CO 2 concentration based on occupant actions of opening or closing of doors (ζ D ) and windows (ζ W ).

ok(room) → V dC in (t) dt = -(Q out (t) + Q cor (t))C in (t) + Q out (t)C out + Q cor (t)C cor (t) + S CO2 n(t) (3.10) with Q out (t) = Q out 0 + ζ W (t)Q W (3.11) Q cor (t) = Q cor 0 + ζ D (t)Q D (3.12) 3.4.1.
3 Determination of coefficients for thermal and CO 2 based air quality model A regressive model is used to identify those variables over a long time period. The training period had then to be properly defined to guarantee a rich enough data-set. The coefficients are determined as follows. The variables Q out 0 , Q cor 0 , Q W and Q D are as unknown constant values i.e as parameters that are determined by optimization. Note that the symbol˜is used to denote the measured value and ok(component) stands for the component is assumed to be in a normal state.

Design of tests for H358 office

The first phase of the proposed framework is the designing of tests. It includes analyzing the living zone including all sensors. The present approach yields all the analytical redundancy relation of a system to be diagnosed for any class of systems and allows the calculation of diagnosability from constraints. The algorithm is based on a join operator coming from the relational algebra [START_REF] Ploix | Automatic design of detection tests in complex dynamic systems[END_REF]. It also relies on a structural abstraction of the constraints and trace all the constraints involved in the obtained testable subsystems. This point is crucial in diagnosis analysis or it is to understand the possible causes of a test revealing an anomaly. Furthermore, this step ends up with a deduced signature table after removing non-detectable components and merging non-discriminable ones. The following tests have been designed in the framework of the office setting. Only the sensors they rely on are presented:

-test1: Toffice-reference sensor, Theater sensor -test2: Toffice-wall sensor, Toffice-reference sensor -test3: room, Toffice-reference sensor, door contact sensor, window contact sensor -test4: Toffice-wall sensor, Theater sensor -test5: room, Theater sensor, door contact sensor, window contact sensor -test6: room, Toffice-wall sensor, door contact sensor, window contact sensor The type of these tests is "automatic tests" i.e software tests which refer to execute a predefined set of test cases with the objective to identify faults. Based on a software code, we simulate the reference behavior of test and then, we apply a fault scenario. The test results are tests reports for fault detection and decision making. In this work, only tests 1 and 6 are detailed. The other tests are detailed in Annex 1. In this work, two hypotheses were used. The first is to assume that tests are done in any situation without taking into account certain contexts. The second is to choose periods where the data sets are complete.

Test1: Test of Toffice-reference sensor and Theater sensor performance

This test compares the measurements of Toffice-reference sensor and Theater sensor. T est 1 generates a residual signal from measurements of two sensors.

T est 1 = B τ (X (t,t+h) ) ∈ B τ ↔ ok(Σ)
where

Behavioral constraint: B τ (X (t,t+h) ) ∈ B τ with B τ = T ref (t) -T heater (t) = 0, ∀t ∈ (t, t + h)
where T ref and T heater are two time series for indoor temperature measured by Toffice-reference and Theater sensors respectively. This test checks the estimation of indoor temperature using door and window positions and Toffice-wall as well as the performance of these sensors. T est 6 generates a residual signal between measured and estimated temperature. The residual generation is based on state observer.

T est 6 = B τ (X (t,t+h) ) ∈ B τ ↔ ok(Σ)
where behavioral constraint is given by: B τ (X

0 0 0 1 1 0 test2 1 0 0 1 0 0 test3 0 1 1 1 0 1 test4 1 0 0 0 1 0 test5 0 1 1 0 1 1 test6 1 1 1 0 0 1
Before studying the results obtained for different fault scenarios, it is unnecessary to distinguish non-discriminable items (i.e items that have almong the same signature according to the performed tests). They will multiply the number of diagnoses, so it is preferable to group the non-discriminable items into a macro-item. Considering the signature table corresponding to the 6 tests, it can be seen that the items office door sensor, office window sensor and room are non-discriminable. To reduce the entries, a macro-item ROOM-SYSTEM which combines office door sensor, office window sensor and room is introduced. The new signature table becomes the one shown in Table 3.4.

1 0 test2 1 1 0 0 test3 0 1 0 1 test4 1 0 1 0 test5 0 0 1 1 test6 1 0 0 1
In the following, various faults were simulated.

Simulation scenarios and diagnostic result for H358 office

This section demonstrates the experimental results of the proposed diagnosis method. Tests had been performed for the entire office including all sensors. In order to make an explicit and concise explanation, the following faulty scenarios have been considered:

-scenario 1: Toffice-reference sensor is subject to bias of 2 degrees from t=2000 until the end of simulation (see Figure 3.8).

-scenario 2: Theater sensor gives null values from t=2000 until the end of simulation.

-scenario 3: Abnormal internal gain, it is assumed that the total metabolism power is increased by 400 Watt from t=2000 until the end of simulation (see Figure 3.9).

-scenario 4: Toffice-wall sensor gives incorrect values over a well defined interval and it's assumed that the temperature is always equal to 23 • C from t=2000 until the end of simulation.

-scenario 5: Door and window contact sensors give random values from t=2000 until the end of simulation.

To set the threshold values for the tests, a behavior representative of the normal behavior is firstly recorded. In order to set reasonable thresholds, it's assumed to take the maximum value for each residuals increased by 10% to avoid false alarms.

In this chapter, only simulation results for scenarios 1 and 3 are presented. The results for other scenarios are in Annex 1.

The behavior of the building is dependent of the season, a period of validation from May 1st, 2015 to June 30th, 2015 is chosen.

Scenario 1 corresponds to the results of Figure 3.8. Fault has been detected for the whole period. The symptom appeared with Test 1 at time t=2225. Test 1 is negative (i.e the test reveals an anomaly because the residual signal exceeds the threshold at t=2225) and tests 2, 3, 4, 5 and 6 are positive (i.e these tests don't detect any anomaly because the residual signals do not exceed the threshold). Bridge approach shows that Toffice-reference and Theater diagnosis are equiprobable with fault probability equal to 66%. The simulated fault consists on simulating that the Toffice-reference sensor is faulty. Thus, the current fault is found and this result is obvious. This approach leads to an accurate diagnosis even for a low fault.

Scenario 2 corresponds to the results of Figure 3.9. The symptoms appeared with tests 3, 5 and 6 at time t=2000. The door-contact and window-contact diagnosis are the most probable. This test violates the behavioral constraint. In the normal context of simulation, it was assumed that there are 3 persons in the office for full time (a professor and 2 Ph.D. students) and the internal gains depends on occupancy and scenario 2 focuses on an abnormal occupancy. It's assumed also that the physical model depends on the opening rates of the door and the window. This is a right result but it is not accurate. This result is due to the limited number of tests.

The following table (Table 3.5) summarizes the BRIDGE possible diagnosis and actual fault for each scenario. In the monozone case, the approach leads to a reduced number of tests which is equal to 6. The approach leads in some cases to an inaccurate diagnosis. However, the diagnostic result is not guaranteed because it is supposed that the tests are applied in any situation without taking into account specific contexts. For example, testing the indoor temperature without taking into account the outdoor temperature, the door and window openings and the number of occupants could lead to a possibly false diagnosis.

Case 2: RueCuvier apartment

The second case study is a multizone building which is the apartment presented in Chapter 1. The example is interesting because the complexity is high compared to H358. The number of sensors is more important (70 sensors). Also, there are interactions between zones and difficult parameters to know such as wall thickness, the coefficient of performance of the heat pump and consequently, there is a complexity due not only on the number of sensors but also on the model. This apartment is subject to an important number of interacting elements. For example, the common room temperature relies on occupant actions of opening and closing of doors and windows of the office, the kitchen, the parent's room and Anna's room. The model of the apartment includes many aspects such as the thermal description, the occupant comfort description, the equipment description and many more. In this work, only the thermal and indoor air quality aspects are detailed.

The model parameters for the apartment are mentioned in Table 3.6

o , C o , R a , C a , R p
The thermal model for the office room is defined by Equations 3.22 and 3.23. ok

(office room)→ dτo dt = Reqo-Ro R 2 o Co τ o + Reqo RoCo φ o + Reqo RoCo ( 1 Roout + ζow Row )T out + Reqo RoCo ( 1 Roc + ζ od R od )T c (3.22) ok(office room)→ T o = Reqo Ro τ o + R o φ o + Req o ( 1 Roout + ζow Row )T out + Req o ( 1 Roc + ζ od R od )T c (3.23)
The thermal model for the Anna room is defined by Equations 3.24 and 3.25.

ok(Anna room)→ dτa dt = Reqa-Ra R 2 a Ca τ a + Reqa RaCa φ a + Reqa RaCa ( 1 Raout + ζaw Raw )T out + Reqa RaCa ( 1 Rac + ζ ad R ad )T c (3.24) ok(Anna room)→ T a = Reqa Ra τ a + R a φ a + Req a ( 1 Raout + ζaw Raw )T out + Req a ( 1 Rac + ζ ad R ad )T c (3.25)
The thermal model for the parent room is defined by Equations 3.26 and 3.27.

ok(parent room)→ dτp dt = Reqp-Rp R 2 p Cp τ p + Reqp RpCp φ p + Reqp RpCp ( 1 Rpout + ζpw Rpw )T out + Reqp RpCp ( 1 Rpc + ζ pd R pd )T c (3.26) ok(parent room)→ T p = Reqp Rp τ p + R p φ p + Req p ( 1 Rpout + ζpw Rpw )T out + Req p ( 1 Rpc + ζ pd R pd )T c (3.27)
The thermal model for the kitchen room is defined by Equations 3.28 and 3.29.

ok(kitchen room)→ dτ k dt = Req k -R k R 2 k C k τ k + Req k R k C k φ k + Req k R k C k ( 1 R kout + ζ kw R kw )T out + Req k R k C k ( 1 R kc )T c (3.28) ok(kitchen room)→ T k = Req k R k τ k + R k φ k + Req k ( 1 R kout + ζ kw R kw )T out + Req k ( 1 R kc )T c (3.29)
The thermal model for the common room is defined by Equations 3.30 and 3.31. The physical model for indoor air quality in office room is defined by Equation 3.32

ok(common room)→ dτc dt = Reqc-Rc R 2 c Cc τ c + Reqc RcCc φ c + Reqc RcCc ( 1 Rcout + ζcw Rcw )T out (3.30) ok(common room)→ T c = Reqc Rc τ c + R c φ c + Req c ( 1 Rcout + ζcw Rcw )T out (3.31)
ok(office room) → V o dCo(t) dt = -(Q oout 0 +Q oc 0 +ζ ow (t)Q ow +ζ od (t)Q od )C o (t)+(Q oout 0 +ζ ow (t)Q ow )C out + (Q oc 0 + ζ od (t)Q od )C c (t) + S CO 2 n o (t) (3.32)
The physical model for indoor air quality in anna room is defined by Equation 3.33

ok(Anna room) → V a dCa(t) dt = -(Q aout 0 +Q ac 0 +ζ aw (t)Q aw +ζ ad (t)Q ad )C a (t)+(Q aout 0 +ζ aw (t)Q aw )C out + (Q ac 0 + ζ ad (t)Q ad )C c (t) + S CO 2 n a (t) (3.33)
The physical model for indoor air quality in parent room is defined by Equation 3.34

ok(parent room) → V p dCp(t) dt = -(Q pout 0 +Q pc 0 +ζ pw (t)Q pw +ζ pd (t)Q pd )C p (t)+(Q pout 0 +ζ pw (t)Q pw )C out + (Q pc 0 + ζ pd (t)Q pd )C c (t) + S CO 2 n p (t) (3.34)
The physical model for indoor air quality in common room is defined by Equation 3.35 The number of tests for the apartment is equal to 1196 difficult to handle and automatize. Hence, there is a need to a methodology to apprehend it. Table 3.7 shows examples of such tests.

ok(common room) → V c dCc(t) dt = -(Q cout 0 + ζ cw (t)Q cw )C c (t) + (Q cout 0 + ζ cw (t)Q cw )C out + (Q oc 0 + ζ od (t)Q od )C o (t) + (Q ac 0 + ζ ad (t)Q ad )C a (t) + (Q pc 0 + ζ pd (t)Q pd )C p (t) + S CO 2 n c (t) ( 3

Discussion

In [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF], the concept of heterogeneous tests is proposed. Heterogeneous tests is a combination of rule, range and model-based tests in the same diagnostic analysis to reduce the whole-building modeling effort. The limitation of the proposed concept is that it relies on an assumption of non-faulty sensors and interests only in thermo-aeraulic processes. Moreover, the combination between building model, sensor and actuator faults increases the complexity. In this chapter, we have highlighted the problem of complexity due to the model and the number of sensors in buildings. A methodology for diagnosis of sensor grids in building system is detailed. The proposed approach should make it possible to determine the different possibilities of faults including multiple faults.

Two real case studies have been investigated to exemplify the complexity: an office setting with 30 sensors and an apartment setting with 70 sensors. In the monozone case, the approach leads to a reduced number of detection tests which is equal to 6. The approach leads in some cases to an inaccurate diagnosis. However, the diagnostic result is not guaranteed. In fact, the fault diagnosis analysis is generated from the modeled behavioural of the system thanks to detection tests. The detection tests are applied to any situation without taking into account specific contexts. In fact, testing the indoor temperature for example without taking into account specific contexts such as the outdoor temperature, the door and window positions, the number of occupants and meteorological conditions could lead to wrong diagnosis result. In buildings, such concepts are still at an immature level. Diagnosis reasoning must differ in different scenarios, e.g., fault detection and diagnosis approaches should be different for normal working days and a vacation period. In conclusion, characterizing a domain of validity where a test proves to be valid offers a guarantee to diagnostic result. However, the validity constraints is measured with possibly faulty sensors that could mislead validity tests. If these sensors are in ok state, the guarantee of the diagnostic result is always assured. If these sensors are faulty, the diagnostic result is not guaranteed. So, we conclude that there is a need for a method to prove a test and global diagnosis.

In this work, we made an assumption that consists of choosing periods where data sets are complete. However, the data gaps is the major fault type in buildings and there is a need for a method to find the periods of missing data.

In the multizone case, the proposed methodology leads to an important number of tests which is difficult to handle and to automate.

Conclusion

This chapter aims at presenting a general diagnosis tool proposed by [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF] that shall be used to support maintenance operators for detecting and localizing faults in a sensor grid of a building system. It is a tool-aided diagnosis with mathematical models and reasoning tools that determines whether a sensor is faulty or not. It is based on detection tests and logical diagnosis analysis for the first principle. At the beginning, the major challenges related to the diagnosis in building are highlighted. Then, the diagnosis algorithm is proposed: it deals with a BRIDGE approach of FDD for a building system focusing on sensor grids. Finally, a series of tests are performed in order to validate the approach.

Two real applications have been investigated to exemplify the complexity due the model and the number of sensors: an office setting with 30 sensors and an apartment with 70 sensors. The number of tests obtained for the monozone office setting is equal to 6. The results show that if the tests are consistent with reality, the proposed approach leads to accurate diagnoses. Indeed, it is not always possible to construct universal tests. For this reason, the proposed approach leads in some cases to a possibly false diagnoses. The diagnostic result is not guaranteed because the tests are supposed to be applied in any situation without taking into account specific contexts [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF]. For example, testing the temperature without verifying the door and window positions, the number of occupants and the meteorological conditions could lead to an inaccurate diagnostic result.

The number of tests obtained for the apartment setting is high and difficult to handle and automate. The complexity due the model and the number of sensors is well justified and there is a need to a method to apprehend it. The work in chapter 3 has been published in [START_REF] Najeh | Diagnosis of sensor grids in a building system using BRIDGE approach[END_REF] and (Najeh et al., 2018a). In the following, new services for diagnosis in building are proposed.

1. The first service consists on performing diagnosis with partially valid tests.

The diagnosis analysis must differ in different contexts (working days, vacation periods and many more). These local contexts constitute the concept of validity constraints for a test. The validity is measured with potentially faulty sensors. If these sensors are in mode ok, the guarantee of the diagnostic result is always assured. If these sensors are not ok, there is no guarantee and consequently, there is a need for an indicator to prove the validity. The question that arise is how to conclude about a test that can be valid or not knowing that validity can only be tested with sensors possibly faulty? The contribution in this work is related to considering that sensors might be faulty when testing validity. In the literature [START_REF] Swets | Measuring the accuracy of diagnostic systems[END_REF], it is assumed that a test is valid in all contexts i.e. it could be applied to any situation without taking into account the test context. In connection with building thermal performance, testing the indoor temperature without verifying the number of occupants, the door and window positions and the weather conditions might lead to complex models or to a false diagnosis (Najeh et al., 2018a).

In the field of diagnosis, the concept of validity was initially introduced in Ploix (2009). In [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF], the concept of contextual test i.e a test valid under specific context is proposed. The limitation of the proposed methodology is that it relies on an assumption of non-faulty sensors. In fact, the validity is measured using sensors that can be faulty: a faulty measurement could disturb the applicability of the proposed methodology. The question that arises is how to conclude about a test that can be valid or not knowing that validity can only be tested with sensors possibly faulty?

In this work, a level of completeness is proposed as a method for better formalizing validity in presence of possibly faulty sensors. We do the hypothesis that there is no precise global model for a building system but there are contextual models with limited validity. The validity is measured with potentially faulty sensors. The problem is how to conclude about a test? The test space consists of a set of measurements. The completeness level is proposed as a method to prove if a test space is fully covered or not. The contribution in this work is related to considering that sensors might be faulty when testing validity. This chapter is organised as follow: Section 4.2 presents the problem statement and highlights the difficulties encountered with the validity. Section 4.3 discusses the concept of partial valid test. The innovative idea and mathematical basis for a method to better formalize validity and prove a test is analysed in section 4.4. Finally, concluding remarks and perspectives are given in section 4.5.

Problem statement

Current work focuses on better formalizing validity for partially tests where sensors can be faulty. In [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF], a test is defined by: Definition 4.1. A test is defined by: 1. a time period T. It is a set of time intervals for which the validity constraint is verified.

a behavioral constraint B(X

T ) ∈ B τ 3. a validity constraint V (X T ) ∈ V τ

a test support

A set of possible explanations in terms of component or item states such as Expl = ¬ok(item 1 ) ∨ ... ∨ ¬ok(item n )

5. a bunch of data X T related to the variables X = {x 1 , x 2 , ..., x n } covering a time period T

The following example justifies why the definition of T is better. Let's consider the example of test dealing with an indoor temperature. This test checks the deviation of indoor thermal comfort in the office setting H358. The test is generally defined by [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF]:

B τ (X T ) ∈ B τ ∧ V τ (X T ) ∈ V τ → ok(Σ) B τ (X T ) / ∈ B τ ∧ V τ (X T ) ∈ V τ → ¬ok(Σ)
The period of the test is February 1st, 2016 from t=16:00:00 to t=18:00:00 with, T = {t 16 = 01/02 16 : 00 : 00, t 17 = 01/02 17 : 00 : 00, t 18 = 01/02 18 : 00 : 00} This test is defined by a simple behavioral constraint

B τ (X T ) ∈ B τ with B τ = T in (t) ∈ [T min , T max ], ∀t ∈ T
The bunch of data required for the test of behavioral constraint is

X T = {T in (t 16 ), T in (t 17 ), T in (t 18 )}
where T in is a set of data of indoor temperature measured by Toffice-reference sensor installed in the H358 office. ). This test is also defined by a test support i.e a set of possible explanations related to such symptom. In Singh (2017), a faulty heating system or an important number of appliances could be responsible for an abnormal thermal performance. Only component faults are considered as an explanations for such symptom. The behavioral constraints are satisfied. So, the test is consistent. The behavior constraint is satisfied and all measurements of indoor temperature belong to the domain of constraint of behavior which is [15.52, 23.8]. However, all the measurements for indoor temperature occupy only one part of the space i.e all the measurements are between 23 and 23.99. Then, if the behavioral constraint is satisfied, all the domain space of the behavior constraint must be covered. It means, the data set of indoor temperature should contain for example measurements between 15 and 18, measurements between 18 and 20, measurements between 20 and 22 and measurements between 22 and 25 for example. So, there is a level of completeness that is going to be introduced. This new concept of completeness level for tests without validity is new and will be detailed later Figure 4.2 shows the validity constraints satisfaction. The test is valid. In fact, the validity constraint is satisfied and all measurements of occupancy, outdoor temperature, door and window positions belong to the domain of validity constraint which is (number of occupants >0) for occupancy, [0, 0.20] for door and window positions and [-3.83, 25.6] for outdoor temperature. However, the measurements occupy only one part of the space of validity. For example, all the measurements of occupancy are between 1 and 2, the measurements of outdoor temperature are only between 11 • C and 13 • C. The window is totally closed and there is no measurements where the window is partially closed i.e (0 < ζ W ≤ 0.20). Then, if the validity constraint is satisfied, the whole space of validity constraint must be covered. It means, the data set for occupancy should contain for example measurements between 1 and 2 and measurements more than 2 occupants. Also, the data set for outdoor temperature should contain measurements between -3.83 • C and 10 • C and measurements between 10 • C and 25.65 • C . So, there is a level of completeness that could be introduced. This level of completeness would make it possible to test at any point in the validity period and thus offers a guarantee on the test. This concept of completeness level for validity constraint will be detailed later. Now, imagine that the period of test is March 7th, 2016 from t=00:00 to t=23:00. Figure 4.3 shows the validity constraint satisfaction for this period. The test is invalid on a period of 23 hours. So, the longer the T is, the more the test tends towards to be invalid and the shorter, the less representative it is. Two conclusions can be withdrawn: On the one hand, the longer T is, the more the test tends towards to be invalid. On the other hand, the validity is discontinuous. In the second period, the test is valid from t=07:00 to t=14:00 and from t=17:00 to t=18:00 and invalid otherwise.

To overcome these issues, the concept of valid time span T is used. It allows tests to be carried out over longer periods of time and only the moments where the test is valid are taken into account. In fact, for the test of validity in March 7th, 2016, the valid time span is T = {t 7 , ..., t 14 , t 17 , t 18 } with t 7 =07/03 07:00, t 14 =07/03 14:00, t 17 =07/03 17:00, t 18 =07/03 18:00.

Before introducing a completeness level, let's define properly the different concepts. A detection test could be range-based (Definition 4.2), rule-based (Definition 4.3) or modelbased (Definition 4.4).

Definition 4.2. Range based test

Range-based if B τ (X T ) ∈ B τ is made of intervals belonging checks. It's a simple test based on signal processing techniques. It is derived with the help of upper and lower bounds and there is no representation between system inputs / outputs.

Buildings are very often equipped with many heterogeneous materials and sensors from different generations, making the exploitation difficult on a daily basis. It is therefore with a view to simplifying the operating work and reducing operating costs that the technical management of building is developed. Technical Building Management is a system that allows to supervise the equipment installed there (power supply, lighting, HVAC, plumbing (lifting pumps, tanks and many more), access control, fire devices (alarms extinctions)). It can thus reassemble alarms triggered in the event of anomalies and makes it possible to follow the consumption of energy. Also, it improves security and simplifies day-to-day management. In this system, all technical, safety and energy management appliances are centralized and the information is transcribed on a graphic interface. The data collected are of various types:

-alarms (failure, abnormal stop, measurement exceeding a threshold) i.e a symptom of anomaly -states (equipment operation, position, order feedback) -measurements (temperature, operating time, number of failures)

In Technical Building Management System, alarms can be generated from binary or analog signals. The binary signals trigger alarms when a change of state occurs. The values of the analog signals are compared to the lower and upper limits and the alarm is triggered if the values go below or beyond of these limits. When an alarm is triggered, an alarm message is displayed in the alarm list of the operating station. So an alarm from the Technical Building Management System belongs to a well-defined test family which are the signal-based tests (Definition 4.2).

An alarm detected that the indoor air quality is not beyond the maximum and minimum air quality range (see Figure 4.4). This test generates test results for the deviation of indoor air quality comfort. The period of test is September 1st, 2016 from t=18:00 to t=22:00. So, the time period is T = [t 18 = 18 : 00 : 00, t 19 = 19 : 59 : 00, t 20 = 20 : 00 : 00, t 21 = 21 : 00 : 00, t 22 = 22 : 00 : 00] This test is defined by a behavioral constraint B τ (X T ) ∈ B τ made of intervals belonging checks with the help of upper and lower bounds with The test is inconsistent because beyond the maximum CO 2 concentrations range, building enters into indoor air quality discomfort zone.

B τ = C in (t) ∈ [C min in , C max in ], ∀t ∈ T. X T = Cin T is a data set of
A building system is complex. To make such tests, it is possible to write the relationships between the different physical quantities describing the different subsystems by rules i. As part of the energy performance requirements of buildings and the required state of the indoor environment, air handling units are currently being studied in the literature, particularly in terms of energy management [START_REF] Taebnia | Air distribution and air handling unit configuration effects on energy performance in an air-heated ice rink arena[END_REF]. Fault detection and diagnosis at early stage is mandatory for critical components of HVAC systems as air handling units [START_REF] Yan | Semi-supervised learning for early detection and diagnosis of various air handling unit faults[END_REF]. To assess the performance of the AHU, a set of rules can be used. AHU performance assessment rules uses control signals and access information to identify the mode of operation of the AHU.

A practical example of rule based tests is given below. This test analyzes if the damper position in ventilation system is faulty or not using a rule determined from a data sheet of ventilation system installed in Denmark application where details are presented in chapter 1.

if (CO 2 ≥ 900 ∧ damper position = 100) ∨ (700 ≤ CO The test compares whether the corresponding measurement follow the estimated temperatures or not. Figure 4.6 shows the error resulting from the comparison of the temperature is measured and the estimated temperature. 2019) is challenged by: 1. The validity constraint is measured with sensors. Sensors are subject to different kinds of faults; they can be biased, subject to outliers or missing data, quite common in buildings. If these sensors are faulty, the diagnostic result is not guaranteed. The question that arises is how to conclude about a test that can be valid or not knowing that validity can only be tested with sensors possibly faulty. Also, if these faults are not detected, they lead to a wrong conclusion about the validity.

Let's consider the following case: for testing the indoor thermal comfort in building, the test is defined by a validity constraint

V τ (X T ) ∈ V τ with V τ = T out (t) ∈ [T min out , T max out ] ∧ ζ D (t) = 0 ∧ ζ W (t) = 0 ∧ occupancy(t) > 0, ∀t ∈ T
This outdoor temperature is measured by two different sensors from the weather station. Figure 4.7 shows the data of outdoor temperature from two different sensors in the same period. In addition, missing data is the most important sensor fault type in building. Imagine that the period of the test for indoor thermal comfort is from March 1st, 2016 to March 31th, 2016. Figure 4.8 shows the missing data for door contact sensor in the month of March. 2019), a faulty heating system or an important number of appliances could be responsible for an abnormal thermal performance. Only component faults are considered as an explanation for such symptoms. In our contribution, possible fault explanations for abnormal thermal performance include sensor level fault. For instance, a faulty temperature sensor could be an explanation for this symptom.

3. The space of validity constraints is defined over sensor measurements. The objective is to have data representative of all possible situations. A practical example is given below. The validity constraint for the test of temperature is

V τ (X T ) ∈ V τ with V τ = occupancy(t) > 0 ∧ ζ D (t) ∈ [0, 0.25] ∧ ζ W (t) ∈ [0, 0.25] ∧ T out (t) ∈ [T min out , T max out ]
, ∀t ∈ T The variables included in the validity constraints could have different situations. For example, the outdoor temperature could be low (-3.83 ≤ T out ≤ 10) or high(10 < T out ≤ 25.65), the number of occupants could be few (0 < occupancy ≤ 2) or important (2 < occupancy ≤ 4). Also, the door and window openings could be totally closed (i.e ζ D = 0 and ζ W = 0) or partially closed (i.e 0 < ζ D ≤ 0.25 and 0 < ζ W ≤ 0.25). The objective is to have data representative of all possible situations. Let's consider 3 different periods for testing how much the data are representative of all situations.

(a) Period 1: March 9th, 2016 from t=09:00 to t=11:00

In this period the test is valid. 4.9 shows the evolution of data involved in the validity constraint for period 1. 4.10 shows the evolution of data involved in the validity constraint for period 2. where denote by the presence of data in a category For period 2, the data are representative with 75% and X T is richer in data than period 1.

The problem is how to conclude about a test that can be valid or not knowing that validity can only be tested with sensors possibly faulty and how to know if the space of validity is totally covered or not? Hence, there is a need for a method for better formalizing validity where sensors can be faulty. The next section deals with the design of partially valid tests.

Design of automatic partially valid tests

In this work, we make the hypothesis that there is no precise test for a building system but there are contextual tests with partially validity. In the domain of fault diagnosis, a symptom is defined as a measurable change in the behavior of a system providing information about the system status or behavioral mode i.e. an indication of fault. A partially valid test is used to generate symptoms. These symptoms appear in the behavioral constraints (Definition 4.5).

Definition 4.5. Behavioral constraint:

Let T = [t 0 , . . . , t n-1 ] be an ordered list of time samples, that will be called time span with dom(T) = R +n , min(T) = t 0 , max(T) = t n-1 and t i < t i+1 . Let X(t i ) = [x 0 (t i ), . . . , x p-1 (t i )] with t i ∈ T, be a set of data related to a system at time t i .

X T = [X(t 0 ), . . . , X(t n-1 )].
Let τ be a test for a system Σ defined by, if τ is true, then the system Σ is in an ok state i.e. τ true ↔ ok(Σ). "Test τ is true" can be modeled by a behavioral constraint B(X T ). Let B τ (X T ) : dom(X T ) → R m ; m ∈ N + * be a behavioral function for test τ . The test τ of system Σ is said consistent if it exists B ⊂ R m such as:

1. B τ (X T ) ∈ B τ ↔ ok(Σ) 2. max(T) → ∞
the longer T is, the more it confirms the ok state of the subsystem Σ Therefore, the test

τ for Σ is inconsistent if B τ (X T ) / ∈ B τ i.e ¬ok(Σ) with ok(Σ) → ∧ i ok(item i ) and ¬ok(Σ) → ∨ i ¬ok(item i )
The items are the components of the system. In diagnosis, it is interesting to distinguish the modes that characterize the system state. An item can have 2 modes: the ok mode which represents the normal behavior and the not ok mode which represents the complement of normal behavior. In the case of the appearance of a symptom, the test leads to an explanation. Let's consider a test examining the following modes ok(item 1 ), ok(item 2 ) and ok(item 3 ) The expression ∧ i ok(item i ) led to ok(item 1 ) ∧ ok(item 2 ) ∧ ok(item 3 ). In this case, the system Σ is on mode ok The expression ∨ i ¬ok(item i ) led to ¬ok(item 1 ) ∨ ¬ok(item 2 ) ∨ ¬ok(item 3 ). If the test conclusion is not ok, we obtain a list of explanations that led to this conclusion which is Expl = {¬ok(item 1 ), ¬ok(item 2 ), ¬ok(item 3 )} Corollary 4.1. Let's introduce a partition of T: P(T) = {T i , ∀i}. Let's decompose the constraint satisfaction problem into subproblems:

B τ (X T ) ∈ B τ ↔ i B τ,i (X T i ) ∈ B τ,i
Let's examine the negation of 1 from definition 4.5:

B τ (X T ) / ∈ B τ ↔ ¬ok(Σ τ )
can be rewritten as

i B τ,i (X T i ) / ∈ B τ,i ↔ ¬ok(Σ τ )
For example, let's consider X T = [19, 20, 19.8, 19.7, 19.1, 19] Partitioning consists on decomposing X T in X T1 = [19, 20, 19.8] and X T2 = [19.7, 19.1, 19] Let's consider the following behavioral constraint

B τ (X T ) ∈ B τ with B τ = X(t) ∈ [16, 21], ∀t ∈ T. This constraint is decomposed into B τ 1 (X T1 ) ∈ B τ 1 and B τ 2 (X T2 ) ∈ B τ 2 with B τ 1 = X1(t) ∈ [16, 21], ∀t ∈ T 1 and B τ 2 = X2(t) ∈ [16, 21], ∀t ∈ T 2 ] B τ (X T ) ∈ B τ is satisfied if B τ 1 (X T1 ) ∈ B τ 1 is satisfied and B τ 2 (X T2 ) ∈ B τ 2 In this example, B τ 1 (X T1 ) ∈ B τ 1 and B τ 2 (X T2 ) ∈ B τ 2 are satisfied. So, B τ (X T ) ∈ B τ is satisfied.
The space of behavioral constraint is defined over measurements. In this case, the space of behavioral constraint which is the interval [16,21] is not totally covered. It means that the measurements occupy only one part of the space which is between 19 and 20 and there is no measurements between 16 and 19. Then, if the behavioral constraint is satisfied, all the domain space of the behavior constraint must be covered. It means, the data set should contain measurements between 16 and 19, measurements between 19 and 20 and measurements between 20 and 21 for example. So, there is a level of completeness (Definition 4.6) for tests without validity that must appear. The level of completeness offers more guarantee on the test result. In the following, we will detail a method to calculate it. Definition 4.6. The completeness of X T with respect to the test τ Let's define a sub-set P of the partition T ∈ P(T). If B τ (X T ) ∈ B τ ↔ ok(Σ) is equivalent to definition 4.5, X T is said complete with respect to the test τ .

Let's T = {t 0 , t 1 , t 2 , t 3 , t 4 , t 5 , t 6 , t 7 } an ordered list of time samples, X T = {16. 1, 17, 17.2, 18, 17.5, 17.4, 17.2, 17} a set of data, T = {t 0 , t 1 , t 2 , t 3 } ∈ P(T) and X T = {16. 1, 17, 17.2

, 18} Let's consider the behavioral constraint B τ (X T ) ∈ B τ with B τ = X (t) ∈ [16, 18], ∀t ∈ T In this case: -B τ (X T ) ∈ B τ is satisfied -max(T ) → ∞.
The space of behavioral constraint is defined over data in X T . The data set is representative enough for different situations because we have data between 16 and 17 and data between 17 and 18. So, the space of behavioral constraint with T is covered and X T is said complete with respect to the test τ .. or it yields the corollary 4.2:

Corollary 4.2. ∃T i ∈ P(T)/B τ,i (X T i ) / ∈ B τ,i → ¬ok(Σ τ )
For example, let's consider [19, 20, 21, 33, 35, 35.4, 38] Partitioning consists on decomposing X T in X T1 = [19,20,21] and X T2 = [33, 35, 35.4, 38] Let's consider the following behavioral constraint

X T =
B τ (X T ) ∈ B τ with B τ = X(t) ∈ [16, 21], ∀t ∈ T]. This constraint is decomposed in B τ 1 (X T1 ) ∈ B τ 1 and B τ 2 (X T2 ) ∈ B τ 2 with B τ 1 = X1(t) ∈ [16, 21], ∀t ∈ T 1 ] and B τ 2 = X2(t) ∈ [16, 21], ∀t ∈ T 2 ] B τ (X T ∈ B τ ) is not satisfied if B τ 1 (X T1 ) ∈ B τ 1 is not satisfied or B τ 2 (X T2 ) ∈ B τ 2 is not satisfied In this example, B τ 2 (X T2 ) ∈ B τ 2 is not satisfied. So, B τ (X T ) ∈ B τ ) is not satisfied.
τ (X T ) ∈ B τ ↔ ok(Σ τ ) 2. ∃T i ∈ P(T)/B τ,i (X T i ) / ∈ B τ,i → ¬ok(Σ τ )
A contextual test is based on validity constraints (Definition 4.8) for a test.

Definition 4.8. Validity constraint

Let's introduce another constraint set V τ (X T ) ∈ V τ , where V is a bound domain, to specify the context where the behavioral constraint set applies (X T is assumed to be a superset of the variables appearing either in behavioral or in validity constraint sets ie some variables might not appear in both constraint sets). Hence, a detection test modeling the normal behavior under validity conditions is defined by:

1. (B τ (X T ) ∈ B τ ) ∧ (V τ (X T ) ∈ V τ ) → ok(Σ τ ) 2. (B τ (X T ) / ∈ B τ ) ∧ (V τ (X T ) ∈ V τ ) → ¬ok(Σ τ )
3. X(T) complete with respect to τ Corollary 4.3. Let's introducing a partition of T: P(T) = {T i , ∀i}. Let's decompose the constraint satisfaction problem into subproblems:

B τ (X T ) ∈ B τ ∧ V τ (X T ) ∈ V τ ↔ i B τ,i (X T i ) ∈ B τ,i ∧ V τ,i (X T i ) ∈ V τ,i
Let's examine the negation of 1 from Definition 4.8:

B τ (X T ) / ∈ B τ ∧ V τ (X T ) / ∈ V τ ↔ ¬ok(Σ τ )
can be rewritten as

i B τ,i (X T i ) / ∈ B τ,i ∧ V τ,i (X T i ) / ∈ V τ,i ↔ ¬ok(Σ τ )
or it yields the corollary 4.4

Corollary 4.4.

∃T i ∈ P(T)/B τ,i (X T i ) / ∈ B τ,i ∧ V τ,i (X T i ) ∈ V τ,i → ¬ok(Σ τ )
Definition 4.8 becomes Definition 4.9 Definition 4.9. Validity constraint for a contextual test τ defined by the data X T , a behavioral constraint represented by B τ (X T ) and B τ , but also a validity constraint represented by V τ (X T ) and V τ :

1. X T complete wrt B τ and V τ , and

(B τ (X T ) ∈ B τ ) ∧ (V τ (X T ) ∈ V τ ) → ok(Σ τ ) 2. ∃T i ∈ P(T)/X T i complete wrt V τ and (B τ,i (X T i ) / ∈ B τ,i ) ∧ (V τ (X T i ) ∈ V τ ) → ¬ok(Σ τ )

Mathematical basis for completeness level

In this work, the concept of completeness level (Definition 4.11) for better formalizing validity and proving a test is used. It is an indicator to prove how much max(T) → ∞ is satisfied. In fact, proving the test ∀t is not possible because we don't have an infinite time. To overcome this problem, the solution is to test in some representative cases i.e in a finite time (max(T) < ∞). In this case, the conclusion is if the test is ok for some cases, we can conclude that it is ok for max(T).

To calculate the completeness level for a test, a partitioning approach (Definition 4.10) is used in this work.

Definition 4.10. representative partitioning approach

Recall a partitioning of an ordered set of data X T related to the set of ordered variables {x 0 , x 1 , ..., x p-1 } covering a valid time span T={t 0 , t 1 , ..., t n-1 }, is to divide the set X T into partitions of T:

P(T) = {T i , ∀i}
The completeness level is computed by:

µ τ (X(T)) = Σ i (X(T) ∩ P i = 0) n (4.2)
with P = {P 1 , P 2 , ..., P n } be a partition of dom(X T ) X(T) ∩ X i = 0 is number of points per partition

A such example of partitioning methodology is shown in the following.

Definition 4.11. Completeness level for test Let X T be a set of known (measurements) covering a time span T A completeness level µ τ (X T ) for a test τ is defined as follows:

1. µ τ (X T ) = 1 means the test with max(T) < ∞ yields the same conclusion than when max(T) → ∞ max(T) → ∞ means that the system is always normal for all times. This cannot be verified as it does not have infinite time. To overcome this problem, the solution is to test in some representative enough cases (ie in a finite time (max(T) < ∞)) and so if the behavior constraint is ok for some representative enough cases, we can say that it should be ok for max(T) → ∞ 3. µ τ (X T ) < µ T (X T ) means the dataset X T is more representative of max(T) → ∞ than X T . For example, let's (X T ) and (X T ) 2 data sets defined by -X T = {-4, -4.3, 5, 5.5}, where T = [t 0 = 0, 4, -4.3, 5, 5.5, 12, 13, 12.6, 14}, where T = [t 0 = 0, t 1 = 1, t 2 = 2, t 3 = 3, t 4 = , t 5 = 5, t 6 = 6, t 7 = 7], with t 0 < t 1 < t 2 < t 3 < t 4 < t 5 < t 6 < t 7

t 1 = 1, t 2 = 2, t 3 = 3], with t 0 < t 1 < t 2 < t 3 -X T = {-
Partitioning approach consists on decomposing the ordered data set X T into subsets for example in two subsets (X f ew T and X lot T such as 3,6], ∀t ∈ T and X lot T = X(t) > 6, ∀t ∈ T and decomposing the ordered data set (X T ) in two subsets (X T f ew and X 3,6], ∀t ∈ T and X T lot = X (t) > 6, ∀t ∈ T The completeness level using partitioning based approach is to check how many boxes are filled. Tables 4.3 and 4.4 show the number of filled boxes for X T and (X T ).

X f ew T = X(t) ∈ [-
T lot ) such as X T f ew = X (t) ∈ [-
Table 4.3 -Completeness level for X T X f ew T X lot T 4 points 0 points Table 4.4 -Completeness level for X T X f ew T X lot T 4

points 4 points

The completeness levels for X T and X T are respectively µ T (X T ) = 0.5 and µ T (X T ) = 1. We conclude that the data set X T is more representative of max(T) → ∞. So, the higher the level of completeness is, the better the database quality is (ie one tends towards max(T) → ∞)

Illustrative example

This section highlights the steps for design of partial valid test with completeness level as well as how to prove the test. An example of test of indoor air quality is used as an illustrative example. The proposed methodology is decomposed into 6 steps:

-Step 1 : define the behavioral and validity constraints for the test as well as possible fault explanations for such symptom -Step 2 : determine a period of test -Step 3 : determine when the test is valid and consequently determine the valid time span

T.

-Step 4 : determine the bunch of data X T related to the variables of behavioral and validity constraints covering the valid time span T.

-Step 5 : Partitioning of the space of test to know how much the data are representative of all possible situations.

-Step 6 : calculate the completeness level using partitioning approach An example of test of indoor air quality is used as an illustrative example. Let's consider the following test that verifies the indoor air quality in the office. The test is defined by

B(X T ) ∈ B τ ∧ V (X T ) ∈ V τ → ok(Σ) B(X T ) / ∈ B τ ∧ V (X T ) ∈ V τ → ¬ok(Σ)
Step 1: determine behavioral and validity constraints for the test This test is defined by a behavioral constraint B(X

T ) ∈ B τ with B τ = C in (t) ∈ [C min in , C max in ], ∀t ∈ T C min
(X T ) ∈ V τ with V τ = ζ D (t) = 0 ∧ ζ W (t) = 0, ∀t ∈ T
Step 2: determine a period for the test

The period of test is September 1st from t=00:00 to t=23:00

Step 3: determine the valid time span The test is valid from t=00:00 to t=09:00 and from t=18:00 to t=23:00 and invalid otherwise. The time span contains only time samples in valid zones. In this case, the time span is T={t 0 =00:00:00, t 1 =01:00:00, t 2 =02:00:00, t 3 =03:00:00, t 4 =00:00:00, t 5 =05:00:00, t 6 =06:00:00, t 7 =07:00:00, t 8 =08:00:00, t 9 =09:00:00, t 18 =18:00:00, t 19 =19:00:00, t 20 =20:00:00, t 21 =21:00:00, t 22 =22:00:00, t 23 =23:00:00}

W (T) = [[ζ W (t 0 ), ..., ζ W (t 9 )], [ζ W (t 18 ), ..., ζ W (t 23 )]])
Step 5: representative partitioning of the space of test to know how much the data are representative of all possible situations

The space of validity constraints is composed by sensor measurements. The variables included in the validity constraints could have different situations. For example, the door and window openings could be totally closed (i. Step 6: calculate the completeness level

The completeness level check whether diverse enough situations are contained in a test or not.

The number of situations is 2 3 = 8 which are:

-when CO We conclude that this test is consistent with a completeness level equal to µ τ (X T ) = 2 8 = 0.25

Conclusion

In [START_REF] Singh | Improving building operational performance with reactive management embedding diagnosis capabilities[END_REF], the concept of contextual test i.e a test valid under specific context is proposed in the framework of fault diagnosis in building. The limitation of the proposed concept is that it relies on an assumption that the sensors are reliable. However, the validity is measured with faulty sensors and a faulty sensor could disturb the efficiency of this concept. The question that arises is how to conclude about a test that can be valid or not knowing that the validity can only be tested with sensors possibly faulty? The contribution in this work is to consider that the sensors might be faulty when testing validity. This chapter starts by highlighting the difficulties encountered in the test of validity constraints which are related to the period of test and the coverage of the space of validity. On the one hand, the longer the period of test is, the more that the test tends towards to be invalid and the shorter, the less representative it is. To overcome this problem, the concept of valid time span is used. It is an ordered list of time samples that corresponds to the moments where the validity constraints are satisfied. On the other hand, the space of validity constraints is defined over sensor measurements and the objective is to have data representative of all possible situations. To overcome this problem, a level of completeness is proposed as a method for better formalizing validity. It is an indicator to prove if the test space is fully covered or not and it is calculated using partitioning approach. Future work deals with new methods for the calculation of the completeness level such as spreadrate technique. The next chapter deals with the calculation of a confidence level for the result of a set of tests.

Chapter 5

From completeness level to confidence level of diagnosis

Introduction

In chapter 4, we presented a framework for performing diagnosis in building with partially valid tests. The reference behavior has been simulated and then, we applied a fault scenario as an illustration. The test results are symptoms for further usage, e.g., for decision making in terms of diagnosis. A completeness level has been proposed as a method to assess the level of validity of a test.

Nevertheless, the diagnostic result is calculated from a set of tests, each one defined by its completeness level. The question that arises is how to conclude in terms of diagnosis and how to take into account the completeness level in the diagnosis?

In the literature, the concept of confidence level for diagnosis is proposed in [START_REF] Dubois | Fuzzy sets, probability and measurement[END_REF]. In [START_REF] Ploix | Des systèmes automatisés aux systèmes coopérants: application au diagnostic et à la gestion énergétique[END_REF], the confidence level for diagnosis with fuzzy logic reasoning is proposed but without validity. It focused on the impact of a false alarm, which is very sensitive to detection thresholds. Indeed, to prevent this from occurring, the setting must be very pessimistic and thus generates a lot of non-detections. To remedy this, [START_REF] Ploix | Automatic design of detection tests in complex dynamic systems[END_REF]; [START_REF] Touaf | DIAGNOSTIC LOGIQUE DES SYSTEMES COMPLEXES ET DYNAMIQUES DANS UN CONTEXTE[END_REF] transposes the crisp logic of diagnostic analysis to a fuzzy logic reasoning [START_REF] Lotfi | The concept of a linguistic variable and its application to approximate reasoning-i[END_REF].

The difference with the work proposed in [START_REF] Ploix | Automatic design of detection tests in complex dynamic systems[END_REF] is that in our work, a test is characterized by crisp threshold. It means that the behavioral constraint of a test is either satisfied or unsatisfied. Doubt is related to the validity constraints and the question that arises is from which completeness level we can conclude a test result is valid? The novelty in this chapter is to propose a solution to compute the confidence level of a global diagnosis deduced from a set of tests whose some of them have a completeness level lower than 1. To solve this problem, we are going to adapt a method based on fuzzy logic reasoning. This chapter is organized as follows: Section 5.2 presents the problem statement. The innovative idea and the mathematical basis for a confidence level for diagnosis are detailed in section 5.3. Section 5.4 deals with a case study for performing diagnosis with partially valid tests with confidence level for the platform in the University of Southern Denmark . Finally, concluding remarks are given in section 5.5.

Problem statement

In chapter 4, a method for performing diagnosis in building with partial valid tests is proposed. The validity is measured using sensors that can be faulty. To overcome this problem, the completeness level is proposed as a method for better formalizing validity. The completeness level is used to evaluate how much the space of the related variables is covered. It is a measurement of a constraint satisfaction whatever the context is.

In the detection phase, a completeness level µ τ (X T ) for each test is determined. It is related to a partial validity result. However, in a building system, various types of tests can be performed and each of them is possibly defined by its own level of completeness. The result of tests and therefore the diagnosis is expressed in terms of faulty components (i.e ∨ i ¬ok(component i ))

Let's consider a simple example on how diagnoses are computed from inconsistent tests. Let τ 1 and τ 2 be 2 tests using the data of three similar sensors that measure the indoor temperature Suppose that τ 1 and τ 2 are inconsistent with a completeness levels equal to µ(τ 1 (X T )) = 0.85 and µ(τ 1 (X T )) = 0.7 respectively. Because these tests are mostly negative, the possible explanations for each test are given by: Expl(τ 1 ) = {¬ok(sensor1), ¬ok(sensor2)} Expl(τ 2 ) = {¬ok(sensor1), ¬ok(sensor3)} Without considering the completeness level, the obtained diagnoses are: D1: ¬ok(sensor1) D2: ¬ok(sensor2) ∧ ¬ok(sensor3)

The question that arises is how to determine the confidence level for global diagnoses? In fact, the diagnostic result is calculated from 2 tests, each defined by its completeness level lower than one. The problem is how to take into account the completeness level to determine a confidence level for global diagnoses?

The next section deals with a method to determine the confidence level for global diagnosis.

From completeness level to confidence level of diagnosis

In the detection phase, a completeness level for each test is determined to assess a level of validity for each test. For the test conclusion to be ok, a test should be consistent AND valid AND complete. For the test conclusion to be not ok, a test should be inconsistent AND valid AND complete. A test is characterized by thresholds i.e the behavioral constraint is either satisfied or unsatisfied. Doubt is related to the validity constraints. To remedy this, we have transpose the crisp logic of diagnostic reasoning into fuzzy logic reasoning. The idea is, instead of speaking about a completeness level to assess the level of validity for a test, we are talking about a membership level to a valid domain for a test and consequently, instead of speaking about consistent/inconsistent tests, we are speaking about a membership level to True/False for a test.

Before introducing the confidence level, let's define the different concepts.

The theoretical basis of fuzzy logic was established in the early 1965s by [START_REF] Lotfi | The concept of a linguistic variable and its application to approximate reasoning-i[END_REF]. This technique combines the notion of "fuzzy membership" (Definition 5.1). An element can belong partially to a given set, modeling an uncertainty that allows a more flexible reasoning. The data are modeled by linguistic variables which are the association of a linguistic term with a fuzzy subset. Thus, the "classical" numerical computation model becomes a "computation with Words (CW)". Fuzzy logic reasoning, based on the definition of rules and a membership level to sets (Definition 5.2), allows to better understand difficult phenomena.

Definition 5.1. fuzzy membership

A subset A of the set X is characterized by a fuzzy membership function f A (x) such that: ∀x ∈ X, f A (x) ∈ [0, 1] with f A = 0 for a null membership and f A = 1 for a total membership Definition 5.2. Membership level Instead of belonging to the "true" set or the "false" set in crisp logic, fuzzy logic admits a membership level to a given set. The membership level to a fuzzy set is materialized by a number between 0 and 1. A precise value of the membership function linked to a value of the variable is noted µ. In order to be able to easily manipulate fuzzy sets, we redefine the operators of the theory of classical sets in order to adapt them to the membership functions. Here are two the most commonly used operators: complement NOT (Definition 5.6), intersection AND (Definition 5.5), and union OR (Definition 5.4). To compare two fuzzy subsets, one must compare their respective membership functions (Definition 5.3)

Definition 5.3. Egality A = B if and only if ∀x ∈ X, f A (x) = f B (x)
To know the common points between two fuzzy sets, we must also look at their respective membership functions and estimate how similar they are. We often take the min operator for that.

Definition 5.4.

Intersection A ∩ B ⇒ µ(A ∩ B)(x) = min(f A (x), f B (x))
To gather two fuzzy subsets, one often takes the operator max.

Definition 5.5. Union

A ∪ B ⇒ µ(A ∪ B)(x) = max(f A (x), f B (x))
It should be noted that the max and the min are not the only possible operators to define respectively the union and the intersection of two fuzzy subsets. In general, we can define the intersection by a triangular norm (t-norm) and the union by a triangular conorm (t-conorm) [START_REF] Nilesh | Introduction to type-2 fuzzy logic systems[END_REF] To express a negation, we use the complement of the membership function of the fuzzy subset.

The following steps explain the diagnostic analysis with confidence level based on fuzzy logic reasoning.

Fuzzification of symptoms

To take better advantage of the fuzzy reasoning, we slightly modify the interpretation of the validity. If a test is consistent, valid and incomplete, the level of completeness is represented by a membership level to valid. Therefore, instead of considering that the test is true or false, a membership level to true / false is used. A system defined by a behavioral and a validity constraint is defined by

V τ (X T ) ∈ V τ ∧ (∧ i ok(component i )) ↔ B τ (X T ) ∈ B τ (5.1)
or equivalent

∧ i ok(component i ) ↔ B τ (X T ) ∈ B τ ∧ ¬(V τ (X T ) ∈ V τ ) (5.2)
To make better use of the fuzzy reasoning, we slightly modify the interpretation of the validated given in Equation 5.2. The idea is to say that if the validity constraints are not satisfied, instead of considering that the system behaves a priori normally, it is in an indeterminate state.

∧ i ok(item i ) ← B τ (X T ) ∈ B τ ∧ V τ (X T ) ∈ V τ (5.3)
The constraint modeling the doubt in case of validity is given by Equation 5.4

¬(V τ (X T ) ∈ V τ ) ≡ doubt in ∧ i ok(item i ) (5.4)
This translates into a constraint that corresponds to Equation 5.5

∧ i ok(item i ) → B τ (X T ) ∈ B τ ∨ ¬(V τ (X T ) ∈ V τ ) (5.5)
Therefore, the validity constraint must be tested. With the fuzzy approach, we will consider that there are more than two possible values for satisfaction (satisfied or not satisfied), but an infinity that ranges from 1 (satisfied) to 0 (not satisfied). This corresponds to the membership level to satisfied. At the end of the test phase, there are two membership levels. In fact, instead of speaking about a completeness level for a test, we speak about a membership level to a valid domain i.e µ V = µ(V τ (X T ) ∈ V τ ). Also, instead of speaking about True or False test, we speak about a membership level to True or False µ T rue = µ(τ = T rue) and µ F alse = µ(τ = F alse).

The objective is to determine a fuzzification function which allows to determine µ T rue from

µ V = µ(V τ (X T ) ∈ V τ ) Using the fuzzy interpretation A → B ≡ ¬A ∨ B, µ(A ∨ B) = min(1, µ(A) + µ(B))
Consider that, in Equation 5.5, the two sets of behavioral and validity constraints must be tested and in the detection phase, two membership levels

µ B = µ(B τ (X T ) ∈ B τ ) and µ V = µ(V τ (X T ) ∈ V τ ) are distinguished.
The objective is to find a function of fuzzification which allows to deduce the membership level to the symptom ∧ i ok(component i ) and thus of the degrees of satisfaction of the constraints of behavior and validity µ(B τ (X T ) ∈ B τ ) and µ(V τ (X T ) ∈ V τ ). Let's transpose Equation 5.5 to Equation 5.6

min(1, 1 -µ(∧ i ok(item i )) + µ(B τ (X T ) ∈ B τ ) + (1 -µ(V τ (X T ) ∈ V τ )), 1) = 1 (5.6)
It comes Equation:

min(1, 2 -µ(∧ i ok(item i )) + µ(B τ (X T ) ∈ B τ ) + +µ(V τ (X T ) ∈ V τ ), 1) = 1 (5.7)
To check Equation 5.7, you have to check

µ(∧ i ok(item i )) ≤ 1 + µ(B τ (X T ) ∈ B τ ) -µ(V τ (X T ) ∈ V τ ) (5.8) Equation 5.4 led to: µ(V τ (X T ) ∈ V τ ) ≡ (µ(∧ i ok(item i )) = 0.5) (5.9) Equation 5.3 yields min(1, -2 -µ(B τ (X T ) ∈ B τ ) -µ(V τ (X T ) ∈ V τ ) + µ(∧ i ok(item i ))) = 1 (5.10)
To satisfy equation 5.9, we must check:

µ(∧ i ok(item i )) ≥ µ(B τ (X T ) ∈ B τ ) + µ(V τ (X T ) ∈ V τ ) -1 (5.11)
In [START_REF] Ploix | Des systèmes automatisés aux systèmes coopérants: application au diagnostic et à la gestion énergétique[END_REF], a function of fuzzification which allows to deduce the membership level to the symptom ∧ i ok(component i ) and thus of the degrees of satisfaction of the constraints of behavior and validity µ(B τ (X T ) ∈ B τ ) and µ(V τ (X T ) ∈ V τ ) and it is defined by:

Γ(µ B , µ V ) = 1 + (2µ B -1)µ V 2
(5.12)

Our case differs from that of [START_REF] Ploix | Des systèmes automatisés aux systèmes coopérants: application au diagnostic et à la gestion énergétique[END_REF]. In our case, a test is characterized by thresholds ie the behavior constraint of a test is either satisfied

(µ(B τ (X T ) ∈ B τ ) = 1) either unsatisfied (µ(B τ (X T ) ∈ B τ ) = 0).
Uncertainty is related to the validity constraints. Indeed, it is difficult to set a threshold for the level of completeness from which one can say that a test is valid.

In this work, we work on a function of fuzzification which allows to deduce the membership level to True from the membership level to a valid domain. It is defined by: In fuzzy logic, if µ V = 1, the test is valid. If µ V = 0, the test is valid or invalid. So, we conclude that, for the test to be valid, it is necessary that µ V ≥ 0.5 Let's consider the following example of 5 tests summarized in Table 5

µ(τ = T rue) = µ τ (X T ) 2 + 0.5 (5.13)
.3. Table 5.3 -Test conclusion Tests consistent/inconsistent valid/invalid complete/incomplete Test conclusion τ 1 consistent valid complete(µ τ (X T ) = 1) True τ 2 consistent valid incomplete(µ τ (X T ) = 0.4) - τ 3 inconsistent valid complete(µ τ (X T ) = 1) False τ 4 inconsistent valid incomplete(µ τ (X T ) = 0.6) - τ 5 inconsistent valid incomplete(µ τ (X T ) = 0.8) -
where -means indefined The diagnostic result is calculated from a set of tests, whose some of them have a completeness level lower than 1.

To overcome this problem, we propose to calculated the membership level to True/False from the membership level to a valid domain. So, in fuzzy logic, a membership level to True/False for each test is determined by Equation 5.13.

µ(τ 1 = T rue) = 1 2 + 0.5 = 1 µ(τ 2 = T rue) = 0.4 2 + 0.5 = 0.7 µ(τ 3 = F alse) = 1 2 + 0.5 = 1 µ(τ 4 = F alse) = 0.6
2 + 0.5 = 0.8 µ(τ 5 = F alse) = 0.8 2 + 0.5 = 0.9 The next section deals with fuzzy logic diagnostic analysis

Fuzzy logic diagnostic reasoning

In the detection phase, a membership level to True for each test is determined (µ(τ = T rue)). In order to determine the faulty components, diagnostic reasoning analyses the symptoms from detection tests. In this work, to compute diagnosis, we use the diagnostic from first principle, based on the concept of conflict and proposed by [START_REF] Reiter | A theory of diagnosis from first principles[END_REF]. If an abnormality is detected, it means that the system state is necessarily false. A conflict is a set of component states, which one of them is at least false. Diagnoses are deduced from the analysis of sets of revealed conflicts. The number of possible diagnoses could be huge. So, the search of minimum diagnoses is required. The minimum diagnoses are obtained thanks to the HS Tree algorithm proposed by [START_REF] Reiter | A theory of diagnosis from first principles[END_REF]. Several situations can occur. Let's T, be a set of tests that is partitioned into:

T = T positive ∪ T negative ∪ T doubtf ul
(5.14)

with

T positive = {τ, µ(τ = T rue) = 1} T negative = {τ, µ(τ = F alse) = 1} T doubtf ul = {τ, µ(τ = F alse) ∈]0, 1[} where µ(τ = T rue) = 1 -µ(τ = F alse)
T doubtf ul is decomposed into doubtful tests mostly positive T doubtf ul mostly positive and doubtful tests mostly negative T doubtf ul mostly negative defined respectively by

T doubtf ul mostly positive = {τ, µ(τ = F alse) ∈]0, 0.5[} T doubtf ul mostly negative = {τ, µ(τ = F alse) ∈ [0.5, 1[}
Now, let's justify the value 0.5. Let A and B be two fuzzy sets. Benvenuti (1996) defines A < B (A less fuzzy than B) by µ A ≤ µ B ≤ 0.5 or 0.5 ≤ µ B ≤ µ A . Through this showed that "the set (noted S/2) defined by µ = 0.5 is the single maximum element.

Let's consider different situations

The first situation corresponds to the case where T positive = ∅ and T doubtf ul mostly positive = ∅. This situation is similar to that of the crisp logic: there is no reason to calculate diagnoses because no anomaly has been revealed.

The second situation corresponds to the case where T negative = ∅ and T doubtf ul mostly negative = ∅.. The diagnoses must then be able to explain not only these tests but also doubtful tests T doubtf ul mostly negative , which reveal a possible anomaly. Let's call D negative = {D negative i , ∀i} the diagnoses explaining T negative . Let's consider the example of three tests T 1 , T 2 and T 3 where T 1 and T 2 are negative (i.e µ(T 1 = F alse) = 1 and µ(T 2 = F alse) = 1) and T 3 is doubtful mostly negative i.e µ(T 1 = F alse) = 0.8 ∈ [0.5, 1[. Let's consider the two following situations.

The first situation consists on calculating the minimal diagnoses from only negative tests that reveal inconsistency. The explanations of each test are the following:

Expl(T 1 ) = ¬ok(component 1 ) ∨ ¬ok(component 2 )¬ok(component 3 ) Expl(T 2 ) = ¬ok(component 2 ) ∨ ¬ok(component 3 )
The set of global minimal diagnoses from negative tests D negative is deduced with the HS Tree algorithm is the following:

D negative = ¬ok(component 2 ) ∨ ¬ok(component 3 )
The second situation consists on calculating the minimal diagnoses from both negative and doubtful mostly negative tests that reveal inconsisties. The explanations of each test are the following:

Expl(T 1 ) = ¬ok(component 1 ) ∨ ¬ok(component 2 )¬ok(component 3 ) Expl(T 2 ) = ¬ok(component 2 ) ∨ ¬ok(component 3 ) Expl(T 2 ) = ¬ok(component 4 )
The obtained diagnoses is:

D = ¬ok(component 2 ) ∨ ¬ok(component 3 ) ∨ ¬ok(component 4 )
According to these two situations, we conclude that with or without ¬ok(component 4 ), the minimal diagnoses ¬ok(component 2 ) ∨ ¬ok(component 3 ) are always present. To explain the T doubtf ul mostly negative tests, each D negative i diagnosis must be completed by additional ¬ok modes (which is ¬ok(component 4 ) in this example). However, the diagnoses resulting from this complement are necessarily not minimal since they contain D negative (which is ¬ok(component 2 ) ∨ ¬ok(component 3 ) in this example) Therefore, in the situation where T = T negative , the minimum diagnoses are calculated only from T negative , written D = D negative

The diagnoses can be calculated but it remains to evaluate their confidence level. The principle is to evaluate the confidence level of what induces each diagnosis. In this situation, the diagnoses are induced by the T negative tests whose characterized by µ(T est = F alse) = 1. So, the confidence level for global diagnosis is equal to:

µ(D negative ) = 1
Let's consider the following system defined by: ok(sensor 1) ok(sensor 2) ok(sensor 3) ok(sensor 4)

τ 1 1 0 1 1 τ 2 1 1 0 1 τ 3 1 1 1 0
Imagine that the observed symptoms are the following:

consistent/inconsistent valid/invalid complete/incomplete τ 1 inconsistent valid complete(µ τ (X T ) = 1) τ 2 inconsistent valid incomplete(µ τ (X T ) = 0.6) τ 3 inconsistent valid incomplete(µ τ (X T ) = 0.7)
The diagnostic result is calculated from tests, whose some of them are incomplete (i.e have a completeness level lower than 1). To remedy this, we have transposed the crisp logic to fuzzy logic reasoning. The first step is to calculate the membership level to "False" for each test. µ(τ 1 = F alse) = 1 2 + 0.5 = 1 µ(τ 1 = F alse) = 0.6 2 + 0.5 = 0.8 µ(τ 1 = F alse) = 0.7 2 + 0.5 = 0.85 In this case, the test τ 1 is negative and tests τ 2 and τ 3 are doubtful mostly negative because their membership level to False is belong the interval [0.5, 1[ Imagine that the obtained diagnoses are ¬ ok (sensor 1) ∨ ¬ ok (sensor 2) ∨ ¬ ok (sensor 3) ∨ ¬ ok (sensor 4)

The confidence level for each diagnosis is equal to 1.

The third situation corresponds to the case T doubf ul mostly negative = ∅. Doubtful tests are decomposed on 2 types of tests doubtful mostly negative tests and doubtful mostly positive test. The question that arise is from which type of these tests, the diagnoses are calculated? Let's call D doubtf ul = {D doubtf ul i , ∀i} the diagnoses explaining T doubtf ul tests. Let's consider the example of 3 tests τ 1 , τ 2 and τ 3 where τ 1 and τ 2 are doubtful mostly negative (i.e µ(τ 1 = F alse) = 0.9 ≥ 0.5 and µ(τ 2 = F alse) = 0.8 ≥ 0.5) and τ 3 is doubtful mostly positive (i.e µ(τ 3 = T rue) = 0.8 ≥ 0.5 Let's consider the 2 following situations: The first situation consists on calculating the minimum diagnoses from only doubtful mostly negative tests that reveal anomalies. The explanations for each test are the following:

Expl(τ 1 ) = ¬ok(component 1 ) ∨ ¬ok(component 2 ) ∨ ¬ok(component 3 ) ∨ ¬ok(component 5 ) Expl(τ 2 ) = ¬ok(component 2 ) ∨ ¬ok(component 3 )
The set of minimum diagnosis from T doubtf ul mostly negative tests, deduced with the Hitting Set algorithm, are the following.

D doubtf ul = ¬ok(component 2 ) ∨ ¬ok(component 3 )
The second situation consists on calculating the minimum diagnoses from both doubtful mostly negative and doubtful mostly positive tests that reveal anomalies. The explanations for each test are the following:

Expl(τ 1 ) = ¬ok(component 1 ) ∨ ¬ok(component 2 ) ∨ ¬ok(component 3 ) ∨ ¬ok(component 5 ) Expl(τ 2 ) = ¬ok(component 2 ) ∨ ¬ok(component 3 ) Expl(τ 3 ) = ¬ok(component 6 ) The obtained diagnosis is -D 1 : ¬ok(component 2 ) ∨ ¬ok(component 6 ) -D 2 : ¬ok(component 3 ) ∨ ¬ok(component 6 )
According to the 2 situations, we conclude that with or without τ 3 which is doubtful mostly positive, the minimum diagnoses (¬ok(component 2 ) ∨ ¬ok(component 3 )) are always present. So, to explain the combinatory of T doubtf ul mostly negative tests, each D doubtf ul i diagnosis must be completed by additional ¬ok modes (which is ¬ok(component 6 ) in this example). However, the diagnoses resulting from this complement are not minimum since they contain D doubtf ul (i.e ¬ok(component 2 ) ∨ ¬ok(component 3 ) in this case).

Therefore, in the situation where T = T doubtf ul , the minimum diagnosis are calculated only from T doubtf ul mostly negative written D = D doubtf ul = ∨ τ i ∈T doubf ul mostly negative

∨ ¬ok(component i )∈Expl(τ i ) ¬ok(item i )
In fact, in fuzzy logic, if µ(τ = F alse) = 1 → τ = F alse if µ(τ = F alse) = 0 → τ = F alse or τ = T rue So, for the test τ to be false, we must have µ(τ = F alse) ≥ 0.5

The diagnoses can be calculated, but it remains to evaluate their confidence level. The principle is to evaluate the confidence level of what induces the diagnosis. In this situation, the diagnoses are induced by ∨ τ i ∈T doubf ul mostly negative ∨ ¬ok(component i )∈Expl(τ i ) ¬ok(component i ) By using max, as the fuzzification operator for OR, the confidence level for diagnosis is defined by: µ(D doubtf ul ) = max τ i ∈T doubtf ul mostly negative µ(τ i = F alse) (5.15)

Let's consider the following example, let's the system defined by the following symptoms consistent/inconsistent valid/invalid complete/incomplete

τ 1 consistent valid incomplete(µ τ (X T ) = 0.3) τ 2 inconsistent valid incomplete(µ τ (X T ) = 0.5) τ 3 inconsistent valid incomplete(µ τ (X T ) = 0.2)
The first step is to calculate the membership level to "False" for each test. µ(τ 1 = F alse) = 0.3 2 + 0.5 = 0.65 µ(τ 2 = F alse) = 0.5 2 + 0.5 = 0.75 µ(τ 3 = F alse) = 0.2 2 + 0.5 = 0.6 The confidence level is equal to max(0.65, 0.75, 0.6) = 0.75

The fourth situation corresponds to the case T negative = ∅. Let's D negative be the diagnoses explaining T negative . In this case, the minimum diagnoses are calculated from T negative where each test τ i ∈ T negative characterized by a membership level to False equal to µ(τ i = F alse) = 1. So, the confidence level for global diagnosis is equal to µ(D negative ) = 1

(5.16)

Let's consider the following example, the system is defined by the following symptoms consistent/inconsistent valid/invalid complete/incomplete

τ 1 inconsistent valid complete(µ τ 1 (X T ) = 1) τ 2 inconsistent valid complete(µ τ 2 (X T ) = 1)
Tests 1 and 2 are False because they are inconsistent and valid and complete. The explanations of each test are the following:

Expl(τ 1 ) = ¬ok(component 1 ) ∨ ¬ok(component 2 ) Expl(τ 2 ) = ¬ok(component 3 )
The diagnoses are calculated from both tests 1 and 2. The minimum diagnoses are ¬ok(component 1) ∨ ¬ok(component 2) ∨ ¬ok(component 3). The confidence level for calculated diagnoses is equal to 1

In the following, a real case study for performing diagnosis with partially valid tests with confidence level is detailed

Case study for Danish application

This section deals with performing diagnosis in the platform in Denmark with partially valid tests. The objective is to detail the transition from the symptom analysis with level of completeness to the confidence level of the calculated diagnoses. In the following, 3 methods for diagnostic analysis are discusses: visual diagnostic analysis, diagnostic analysis by [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF] and the proposed diagnostic analysis. In the following, various faults were simulated. The behavior of the building is dependent of the season, a period of validation from February 6th, 2017 to February 15th, 2017 is chosen. In this work, we make the assumption that to perform a test, all data sets are complete i.e there are no data gaps.

Contextual test design

Test 1: damper (rule-based)

This test verifies if the damper is faulty or not. T est 1 generates test results about the presence/absence of fault in the damper using a set of rules.

T est1 = B(X T ) ∈ B τ ∧ V (X T ) ∈ V τ → ok(Σ) B(X T ) / ∈ B τ ∧ V (X T ) ∈ V τ → ¬ok(Σ)
Since it is difficult to establish a linear law between the concentration of CO2 and the position of damper, we tried to define a law of control experimentally (see Figure 5. This test verifies the efficiency of the heater exchanger. T est 2 generates test results about the efficiency of the heater exchanger (see Figure 5.4). Possible fault explanations for this test combines all the major components that potentially affect the efficiency of the heater exchanger. Possible fault explanations include sensor level fault. For instance, ok(intake air temperature sensor)→ obs(T air ) = T air where ok signifies the non-faulty behavior of air temperature sensor and obs stands for the observed value. The test of damper is given as: This test is defined by a validity constraint V τ (X T ) ∈ V τ with V τ : rpm(t) > 0∧airf low(t) > 0, ∀t ∈ T. The first step for designing a partial valid test is the determination of a valid time period. Figure 5.5 shows the evolution of rpm and airflow from February 6th, 2017 to February 15th, 2017 and consequently the valid time period for this test. This test aims at verifying the performance of the first radiator installed in the classroom. Test 4 generates test results about the performance of the radiator.

T est2 = B(X T ) ∈ B τ ∧ V (X T ) ∈ V τ → ok(Σ) B(X T ) / ∈ B τ ∧ V (X T ) ∈ V τ → ¬ok(Σ)
T est4 = B(X T ) ∈ B τ ∧ V (X T ) ∈ V τ → ok(Σ) B(X T ) / ∈ B τ ∧ V (X T ) ∈ V τ → ¬ok(Σ)
This test is defined by a validity constraint V τ (X T ) ∈ V τ where V τ : radiator 1 opening(t) > 0 ∧ heating period, ∀t ∈ T. This test aims at verifying the performance of the first radiator installed in the classroom. Test 5 generates test results about the performance of the radiator.

T est5 = B(X T ) ∈ B τ ∧ V (X T ) ∈ V τ → ok(Σ) B(X T ) / ∈ B τ ∧ V (X T ) ∈ V τ → ¬ok(Σ)
This test is defined by a validity constraint V τ (X T ) ∈ V τ where V τ : radiator 2 opening(t) > 0 ∧ heating period, ∀t ∈ T. The test is valid from February 6th, 2016 at t=00:00 to February 15th, 2016 at t=23:00. These instants where the validity constraints are satisfied and correspond to the valid time span for Test 5. This test is also defined by a behavioral constraint B τ (X T ) ∈ B τ where B τ : heat radiator 2 (t) > 0, ∀t ∈ T The bunch of data required for the test of behavioral constraint is heat radiator 2(T) . It is a sequence of similar intervals of heater from radiator 2 measured by heat sensor installed in the classroom of Denmark application. The bunch of data required for the test of validity constraint is radiator 2 opening(T) . The are a sequence of similar intervals of radiator opening rate (i.e the position of the thermostatic valve) measured by radiator opening sensor of the radiator 2.

The test is also defined by a test support. The possible fault explanations for this test are ¬ok(radiator 2 thermostatic valve) ∨ ¬ok(radiator 2) ∨ ¬ok(radiator 2 thermostatic valve sensor) ∨ ¬ok(radiator 2 heat sensor) ∨ ¬ok(outdoor temperature sensor) Test 6: air quality (range-based)

Here is an example of a range-based test that verifies the indoor air quality (i.e CO 2 concentrations) range in the classroom in the University of Southern Denmark. T est 6 generates test results for the deviation of indoor air quality performance. Possible fault explanations for this test combines all the major components that potentially affect the office air quality performance. For example, a faulty ventilation system or an important number of occupants could be responsible for the poor air quality performance. Possible fault explanations include sensor level fault. For instance: ok(indoor CO 2 sensor) → obs(C in ) = C in where ok signifies the non-faulty behavior of CO 2 concentrations sensor and obs stands for an observed value. Indoor air quality test is given as: The bunch of data required for the behavioral constraint is C in(T) . It contains the measurements of CO 2 concentrations during the valid time period T. These measurements are collected from CO 2 concentrations installed in the classroom. This test is also defined by a test support. The possible fault explanations for Test 6 in case of inconsistency are: ¬ ok (CO 2 concentration sensor) ∨ ¬ ok(ventilation system) ∨ ¬ ok(damper)

T est 6 =      consistent if B(X T ) ∈ B τ ∧ V (X T ) ∈ V τ inconsistent if B(X T ) / ∈ B τ ∧ V (X T ) ∈ V τ no conclusion otherwise

Visual diagnostic analysis

This section discusses the visual diagnostic analysis. We have simulated fault scenarios that we ask the reader to guess. The following figures show respectively the CO 2 concentrations as a function of the damper position, the efficiency of the heat exchanger, the fan power, the heat from the radiator 1, the heat from the radiator 2 and the CO 2 concentrations. Figure 5.7 shows the satisfaction of behavioral constraint for Test 1 which corresponds to verify the presence/absence of fault in the damper. The question that arises is: What is the simulated fault? We conclude that it is difficult to conclude on the source of default. [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF] According to [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF], the diagnoses are calculated from inconsistent and valid tests, i.e. from tests 1, 2 and 6 (see Table 5 [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF] The simulated fault is an offset on the CO 2 concentrations sensor, a bias on the Tair supply sensor and an offset on the rpm sensor. The obtained result is inexact. The diagnoses are calculated from the 3 tests which are Test 1, Test 2 and Test6. In this case, a bias is applied to the rpm sensor which intervenes in the validity of test 2. So, with [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF], the diagnoses are calculated by 3 tests, the validity of one of which is measured by a faulty sensor.

Diagnostic analysis by

Proposed diagnostic analysis

In the proposed methodology, we suppose that the validity is measured with faulty sensors. At the beginning, a level of completeness is calculated for each inconsistent test (see Table 5.7). Tests 1 and 6 are always valid. So, their completeness levels are equal to 1. Now, let's calculate the completeness level for Test 2. This step consists on representative partitioning of the space of test to know how much the data are representative of all situations. During the valid time period for Test 2, we notice from Figure 5.13 that there are few number of points of rpm that belong to the interval [1.44, 24.76]. The points of rpm are widely distributed in the interval ]24.76, 315.37]. Also, we notice from Figure that there are few number of points of airflow that belong to the interval [262.3, 3004, 94] and the points of airflow are widely distributed in the interval ]3004. 94,16667,8]. So, partitioning consists on decomposing the data set of rpm into low rpm (i.e 1.44 ≤ rpm f ew ≤ 24.76) and high rpm (i.e 24.76 < rpm lot ≤ 315.37) and decomposing the data set of airflow into low airflow (i.e 262.3 ≤ airf low f ew ≤ 3004.94) and high airflow (i.e 3004.94 < airf low lot ≤ 16667.8). Table 5.6 shows all the possible combinations to cover the test space, the number of boxes filled as well as the number of points in each box. with means that the case is filled. Figure 5.15 shows the combination between rpm and airflow as well as the number of points in each combination.

Figure 5.15 -Combination between rpm and airflow for Test 1 in scenario 1

Figure 5.15 shows that the domain of rpm is covered and the two possibilities of low and high rpm are present. Also, the domain of airflow is covered and the two possibilities of low and high airflow are present. The conclusion about this test is: Test 2 is inconsistent with a completeness level equal to µ τ (X T ) = 2 4 = 0.5 The diagnostic result is calculated from a set of tests, each one defined by its completeness level. To compute the confidence level of a global diagnosis deduced from a set of tests whose some of them have a completeness level lower than 1, we are going to adapt a method based on fuzzy logic reasoning. In this case, tests 1 and 6 are negative and test 2 is doubtful mostly negative because µ(T est 3 = F alse) = 0.75 ≥ 0.5. With the proposed methodology, we obtained fewer diagnoses compared to the number of diagnoses found by [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF]. In fact, in [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF], the diagnoses are calculated from tests 1, 2 and 6. With the proposed approach, the diagnoses are calculated only from tests 1 and 6. The validity of test 2 is measured by potentially faulty sensors. Test 2 is doubtful mostly negative, and therefore this test was not taken into account in the calculation of diagnoses.

This chapter assumes that, to perform a test, all data sets are complete i.e there is no missing data. However, the data gaps is the main sensor fault in buildings. Sensor values are not uniformly sampled and there is a need to decide from which delay the sensor becomes faulty? Next chapter deals with automatic thresholding for data gaps detection for a set of sensors in buildings.

Chapter 6

Coping with complexity due to numerous sensors

Introduction

With the massive arrival of inexpensive communicating sensors, the building sector is undergoing an unprecedented revolution: the building is becoming smart, which means it offers new services to occupants related to safety, energy management, comfort. Article 23 of the thermal regulation RT2012 in France requires the measurement of certain variables, which promotes the deployment of sensor grids in new buildings. In addition, research projects such as the ANR OMEGA show the interest of companies to guarantee overall performances i.e. total real consumption, interior comfort, etc. . . after refurbishment. In addition to the different aspects of comfort and energy consumption, these sensors can also be used to estimate occupant practices essential for energy consumption by estimating the number of occupants per area and their metabolic contribution, their activities and their routines.

The concept of healthy sensors is explained in the literature [START_REF] André | Distributed sensor and actuator reconfiguration for fault-tolerant networked control systems[END_REF][START_REF] Shi | Sensor data scheduling for optimal state estimation with communication energy constraint[END_REF][START_REF] Wang | Comprehensive diagnosis and tolerance strategies for electrical faults and sensor faults in dual three-phase pmsm drives[END_REF]. Authors in [START_REF] Li | A routing protocol for balancing energy consumption in heterogeneous wireless sensor networks[END_REF] assumed that there are two groups of sensors: first that correctly measure structural responses (termed as reference sensors ) and second are failed (or uncertain) sensors. Affordable sensor grids in buildings are particularly sensitive to battery exhaustion, hardware and other communications related failures [START_REF] Ni | Sensor network data fault types[END_REF]. As a result, data sets collected from these sensors often miss some records [START_REF] Ramanathan | Data envelopment analysis for weight derivation and aggregation in the analytic hierarchy process[END_REF][START_REF] Werner-Allen | Deploying a wireless sensor network on an active volcano[END_REF][START_REF] Li | Recommending missing sensor values[END_REF].

In the literature, many techniques are available for data analysis such as time series, statistical approaches, clustering methods and many more (Le [START_REF] Halatchev | Estimating missing values in related sensor data streams[END_REF][START_REF] Pan | K-nearest neighbor based missing data estimation algorithm in wireless sensor networks[END_REF][START_REF] Yang | Multiple imputation for missing data: Concepts and new development[END_REF][START_REF] Gruenwald | Using data mining to estimate missing sensor data[END_REF]. However, all of them are interested only in bias [START_REF] Yu | Fault-tolerant aircraft control based on selfconstructing fuzzy neural networks and multivariable smc under actuator faults[END_REF] and outliers [START_REF] Zhang | A novel outlier detection method for improving industrial process monitoring[END_REF] fault types. Occurrence of data gaps has not been given interest from building researchers. Hence, there is a need for techniques to detect them i.e. a need to know the periods of good operation of sensors. Given these observations, research attention is now turning towards automated detection of sensor faults [START_REF] Kim | A review of fault detection and diagnostics methods for building systems[END_REF], as well as techniques that can automatically scrub collected sensor data to ensure high quality building performance. The possibility of time delayed data becomes a reality. It means while after preprocessing the sensors report values regularly, reality shows that quite many values are missing [START_REF] Zhou | Recover missing sensor data with iterative imputing network[END_REF][START_REF] Mehmood | Missing observation approximation for spatio-temporal profile reconstruction in participatory sensor networks[END_REF].

Sensor measurements could have temporal and frequential representations [START_REF] Monte-Moreno | Maximum likelihood linear programming data fusion for speaker recognition[END_REF]. In this work, only the temporal representation is considered and sensor measurements are considered to be statistical time series. When the sensors are in ok states, the delay data have a distribution corresponding to the normal mode of operation and these distributions change when the sensor is faulty. In general, sensor values are not uniformly sampled and the question that arises is from which delay can we say that the sensor becomes faulty? Hence, the automatic thresholding for data gap detection for heterogeneous sensors is a feasible paradigm for the instrumented residential environment.

The objective of this chapter is to solve the issue of unreliable instrumentation in buildings. It focuses on developing methods for automatic thresholding for data gap detection for heterogeneous sensors in instrumented buildings. Two algorithms based respectively on times series analysis and statistical approaches have been adapted to an office setting at Grenoble Institute of Technology which is equipped with 30 sensors. This chapter is organized as follow: section 6.2 presents the problem statement and the proposed methodologies. Sections 6.3 and 6.4 present respectively the automatic thresholding with time series analysis and probability density function and analyse the results for each method for the office H358. Section 6.5 discusses the findings of the literature review, the proposed methodologies, their limits and the results. Finally, concluding remarks and future works are given in section 6.6.

Problem statement and proposed methodologies

Let's consider the evolution of raw sensor measurements for two different sensors: a door contact sensor and a CO2 concentration sensor (see respectively Figure 6 Many values are missing. Data Gaps (see Definition 6.1) are easy to identify visually but it is not to that easy to define automatically a relevant threshold for each measurement. Figures 6.1 and 6.2 show that there is no regularly delayed data for a variable. Delays depend not only on the type of sensor but also on the measured values. Hence, there is a necessity for automatic thresholding for data gap detection for heterogeneous sensors in instrumented building. Let T be a sequence of times T = (t 0 , ..., t n-1 ) with ∀ k, t k+1 > t k The problem is to automatically detect abnormal delays defined by Equation 6.1

∆ = t k+1 -t k (6.1)
Let's define the sequence of delays:

∆ = {∀k, ∆ k = t k -t k-1 , k ∈ (1, ..., n -1)} (6.2)
Two methodologies have been proposed in this work for automatic thresholding for sensor data gaps detection

Time series based methodology

In this work, a two steps methodology is proposed.

- This method places the abnormality at λσ ∆x

Statistical approaches based methodology

Let's consider that ∆ is a stochastic variable satisfying a probability distribution function δ to be characterized by suitable algorithms.

A probability density function defined by Equation 6.4 is most commonly associated with absolutely continuous univariate distributions. A random variable X has a density f X , where f X is a non-negative Lebesgue-integrable function, if:

P (a x b) = b a f X dx (6.4) A given time delay ∆ k is abnormal if ∆ k > δ
where δ is a threshold value satisfying Equation 6.5

P (∆ ≥ δ) ≤ ρ % (6.5)
where ρ % is a low probability value like 1% of chance of a ∆ k to be greater that δ Equation ( 6.5) has to be solved to get δ = δ (ρ % ), parameters coming from the characterization of the pdf.

To solve this problem, a three steps methodology is proposed:

-Step 1 : The delay is considered as a continuous random process modeled by a stochastic variable. The first step is to identify the appropriate laws modeling the time series related to delays.

-Step 2 : plot by class the data in order to trace the actual observed distribution as an histogram. From the shape of the histogram, determine a distribution law that seems to describe the actual distribution. Then determine the parameters of this law.

-Step 3 : Solve the following equation to get the threshold th.

th 0 f X dx = 0.99 (6.6)

6.3 Automatic thresholding with time series analysis

Methodology description

The proposed algorithm is a way of describing a data point in terms of its relationship to the average difference between two consecutive data points for the whole data set and standard deviation of the difference between two consecutive data points for the whole data set. This method was based on the principle that the variation of measurements (i.e delays) should smoothly vary and follow a Gaussian distribution. The proposed idea was the outlier fence, which is defined by the average difference between two consecutive data added by a standard deviation of the difference of the time serie measurements.

The aim of this work is to process time series of data representing time samples. Outliers on the delay have to be detected. They are defined as data points, which, in the contact of previous and future data points, seem highly improbable.

In the case of normally distributed time samples, it is assumed that, at a given moment, the difference between the current and previous data point i.e. data sent by a sensor (see Equation 6.7) is equal to the current and next data point (see Equation 6.8).

p dif f k = x k -x k-1 (6.7) f dif f k = x k+1 -x k (6.8)
Then, a rule has been fixed at a fixed threshold and is equal to th = m ∆x + λσ ∆x (6.9) with λ a configurable parameter. If no outlier is found, reducing the value of λ for testing is required.

Since, the majority of points in a distribution are within "λσ ∆x " deviations of the average difference the decision is "abnormal delay" when the value of delay is this threshold, otherwise the decision is "normal case".

These points have been detected as the ones that follow the equations simultaneously: 6.12) where:

|p dif f k | > m ∆x + λσ ∆x (6.10) |f dif f k | > m ∆x + λσ ∆x (6.11) p dif f k .f dif f k < 0 (
-x k : value of the variable at time sample -p dif f k : difference between the current and previous data point -f dif f k : difference between the current and next data point -m ∆x : average difference between two consecutive data points for the whole dataset -σ ∆x : standard deviation of the difference between two consecutive data points for the whole dataset -λ: configurable parameter

Experimental results

A data set covering 1 month from 01-March-2016 have been used to detect the abnormalities on the delay and subsequently the data gaps from raw measurements of sensors. ((2016, 3, 10, 2, 19, 17), (2016,3,10,10,11,28)), ((2016, 3, 15, 5, 24, 56), (2016,3,15,10,6,6)), ((2016, 3, 25, 18, 1, 6), (2016,3,29,9,33,12)), ((2016, 3, 31, 3, 17, 35), (2016,3,31,9,[START_REF] Najeh | Diagnosis in buildings: new trends illustrated by an application, soumis dans[END_REF]20)) Figures 6.5,6.6,6.7,6.8 show a zoom of these intervals. (2016,3,25,18,1,6), (2016,3,29,9,33,12)) 5 3 ((2016, 3, 10, 2, 19, 17), (2016,3,10,10,11,28)), ((2016, 3, 15, 5, 24, 56), (2016,3,15,10,6,6)), ((2016, 3, 25, 18, 1, 6), (2016,3,29,9,33,12)) 0. 3 4 ((2016, 3, 10, 2, 19, 17), (2016,3,10,10,11,28)), ((2016, 3, 13, 5, 29, 42), (2016,3,13,6,55,42)), ((2016, 3, 15, 5, 24, 56), (2016,3,15,10,6,6)), ((2016, 3, 25, 18, 1, 6), (2016,3,29,9,33,12))

The configurable parameter λ has an effect on the outlier detection rate and consequently on the determination of non-healthy periods of sensors (see Table 6.1). The first algorithm for data gap detection is based on time series analysis. The approach makes the hypothesis that the delay follows a Gaussian probability density function which is defined on R. However, the delay is always strictly positive. This is the first limitation of this approach. Moreover, the approach places the abnormality at λσ and it is difficult to tune λ for each measurement. This is the second limitation of the proposed approach. These two limitations for time series analysis for data gap detection for automatic thresholding for data gap detection encourage the development for an approach that makes the hypothesis that the delay follows a specific pdf defined by suitable algorithms. The next section deals with automatic thresholding with probability density function 6.4 Automatic thresholding with probability density function

Methodology description

This section demonstrates the proposed methodology for automatic thresholding for data gap detection for a set of sensors. This first step of the proposed methodology discusses about what probability density function to use with data analysis. The delay is a continuous variable. It can correspond to one of the continuous laws below (see Table 6.2). Figures 6.9 and 6.10 show the abnormal delays detected visually for temperature sensor by truncated normal and gamma distributions respectively. Figure 6.9 -Fitted probability density of the truncated normal distribution for door contact sensor Figure 6.10 -Fitted probability density of the gamma distribution for door contact sensor Table 6.3 shows the number as well as the instants of detection of abnormal delays for door contact sensor by truncated normal and gamma distributions respectively. and6.12 show the abnormal delays detected visually for temperature sensor by truncated normal and gamma distributions respectively. Figure 6.11 -Fitted probability density of the truncated normal distribution for Toffice wall sensor Figure 6.12 -Fitted probability density of the gamma normal distribution for Toffice wall sensor Table 6.4 shows the number as well as the instants of detection of abnormal delays for power sensor by truncated normal and gamma distributions respectively. 6.13 and 6.14 show the abnormal delays detected visually for power sensor by truncated normal and gamma distributions respectively. Figure 6.13 -Fitted probability density of the truncated normal distribution for power sensor Figure 6.14 -Fitted probability density of the gamma normal distribution for power sensor Table 6.5 shows the number as well as the instants of detection of abnormal delays for power sensor by truncated normal and gamma distributions respectively. 6.6 shows the number as well as the instants of detection of abnormal delays for CO 2 concentrations sensor by truncated normal and gamma distributions respectively. We conclude that the truncated normal distribution is more adequate for the delay because it detects more abnormal delays compared to the gamma distribution For example, there is an abnormal delay for power sensor at t=1.79014e +06 which is detected by the truncated normal distribution and not detected by the gamma distribution. In the following, we will be interested in the third step which is the resolution of th 0 f X (x) = 0.99 with f X is the probability density function of the truncated normal distribution.

The third step of the proposed methodology is the calculation of the threshold.

In probability and statistics, the truncated normal distribution is the probability distribution derived from the normal distribution. Suppose X → N( µ, σ 2 ) has a normal distribution and lies within the interval X ∈ (a, b), -∝ ≤ a <b ≤ +∝ Then X conditional on a < X < b has a truncated normal distribution defined by Equation 6.13.

f (x; µ, σ, a, b) = φ( x-µ σ ) σ(Φ( b-µ σ ) -Φ( a-µ σ )) (6.13)
where φ is the probability density function of the standard normal distribution defined by Equation 6.14

φ(ξ) = 1 √ 2π exp( -1 2 ξ 2 ) (6.14)
and Φ is its cumulative distribution function defined by Equation 6.15

Φ(x) = 1 2 (1 + erf ( x √ 2
)) (6.15) with erf is the error function defined by Equation 6.16:

erf (x) = 1 √ π x -x exp -t 2 dt = 2 √ π x 0 exp -t 2 dt (6.16)
The delay is abnormal if there is a probability of for instance 1% of a delay greater than the threshold. The following equation has to be solved: th 0 f X (x) dx = 0.99 (6.17)

In general, if the function f depends on a single parameter, so

f (x) = x 0 f (t)dt
where f is the derivative of f If f depends on several parameters: f(x, y, z, t), when we speak about f , 4 propositions are distinguished:

f x = df dx , f y = df dy , f z = df dz and f t = df dt
In our case, we have:

f (x) = th 0 f X (x)
It yields:

f (x, µ, σ, a, b) = th 0 f X (x) (6.18)
where f X is the derivative of f with respect to x. So, the primitive is f (x, µ, σ, a, b) It yields: 6.19) where F(x)=f (x, µ, σ, a, b) and f(t)=f X It yields:

F (x) = x 0 f (t)dt (
f (th) -f (0) = φ( th-µ σ ) σ(Φ( b-µ σ ) -Φ( a-µ σ )) -f (0) = 0.99 (6.20) φ( th-µ σ ) σ(Φ( b-µ σ ) -Φ( a-µ σ )) = f (0) + 0.99 (6.21) It comes: φ( th -µ σ ) = σ(Φ( b -µ σ ) -Φ( a -µ σ ))(f (0) + 0.99) (6.22)
We apply the log:

1 √ 2π exp -1 2 ( th-µ σ ) 2 = ln(f (0) + 0.99) + ln(σ(Φ( b -µ σ ) -Φ( a -µ σ ))) (6.23) It yields: ln( 1 √ 2π ) - 1 2 ( th -µ σ ) 2 = ln(f (0) + 0.99) + ln(σ(Φ( b -µ σ ) -Φ( a -µ σ ))) (6.24) - 1 2 ( th -µ σ ) 2 = ln(f (0) + 0.99) + ln(σ(Φ( b -µ σ ) -Φ( a -µ σ ))) -ln( 1 √ 2π ) (6.25) ( th -µ σ ) 2 = -2 ln(f (0) + 0.99) -2 ln( Φ( b-µ σ ) -Φ( a-µ σ ) 1 σ ) + 2 ln( 1 √ 2π ) (6.26) ( th -µ σ ) = ± -2 ln(f (0) + 0.99) -2 ln( Φ( b-µ σ ) -Φ( a-µ σ ) 1 σ ) + 2 ln( 1 √ 2π ) (6.27)
The threshold is defined by:

th = µ + σ ± -2 ln(f (0) + 0.99) -2 ln( Φ( b-µ σ ) -Φ( a-µ σ ) 1 σ ) + 2 ln( 1 √ 2π ) (6.28) where Φ( b -µ σ ) = 1 2 [1 + erf ( b-µ σ √ 2 )] = 1 2 [1 + erf ( b -µ √ 2σ )] (6.29) Φ( a -µ σ ) = 1 2 [1 + erf ( a-µ σ √ 2 )] = 1 2 [1 + erf ( a -µ √ 2σ
)] (6.30) a=0 and b=∞ Equation 6.28 becomes: .32) In this section, a 3-step methodology is used to find a threshold from which a delay is considered abnormal. Delay is a continuous variable that follows the truncated normal law. The delay is calculated by solving the equation 6.17.

th = µ + σ ± -2 ln(f (0) + 0.99) -2 ln( 1 2 [1 + erf ( b-µ √ 2σ )] -1 2 [1 + erf ( a-µ √ 2σ )] 1 σ ) + 2 ln( 1 √ 2π ) (6.31) where f (0) = φ( -µ σ ) σ[Φ( b-µ σ ) -Φ( a-µ σ )] = 1 √ 2π exp -1 2 ( µ 2 σ 2 ) σ[ 1 2 [1 + erf ( b-µ √ 2σ )] -1 2 [1 + erf ( a-µ √ 2σ )]] ( 6
In the following, we will test the calculation of this threshold on time series of delay for different variables 6.4.2 Experimental results

Experimental results for H358 office

A data set covering 3 months from January 1st, 2016 to March 31th, 2016 has been used to detect the abnormalities on the delay and subsequently the data gaps from raw measurements of sensors. Figure 6.17 shows the detection of data gaps for the office CO 2 concentration sensor installed in the H358 office presented in chapter 1. Figure 6.17 -Detected data gaps for the CO 2 concentration sensor Non-healthy periods for this sensor are the followings: ((2016, 1, 4, 14, 57, 5), (2016,1,8,11,42,16)), ((2016, 1, 16, 2, 21, 26), (2016,1,17,2,1,28)), ((2016, 1, 20, 16, 3, 19), (2016,1,26,13,13,14)), ((2016, 1, 29, 6, 39, 45), (2016, 2, 1, 15, 52, 1)), ((2016, 2, 2, 11, 46, 55), (2016,2,23,12,22,26)), ((2016, 2, 24, 4, 22, 49), (2016,2,25,11,6,24)), ((2016, 3, 25, 18, 1, 6), (2016,3,29,9,33,12)),

The following figures (Figure 6.18 and Figure 6.19) show a zoom of some intervals. Where for example (2016,2,2,11,46,55) and (2016,2,23,12,22,26) represent respectively the lower and the upper bound of a non-healthy period Table 6.7 shows the abnormal gaps visually detected and gaps detected with 1% We conclude that the data gaps visually detected data coincide with that detected with a probability of 1% of a delay greater than the threshold. These results are obvious. The current approach yields to an accurate result. We conclude also that the threshold depend on the measured value and the type of sensor.

Experimental results for RueCuvier

A data set covering 3 months from May 1st, 2016 to July 31th, 2016 has been used to detect the abnormalities on the delay and subsequently the data gaps from raw measurements of sensors. Table 6.8 shows the abnormal gaps visually detected and gaps detected with 1% for common window sensor, common temperature sensor, Anna motion sensor, parent motion sensor, parent CO 2 concentrations sensor and parent humidity sensor installed in the RueCuvier platform presented in chapter 1. (2016,6,28,5,36,33), (2016,6,30,18,51,50)) 158493225.35 window (see Figure 6.25) common 1 detection ((2016, 5, 29, 15, 47, 25), (2016,6,29,21,13,12)) 349347258.24 temperature (see Figure 6.25) Anna 2 detections ((2016, 6, 12, 19, 36, 43), (2016,7,3,20,28,58)), 200725887.85 motion (see Figure 6.27) ((2016, 7, 13, 12, 42, 1), (2016, 7, 18, 0, 33, 4)) parent 3 detections ((2016, 6, 12, 19, 29, 24), (2016,6,19,8,58,6)), 59526522.43 motion (see Figure 6.28) ((2016, 7, 2, 10, 5, 5), (2016,7,3,15,54,35)) ((2016, 7, 12, 7, 43, 9), (2016, 7, 18, 0, 33, 37)) parent 3 detections ((2016, 5, 29, 15, 46, 51), (2016,6,29,6,54,29)) 403727118.32 CO 2

(see Figure 6.29) ((2016, 7, 16, 12, 48, 19), (2016,7,27,17,42,44)) parent 1 detection ((2016, 7, 16, 12, 48, 19), (2016,7,27,17,42,44)) 70273717.51 humidity (see Figure 6.30) Figure 6.25 -Detection of data gaps for common window sensor A second data set covering 5 months from August 1st, 2016 to December 31th, 2016 has been used to detect the abnormalities on the delay and subsequently the data gaps from raw measurements of parent kitchen motion sensor and kitchen window sensor. Table 6.9 presents the abnormal gaps visually detected and the number of gaps detected with 1% of probability of having a delay greater than the threshold for kitchen motion sensor and kitchen window sensor. (2016,9,26,19,1,32), (2016,9,29,22,55,54)) 39518937.67 motion (see Figure 6.31) kitchen 1 detection ((2016, 8, 1, 5, 9, 46), (2016,8,18,16,41,37)) 979648022.63 window (see Figure 6.32) We conclude that the threshold depend on the measured value and the type of sensor.

Discussion

In this chapter, we have highlighted the issue of unreliable sensors in buildings. In fact, smart buildings are equipped with several sensors that collect large amounts of data that can be used for control, energy management and diagnosis. Significant discrepancies between simulated and actual measured building performance also led to a move to uncover these discrepancies by analyzing the data collected through extended sensor grids. Since the diagnosis of building systems usually requires chronological data, ensuring the quality of sensor data is an important step in pre-treatment. Recent literature contributes methods for the detection and classification of sensor faults. Fault classification techniques vary: several existing fault taxonomies use different criteria for categorizing a fault. However, most researchers in the literature are interested only by the following known fault types: drift, outliers and bias. Occurrence of data gap faults has also not been given an adequate span of attention in the research literature. This is the key objective of this work. It focuses on developing method for automatic thresholding for automatic data gap detection for heterogeneous sensors in instrumented buildings. Two algorithms have been have been adapted to the H358 test bed. The first algorithm is based on time series analysis. The time series method is a special case of statistical approach. It makes the hypothesis of a Gaussian pdf and places the abnormality at λσ. This method could provide the first explanation of automatic thresholding for sensor data gap detection to help building researchers. However, the disadvantage of this method is that it does not take a percentage error i.e a percentage of chance to have a delay outside the distribution.

The second method is based on statistical approaches. The delay is a stochastic variable satisfying a truncated normal distribution and at a given time, the delay is abnormal if there is a law probability value like 1% of chance of a delay gather then the threshold. In this work, only the percentage has to be specified. However, this value is chosen arbitrary. Next works investigate the determination of this percentage by suitable algorithms. Also, in this work, only the data gaps due to a battery problem are studied. However, in a building system, the sensors inform the controller which, in function of these data, controls the actuators. Therefore if the actuator is totally faulty, there will be no measurements taken by the sensor. So the data gaps can have as origin a faulty actuator. Future works will be around diagnosing components themselves. The two steps i.e. sensor diagnosis and actuator diagnosis are decoupled.

Conclusion

This chapter deals with the issue of unreliable sensors in buildings. At the beginning, a state of the art about sensor fault detection is presented. It is concluded that research literature focus only on classic fault types such as bias and outliers. This chapter focus on data gaps fault type and presents a method of automatic thresholding for data gap detection applying to heterogeneous sensors in instrumented buildings. Two solutions are proposed for detection of abnormalities on the delays. The first solution is a time series based methodology. The delay is considered as a stochastic variable that follows the Gaussian law. The idea is to calculate the outliers on the delay to find the sensor data gaps. This method is challenged by the domain of Gaussian pdf which is R while the delay is defined on R + . An other challenge is the difficulty to tune λ for each measurement. To overcome these limits, it is necessary to define an approach that makes the hypothesis that the delay follows an adequate pdf defined by suitable algorithms. This solution is published in Najeh et al. (2019a). The second solution is a statistical approach based methodology. While the goal in time series analysis is always to make the distribution of any continuous random variable compatible with a Gaussian distribution. In this work, we propose to check whether the delay is abnormal or not compared to a threshold. Before calculating the threshold for each variable one must first identify the appropriate distribution law for the delay. With the proposed method, data gaps in the measurements can be carried out whatever the number of sensors is. Only the threshold as percentage has to be specified. This solution is published in Najeh et al. (2019c). In this work, only data gaps due to battery problem are studied. However, in buildings, if an actuator is faulty, there is no measurements taken by the sensor. The next step is to diagnose components themselves. The two steps are decoupled.

General conclusion and future work

The goal of this PhD has been to design a diagnostic analysis system that takes into account the reliability of sensors in diagnostic analysis. The initial point of the work starts by highlighting the complexity in building. A framework for detecting and localizing faults in a sensor grid of a building system is proposed. It is a tool-aided diagnosis that determines whether a sensor is faulty or not. It is based on detection tests and logical diagnosis analysis for the first principle. The bridge approach is used because it determines the minimum diagnoses with explanation at the component level. Two real applications have been studied for validation: an office and an apartment with different level of complexity according to their available sensors, context and number of zones. In the monozone case, the followed methodology leads to a few number of tests which is equal to 6. The results show that if the tests are consistent with reality, the proposed approach leads to accurate diagnoses. Indeed, it is not always possible to construct universal tests. For this reason, the proposed approach leads in some cases to a possibly false diagnoses. The diagnostic result is not guaranteed because the tests are supposed to be applied in any situation without taking into account specific contexts. In the multizone case, the followed methodology leads to a huge number of tests difficult to handle. The complexity is well justified and there is a need for a method to apprehend it. The scope of work includes a three steps methodology to apprehend the complexity in buildings. Three challenges are considered in this research. In order to investigate these challenges and find solutions, three solutions have been proposed for diagnosis in building.

(A) A level of completeness for better formalizing validity. It consists on improving decision making in building diagnosis using partial valid tests with confidence level. The validity is measured with potentially faulty sensors. To overcome this problem, the completeness level is proposed as a method to prove a test. It is measured using partitioning approach and it offers a guarantee to the diagnostic result. In order to prove the global diagnosis, a confidence level with fuzzy logic reasoning is proposed as a new method.

(B) A confidence level for proving diagnosis. The diagnostic result is calculated from a set of tests, each one defined by its completeness level. The contribution is to propose a solution to compute the confidence level of a global diagnosis deduced from a set of tests whose some of them have a completeness level lower than 1. A method based on fuzzy logic reasoning is used for this purpose. An office has been used for validation.

(C) Automatic thresholding for data gap detection for a set of sensors in instrumented buildings. Two methods have been studied for detection of abnormalities on the delays: a times series based methodology and statistical based approach. In time series analysis, the delay is considered as a stochastic variable that follows the Gaussian law. The idea is to calculate the outliers on the delay to find the sensor data gaps. In statistical-based approach, we propose to check whether the delay is abnormal or not compared to a threshold. Before calculating the threshold for each variable one must first identify the appropriate distribution law for the delay. Only the threshold as 1% probability of having a delay greater than the threshold has to be specified. An office has been used for validation.

Future work could be around:

(A) Development of new indicators to test the validity such as completeness level using "spreadrate" technique (Amayri et al., 2019b). It's an indicator about database quality.

(B) Validate the proposed methods on a block of flats. This allows for other types of tests at the component and subcomponent level.

(C) Diagnosis of human misbehaviors. It consists on design indicators to analyse the behavior of occupants towards specified criteria. Indicators are a means of communication that allows interaction with the occupants so that they can make informed decisions about their daily habits and consequently they can understand the consequences of their misuse and learn to improve their comfort.

(D) Integrating knowledge collected through interactions with an expert in diagnostic analysis.

The idea is to accompany the expert as the diagnostic process progresses to allow him to judge based on his tacit knowledge. The confidence level will be proposed as a method to prove an expert-based test. A classroom in the university of Southern Denmark will be used for validation.

(E) Dealing with the case where the expert defines specific fault modes for each component.

In fact, in this work, only two types of fault modes are studied (ok and not ok). However, it is possible that a component admit specified fault modes that are clearly identifiable by a mode name such as "broken pipes" fault is an example of specific fault mode. Finally, there remains the set of states that are neither normal nor specific fault modes. This set, collated under the complementary fault mode label and that represent all abnormal behaviors that have not been modeled.

(F) Guide the expert in the choice of test during the diagnostic process. In other words, after each iteration, it is necessary to decide on which test to give to the expert and this requires a methodology to develop.

Annex 1

In chapter 3, which deals with the problem of complexity in building, only the design of tests 1 and 6 are detailed. Also, only simulation results for two fault scenarios (scenario 1 and scenario 3) are detailed. This annex details the design of tests 2, 3, 4 and 5 as well as simulation results for scenarios 2, 4 and 5.

Design of tests for H358 office

This section details the tests 2, 3, 4 and 5. This test checks the estimation of indoor temperature using door and window positions and Toffice-wall as well as the performance of these sensors. T est 3 generates a residual signal between measured and estimated temperature. The residual generation is based on state observer.

T est 3 = B τ (X (t,t+h) ) ∈ B τ ↔ ok(Σ)

where Behavioral constraint: B τ (X (t,t+h) ) ∈ B τ where B τ = Tin (t) -T in (t) = 0, ∀t ∈ (t, t + h) contact sensor) ∨ ¬ ok(Toffice-reference sensor) Required sensors for behavior: the variable involved in the test of behavior are door and window positions and Toffice-reference: they are measured respectively by door contact sensor, window contact sensor and Toffice-reference sensor.

Test4: Test of Toffice-wall sensor and Theater sensor performance

This test compare the measurements of Toffice-wall sensor and Theater sensor. T est 4 generates a residual signal from measurements of two sensors.

T est 4 = B τ (X (t,t+h) ) ∈ B τ ↔ ok(Σ) where Behavioral constraint: B τ (X (t,t+h) ) ∈ B τ where B τ = T wall (t) -T heater (t) = 0, ∀t ∈ (t, t + h) where T wall and T heater are two time series for indoor temperature measured by Toffice-wall and Theater sensors respectively. Support: Possible fault explanations for Test 4 are: ¬ ok(Toffice wall sensor) ∨ ¬ ok(Theater sensor)

Test5: check the door-contact, window-contact and Theater sensors performance and the model of temperature (ok(room))

This test checks the estimation of indoor temperature using door and window positions and Theater as well as the performance of these sensors. T est 5 generates a residual signal between measured and estimated temperature. The residual generation is based on state observer.

T est 5 = B τ (X (t,t+h) ) ∈ B τ ↔ ok(Σ) where Behavioral constraint: B τ (X (t,t+h) ) ∈ B τ where B τ = Tin (t) -T in (t) = 0, ∀t ∈ (t, t + h) Support: Possible fault explanations for Test 5 are: ¬ ok(door contact sensor) ∨ ¬ ok(window contact sensor) ∨ ¬ ok(Theater sensor) Required sensors for behavior: the variable involved in the test of behavior are door and window positions and Theater: they are measured respectively by door contact sensor, window contact sensor and Theater sensor.

Simulation scenarios

This section details the simulation scenarios 2, 4 and 5. Toffice-wall sensor (with fault probability 100%) ROOM-SYSTEM AND Theater AND Toffice-reference (with fault probability 50%) Interpretation: Scenario 4 corresponds to the results of figures 6.34(a) and 6.34(b) . The Toffice-wall sensor diagnosis is the most probable. The simulated fault consists on supposing that the Toffice-wall sensor is faulty. Thus, the current fault is found and this result is obvious. This scenario reveals that this approach leads to an accurate diagnosis. ROOM-SYSTEM (with fault probability 100%) Toffice-wall AND Theater AND Toffice-reference (with fault probability 50%) Interpretation: Scenario 5 corresponds to the results of figures 6.35(a) and 6.35(a). The simulated fault consists on supposing that the door-contact and window-contact sensors are faulty. In this scenario, 2 separate diagnoses are possible: -The multiple faults are found but not accurately. It can be argued that only minimal diagnoses are provided. On the one hand, this has the advantage of reducing the list of proposed diagnoses and, on the other hand, it is possible to go back to any diagnosis by adding modes corresponding to items not yet present in the diagnoses. In practice, it is often sufficient to have minimal diagnoses and, when hidden fault modes are present, they will be found later.

-This diagnosis coincide with results of scenario 3. This result proves the diagnosability of the system given in section 4.3 and confirms that the three components are non-discriminable.

Abstract: Fault diagnosis and maintenance of a whole-building system is a complex task to perform. Available building fault detection and diagnosis tools are only capable of performing fault detection using behavioral constraints analysis. The thesis of Mahendra Pratap Singh proposes to use heterogeneous tests with validity constraints in the context of building fault diagnosis but the proposed approach assumes that the sensors are reliable. Nevertheless, validity constraints are checked with potentially faulty sensors. If these sensors are faulty, the diagnostic result is not guarantee and there is a need for method to prove the test as well as global diagnoses.

To make a test, data are required from different parts: meteorological, human and physical parts. However, the data gaps is the main sensor fault in buildings. Sensor values are not uniformly sampled and there is a need to decide from which delay the sensor becomes faulty?

The objective of this work is to highlight these challenges as well as to provide a strategy about how to solve them. Three solutions for diagnosis in building are proposed 1. A level of completeness for better formalizing validity.

In this work, we make the hypothesis that there is no precise global model for a building system but there is contextual models with limited validity. The validity is measured with potentially faulty sensors. The completeness level is proposed as a method to prove if a test space is fully covered or not i.e to assess the level of validity of a test.

A confidence level for proving global diagnosis

An automatic test is characterized by thresholds i.e the behavioral constraint is either satisfied or unsatisfied. Uncertainty is related to the validity constraints. Indeed, it is difficult to set a threshold for the level of completeness from which one can say that a test is valid. Diagnostic results are calculated from a set of tests, each one defined by its completeness level. The contribution is to propose a solution to compute the confidence level of a global diagnosis deduced from a set of tests whose some of them have a completeness level lower than 1. A method based on fuzzy logic reasoning is used for this purpose.

3. Automatic thresholding for sensor data gap detection.

The delay depends on the measured value and the type of sensor. The objective is to identify from which delay a sensor become faulty. Two techniques are proposed: a time series analysis and a statistical approaches.

Different applications have been studied for validation: an office at G-SCOP lab, an appartement at Grenoble and a platform in the University of Southern Denmark.

Key

Figure 1 . 1 -

 11 Figure 1.1 -Commercial Energy End-Use Spilt

- 2 Figure 1 . 3 -

 213 Figure 1.3 -Test bench

Figure 1 . 4 -

 14 Figure 1.4 -Sensor configuration at H358 office, Grenoble INP

Figure 1 .

 1 Figure 1.5 -Raw CO 2 concentration measurements

Figure 2

 2

Figure 2 . 1 -

 21 Figure 2.1 -Behavioral and contextual test for diagnosis

Figure 3 . 1 -

 31 Figure 3.1 -Indoor temperature from 3 different sensors

Figure 3 .

 3 2 illustrates the various steps of the proposed methodology.

Figure 3 . 2 -

 32 Figure 3.2 -Required tasks to perform to setup a bridge diagnosis approach

  T min in and T max in represent respectively the lower and upper bounds of normal behavior of the indoor temperature sensor in the month of September, 2016 without fault in the sensor. To avoid false alarms, the upper and lower bounds have been increased by 10% (T min in = 19.87 • C and T max in = 31.5 • C) T out , ζ D and ζ W are time series of outdoor temperature, door and window positions measured respectively by weather station, door and window contact sensors. Occupancy is a time series for number of occupants and it is estimated by the algorithm proposed by Amayri et al. (

Figure 3 . 3 -

 33 Figure 3.3 -Behavioral constraints for indoor temperature consistent test

Figure 3 .

 3 [START_REF] Najeh | Diagnosis in buildings: new trends illustrated by an application, soumis dans[END_REF] shows the evolution of validity constraints.

  Figure 3.4(a) shows the evolution of door and window positions.

  Figure 3.4(b) shows the evolution of occupancy.

Figure 3 . 4 -

 34 Figure 3.4 -Validity constraints for indoor temperature test

Definition 3 . 4 .

 34 Hamming distanceFor given two equal length binary vectors b1 and b2, normalized hamming distance d H is defined by Equation3.7d H (b 1 , b 2 ) =bit wise changes in b1 and b2 number of bits in b1 or b2 (3.7)Hamming distance measure the closeness between observed symptom and each column of the theoretical signature table.

Figure 3 .

 3 Figure 3.5 -HS Tree

Figure 3 .

 3 Figure 3.6 -HS tree

Figure 3

 3 Figure 3.7 -Building simulation models

3. 4 . 1 . 4

 414 Physical model for sensors Physical models to predict whether the sensors installed in the office are working well or not are as follows: ok(of f ice ref erence temperature sensor) → Toffice ref erence = T of f ice ref erence (3.13) ok(of f ice wall temperature sensor) → Toffice wall = T of f ice wall (3.14) ok(heater temperature sensor) → Theater = T heater (3.15) ok(corridor temperature sensor) → Tcorridor = T corridor (3.16) ok(CO 2 concentration sensor) → C O 2 = CO 2 (3.17) ok(corridor CO 2 cencentration sensor) → Ccorridor = C corridor (3.18) ok(door contact sensor) → ζD = ζ D (3.19) ok(window contact sensor) → ζ W = ζ W (3.20) ok(occupancy) → õccupancy = occupancy (3.21)

Support:

  Possible fault explanations for Test 1 are: ¬ ok(Toffice reference sensor) ∨ ¬ ok(Theater sensor) Test6: check the door-contact, window-contact and Toffice-wall sensors performance and the model of temperature (ok(room))

Figure 3 . 8 -

 38 Figure 3.8 -Residual generation for scenario 1

Figure 3 .

 3 Figure 3.9 -Residual generation for scenario 3

3. 4 . 2 . 1

 421 Figure 3.10 -Thermal model for the apartment

3. 4 . 3

 43 Figure 3.11 -Aeraulic model for RueCuvier

  .35) 3.4.3.1 Physical model for sensors Physical models to predict whether the sensors installed in the office are working well or not. Only physical models for sensors in common room are presented. Physical models for other sensors are in Annex 1. ok(common temperature sensor) → T = T (3.36) ok(common temperature motion sensor) → Tm = T m (3.37) ok(CO 2 concentration sensor) → C O 2 = CO 2 (3.38) ok(common window contact sensor) → ζ cw = ζ cw (3.39) ok(common occupancy) → õccupancy common = occupancy common (3.40) 3.4.3.2 Detection tests

T

  min and T max represent respectively lower and upper values of indoor temperature in the month of March 2016 without fault in the sensor (T min = 15.52 • C and T max = 23.8 • C). This test is also defined by a validity constraint V τ (X T ) ∈ V τ where V τ = (T out (t) ∈ [T min out , T max out ]) ∧ (occupancy(t) > 0) ∧ (ζ D (t) ∈ [0, 0.20]) ∧ (ζ W (t) ∈ [0, 0.20]), ∀t ∈ T In this test, we consider that the door and the window are closed if their opening rates are belong the interval [0, 0.20]. If we consider that the door and the window are open, then we must model the airflow through the door and the window, which is difficult to do. So, doing the test with closed door and window makes testing easier. The bunch of data required for the test of validity constraint is X T = {T out (t 16 ), ..., T out (t 18 ), ζ D (t 16 ), ..., ζ D (t 18 ), ζ W (t 16 ), ..., ζ W (t 18 ), occupancy(t 16 ), ..., occupancy(t 18 )} ζ D and ζ W are two data sets for door and window positions measured respectively by door and window contact sensors installed in the H358 office. Occupancy is a set of data for the number of occupants estimated by Amayri et al. (2016). T out is a set of data for outdoor temperature measured by a weather station. T min out and T max out represent respectively lower and upper values of outdoor temperature in the month of March 2016 without fault in the sensor (T min out = -3.83 • C and T max out = 25.65 • C

Figure 4 .

 4 1 shows the behavioral constraints for this test

Figure 4 . 1 -

 41 Figure 4.1 -Behavioral constraints for thermal comfort test

  Figures 4.2(a), 4.2(b), 4.2(c) and 4.2(d) show respectively the evolution of occupancy, door and window position and outdoor temperature during the time span T.

Figure 4 . 2 -

 42 Figure 4.2 -Validity constraints satisfaction for a period of 3 hours

  Figures 4.2(a), 4.2(b), 4.2(c) and 4.2(d) show respectively the evolution of occupancy, door and window position and outdoor temperature during this period.

Figure 4 . 3 -

 43 Figure 4.3 -Validity constraints satisfaction for a period of 3 hours

  CO 2 concentrations collected from CO 2 concentrations sensor located in H358 office (Cin T = [C in (t 18 ), ...C in (t 22 )]) C min in and C max in represent respectively the lower and the upper bounds of CO 2 concentrations without fault in the sensor (C min in = 390ppm and C max in = 879ppm).

Figure 4 .

 4 4 shows an abnormal CO 2 concentrations i.e an air quality discomfort.

Figure 4 . 4 -

 44 Figure 4.4 -Range based test

3 .

 3 Rule based testRule-based if B τ (X (T) ) ∈ B τ is made of " if ... then ... else"

2 <

 2 900 ∧ 60 ≤ damper position < 100) ∨ (600 ≤ CO 2 ≥ 700 ∧ 45 ≤ damper position < 60) ∨ (CO 2 < 600 ∧ damper position = 0) then damper fault=0 else damper fault=1 Let's consider the following test of damper referred to the first rule. The test evaluates the mismatch between the damper position and the indoor CO 2 concentrations in the zone. Possible explanations are derived from "if...then...else" implication and help to establish a link between the test and faulty components. The period of test is from February 1st 2017 at midnight to February 7th, 2017 at t=23:00. So, T = {(t 0 = 01/02 00 : 00), ..., (t 167 = 07/02 00 : 00)} This test is defined by a behavioral constraint B τ (X T ) ∈ B τ made of "if...then...else" with B τ = CO 2 (t) ≥ 900 ∧ damper position(t) = 100, ∀t ∈ T where X T = [[CO 2 (t 0 ), ..., CO 2 (t 167 )], [damper position(t 0 ), ..., damper position(t 167 )]] CO 2 and damper position are measured respectively using CO 2 concentrations sensor and damper position sensor installed in Denmark application.

Figure 4 .Definition 4 . 4 .

 444 Figure 4.5 -Rule based test

Figure 4 . 6 -

 46 Figure 4.6 -Model based test

Figure 4 .

 4 Figure 4.7 -Outdoor temperature from two different sensor

Figure 4 .

 4 Figure 4.8 -Missing data for validity constraints

Figure 4 . 9 -

 49 Figure 4.9 -Data involved in validity constraint for period 1

Figure 4 .

 4 Figure 4.9(a) shows that outdoor temperature occupy only one part of the domain of outdoor temperature which is [-3.83, 25.65]. In fact, all the measurement of T out are between 0 • C and 1 • C.Figure 4.9(b) shows that only the part of important number of occupants is covered and there are no measurements that corresponds to few number of occupants (i.e 1 ≤ occupancy ≤ 2).Figure 4.9(c) shows that the door position occupy only one part of the space which is door partially closed (i.e 0 < ζ D ≤ 0.25) and there are no measurements when the door is totally closed (i.e ζ D = 0).Figure 4.9(d) shows that the window position occupy only one part of the space which is window totally closed (i.e ζ W = 0) and there are no measurements when the window is partially closed (i.e 0 < ζ W ≤ 0.25).

Figure 4 .

 4 Figure 4.9(a) shows that outdoor temperature occupy only one part of the domain of outdoor temperature which is [-3.83, 25.65]. In fact, all the measurement of T out are between 0 • C and 1 • C.Figure 4.9(b) shows that only the part of important number of occupants is covered and there are no measurements that corresponds to few number of occupants (i.e 1 ≤ occupancy ≤ 2).Figure 4.9(c) shows that the door position occupy only one part of the space which is door partially closed (i.e 0 < ζ D ≤ 0.25) and there are no measurements when the door is totally closed (i.e ζ D = 0).Figure 4.9(d) shows that the window position occupy only one part of the space which is window totally closed (i.e ζ W = 0) and there are no measurements when the window is partially closed (i.e 0 < ζ W ≤ 0.25).

Figure 4 .

 4 Figure 4.9(a) shows that outdoor temperature occupy only one part of the domain of outdoor temperature which is [-3.83, 25.65]. In fact, all the measurement of T out are between 0 • C and 1 • C.Figure 4.9(b) shows that only the part of important number of occupants is covered and there are no measurements that corresponds to few number of occupants (i.e 1 ≤ occupancy ≤ 2).Figure 4.9(c) shows that the door position occupy only one part of the space which is door partially closed (i.e 0 < ζ D ≤ 0.25) and there are no measurements when the door is totally closed (i.e ζ D = 0).Figure 4.9(d) shows that the window position occupy only one part of the space which is window totally closed (i.e ζ W = 0) and there are no measurements when the window is partially closed (i.e 0 < ζ W ≤ 0.25).

  Figure 4.9(a) shows that outdoor temperature occupy only one part of the domain of outdoor temperature which is [-3.83, 25.65]. In fact, all the measurement of T out are between 0 • C and 1 • C.Figure 4.9(b) shows that only the part of important number of occupants is covered and there are no measurements that corresponds to few number of occupants (i.e 1 ≤ occupancy ≤ 2).Figure 4.9(c) shows that the door position occupy only one part of the space which is door partially closed (i.e 0 < ζ D ≤ 0.25) and there are no measurements when the door is totally closed (i.e ζ D = 0).Figure 4.9(d) shows that the window position occupy only one part of the space which is window totally closed (i.e ζ W = 0) and there are no measurements when the window is partially closed (i.e 0 < ζ W ≤ 0.25).

Figure 4 .

 4 10(a) shows that outdoor temperature occupy only one part of the domain of outdoor temperature which is[-3.83, 10 • C] and there is no measurements for T out > 10 • C.

Figure 4 .

 4 10(b) shows that the domain of occupancy is covered. In fact, the 2 possibilities of few (1 ≤ occupancy ≤ 2) and important (3 ≤ occupancy ≤ 4) of occupants are present.

Figure 4 .

 4 10(c) shows that the door position is covered. In fact, the 2 possibilities of door totally closed (i.e ζ D = 0) and door partially closed (i.e 0 < ζ D ≤ 0.25) are present.

Figure 4 .

 4 10(d) shows that the window position occupy only one part of the space which is window totally closed (i.e ζ W = 0) and there are no measurements when the window is partially closed (i.e 0 < ζ W ≤ 0.25).

Figure 4 .

 4 Figure 4.10 -Data involved in validity constraint for period 2

2 -

 2 Data representation for period 2

Definition 4 .

 4 5 becomes Definition 4.7 Definition 4.7. for a test τ defined by the data X T and the behavioral constraint represented by B τ (X T ) and B τ 1. X T complete with respect to B τ and B

2 .

 2 µ τ (X T ) = 0 means | T |= 0 where | T | is the cardinal of T. T has no element. Let's consider the following example: Let T = {t 1 , t 2 , t 3 , t 4 }: The set T has 4 elements. It is said that | T |= 4. Let T = ∅ be the empty set. | T | = 0. Indeed, T has no element.

  in and C max in represent respectively the upper and the lower of CO 2 concentrations in the month of September, 2016 without fault in the sensor (C min in =390 ppm) and (C max in =1000 ppm). The test is also defined by a validity constraint V

Figure 4 .

 4 Figure 4.11 shows the evolution of door and window positions.

Figure 4 .

 4 Figure 4.11 -Zones of validity

Step 4 :

 4 determine the bunch of data The bunch of data required for the behavioral is Cin T , a sequence of similar intervals of CO 2 concentrations in September 1st, 2016 measured by CO2 concentrations sensor installed in the H358 office (C in(T) = [[C in (t 0 ), ..., C in (t 9 )], [C in (t 18 ), ..., C in (t 23 )]]) The bunch of data required for the validity is ζ D(T) , a sequence of similar intervals of door positions in September 1st, 2016 measured by door contact sensor installed in the H358 office (ζ D(T) = [[ζ D (t 0 ), ..., ζ D (t 9 )], [ζ D (t 18 ), ..., ζ D (t 23 )]]) and ζ W (T) , a sequence of similar intervals of window positions in September 1st, 2016 measured by window contact sensor installed in the H358 office (ζ

  e ζ D = 0 and ζ W = 0) or partially closed (i.e 0 < ζ D ≤ 0.25 and 0 < ζ W ≤ 0.25). The objective is to have data representative of all possible situations. Partitioning approach consists on decomposing the ordered data set T into subsets for example in two subsets (few and lot) such as the domain of CO 2 concentrations (390 ≤ C in ≤ 1100) is decomposed on low CO 2 concentrations(390 ≤ C f ew in ≤ 450) and high CO 2 concentrations (450 < C lot in ≤ 1100), the domain of door openings (0 ≤ ζ D ≤ 0.25) is decomposed on door totally closed (0 ≤ ζ f ew D ≤ 0.08) and door partially closed (0.08 < ζ lot D ≤ 0.25) and the domain of window openings (0 ≤ ζ W ≤ 0.25) is decomposed on window totally closed (0 ≤ ζ f ew W ≤ 0.08) and window partially closed (0.08 < ζ lot W ≤ 0.25)

Figure 4 .

 4 Figure 4.12 -Combination between CO 2 and door position

Figure 5 .

 5 Figure 5.1 shows an example of membership level to True/False for a test, from its completeness level. According to Figure 5.1, we can see that for a completeness equal to 0.6, the

Figure 5 .

 5 Figure 5.2 illustrates this point of view.

Figure 5 . 2 -

 52 Figure 5.2 -Membership level to "valid" according to level of completeness

  The first step is the design of automatic tests. The following tests have been performed in the framework of the platform.-Test 1: damper(rule based test) -Test 2: heat exchanger (rule-based) -Test 3: Performance test design for a ventilation fan unit (model-based) -Test 4: heater temperature from radiator 1(range-based) -Test 5: heater temperature from radiator 2(range-based) -Test 6: air quality(range-based) Each test is defined by: -a behavioral and validity constraints -a valid time span T -a bunch of data X T covering a valid time span T -a test support i.e a list of explanations for the test in case of inconsistency -required sensors for the test of behavior and validity constraints -a completeness level µ τ (X T )

3 )Figure 5 . 3 -

 353 Figure 5.3 -Law of control between the concentration of CO2 and the position of damper

Figure 5 . 4 -

 54 Figure 5.4 -Heat exchanger efficiency

Figure 5

 5 Figure 5.5 -Valid time period for Test 2

Test 6

 6 is always valid. This test is also defined by a behavioral constraint B(X T ) ∈ B τ withB τ = C in (t) ∈ [C min , C max ],∀t ∈ T where C min , C max represent respectively the lower and the upper values for CO 2 in fault free case of sensor in the month of March, 2016 (C min =390 ppm, C max =1828.6 ppm)

Figure 5

 5 Figure 5.7 -Behavioral constraint satisfaction for Test 1

Figure 5 .

 5 Figure 5.8 shows the satisfaction of behavioral constraint for Test 2 which verifies the efficiency of the heater exchanger.

Figure 5

 5 Figure 5.8 -Behavioral constraint satisfaction for Test 2

Figure 5 .

 5 Figure 5.9 shows the satisfaction of behavioral constraint for Test 3 which verifies the performance for a ventilation fan unit.

Figure 5

 5 Figure 5.9 -Behavioral constraint satisfaction for Test 3

Figure 5 .

 5 Figure 5.10 shows the satisfaction of behavioral constraint for Test 4 which verifies the performance of the first radiator installed in the classroom.

Figure 5 .

 5 Figure 5.10 -Behavioral constraint satisfaction for Test 4

Figure 5 .

 5 Figure 5.11 shows the satisfaction of behavioral constraint for Test 5 which verifies the performance of the second radiator installed in the classroom.

Figure 5 .

 5 Figure 5.11 -Behavioral constraint satisfaction for Test 5

Figure 5 .

 5 Figure 5.12 -Behavioral constraint satisfaction for Test 6

  Figure 5.13 and Figure 5.14 show respectively the evolution of rpm and airflow during the valid time period.

Figure 5 .

 5 Figure 5.13 -Evolution of rpm during the valid time period of Test 2

Figure 6 . 1 -Figure 6 . 2 -

 6162 Figure 6.1 -Time of recordings for door contact sensor

Definition 6 . 1 .

 61 Data gapData gap means an abnormal change in the data delays sending by a sensor.

  Figure 6.3 and Figure 6.4 show respectively the detection of outliers with λ = 5 as well as the detection data gaps for the Toffice-wall sensor installed in the H358 office.

Figure 6 . 3 -Figure 6 . 4 -

 6364 Figure 6.3 -Detection of outliers on the delay

Figure 6

 6 Figure 6.5 -Interval 1

Figures

  Figures 6.13 and 6.14 show the abnormal delays detected visually for power sensor by truncated normal and gamma distributions respectively.

Figure 6 .

 6 Figure 6.15 -Fitted probability density of the truncated normal distribution for CO 2 concentrations sensor

Figure 6 .Figure 6 .

 66 Figure 6.18 -Detected data gaps for the CO 2 concentration sensor: zoom 1

Figure 6 .

 6 Figure 6.22 -Detection of data gaps for CO 2 concentrations sensor

Figure 6 .

 6 Figure 6.26 -Detection of data gaps for common temperature sensor

Figure 6 .

 6 Figure 6.29 -Detection of data gaps for parent CO 2 concentrations sensor

Figure 6 .

 6 Figure 6.31 -Detection of data gaps for kitchen motion sensor

  (A) Need for an indicator to better formalizing validity (B) Need for a confidence level for global diagnosis (C) Need for detecting faults for an unreliable instrumentation in building

Test2:

  Test of Toffice-wall sensor and Toffice-reference sensor performanceThis test compare the measurements of Toffice-wall sensor and Toffice-reference sensor. T est 2 generates a residual signal from measurements of two sensors.T est 2 = B τ (X (t,t+h) ) ∈ B τ ↔ ok(Σ) where Behavioral constraint: B τ (X (t,t+h) ) ∈ B τ with B τ = T wall (t) -T ref (t) = 0, ∀t ∈ (t, t + h)where T wall and T ref are two time series for indoor temperature measured by Toffice-wall abd Toffice-reference sensors respectively. Support: Possible fault explanations for Test 2 are: ¬ ok(Toffice wall sensor) ∨ ¬ ok(Toffice reference sensor)Test3: check the door-contact, window-contact and Toffice-references sensors performance and the model of temperature (ok(room))

Figure 6 .

 6 Figure 6.35 -Residual generation for scenario 5

3

  Diagnosis in building: the complexity issue 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Sensor grids in buildings increase diagnosis complexity . . . . . . . . . . 3.2.2 Needs for clear explanations to support maintenance operators . . . . . . 3.2.3 Modeling difficulty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.4 Sub-systems interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.5 Sensor fault not easy to find . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.6 Limits for fault diagnosis techniques . . . . . . . . . . . . . . . . . . . . 3.3 Followed methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 The design phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2 The run phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4 A case study for a building system . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.1 Case 1: H358 office . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.4.2 Case 2: RueCuvier apartment . . . . . . . . . . . . . . . . . . . . . . . . 3.4.3 CO 2 based air quality model . . . . . . . . . . . . . . . . . . . . . . . . . 3.5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Performing diagnosis in building with partially valid tests 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Design of automatic partially valid tests . . . . . . . . . . . . . . . . . . . . . . 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2 Problem statement and proposed methodologies . . . . . . . . . . . . . . . . . . 6.2.1 Time series based methodology . . . . . . . . . . . . . . . . . . . . . . . 6.2.2 Statistical approaches based methodology . . . . . . . . . . . . . . . . . 6.3 Automatic thresholding with time series analysis . . . . . . . . . . . . . . . . . . 6.3.1 Methodology description . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.3.2 Experimental results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.4 Automatic thresholding with probability density function . . . . . . . . . . . . . 6.4.1 Methodology description . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.4.2 Experimental results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

	Acronyms Symbols
	ABCAT Symbol	Automatic Building Commisioning Analysis Tool Unit Description
	ARR φ in	Analytical Redundancy Relation W Internal gains
	ASHRAE C in	American Society of Heating and Refrigeration and Air-ppm Indoor CO 2 concentrations
	C cor	conditioning Engineers ppm	Corridor CO 2 concentrations
	BAS ζ D	Building Automation System -Position of the door
	General conclusion BM ζ W	Behavioral Model -	Position of the window
	BEMS	Building Energy Management System
	CFM	Complementary Fault Mode
	DX	Logical Diagnosis
	EMS	Energy Management System
	EPG	Energy Performance Guarantee
	EPBD	Energy Performance of Buildings Directive
	FDD	Fault Detection Diagnosis
	FDI	Fault Detection Isolation
	FSM	Fault Signature Matrix
	HAL	Home Abstraction Layer
	HAZOP	Hazard And Operability Analysis
	HS-Tree	Hitting Set Tree
	HVAC	Heating Ventilation and air Conditioning
	IAQ	Indoor Air Quality
	IEA	International Energy Agency
	IAQ	Indoor Air Quality
	OM	Observation Model
	PNNL	Pacific Northwest National Laboratory
	SDU	University of Southern Denmark
	SM	System Model
	WBD	Whole Building Diagnostician
	PDF	Probability Density Function
		x

  Average production of CO 2 per person

	Notations
	R	Set of real numbers
	R +	Set of positive real numbers
	R n	Euclidean real space of dimension n
	t	temporal variable
	≥	Greater or equal
	≤	Less or equal
	→	Implies
	∨	Logical OR
	∧	Logical AND
	∀	For all
	∃	Exists
		Union
		Intersection
	=	Not equal
	¬	Logical negation
	⊆	Subset
	∈	An element of
	T in	• C	Indoor temperature
	T n	• C	Temperature of the corridor
	T out	• C	Outdoor temperature
	V	m 3	Volume of the room
		xi

-1

Table

Table 1 .

 1 1.

	1 -Activity types
	activities 1: with possible interactions activities 2: without possible interactions
	cleaning	working
	talking	sleeping
	doing sport	cooking
	watching TV	family meal

Table 1 .

 1

			2 -Knowledge based applications
	application name multizone density of sensors long-term data availability validation
	1-H358	no	high	yes	yes
	2-Rue Cuvier	yes	high	yes	yes
	3-Predis	yes	yes	yes	no
	3-OU44	yes	medium	no	yes

Table 2 .

 2

		1 -Table of validity
	B	V	Conclusion
	satisfied ∀t	satisfied ∀t normal behavior
	satisfied ∀t non satisfied	invalid
	non satisfied satisfied ∀t	abnormality
	non satisfied non satisfied	invalid
	satisfied ∃t	satisfied ∃t normal behavior
	satisfied ∃t non satisfied	invalid
	non satisfied satisfied ∃t	abnormality
	non satisfied non satisfied	invalid

Table 3 .

 3

	1 -Signature Table

Table 3 .

 3 2 -Description of model parameters. τ Average temperature of the building envelope R n , R out , R W and R D Thermal resistance of neighboring zones, outdoor, window and door R i , C i Equivalent resistance and capacitance due to inertia R eq Equivalent resistance T in , T n , T out Temperatures inside, with adjacent corridor and outside φ in Total indoor energy gains ρ air Air density C p,air Specific heat of air at room temperature C in , C n , C out CO 2 concentration indoor, with neighboring zone and outdoor Q

  Possible fault explanations for Test 6 are: ¬ ok(door contact sensor) ∨ ¬ ok(window contact sensor) ∨ ¬ ok(Toffice-wall sensor)Required sensors for behavior: the variable involved in the test of behavior are door and window positions and Toffice-wall: they are measured respectively by door contact sensor, window contact sensor and Toffice-wall sensor.The outcome of the different tests are merged into a single table for further analysis. Table3.3 combines all tests with test support. These tests are derived from sensors installed in the office. For example, possible fault explanations for Test 1 are : ¬ ok(Toffice-reference sensor) ∨ ¬ ok(Theater sensor). So, Toffice-reference sensor and Theater sensor are checked as(1) in the signature table. With the help of tests and their supports, the theoretical signature table(Table 3.3) is developed.

		Table 3.3 -Signature Table
	Toffice wall door contact window contact Toffice reference Theater room
	sensor	sensor	sensor	sensor	sensor
	test1

(t,t+h)

) ∈ B τ with B τ = Tin (t) -T in (t) = 0, ∀t ∈ (t, t + h) Support:

Table 3 .

 3

			4 -Signature Table
		Toffice wall Toffice reference Theater ROOM-SYSTEM
		sensor	sensor	sensor
	test1	0	1

Table 3 .

 3 5 -Diagnosis result and fault explanation

	Scenarios	BRIDGE possible diagnosis	Actual fault	Conclusion
	Scenario 1	Toffice-reference (66.66%)	Toffice-reference	Accurate
		Theater (66.66%)		disgnosis
	Scenario 2	Theater (100%)	Theater	Accurate
		ROOM-SYSTEM, Toffice-wall, Toffice-reference (50%)		diagnosis
	Scenario 3	ROOM-SYSTEM (100%)	Abnormal internal Not accurate
		Toffice-wall, Theater, Toffice-reference (50%)	gains	diagnosis
	Scenario 4	Toffice-wall(100%)	Toffice-wall	Accurate
		ROOM-SYSTEM, Theater, Toffice-reference (50%)		diagnoses
	Scenario 5	ROOM-SYSTEM	door-contact	Not accurate
		Toffice-wall, Theater, Toffice-reference (50%)		diagnoses

Table 3 .

 3 6 -Description of model parameters for the apartment τ o , τ a , τ p , Average temperature of the building envelope τ k , τ c respectively for office, Anna, parent, kitchen and common rooms R od , R ad , R pd Thermal resistance for office, Anna, and parent doors R ow , R aw , R pw Thermal resistance for office, Anna, R kw , R cw parent, kitchen and common windows R oc , R ac , R pc , Thermal resistance between office and common, Anna and common R kc parent and common, kitchen and common respectively R oout , R aout , R pout , Thermal resistance between office and outdoor, Anna and outdoor R kout , R cout parent and outdoor, kitchen and outdoor, common and outdoor respectively R

Table 3 .

 3 7 -Diagnosis result and fault explanation Tests components included in the test Test 1 common temperature, common temperature motion Test 10 office door, office window, parent occupancy, office occupancy, office room, common co2, parent door, parent room, parent co2, parent window, office co2 Test 100 parent room, parent co2, common window, Tout, office temperature, Anna occupancy, Anna temperature, parent window, common room, office door, office co2, Cout, Anna room, Anna co2, parent occupancy, Anna door, office occupancy, office room, parent door Test 1000 parent room, common window, Anna window, Anna temperature, office temperature motion, parent window, common occupancy, common room, parent temperature, office door, office co2, Anna room, Anna door, common co2, common temperature motion, office room, office occupancy, parent door Test 1150 Anna window, common room, parent occupancy, Anna room, Tout, common co2, parent door, parent room,parent co2, common occupancy, parent window, Anna door, Anna temperature motion Test 1170 office door, office temperature motion, Anna window, common room, office window, parent occupancy, common temperature motion, Anna room, office room, common co2, parent door, parent room, parent co2, common occupancy, parent window, Anna door, Anna temperature motion Test 1180 office door, common room, office window, parent occupancy, common temperature motion, office occupancy, Tout, office room, parent door, parent room, parent co2, parent window, common occupancy, office co2, Cout Test 1195 parent room, parent co2, common temperature, office window, Tout, Anna window Anna occupancy, parent window, common occupancy, common room, office door, office co2, Anna room, Anna co2, parent occupancy, Anna door, office room, office occupancy Test 1196 parent room, parent CO2 sensor, office window, Tout sensor, Anna window, Anna occupancy, parent window, common occupancy, common room, office door, office co2, Anna room, Anna co2, parent occupancy, Anna door, office room, office occupancy, common temperature motion, parent door

  2. A test is characterized by net thresholds. It means that the behavioral constraint is either satisfied either unsatisfied. Uncertainty is related to the validity constraint. The question that arise is from which level of validity we can conclude about the test?The diagnostic result is calculated from a set of tests, each defined by its level of validity and the question that arise is how to prove diagnosis?The second contribution is to calculate, from the level of validity for each test, the confidence level for global diagnosis.

	Chapter 4
	Performing diagnosis in building with
	partially valid tests
	4.1 Introduction
	3. A test is defined over sensor data. In this work, we can not defined a test without data.
	Hence, there is a need to know the periods of good operation operations. Data gaps
	i.e missing data are the most important sensor fault type in building. Sensor values
	are not uniformly sampled and the question that arise is from which delay a sensor

becomes faulty? The third service for apprehending the complexity consists on automatic thresholding for data gap detection for a set of sensors in instrumented buildings Next chapter deals with the first new service for diagnosis in building which deals with performing diagnosis in buildings with partially valid tests.

Table 4 .

 4 1 shows how many situations are satisfied.

Table 4 .

 4 1 -Data representation for period 1where denote by the presence of data in a category For period 1, the data are representative with 50%.(b) Period 2: March 2nd, 2016 from t=09:00 to t=20:00The test is valid from t=11:00 to t=18:00. The valid time span is T = {t 11 , t 12 , t 13 , t 14 , t 15 , t 16 , t

17 , t 18 } with t 11 =11:00, t 12 =12:00, t 13 =13:00, t 14 =14:00, t 15 =15:00, t 16 =16:00, t 17 =17:00, t 18 =18:00. The bunch of data for validity constraint is X T = {T out (t 11 ), ..., T out (t 18 ), occupancy(t 11 ), ..., occupancy(t 18 ), ζ D (t 11 ), ..., ζ D (t 18 ), ζ W (t 11 ), ..., ζ W (t 18 )} Figure

Table 4 .

 4

2 shows how many situations are satisfied.

Table 4 .

 4 2 concentrations is low and door is totally closed -when CO 2 concentrations is low and door is partially closed -when CO 2 concentrations is high and door is totally closed -when CO 2 concentrations is high and door is partially closed -when CO 2 concentrations is low and window is totally closed -when CO 2 concentrations is low and window is partially closed -when CO 2 concentrations is high and window is totally closed -when CO 2 concentrations is high and door is partially closed Table 4.5 checks how many boxes are filled. 5 -Completeness level for test of CO 2

  The test is valid from February 6th, 2016 at t=00:00 to February 15th, 2016 at t=23:00. These instants where the validity constraints are satisfied and correspond to the valid time span for Test 4. This test is also defined by a behavioral constraint B τ (X T ) ∈ B τ where B τ : heat radiator 1 (t) > 0, ∀t ∈ T The bunch of data required for the test of behavioral constraint is heat radiator1(T) . It is a sequence of similar intervals of heater from radiator 1 measured by heat sensor installed in the classroom of Denmark application. The bunch of data required for the test of validity constraint is radiator 1 opening(T) . The are a sequence of similar intervals of radiator opening rate (i.e the position of the thermostatic valve) measured by radiator opening sensor of the radiator 1. The test is also defined by a test support. The possible fault explanations for this test are ¬ok(radiator 1 thermostatic valve) ∨ ¬ok(radiator 1) ∨ ¬ok(radiator 1 thermostatic valve sensor) ∨ ¬ok(radiator 1 heat sensor) ∨ ¬ok(outdoor temperature sensor)

	Test 5: heater temperature from radiator 2 (range-based)

  [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF] uses the diagnosis according to first principle to calculate the diagnoses because the supposed faults are not necessarily revealed and because it allows to calculate the minimum explanations at the component level and it allows the detection of multiple faults. With the method proposed by[START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF], we obtain 27 diagnoses none of which is right. In this work, only diagnoses number 0, 6, 8, 12, 26 and 27 are presented (see Table5.5).

	Diagnostics found	Results according	Fault probability
		to the proposed approach
	D0	heater exchanger AND	100%
		damper
	D6	heater exchanger AND	100%
		CO 2 concentrations sensor
	D8	Tair supply sensor AND	100%
		CO 2 concentrations sensor
	D12	airflow sensor AND	100%
		damper
	D26	fan AND	83.33%
		rpm sensor AND
		damper
	D27	fan AND	83.33%
		airflow sensor AND
		damper position sensor
	Table 5.5 -Diagnosis analysis by
		.4)
	Tests Consistent/Inconsistent Valid/Invalid
	Test1	Inconsistent	Valid
	Test2	Inconsistent	Valid
	Test3	Consistent	Valid
	Test4	Consistent	Valid
	Test5	Consistent	Valid
	Test6	Inconsistent	Valid
	Table 5.4 -Diagnosis analysis by Singh et al. (2019)

Table 5 .

 5 6 -Completeness level for validity using partitioning method for Test 2 airf low f ew airf low lot rpm f ew rpm lot -

Table 6 .

 6 1 -Effect of λ on the Outlier Detection Rate

	λ	detection rate	Intervals
	12	1	(

Table 6 .

 6 3 -Resulting errors for door contact sensor

	Law probability	number of detections
	name
	truncated nor-	5 detections (at t=313698, t=1.14503 e +06 , t=2.38682 e +06 ,
	mal
		t=3.53624 e +06 , t=3.9141 e +06 )
	gamma	3 detections (at t=338.819, t=1.14578 e +06 ,
		t=3.91619 e +06 )

Table 6 . 4 -

 64 Resulting errors for door contact sensor

	Law probability	number of detections
	name
	truncated nor-	3 detections (at epochtime=17349.9, epochtime=264707
	mal
		and epochtime=611247)
	gamma	2 detections (at epochtime=17971.8, epochtime=264641
		and epochtime=611377)

Table 6 .

 6 5 -Resulting errors for power sensorFigures 6.15 and 6.16 show the abnormal delays detected visually for CO 2 concentrations sensor by truncated normal and gamma distributions respectively.

	Law probability	number of detections
	name
	truncated nor-	4 detections (at epochtime=20000, epochtime=594542,
	mal
		epochtime=1.1674 e +06 , epochtime=1.79014 e +06 )
	gamma	3 detections (at epochtime=29911.5, epochtime=594698
		and epochtime=1.16879 e +06 )

Table 6 .

 6 6 -Resulting errors for CO 2 concentrations sensor

	Law probability	number of detections
	name
	truncated nor-	3 detections (at epochtime=13291, epochtime=288548,
	mal
		epochtime=595023)
	gamma	2 detections (at epochtime=13591, epochtime=288296

Table 6 .

 6

	8 -Probability laws

Table 6 .

 6

	9 -Probability laws

  -words: building system, diagnosis, sensors, faults, validity, data gaps, expert knowledge, completeness level, confidence level Résumé: Le diagnostic des défauts et la maintenance d'un système bâtiment est une tâche complexe à effectuer. Les outils existants pour la détection et le diagnostic de défauts dans les bâtiments permettent d'effectuer cette détection à l'aide d'une analyse des contraintes comportementales. La thèse de Mahendra Pratap Singh propose le concept de tests hétérogènes avec des contraintes de validité dans le contexte du diagnostic de défauts dans les bâtiments, mais l'approche proposée suppose que les capteurs sont fiables et ne s'intéresse qu'aux processus thermo-aérauliques et aux systèmes de chauffage. Les contraintes de validité sont mesurées avec des capteurs. Si ces capteurs sont défectueux, le résultat du diagnostic n'est pas garanti et il est nécéssaire d'avoir une méthode permettant de prouver le test ainsi que le diagnostic global. Pour effectuer un test, il est nécessaire de disposer de données provenant de différentes parties: météorologiques, humaines et physiques. Cependant, les données manquantes constituent le type de défauts de capteurs majeur dans les bâtiments. Les mesures des capteurs ne sont pas échantillonnées de manière uniforme et il est nécessaire de décider à partir de quel retard le capteur devient défectueux. L'objectif de ce travail est de mettre en évidence ces défis et de fournir une stratégie sur la façon de les résoudre. Trois solutions pour le diagnostic du système bâtiment sont proposées

Un niveau de complétude pour une formalisation de la validité lorsque les capteurs sont potentiellement défaillants. Pour le système bâtiment, il n'existe pas de modèle global précis mais il existe des modèles contextuels à validité limitée. L'espace de test consiste en un ensemble de mesures. Le niveau de complétude est proposé comme méthode pour prouver si un espace de test est entièrement couvert ou non c'est-à-dire pour évaluer le niveau de validité d'un test en présence de capteurs non fiables.

List of Figures

An example of model based test is given below. A simplified model is used for estimating the indoor temperature in H358 office. This test performs a comparison of the measured and estimated temperature. The thermal model verifies the thermal discomfort at zonal or local level. The period of test is March 2nd, 2016 from t=12:00 to t=18:00. So, the time period is T = {t 12 , t 13 , t 14 , t 16 , t 17 , t 18 } with t 12 =12:00:00, t 13 =13:00:00, t 14 =14:59:00, t 16 =16:00:00, t 17 =17:00:00 and t 18 =18:00:00 The test is defined by a behavioral constraint B τ (X (T) ) ∈ B τ with B τ : T estimated (t) ∈ T measured (t)-∆T, T measured (t) + ∆T, ∀t ∈ T] T measured and T estimated represent respectively two data sets of measured and estimated indoor temperature (T measuredT = [T measured (t 13 ), T measured (t 14 ), T measured (t 16 ), T measured (t 17 ), T measured (t 18 )] and T estimatedT = [T estimated (t 13 ), T estimated (t 14 ), T estimated (t 16 ), T estimated (t 17 ), T estimated (t 18 )]) The estimated temperature (T estimated ) is performed with the help of linear regression model defined by Equation 4.1. For the estimation, two independent data sets are used: a training data set from October 1st, 2015 at midnight to February 28th, 2016 at t=23:00 and a validation data set in March 2nd from t=12:00 to t=18:00

where u 0 : sequence of similar intervals of outdoor temperature u 1 : sequence of similar intervals of corridor temperature u 2 : sequence of similar intervals of window positions u 3 : sequence of similar intervals of door positions u 4 : sequence of similar intervals of total power u 5 : sequence of similar intervals of solar radiation u 6 : sequence of similar intervals of number of occupants u 7 : sequence of similar intervals of heater temperature y: sequence of similar intervals of estimated indoor temperature

The outdoor temperature and solar radiation are measured by a weather station. The corridor temperature, the window and door positions, the total power, the heater temperature and the indoor temperature are measured respectively from corridor temperature sensor, window and door position sensors, total power sensor, heater temperature sensor and Toffice-reference sensors installed in the H358 office. Occupancy is estimated by the algorithm proposed in [START_REF] Amayri | Estimating occupancy in heterogeneous sensor environment[END_REF].

Let's consider the following example of partial valid test of CO 2 concentrations during a valid time span

The bunch of data required for the test of behavioral constraint is C in(T) = [395, 410, 450, 500, 650, 698]

In addition, the space of behavioral constraint is totally covered. It means that the data set contains the two possibilities of low CO 2 concentrations (i.e 390 ≤ CO 2 ≤ 450) and high CO 2 concentrations (i.e 450 < CO 2 ≤ 700) are present. So, we conclude that C in(T) is complete with respect to B τ Also, V τ,1 (X T,1 ) ∈ V τ,1 is satisfied and V τ,2 (X T,2 ) ∈ V τ,2 is satisfied. So, V τ (X T ) ∈ V τ is satisfied. In addition, the space of validity constraint is totally covered. It means that the data set contains the two possibilities of door and window totally closed (i.e 0 ≤ ζ D ≤ 0.08 and 0 ≤ ζ W ≤ 0.08) and door and window partially closed (i.e 0.08 < ζ D ≤ 0.10 and 0.08 < ζ W ≤ 0.10). So, we conclude that ζ D(T) and ζ W (T) are complete with respect to V τ Consequently, the conclusion about this test is ok.

The next section deals with a method to calculate the completeness level.

The completeness level: a new concept for better formalizing validity

This section deals with a method for better formalizing validity and proving a test.

Definition 5. 6

. Complement

The complement A is defined by f

Reasoning in fuzzy logic is based on one main element which is the fuzzy relationship [START_REF] Lotfi | The concept of a linguistic variable and its application to approximate reasoning-i[END_REF][START_REF] Iancu | A mamdani type fuzzy logic controller[END_REF] Definition 5.7. fuzzy relation Let X and Y be two sets. A fuzzy relationship R between X and Y is a fuzzy subset belonging to X × Y Thus, the fuzzy implications (Definition 5.8) have been constructed as fuzzy relations between two sets X and Y.

Definition 5.8. fuzzy implication

Let A and B be two fuzzy subsets belonging to the two sets X and Y. A fuzzy implication translates as:

where x and y are values belonging to the two reference sets X and Y respectively.

A fuzzy implication is thus a quantification of the degree of truth which links the two elementary propositions (x is A) and (y is B ). Therefore, it depends on the membership functions, f A and f B , of the two fuzzy subsets A and B. The notation noted (p ⇒ q) = (¬p ∨ q) in crisp logic where the values take only the values 0 or 1, is defined by Table 5.1. On the other hand, Table 5.1 -Implication in crisp logic

in fuzzy logic, there are several definitions of implication. of which we present some of the most used in Table 5.2.

Table 5.2 -The main fuzzy implications Name Definition Mamdani [START_REF] Peter | The application of fuzzy control systems to industrial processes[END_REF] min(f A (x), f B (y)) Lukasiewicz [START_REF] Lukasiewicz | On three-valued logic[END_REF] min(1-f A (x)+f B (y), 1) Larsen [START_REF] Larsen | Industrial applications of fuzzy logic control[END_REF] f

Mamdani's definition is the most simplifying since it reduces an implication to an operator of type "and" [START_REF] Peter | The application of fuzzy control systems to industrial processes[END_REF]. The implication of Reichenbach (1934) results from (p ⇒ q) = (¬p ∨ q) which can also be written (p

The test is valid during:

-February 8th, 2017 from t=06:00 to t=19:00 -February 9th, 2017 from t=07:00 to t=22:00 -February 13th, 2017 from t=06:00 to t=17:00 -February 14th, 2017 from t=06:00 to t=22:00 -February 15th, 2017 from t=06:00 to t=20:00

These instants where the validity constraints are satisfied correspond to the valid time period for Test 2. This test is also defined by a behavioral constraint B τ (X T ) ∈ B τ with B τ : ef f iciency(t) ≥ 70%, ∀ ∈ T with efficiency is the efficiency of the heating exchanger and it is calculated by:

, ∀t ∈ T (5.17) with ∆ T 1 = T Suply air -T intake air (5.18)

The bunch of data required for the test of behavioral constraint are T Suply air(T) , T intake air(T) and T exhaust air(T) . They are a sequences of similar intervals of supply air temperature, intake air temperature and exhaust air temperature measured respectively by supply air temperature sensor, intake air temperature sensor and exhaust air temperature sensor. The bunch of data required for the test of validity constraint is rpm (T) and airf low (T) . They are a sequence of similar intervals of rotation speed per minute of the fan and airflow measured respectively by rotation speed sensor and airflow sensor. The rpm is used to model that the ventilation system is in mode ON. This test is also defined by a test support. The possible fault explanations for this test in case of inconsistency are ¬ ok (heater exchanger) ∨ ¬ok(temperature controller) ∨ ¬ ok(supply air temperature sensor) ∨ ¬ ok(intake air temperature sensor) ∨ ¬ok(exhaust air temperature sensor) ∨ ¬ ok(rpm sensor) ∨ ¬ ok(airflow sensor)

Test 3: Performance test design for a ventilation fan unit (model-based)

Ventilation fans are an important component of any mechanically ventilated building. Poor fan performance could significantly affect the whole building performance metrics. There are several issues such as dirty blades, mechanical wear could impact the fan's performance. This test evaluates the building ventilation system fan operation using performance curve [START_REF] Stein | Development and testing of the characteristic curve fan model[END_REF]. Expected fan performance is modeled with the help of manufacturer data and compared against the real-time fan performance. Two data-driven models are developed and implemented. The first model is used to compute expected total fan pressure at a given airflow rate while second is a Support Vector Regression (SVR) model, to predict the fan efficiency.

The performance monitoring of the ventilation fan unit is determined in terms of expected and actual fan energy consumption. To estimate expected fan energy consumption of ventilation system fan using airflow measurement it is necessary to model total fan pressure in the terms of measured airflow. A second model requires to estimate expected fan efficiency followed by the expected fan energy consumption. Further the following performance test is formalized to monitor the normal and abnormal behavior of ventilation fan unit. The test is also defined by a validity constraint V τ (X T ) ∈ V τ with V τ : electricity(t) > 0, ∀t ∈ T. The test is defined by a behavioral constraint B τ (X T ) ∈ B τ with B τ : P expected -DN + < P measured < P expected +DN -, DN + and DN -are upper and lower value of performance design number and can be obtained from the ventilation commissioning team (DN + = 30% and DN -= 30%), P expected and P measured represent receptively the expected and the measured power consumption. A set of fan performance curve (FPC), provided by NK Industri (Figure 5.6) is used for the modeling purpose. The simulated fault is an offset on the CO 2 concentrations sensor, a bias on the Tair supply sensor and an offset on the rpm sensor. The obtained result is inexact. The diagnoses are calculated from only 2 tests which are Test 1 and Test6. In fact, a bias is applied to the rpm sensor which intervenes in the validity of test 2.

Conclusion

In this chapter, a method for performing diagnosis in building with partially valid tests is proposed. The concept of completeness level is proposed as a method to assess the level of validity of a test. A test is characterized by thresholds. It means that the behavioral constraint is either satisfied either unsatisfied. Doubt is related to the validity constraints. In fact, it is difficult to set a threshold for completeness level from which we can conclude a test result is valid. The diagnostic result is calculated from a set of tests where some of them have a completeness level lower than 1. The contribution in this work is to adapt the completeness level for symptom analysis to calculate the confidence level of calculated diagnoses. A fuzzy logic reasoning, is proposed as a method to prove the global diagnosis. A real case study is studied for performing diagnosis in building with partially valid automatic with confidence level. At the beginning, a set of tests have been designed in the framework to the classroom and a completeness level for each symptom is calculated using partitioning approach. Then, two fault scenarios are simulated. The calculated diagnoses are proved with a confidence level. In this work, three diagnostic analysis methods are discussed: visual diagnostic analysis, diagnostic analysis by [START_REF] Singh | Advancing Building Fault Diagnosis Using the Concept of Contextual and Heterogeneous Test[END_REF] and proposed diagnostic analysis. The first method shows that it is difficult to find the fault visually. The second method leads to a number of diagnoses equal to 27 none of which is right.

The proposed approach leads to a number of diagnoses equal to 4 of which 1 is right. It makes it possible to find the faults but the diagnosis does not come out at 100%, that is, there is only a part of the diagnosis that is found. For example, in the case of the fault scenario which consists on an offset for the CO 2 concentrations sensor, an offset on the rpm sensor and a bias on the Tair supply temperature. The fault is found (i.e faulty CO 2 concentration sensor) but the other faults are not found According to the principles of each law of probability, it is concluded that the truncated normal law and the gamma law are adequate for the delay. exponential no (because the order of magnitude of delay in ms is very high between 1456786822423 and 1458082719570 in the month of March 2016, the PDF is e (-λx) which tends to 0) chi squared no (because the order of magnitude of delay in ms is very high) between 1456786822423 and 1458082719570 in the month of March 2016, the PDF is e (-λx) which tends to 0) student no (because the order of magnitude of delay in ms is very high) between 1456786822423 and 1458082719570 in the month of March 2016, the PDF is e (-λx) which tends to 0)

The second step of the proposed methodology is to compare the histogram representations of each of these laws. Figures 6.9,6.10,6.11,6.12,6.13,6.13, represent the histogram representation of the time delay and the pdf curve for the truncated normal and gamma distributions for door contact sensor, temperature sensor (Toffice-wall sensor), power sensor respectively. Only these sensors are presented in this chapter. The histogram respresentation for other sensors are omitted in the reason of space. The period of test is from January 1st, 2016 to January 31th, 2016. ((2016, 1, 4, 14, 46, 33), (2016,1,8,11,59,24)), 247226213.58 contact (see Figure 6.20) ((2016, 2, 2, 11, 42, 56), (2016,2,23,12,38,58)), ((2016, 3, 25, 17, 54, 39), (2016,3,29,9,40,32)) Temperature 3 detections ((2016, 1, 4, 14, 57, 5), (2016,1,8,11,42,16)), 38101174.48 (see Figure 6.21) ((2016, 1, 16, 2, 22, 56), (2016,1,17,2,1,28)), ((2016, 1, 20, 16, 3, 19), (2016,1,26,13,13,14)) CO 2 3 detections (2016, 1, 4, 14, 57, 5), (2016,1,8,11,42,16) 37144272.41 (see Figure 6.22) ((2016, 1, 16, 2, 21, 26), (2016,1,17,2,1,28)), ((2016, 1, 20, 16, 3, 19), (2016,1,26,13,13,14)) Power 3 detections ((2016, 1, 4, 14, 56, 43), (2016,1,8,11,48,56)), 35154742.37 (see Figure 6.23) ((2016, 1, 16, 2, 11, 1), (2016,1,17,2,8,58)), ((2016, 1, 29, 6, 37, 8), (2016,1,30,2,[START_REF] Najeh | Diagnosis in buildings: new trends illustrated by an application, soumis dans[END_REF]38)) detected 3 detections ((2016, 1, 4, 14, 52, 16), (2016,1,8,11,47,11)), 61472466.89 motions (see Figure 6.24) ((2016, 1, 16, 2, 5, 30), (2016,1,17,2,21,34)), ((2016, 1, 29, 6, 14, 37), (2016, 1, 30, 2, 9, 7)) Figure 6.20 -Detection of data gaps for door window sensor Theater sensor (with fault probability 100%) ROOM-SYSTEM AND Toffice-wall AND Toffice-reference (with fault probability 50%) Interpretation: Scenario 2 corresponds to the results of figures 6.33(a) and 6.33(b). A fault on Theater sensor is the most probable. The simulated fault consists on supposing that the Theater sensor is faulty. Thus, the current fault is found and this result is obvious. This scenario reveals that this approach leads to an accurate diagnosis.

List of publications

Publications in international peer-reviewed journals