# Automated Methodology for Dependability Evaluation of Wireless Visual Sensor Networks
## 3 Problem Formulation and Background
### Battery Modeling  
Based on [PERSON]'s law [57; 58; 59], which expresses the battery lifetime given an initial capacity \(C\), the trend of the battery discharging process with respect to the time is represented by Equation (5). In this equation, \(c_{0}\) is the initial capacity of the battery (expressed in Ampere-hour), \(I\) is the average continuous discharge current (measured in Ampere), \(H\) is the hour rating (hours), whereas \(\eta\) expresses the Peukert's constant, which depends on the battery material (e.g., 1.06 to 1.13 for lithium ion batteries and 1.2 to 1.4 for alkaline batteries). \[c\left(t\right)=c_{0}-I\cdot H\cdot\left(\frac{t}{H}\right)^{\frac{1}{\eta}}. \tag{5}\]  
The battery behavior presented in Equation (5) is nonlinear and cannot be modeled using the same reasoning of the hardware modeling. To cope with this problem and to evaluate the battery availability, we propose an approximation of the nonlinear battery discharging behavior by a stochastic process, following the approach proposed by [PERSON] et al. [60]. First, the battery's useful charge range is identified as \(\left[c_{0},c_{\min}\right]\), splitting it into \(n\) contiguous intervals \(\left[c_{i},c_{i+1}\right]\) of equal size \(\left(c_{0}-c_{\min}\right)/n\), with \(i=0,\ldots,n-1\). That way, the battery capacity is discretized into \(n+1\) charge levels with generic value \(c_{i}=c(t_{i})\) (\(i=0,\ldots,n\)), where \(c_{n}=c_{\min}\). It is assumed that the duration of the \(i\)-th time interval, \(\tau_{i}=t_{i+1}-t_{i}\), with \(i=0,\ldots,n-1\), can be described by an exponential distribution, in which the charge assumes values ranging into \(\left[c_{i},c_{i+1}\right]\). Based on these assumptions, the discharge phenomenon can be represented by a CTMC with \(n+1\) stages, defined by the stochastic process \(B=\left\{B\left(t\right),t\geq 0\right\}\), as shown in Figure 5.  
In this CTMC, the state \(B_{i}\) represents the \(i\)-th charge interval, \(\tau_{i}\) can be considered as the sojourn time into the state \(B_{i}\) and, as a consequence, the transition rate between states \(B_{i}\) and \(B_{i+1}\) has to be set to \(\lambda_{bit}=1/\tau_{i}\). The discharge rates \(\lambda_{bit}\) would be analogous to a set of battery failure rates, since these rates imply that the system will eventually reach a failed state. \(B_{n}\) is an absorbing state that represents the \(c_{\min}\) level. The probability of the battery being discharged (\(c(t)\leq c_{\min}\)) is \(Prob\left\{B_{n}(t)\right\}\)  
Figure 4: Hardware model. and, consequently, the probability of the battery being a working (\(c(t)\geq c_{\text{min}}\)) can be computed as \(1-Prob\left\{B_{n}(t)\right\}\). When the battery discharges below the minimal operational level (\(c_{\text{min}}\)), it can be replaced or recharged, which is analogous to a repair. For the same reasons presented in Section 3.2.1, we model battery repair actions by a constant repair rate \(\mu_{bt}\). For the battery availability evaluation, we propose the CTMC model presented in Figure 6, where the state \(DOWN\) is equivalent to the state \(B_{n}\) from Figure 5, and it is the only one which triggers the repair action. However, when the WVSN active-sleep cycle operation is considered, this approach becomes inaccurate [61]. For this purpose, considering that the battery current is almost constant in the active state and that it is negligible (\(\approx\)0) in the sleep state, [PERSON] et al. [14] characterize the active-sleep cycle by a duty-cycle \(DC\), which is the percentage of time that a node stays in the active state. In this case, the amount of battery discharge in a interval \(\tau_{i}\) is now proportional to \(DC\). This is equivalent to assuming that the sojourn time for each state \(B_{i}\) is \(\tau_{i}/DC\).