Numerical optimization of the transfer function of the intelligent building management system

The paper deals with structural-parametric models for describing dynamic processes of technical systems of an intelligent building. The task of searching for the transfer function of the synthesized elements and devices of its information-measuring and control systems based on the Mason method is formalized. The components of the transfer function are presented in the form of characteristic polynomials in the structural scheme of the energy-information model of the circuit. The results of a comparative analysis of search methods for multiple real and complex conjugate polynomial roots are presented. To organize their search, an iterative method of unconditional optimization of FletcherReeves was chosen. This conjugate gradient method allows to solve the problem of numerical optimization in a finite number of steps and shows the best convergence in comparison with the methods of the fastest descent, with the same order of difficulty of performing the steps of the algorithm.


Introduction
Management of an intelligent building is based on the collection and processing of information coming from elements of controlled engineering systems, represented as an extensive network of sensors and actuators [1][2][3][4][5][6][7][8][9]. The incoming data characterize the external impact and the response of the chain of a certain physical nature. To be able to assess changes in its parameters in a structurally formalized language for describing processes in technical devices, it is necessary to build an energy-information model of the circuit [10,11]. According to this model, the relationship between the quantities and parameters of the chains is determined by formula transformations through a system of energy, static and dynamic criteria.
The criteria of the energy-information model of the circuit, provided that the parameters are quasi-constant, can be represented in the operator form:

Methods
Since the main task of the system's core is to obtain an analytical function of a parametric block diagram at a given point, a method was chosen based on obtaining the Laplace map of the desired transfer function and its translation into the original area.
In this case, the operation of each individual circuit circuit block can be described as a linear differential equation: The search for a solution to the resulting system of equations reduces to the definition of an analytic representation of functions 1 ( ), … , ( ), 1 ( ), … , ( ) for a given ( ), produced by the generator G(t).
To determine the dynamic characteristics of systems built according to similar rules, we use the Mason automated calculation method. [12,13]. The main idea of this method is that the system is represented as a directed graph, in which arcs are equivalent to elementary links (blocks), and vertices -to signal transmission lines. The direction of the arc corresponds to the direction of movement of the signal. The control point at which the desired function will be calculated can only be a vertex. Since each vertex may be incident, both along the incoming and outgoing arcs, the signal at the vertex is a superposition of the output signals of the blocks corresponding to the arcs entering the vertex. The generator is represented by an arc, the initial vertex of which can only be outgoing.
The Laplace transfer function in a fixed r-vertex of a directed graph is calculated by the formula: where ( ( ))  is the mapping of the desired process;  number of generators; ( ( ))  display of the function generated by the i-th generator;  the final vertex of the arc corresponding to the i-th generator; ,  is the transfer function of the circuit that converts the signal coming from the vertex into the signal arriving at the vertex r.
As a result of the implementation of the Mason algorithm, we obtain the transfer function of the entire system: The inverse Laplace transform allows you to get the original function f (t) in its image F(p):

Results and Discussion
The use of this expression is very difficult, especially for complex expressions F (p). Therefore, more acceptable methods of determining the original f (t) were developed. To move from the image of L {F (p)} to the original, you need to convert it to a rational fraction, decompose it into simple fractions and, using table transformations, present the sum of the simplest fractions as the sum of their corresponding originals. As a result of the implementation of the developed algorithms for working with an oriented graph, the transfer function of the structural scheme, defined by the Mason formula, can be expressed in terms of the transfer functions of the elementary links.
Consider the transformation of the transfer function of the structural scheme from the display to the original, i.e. to real dynamic response: Each rational function of p appearing in the denominator of the transfer function of the structural scheme is represented as a polynomial and is a characteristic polynomial of this structural scheme, and an equation of the form: is a characteristic equation of the structural scheme, which has n roots, among which can be both real multiples and complex conjugates.
It is known that any regular rational fraction , whose denominator is factorialized: can be represented (and in this unique way) in the form of the following sum of simple fractions: each of which is a transfer function of the link of the structural diagram.
For such a representation ( ) ( ) you need to find the roots of the polynomial X (p) and determine the coefficients.
Case 1. The polynomial X (p) of the denominator has real roots of multiplicity . 1) the degree of the numerator m of the polynomial Y (p) is greater than the degree of the denominator n of the polynomial X (p): when n≤m, the numerator is divided by the denominator according to Gorner's scheme, then step 2), 2) the degree of the numerator m of the polynomial Y (p) is less than the denominator n of the polynomial X (p): for n≥m, the transfer functions of the structural scheme are represented as the sum of the elementary fractions corresponding to the roots (of multiplicity ) of the polynomial X (p): To find the roots of the characteristic equation of the structural scheme, classical methods are used. [14,15].
Comparative results of methods for finding real multiple roots of a polynomial are presented in table 1. To organize the search for real roots of the multiplicity of the characteristic equation of the structural scheme, the Stephenson method was chosen, despite the fact that an increased number of iterations due to the replacement of approximation by a derivative with a computational expression leads to a new iterative algorithm. However, due to this, there is no need to calculate the derivatives at each step, and the difficulty of implementation at the program level is sharply reduced.
The main iterative steps of the Stephenson method [16,17] can be represented as follows.
1. Let be the current approach to the root and ∆ = − . 2. Find the point = +1 as the following root refinement. 3. Then we come to the iterative algorithm: which underlies the Stephenson method.
For the decomposition of a rational fraction In this case, the elementary fractions correspond to an arbitrary pair of complex conjugate roots : With all the variety and variability of the numerical implementation of algorithms for the organization of their search, one of the methods of conjugate gradients was chosen, namely the iterative method of unconditional Fletcher-Reeves optimization [19].
The methods of conjugate gradients are based on the calculation of the values of only the first derivatives and have positive properties in comparison with the Newtonian methods (Cauchy, Newton and others), which are referred to the methods using second order derivatives. Newton's methods guarantee obtaining a minimum of nonlinear functions of the goal, but it is impossible to judge in advance the number of necessary iterations even for the case of quadratic functions of the goal. The methods of conjugate gradients guarantee the achievement of a minimum of a quadratic goal function in a finite number of steps, not exceeding the value of n, the dimension of the space [20]. Such methods are called quadratically convergent, since the rate of convergence is quadratic. This is a significant advantage when compared with conventional gradient methods (the steepest descent method or the coordinate descent method). Conjugate gradient methods converge 4-5 times faster than the fastest descent method. These methods are highly reliable and quickly converge in the vicinity of the minimum point. They allow you to guarantee convergence in a finite number of steps, and the required accuracy can be achieved much earlier.
Comparative results of methods for finding complex conjugate roots of a polynomial are presented in Table 2. The advantage of the Fletcher-Reeves algorithm is that it does not require timeconsuming computations of second partial derivatives like Newton's methods and saves computer memory, since it does not need Hessian matrices used in Newton's method and other second-order methods. At the same time, this method is almost as effective as quasi-Newton algorithms [15].
The Fletcher-Reeves method allows us to find the minimum of a nonlinear objective function of several variables [17]. For this, the complex conjugate roots are represented as a function of two variables: where 1 = , 2 = Im , 1 = , 2 = Im . Then the problem of finding the roots of a polynomial is equivalent to the problem: Such a formulation of the problem extends to the search for all roots of a polynomial, both real multiple and complex conjugate.
Consider the Fletcher-Reeves algorithm in more detail. In this method, the direction of steepest descent is rejected by adding to it the direction used in the previous step. As a result, a sequence of search directions is built. ( ) , which are linear combinations of the gradient of the current direction of the fastest descent [−∇ ( ( ) )], and previous research directions -( ) , i. е.
The values of weighting coefficients are chosen so that the new direction ( ) it was associated with all previous directions. With this criterion for the end of the search is the condition: (∇ 2 ( ( ) ), ( ) ) = 0 (20) It is proved that: where ‖∇ ( ( ) )‖ 2 -the gradient modulus determines the rate of increase or decrease of the function in the direction of the gradient or anti-gradient, respectively. This condition allows us to build a fast and efficient algorithm for searching for extrema. As a result, the Fletcher-Reeves algorithm can be written as follows: 1) Set > 0, 1 to the starting point, (1) = −∇ ( 1 ) and set (1) = (1) , = = 1.

Conclusion
The Fletcher-Reeves algorithm is sensitive to the accuracy of a one-dimensional search, so when using it, you need to eliminate any rounding errors that may occur. There is no guarantee of convergence always and everywhere in the algorithm, but as shown by practical calculations, the algorithm almost always leads to an approximate optimum. The main advantage of the conjugate gradient method is that it allows to solve the optimization problem in a finite number of steps and shows better convergence in comparison with the methods of the fastest descent, with the same order of complexity of the steps of the algorithm.
Thus, to go from the image to the original of the transfer function of the parametric structural scheme, you must perform the following steps: 1. Find the roots of the denominator of the output transfer function using the Fletcher-Reeves algorithm.
2. Decompose the output transfer function into elementary terms. 3. Translate elementary terms into the original area and present the original output transfer function as a whole.