Hidden Markov Model and States Prediction of an Autonomous Wind-Diesel Complex

. The problem of assessing the reliability and analyzing the functioning of an autonomous wind-diesel complex, consisting of a wind power plant, working and standby diesel generators, an inverter and a storage battery, is considered. First, a semi-Markov model of an autonomous wind-diesel complex is built, which makes it possible to calculate the stationary and temporal reliability characteristics. Then, on its basis, a hidden Markov model is developed, which is used to solve the problems of predicting and evaluating its characteristics, taking into account the given parameters and the signal vector. The results of the study are obtained in a general form and are invariant with respect to the laws of distribution of random variables describing the elements of an autonomous wind-diesel complex. They allow you to simulate the functioning of the system under various distribution laws, based on statistical data, without modifying the model itself.


Introduction
Currently, renewable energy sources are being introduced into power supply system's everywhere.The combined use of wind turbines and diesel generators contributes not only to economic benefits, but also to the reduction of emissions of fuel processing products.[10,2] However, the efficiency of wind turbines depends on many factors, in particular, on the wind load, which is stochastic.In this regard, the problem arises of constructing adequate mathematical models that take into account the stochastic nature of work and the natural resources used (for example, wind) and the presence of a diesel generator (backup energy source).
The article [3] considers an approximate model of a wind-diesel complex in Matlab\Simulink.Articles [4,5] present the results of simulation studies.In [6,7], the assessment of the operating modes of the power supply complex with a wind-diesel power plant is studied.In [1,2], Markov models are used to analyze the functioning of a wind-diesel complex.It should be noted that most of the results obtained by other authors consider cases where the random variables describing the system have an exponential distribution (Markov model).The semi-Markov model proposed in this article allows the use of distributions of an arbitrary form.It also allows you to find the time characteristics of the reliability and efficiency of the system, in contrast to the Markov model.
Secondly, for territorially remote systems (or systems controlled remotely), the operator is not always able to completely obtain the information contained in the encoding of the states of the semi-Markov model when changing their states, but it is always possible to obtain some signal (information) associated with the states of the nested chain Markov, which can be considered unobservable (hidden).In such cases, the use of the theory of hidden Markov models makes it possible to solve the problems of finding and estimating characteristics based on the observed signal vector.The purpose of our work is to apply the theory of semi-Markov processes with a common phase space of states and the theory of hidden Markov models for the analysis of reliability and efficiency of an autonomous wind-diesel complex (WDC).
This article discusses the problem of assessing the reliability and analysis of the functioning of an autonomous WDC, consisting of a wind power plant, working and standby diesel generators, an inverter and a storage battery.
In this paper, first, a semi-Markov model [8][9][10][11][12] of an autonomous WDC is constructed, which makes it possible to calculate the stationary and temporal characteristics of reliability.Then, following the methodology proposed by the authors [18], a hidden Markov model [15][16][17] is developed on its basis, which is used to solve forecasting problems and evaluate its characteristics, taking into account the given parameters.
battery to be absolutely reliable in the sense that the probability of their failure is much less than the probability of failure of other elements.Therefore, we will not take them into account when constructing a semi-Markov model.Then the system S can be represented as a three-element system with a time reserve: element 1 is a wind turbine, element 2 is a diesel generator (DG), element 3 is a reserve diesel generator (RDG) (time reserve).The failure of element 1 should be understood as any event that leads to disruption of normal functioning (for example, lack of wind, failure of one of the components, etc.).The system functions as follows: if element 1 (2) fails, then element 2 (1) is switched off, element 3 is switched on, and the system operates due to the reserve of time (element 3).As soon as element 1 (2) is restored, element 3 is switched off (in this case, we assume that by the next time its characteristics are fully restored), and element 2 (1) starts working with the previous level of operating time.System failure occurs when element 1 (2) is on recovery, element 2 (1) is disabled, and the reserve time ends (failure of element 3).The reserve of time ends if either the fuel of the backup generator runs out (time of operation due to the reserve of fuel), or it fails.
Let`s assume that the uptime of elements 1 and 2 are described by random variables (RV) α and α , respectively, having distribution functions F x P α x , F x P α x and density distributions f x , f x , and the recovery time -by random variables β and β , having distribution functions G x P β x , G x P β x and distribution density g x , g x .A random instantly replenished reserve of time is considered, which is described by RV τ having the distribution function R x P τ x and distribution density r x .Random variables α , α , β , β , τ are assumed to be independent and have finite mathematical expectations.It should be noted that SV τ is the minimum of the operating time due to the fuel reserve of the standby generator and its uptime.
On fig. 1 is shown a block diagram of the system under consideration.
Consider the discrete-continuous phase space of states of the system under consideration: Phase states are designated according to the following scheme: the first digit of the code indicates the number of the element in which the state change occurred; the rest of the numbers -what happens to each element (1 -work, 2 -disabled, 0 -recovery).The continuous components show the time remaining until the next state change.Let`s write down the probabilities of transitions between the states of the system: Let`s write down the system of equations for finding the stationary distribution of the embedded Markov chain.
Let `s substitute equation 5 into equation 1 of system (3).We`ll get Similarly, substituting equation 6 into equation 2 of system (3), we obtain: Consequently, system (3) is reduced to the form: The solution to system (4) was found in [12] and has the form: the constant  is found from the normalization condition.Stay times in system states: where ∧ is the sign of the minimum.
Then the average residence times in the states are equal to: ,   .
We divide the state space E into two nonoverlapping subsets: healthy ( ) and failure states ( ): Let`s find the stationary characteristics of the system reliability.
Using transition probabilities (2), stationary distribution (5), average residence times in states (7) Where indicated above:   -average residence times in states,  , probabilities of transition from operable to failure states,   ∧  -mathematical expectation of the minimum of two RVs,    -mathematical expectation of that RV β is greater than RV τ, Using the formulas presented in [12,13] and the expressions found above, we obtain: As an illustrative example of the use of formulas ( 8)-( 9), consider the system S, for which, before the start of its operation, it is assumed that the RVs α , α , β ,

Finding the transition probabilities of the enlarged semi-Markov model
To construct a hidden Markov model (HMM), we enlarge the stationary distributions (5) in terms of continuous components, i.e. we apply the algorithm of stationary phase enlargement to each state.Note that the phase space of semi-Markov states is obtained by adding to the codes of physical states a set of continuous components that fix the residual times of the action of factors that change the state of the system.[13]  Then the matrix of transition probabilities  between the enlarged states of the system is equal to:

Hidden Markov model of the system under consideration
For a complete description of the HMM [16,17], it is necessary to determine: 1.The set of model states corresponds to the set of states of the enlarged model  .

Observable sequence alphabet (set of signals).
Let`s assume that during the functioning of the system S, the states of the EMC of the enlarged model are not observed (hidden states), but only the number of operable elements is observed during the change of states of the HMM.We introduce the following set of signals: 0, 1, 2 , where  0 -system failure;  1 -elements 1 and 2 of the system are functioning;  2 -the system is operational due to the backup diesel generator.Many signals can be selected in different ways.The set of signals J is chosen in this form, because "Accurate" information about the number of operable main and redundant elements can be obtained for almost any system.

The matrix of transition probabilities between
system states.
For our model, the transition probability matrix consists of the transition probabilities  of the enlarged semi-Markov model.

Connection of model states with signals.
Consider the relationship between the states of the embedded Markov chain (EMC) of the enlarged model and signals, i.e. define the connection function  | [16,18]: where  is the n-th signal.We assume that signals 0 and 2 are emitted correctly with a probability of 0.99 and erroneously with a probability of 0.01.
The function  | of the connection between the NCM states of the integrated digital model and the signals is presented in Table 1.

5.
The initial probability distribution of the model.
We will assume that at the initial moment of time the enlarged model can be equally likely to be in the state 1112 or 2112.
The HMM is built on the basis of the enlarged semi-Markov model.

Evaluation of characteristics and prediction of states
As an illustrative example, consider a system S, for which, before starting its operation, it is assumed that the CVs  ,  ,  ,  have an Erlang distribution of order IV and  150 h,  100 h,  24 h,  20 h,  15 h.It is assumed that at the initial time the system is in states 1112 and 2112 with probabilities of 0.5.
Suppose that as a result of the operation of the system S, the following vector of signals is received: Consider the problem of estimating the characteristics of a hidden Markov model, taking into account the introduced parameters, following [18,19].
1. Let`s determine the probabilities of states of the hidden model at the moment of emission of the 30th signal (the last signal in the chain).
Because the 30th signal is equal to 1 (elements 1 and 2 of the system are functioning), then the task is to determine the probability of finding the enlarged system in states leading to the emission of the specified signal.As a result, we get that at the 30th step the enlarged model with a probability of 0.3553 was in state 1112, with a probability of 0.6447 in state 2112.For other states, this probability is equal to zero.The probabilities of the transition of the hidden model at the 31st step: to state 1021 with a probability of 0.419, to state 2201 -0.581, to all others -with zero.
3. Let's determine the probabilities of the appearance of signals at the next 31st step.
We get that the probability of the appearance of signal 2 at the 31st step is 0.99, signal 0 -0.01, signal 1 -0.
4. Let's find the probability of occurrence (emission) of the received signal vector  .
The probability of occurrence of the received signal vector  is equal to 0.00000243.

5.
Forecasting the states of the hidden model based on the received signal vector.
Table 2 shows the most probable states of the hidden model at the transitions indicated in it and the probabilities of these states.Applying the Baum-Welsh algorithm [15,16], we obtain an overestimated matrix of transition probabilities for the system under consideration.The original transition probability matrix and the transition probability matrix after reassessment are presented in Fig. 3.
Applying the Viterbi algorithm [15,16] to the overestimated model, we determine the most probable chain of states for the received signal vector:

Discussions
The results of this article open up great opportunities for evaluating the functioning of autonomous winddiesel complexes.The article shows how to apply the apparatus of the theory of hidden Markov models (used for systems with a finite set of states) to semi-Markov models that have a common phase space of states, which expands the possibilities of applying the HMM theory.
The article provides only illustrative examples showing the expansion of the possibilities of modeling autonomous wind-diesel complexes using the methodology developed by the authors.However, it is obvious that it will not be difficult for energy specialists to use the parameters of real wind-diesel complexes as input data for models with subsequent calculation of characteristics.
It should be noted that the results obtained, with proper reformulation, can be used to analyze the functioning of technical systems for various purposes.

Conclusion
In this work, a semi-Markov model of an autonomous WDC is constructed, which allows calculating the stationary and temporal reliability characteristics.Then, on its basis, a hidden Markov model was developed, which is used to find estimates of the characteristics of an autonomous WDC and predict its states based on the signal vector obtained as a result of the operation.The results of the study will make it possible to predict the operating modes of an autonomous WDC.The resulting HMM allows you to re-evaluate the parameters of the constructed model (train) to increase its adequacy, according to the signals received in the process of functioning.
The results of the study are obtained in a general form and are invariant with respect to the distribution laws of random variables that describe the elements of an autonomous WDC.They allow you to simulate the functioning of the system under various distribution laws, based on statistical data, without modifying the model itself.In the future, it is planned to generalize the results for the case of a fleet (consisting of N pieces) of wind-diesel complexes.

Fig. 2 .
Fig. 2. Graphs of stationary reliability characteristics for different values of the reserve time h: a) mean uptime, b) mean recovery time, c) stationary availability factor.

Fig. 4 .
Fig. 4. The trellis of maximized transition probabilities for considered chain of signals The trellis diagram for the first 12 received signals is shown on fig.4.For simplicity, the following recoding of model states is used: 1112↔1, 2112↔2, 1021↔3, 2201↔4, 3020↔5, 3200↔6.The most probable states (according to the Viterbi algorithm for the overestimated model) for the vector of received signals are marked with a thick line.Thin lines connect other possible states that the system could achieve without information about the signal vector.

Fig. 3 .
Fig. 3. Transition probability matrices: a) original transition probability matrix , j i P b) overestimated transition probability matrix j i P .
The study was supported by the grant of the President of the Russian Federation for state support of young Russian scientists -Candidates of Sciences No. MK-329.2022.4.
Consequently, the discrete phase space of enlarged states of the system under consideration has the form: (11)g the formulas presented in[12, p. 36],     ,    ,        11we find the probabilities of transitions p between the enlarged states and the average sojourn times m in them.Let`s calculate the denominators of formulas(11).

Table 1 .
The connection function between the merged model EMC states and the signals.

Table 2 .
Most probable states of the hidden model on transitions.