# Observer Design for Estimation of Nonobservable States in Buildings

Authors: M. Długosz; J. Baranowski
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

Efficient temperature control requires more than air temperature measurements. Relevant variables, such as wall, ceiling, and other construction temperature evolution are usually unmeasured. Estimation of such quantities is often difficult because they are not observable with respect to available data. Their availability however would allow efficient control design. In this paper, we propose a method for designing state observers that efficiently estimate not only observable but also nonobservable (but detectable) state variables. Our method uses contraction semigroup, to obtain observer with a monotonic error reduction. Proposed approach gives twice as fast estimation as pure simulation and avoids transitional error standard observer would have. Problem of state estimation in building control applications is an important one. Attractiveness of obtaining values of physically unmeasurable variables is easily visible, as it would allow more efficient methods of temperature control. In this paper, authors discuss the problem of such estimation using a lumped capacitance model. This type of model is usually only detectable but not observable. Methods of observer tuning for such systems are not discussed properly in the literature and require special consideration. In this paper, three approaches for estimation are compared: pure model, eigenvalue shifting, and contraction semigroup observer. Results are illustrated with numerical experiments.


---

## Body

## 1. Introduction

One of the currently important areas of control and electrical engineering is the problem of efficient energy usage in building installations [1, 2]. It is especially important because of economical reasons. While problem of industrial and office buildings is well known, the area of housing buildings was not extensively investigated. Practical approaches of home owners usually focus on thermal isolation and efficient heaters (either condensation gas furnaces or heat pumps). The idea of using dedicated control strategies for housing buildings is not yet popular; however, it is believed that it would lead to both increase in comfort and more efficient energy usage.In order to formulate proper control algorithms, methods of modelling and estimation have been investigated. Sufficient models for building dynamics are obtained by the lumped capacitance method [3, 4] . Conveniently, they can be interpreted as electrical circuits. Different approaches include fractional calculus, finite elements, or thermal responses [5–7]. A comprehensive review of building modelling was performed by Davies [8]. Methods of simulation of heat transfers in buildings were reviewed by Clarke [9]. Methods of control of building systems were considered among the others by Wang [10] and also by Underwood and Yiki [11]. Methods of control for housing buildings were investigated in [12, 13].It is obvious that control without information is not possible. In perfect conditions, we would measure all the relevant variables having full information about the system. If measurements are not complete and system is observable, then there is a plethora of methods for state estimation. Among the others are state observers, filters, recursive algorithms, hybrid algorithms, or optimisation approaches [14–20].Problem occurs when certain states of the system do not fulfill the observability requirement. In this paper, we present a methodology for estimating state under much weaker detectability condition. In such case, only asymptotic state estimation is possible. We present a contraction semigroup-based approach allowing estimation of the entire state vector (including nonobservable states) with continuous reduction of estimation error. We compare it with pure model and eigenvalue shifting approach.The rest of the paper is organised as follows: we present an example of mathematical model of a room and show that it is detectable, but not observable. We then present three methods of constructing state estimator for a detectable system, including contraction semigroup-based approach. We then verify its application for the analysed system and present discussion of methods’ effectiveness.


## 2. Mathematical Model of a Room

For modelling of temperature evolution inside the building, the method of lumped thermal capacitance method was used. Every element that can influence the temperature is modelled with two resistors and one capacitor. The notations for the variables used in this article are as follows:(i)
Ci: thermal capacity of i-th element inside the room JK−1, i=1,…,8(ii)
Ti: temperature of i-th element inside the room C°, j=i,…,8(iii)
Uj=1/Rj: thermal conductance of j-th element inside the room Wm−2K−1, j=1,…,8(iv)
Cm: thermal capacity of emitter material JK−1(v)
Cint: thermal capacity of air inside the room JK−1(vi)
Tout: outside air temperature C°(vii)
Tint: inside air temperature C°(viii)
Tz1,Tz2,Tz3: temperatures “outside” floor, ceiling, and inside walls C°(ix)
Qg: casual heat gains to space W(x)
Qp: power of thermal installation W(xi)
Qs: solar energy WThe modelled system is a single room two walls of which are outside walls and two that are inside walls. Room surface is 63 m2, and its volume is 179.5 m3. Equations and their parameters are from [21]. The proposed model is consistent with real system ([11], p. 244). The electrical analogue of the system is presented in Figure 1. We assume, that the only measurement is the temperature inside the room.Figure 1
Equivalent circuit of the mathematical model of the building.The analysed model is presented in the form of vector matrix notation:(1)Ex˙t=A1xt+But+Zzt,(2)yt=Cxt,where A is the state matrix, B is the control matrix, Z is the exogenous input matrix, C is the output matrix, xt is the state, zt is the exogenous input, ut is the control, and yt is the output.(3)E=C1000000C2000000C3000000C4000000C5000000Cint,(4)A1=aij∈ℝ6×6.MatrixA has most of its elements equal to zero, except(5)a11=−U1−U2,a16=U1,a22=−U3−U4,a26=U3,a33=−U5−U6,a36=U5,a44=−U5−U6,a46=U6,a55=−2U7,a56=U7,a61=U1,a62=U3,a63=U5,a64=U6,a65=U7,a66=−U1−U3−U5−U6−U7−U8.Other matrices take the following form:(6)B1=000001T,(7)C=000001,(8)Z1=U200000U4000000U6001000U5000000U700U800001,(9)xt=T1T2T3T4T5TintT,(10)zt=ToutTz1Tz2Tz3QsQgT.In equation (1), matrix 8 and vector 10 temperatures Tz1, Tz2, and Tz3 are interpreted as exogenous inputs, as they are not measured (usually such measurements are not available). They cannot be ignored, as they would introduce additional errors in the estimation. Frequently used simplification is to assume that these temperatures are equal to Tout ([11], p. 88).Assuming that(11)Tz1=Tz2=Tz2=Tout,matrices of the model have to be modified.In the case of state matrixA, the following elements are changed(12)a36=U5+U6a46=U6+U5a56=2U7,matrix of exogenous inputs takes the following form:(13)Z1=U200U400010000000U801,and vector of inputs is reduced to(14)zt=ToutQsQgT.For reminder of the paper, we will multiply the state equation (1) by E−1 obtaining standard state equations with A=E−1A1, B=E−1B1, and Z=E−1Z1.


## 3. Analysis of Observability

As it is common with systems with real parameters and order grater than 3 using the standard Kalman condition for observability, i.e.,(15)rankCCACA2⋮CAn−1=n,A∈ℝn×n,cannot be applied directly. The number of multiplications of rarely well-scaled coefficients often makes the matrix rank undeterminable. It is frequent that (in case of single output systems) determinant of the Kalman matrix is close to zero but results are inconclusive. For larger systems, it is more practical to use the extension of detectability condition, that is,(16)rankCsI−A=n,∀s∈λA.This criterion is much more numerically efficient, as the determination of matrix rank is much easier.Using extension of detectability condition, one can easily determine that the system is not observable, as for two eigenvalues the rank is 5. The system is however detectable because it is asymptotically stable. It is enough for the construction of Luenberger observer. It is however problematic how to set the gains of the observer because the literature does not present appropriate criteria for such case. It is often suggested to decompose the system into observable and unobservable subspaces; however, such decomposition for our case is not practical. Another way to solve the problem with lack of observability was presented in article [12] where indistinguishable states were aggregated into one state. The decomposed system has its own observable state variables that cannot be used for the determination of values of physical state variables. We will now discuss three approaches for detectable system observer.We will focus on the full-rank Luenberger observer, that is,(17)x^˙t=Ax^t+But+Zzt+Gyt−Cx^t.It is a known fact that for estimation error defined ase=x−x^, error dynamics evolves according to the following equation:(18)e˙t=A−GCet,and error of estimation will be a focus of the analysis.


## 4. Pure Model Estimation

This approach is popular in electric drive control and is effectively an open loop estimator. In such case, matrix gainG=0 and observer reduces to the following form:(19)x^˙t=Ax^t+But+Zzt.The system is asymptotically stable, so the error estimation is as follows:(20)e˙t=Aet.Pure model estimation does not use information about system outputs. That is why its dynamics is equal to the dynamics of the original system. Its merit is however that the estimate is not influenced by measurement errors.


## 5. Eigenvalue Shifting

Because the system is not observable, its eigenvalues cannot be placed at desired values; however, one can choose such gainG that real parts of error dynamics matrix A−GC eigenvalues are shifted to the left as far as possible. Such gain is a solution of the following optimisation problem:(21)G=argmingmaxReλA−gC.It is a typical min-max problem and comes with all its difficulties. Such problems are usually hard to solve using any simple method. After careful analysis of Nelder–Mead and genetic and other derivative-free algorithms, the best results were obtained with simulated annealing.


## 6. Contraction Semigroup Observer

This type of research was considered in earlier research (see [22], where it was focused on systems observable but with multiple outputs. This type of observer cannot be constructed for every kind of system, as it depends strongly on structural properties of matrix; among the others, it can be constructed for systems where error dynamics state matrix takes the form of symmetric, normal, or diagonally dominated Metzler matrix. However, this approach can be used for detectable systems with desired structure as it does not require specific placement of eigenvalues.


### 6.1. Motivation

It is a common conception that if linear systems, such as(22)x˙t=Axt,have only real negative eigenvalues, it is well damped. It is usually explained that the absence of complex eigenvalues guarantees the lack of oscillations. Norm of the trajectory fulfills the following relation:(23)xt≤x0eAt.Moreover, the exponential stability of the system guarantees that the norm of fundamental matrixeAt is bounded as follows:(24)∀ε>0,∃cε>0:eAt≤cεeγ+εt,0≤t<∞,where γ=maxiReλiA.Let us consider the following matrix(25)A=−120000−220000−320000−4.It can be easily seen that this matrix has real, distinct eigenvalues, so its trajectories should be well damped. However, see Figure2 for the plot of the norm of the trajectory of system 21 with the matrix 23 with the initial condition:(26)x0=0001.Figure 2
Motivatory example: the norm of a trajectory of a system with real negative eigenvalues exhibits large transitory extremum.As one can see, the initial normx0=1 is multiplied by about 150 at t≈1.5. That is why additional analysis of damping of the system is necessary. It should be noticed that the bound 22 still holds. Unfortunately, the multiplier cε in general case can be arbitrarily large; in this case, it would be about few hundreds.One can easily come to the conclusion that if error of the observer would behave in the similar way, the control quality would be seriously impaired. Moreover, analysis of these phenomena is desired because it is quite common for observers with high gains to generate large transitional errors. In the literature, it is called the peaking phenomena.The best possible situation for the estimation quality would be for the error of estimation to decrease with time. In case of systems with linear error dynamics in order for this to happen, the evolution must behave as a contraction semigroup, that is,expA−GCt≤e−αt,α>0. It gives an exponential bound on the vanishing of error and guarantees that the error will not exceed the initial value.


### 6.2. Bound on the Matrix Exponential

In order to guarantee the fulfillment of(27)expA−GCt≤e−αt,α>0,t≥0,one needs to find a way to asses the value of matrix exponential norm. It is rather obvious that determination of such norm explicitly, especially as a function of observer parameters, is difficult, if not entirely impossible. Let us introduce the following.Definition 1.
(Damping coefficient). A real numberμA will be called a damping coefficient of matrix exponential of A if(28)μA=limΔ⟶0+I+ΔA−1Δ.
Norm of the matrix exponential fulfills the following bound:(29)eAt≤eμAt.
The exact value of a damping coefficient depends on the norm used in Definition1. For spectral norm, we have(30)μA=λmaxA+AT2.
For more details on damping coefficient (under the name logarithmic norm), see [23]. As it can be seen if damping coefficient is negative, then matrix exponential of A is a contraction semigroup.
In this paper, this methodology was used for design of the observer. The main idea was to find observer gainG which would lead minimal damping coefficient, and if that coefficient would be negative, then this gain would be used. That proved to be the case, and the gain being the solution to(31)G=argmingmaxλ12A−gC+AT−CTgT.
This optimisation problem was well conditioned and easily solvable with a Nelder–Mead algorithm.


## 6.1. Motivation

It is a common conception that if linear systems, such as(22)x˙t=Axt,have only real negative eigenvalues, it is well damped. It is usually explained that the absence of complex eigenvalues guarantees the lack of oscillations. Norm of the trajectory fulfills the following relation:(23)xt≤x0eAt.Moreover, the exponential stability of the system guarantees that the norm of fundamental matrixeAt is bounded as follows:(24)∀ε>0,∃cε>0:eAt≤cεeγ+εt,0≤t<∞,where γ=maxiReλiA.Let us consider the following matrix(25)A=−120000−220000−320000−4.It can be easily seen that this matrix has real, distinct eigenvalues, so its trajectories should be well damped. However, see Figure2 for the plot of the norm of the trajectory of system 21 with the matrix 23 with the initial condition:(26)x0=0001.Figure 2
Motivatory example: the norm of a trajectory of a system with real negative eigenvalues exhibits large transitory extremum.As one can see, the initial normx0=1 is multiplied by about 150 at t≈1.5. That is why additional analysis of damping of the system is necessary. It should be noticed that the bound 22 still holds. Unfortunately, the multiplier cε in general case can be arbitrarily large; in this case, it would be about few hundreds.One can easily come to the conclusion that if error of the observer would behave in the similar way, the control quality would be seriously impaired. Moreover, analysis of these phenomena is desired because it is quite common for observers with high gains to generate large transitional errors. In the literature, it is called the peaking phenomena.The best possible situation for the estimation quality would be for the error of estimation to decrease with time. In case of systems with linear error dynamics in order for this to happen, the evolution must behave as a contraction semigroup, that is,expA−GCt≤e−αt,α>0. It gives an exponential bound on the vanishing of error and guarantees that the error will not exceed the initial value.


## 6.2. Bound on the Matrix Exponential

In order to guarantee the fulfillment of(27)expA−GCt≤e−αt,α>0,t≥0,one needs to find a way to asses the value of matrix exponential norm. It is rather obvious that determination of such norm explicitly, especially as a function of observer parameters, is difficult, if not entirely impossible. Let us introduce the following.Definition 1.
(Damping coefficient). A real numberμA will be called a damping coefficient of matrix exponential of A if(28)μA=limΔ⟶0+I+ΔA−1Δ.
Norm of the matrix exponential fulfills the following bound:(29)eAt≤eμAt.
The exact value of a damping coefficient depends on the norm used in Definition1. For spectral norm, we have(30)μA=λmaxA+AT2.
For more details on damping coefficient (under the name logarithmic norm), see [23]. As it can be seen if damping coefficient is negative, then matrix exponential of A is a contraction semigroup.
In this paper, this methodology was used for design of the observer. The main idea was to find observer gainG which would lead minimal damping coefficient, and if that coefficient would be negative, then this gain would be used. That proved to be the case, and the gain being the solution to(31)G=argmingmaxλ12A−gC+AT−CTgT.
This optimisation problem was well conditioned and easily solvable with a Nelder–Mead algorithm.


## 7. Observer Comparison

In this section, comparison of observers obtained with three described methods is presented. For every case, the evolution of Euclidean norm of the system is analysed. For each case, plots of the norm are presented in linear and logarithmic scales. The principal reason for using both these scales is that, in all cases, error should vanish approximately exponentially. It is easily visible in the initial stages on the linear scale; however, when the error drops few orders of magnitude, the differences stop being visible. In logarithmic scale however, the exponential trend is visible as the straight line, and one can easily observe error behaviour for all orders of magnitude. It should be noted that because the times of integration of differential equations are long, special consideration has to be taken with the respect to solver. Initially, the Dormand–Prince 5(4) solver was used; however, it introduced artificial oscillations. It was replaced with a Kolpfstein–Shampine 1–5 solver, which is dedicated for stiff equations, and these oscillations were eliminated.The first system presented is the estimator using only model. Its operation is illustrated in Figure3. Figure 3(a) presents vanishing of the error in linear scale, and Figure 3(b) shows strictly exponential behaviour. It can be seen as the point of reference for other observers, which should at least produce some improvement.Figure 3
Norm of estimation error for pure model estimation in standard (linear) (a) and logarithmic (b) scales. Error slowly and monotonically decreases in an exponential way.
(a)(b)The second observer analysed was based on eigenvalue shifting. Its operation is illustrated in Figure4. It can be easily seen that peaking phenomena occur. The error norm has two maxima visible both in linear (Figure 4(a)) and logarithmic scales (Figure 4(b)). Initial error is multiplied by 10. In logarithmic scale, it can be seen that reduction to the order 100 occurs faster than for pure model, and reduction of error from that is the the fastest up till order 10−3. The system however exhibits oscillations that make further reduction impossible. These oscillations are connected with a conjugate complex pair of eigenvalues:(32)λ≈1.6⋅10−51±0.1j,of the observer matrix A−GC. Appearance of complex eigenvalues is the consequence of the optimisation-based eigenvalue shifting approach.Figure 4
Norm of estimation error for observer based on eigenvalue shifting. Observer introduces large transitory error and low magnitude oscillations in the steady state. (a) Linear vertical scale. (b) Logarithmic vertical scale.
(a)(b)The final analysed observer was based on obtaining contraction semigroup. Its operation is illustrated in Figure5. As it can be seen, this observer does not introduce errors visible as in the case of the previous one. The observer is the fastest to reach the order of magnitude of 100 and does not introduce transitional errors. What is important, the observer keeps the exponential vanishing of error throughout the simulation.Figure 5
Norm of estimation error for observer based on contraction semigroup. Error vanishes exponentially, faster than the pure model. (a) Linear vertical scale. (b) Logarithmic vertical scale.
(a)(b)For comparison of observer performance, it is best to view the error behaviour at the same plot. Because the biggest difference is visible both for high (transitional error) and low (oscillations) orders of magnitude, trajectories are presented in the logarithmic scale in Figure6. One can observe as follows:(i)
Both eigenvalue shifting and contraction semigroup approach lead to improvement over pure model simulation.(ii)
The fastest initial reduction (until order of100) is obtained with the contraction semigroup observer, which does not introduce initial errors.(iii)
Eigenvalue shifting allows very quick reduction of the error to the order of10−3. However, presence of oscillations stops the exponential vanishing at that level.(iv)
Contraction semigroup observer keeps the exponential trend till the end of simulation, overtaking in error reduction.Figure 6
Comparison of estimation errors in logarithmic scale for all of the observers. During initial 100 seconds contraction, semigroup design shows the fastest error vanishing (corresponding to error less than 1°C). In that period, eigenvalue shfting design introduces transitional error up to an order of magnitude greater than the initial one. After 100 seconds, eigenvalue shifting design reduces error faster but then starts oscillating. Contraction semigroup design reduces error monotonically till the end.


## 8. Conclusions

Analysis of methods of observer parameter tuning shows advantages of contraction semigroup approach to others considered. However the problem of observer tuning for detectable systems is still open, as this approach can be applied only for a specific class of systems, which is not fully defined.It should be noted that both proposed observer tuning methods have their strengths. Eigenvalue shifting observer allows quick reduction of error to relatively low values. Unfortunately it introduces transitional errors, which can lead to very completely unsuitable control. In extreme cases, it could lead to temperature oscillations in the building, which would lead to a drastic comfort reduction. Contraction semigroup observer guarantees that no transitional error will be greater than the initial one. This along with initial convergence suggests this observer as the suggested one for building control applications. Unfortunately, lack of observability of the system does not allow combination of the two—construction of the switching function based on available measurements is impossible.



---

*Source: 3404951-2020-09-25.xml*