WSN Nodes Placement Optimization Based on a Weighted Centroid Artificial Fish Swarm Algorithm

Aiming at optimal placement of wireless sensor network (WSN) nodes of wind turbine blade for health inspection, a weighted centroid artificial fish swarm algorithm (WC-AFSA) is proposed. A weighted centroid algorithm is applied to construct an initial fish population so to enhance the fish diversity and improve the search precision. Adaptive step based on dynamic parameter is used to jump out local optimal solution and improve the convergence speed. Optimal sensor placement is realized by minimizing the maximum off-diagonal elements of the modal assurance criterion as the objective function. Five typical test functions are applied to verify the effectiveness of the algorithm, and optimal placement of WSNs nodes on wind turbine blade is carried out. The results show that WC-AFSA has better optimization effect than AFSA, which can solve the problem of optimal arrangement of blade WSNs nodes.


Introduction
Blade is one of the key components of the wind turbine.It is responsible for converting wind energy into rotational mechanical energy of wind turbine rotors.The wind turbine blade is extremely easy to suffer varying degrees of damage under the influence of environment of wind, sand, ice, thunder and lightning, as well as a variety of stress concentrations, leading to the shutdown of the wind turbine, and serious economic losses.The volume and mass of wind turbine blade are huge, so it is difficult to maintain manually, with high maintenance costs.Therefore, in order to decrease the risk of operation, while reducing maintenance costs, it is of great significance to carry out health monitoring in the wind turbine blade structure, especially identify the damage state quickly and accurately [1,2].
In this work, modal test is made for the health monitoring of blades.Attach a certain number of sensors on the blades to extract modal parameters.Due to the relative motion between the blades and cabin, it is inconvenient to transmit data through wired mode.At the same time, owing to the large number of sensors and complex wire arrangement, it is very convenient to use wireless sensors to transmit the real-time information about blade's health state to receiver.
Wireless sensor networks (WSNs) [3] are usually deployed in complex monitoring areas where the environment is harsh and is inaccessible to people.Deployment of WSNs can enlarge the transmission distance and make the system not easily disturbed by the environment.The wireless sensor network adopts an ad hoc network and multi-hop technology, which greatly reduces the cost of the monitoring system, and makes the installation and maintenance of the sensor network very convenient and fast.By changing the topology of the network in WSNs dynamically, energy consumption is reduced, network capacity and life are increased and collisions between nodes are avoided [4,5].The topology control of WSNs is divided into the network topology establishment stage and the network topology maintenance stage.To ensure that the complex topology can operate, as well as the simple topology built initially, a reasonable topology control algorithm is needed [6].WSNs technology has attracted more and more attention in recent years [7,8].
By means of WSNs, we can collect, process, and analyze the data reflecting the blade's health state.However, there are few studies on the optimal placement of WSNs for wind turbine blades monitoring.The artificial fish swarm algorithm (AFSA) is a new kind of swarm intelligence optimization algorithm based on the behavior of fish [9,10].The basic idea of AFSA is to imitate the fish behaviors such as prey, swarm, and follow.AFSA is simple in principle and has some good features such as robustness, and tolerance of parameter setting.This algorithm has some disadvantages yet.Non-uniform distribution deduced by randomly generating initial fish population decreases the global search ability of the algorithm.The search step of each fish is fixed.At the early iteration, the algorithm is easy to fall into local minimum.
To solve the above problems, a weighted centroid algorithm (WCA) [11] is introduced to the artificial fish swarm algorithm (AFSA) to initialize the fish swarm in this work.By measuring the distance between nodes, localization compensation error and adaptive search step, the convergence speed and optimization precision are improved.

Mathematical Model of Blades WSNs Nodes Optimal Placement
To carry out finite element model (FEM), the essential is to obtain the three mechanical properties: displacement, strain and stress.For the complex structure like wind turbine blades, after analyzing the above three mechanical properties, we can evaluate the structures' strength and stiffness to obtain the structure's vibration characteristics parameters such as frequency and mode shapes which provide theory support for structure health monitoring, damage identification and analysis of dynamic characteristics.
Establish the FEM of wind turbine blade, and extract mode shape matrix φ n×m .n denotes the number of degrees of freedom (DOFs), namely, the number of candidate sensor positions.m denotes the order number of mode shapes.Select s DOFs from n DOFs as the final sensor locations.In order to ensure the measured modal vectors being easily distinguished, modal assurance criterion (MAC) [12] is applied to evaluate the measured modal vectors.The maximum off-diagonal element of MAC is taken as the objective function of minimum problem.The mathematical model can be expressed as: where 0 ≤ f (φ s×m ) ≤ 1. φ i and φ j represent the ith and jth column vectors in matrix φ, respectively.The superscript T denotes the transpose of the vector.If the off-diagonal elements of MAC ij (i = j) tend to zero, which indicates that there is little correlation between the modal vector i and j, that is to say, the modal vector can be distinguished easily.
The objective function of blade WSNs nodes optimal placement can be expressed as: (2)

Weighted Centroid Fish Swarm Algorithm
In this paper, the weighted centroid fish swarm algorithm is used for global search.The weighted centroid algorithm and adaptive search step are introduced to improve the search capability.

Principle of the AFSA
In water, fish are most likely distributed around the field with the most abundant food.A fish swarm completes its food foraging process by several social behaviors.AFSA, inspired by the behaviors of fish, is a novel method for searching the global optimum.It is a random search algorithm based on simulating fish swarm behaviors, which include prey behavior, swarm behavior, follow behavior and random behavior.
Suppose the current state of an artificial fish is X = (x 1 , x 2 , . . ., x n ).Visual is the perception scope of an artificial fish, which determines the moving direction of each artificial fish.
Step is the maximum moving step length.To avoid missing the optimal solutions, Step should not be set too large.X v = (x 1 , x 2 , . . ., x n ) is the location at certain moment.Visual and Step are shown in Figure 1.
where rand ( ) produces random number between 0 and 1.
Algorithms 2018, 11, x FOR PEER REVIEW 3 of 14 In water, fish are most likely distributed around the field with the most abundant food.A fish swarm completes its food foraging process by several social behaviors.AFSA, inspired by the behaviors of fish, is a novel method for searching the global optimum.It is a random search algorithm based on simulating fish swarm behaviors, which include prey behavior, swarm behavior, follow behavior and random behavior.
Suppose the current state of an artificial fish is Visual is the perception scope of an artificial fish, which determines the moving direction of each artificial fish.
Step is the maximum moving step length.To avoid missing the optimal solutions, Step should not be set too large.
1 2 ( , ,..., ) is the location at certain moment.Visual and Step are shown in Figure 1.
where rand ( ) produces random number between 0 and 1.

. Binary Coding
Binary coding is intuitive and convenient for the optimal sensor placement problem [13].Let n denote the initial number of candidate sensors and s denote the final number of sensors determined.
The binary coding for a solution can be expressed as T 0 1 = ( , ,..., ... ) , there is a sensor on that DOF.If = 0 j x , there is no sensor on that DOF.The condition x x j n  in X.For convenience, this process is represented by Equation (4): where the modal matrix s m   is a solution for placing s sensors in optimal sensor placement; ×1 n X is the binary coding corresponding to a solution.

Binary Coding
Binary coding is intuitive and convenient for the optimal sensor placement problem [13].Let n denote the initial number of candidate sensors and s denote the final number of sensors determined.The binary coding for a solution can be expressed as X = (x 0 , x 1 , . . ., x j , . . ., x n ) T , j ∈ {1, 2, . . . ,n}.If x j = 1, there is a sensor on that DOF.If x j = 0, there is no sensor on that DOF.The condition The conversion between binary coding X and modal matrix φ s×m is the process of removing the rows of φ n×m .In this process, remove those rows of φ n×m corresponding to those x j x j = 0, j ∈ [1, 2, . . ., n] in X.For convenience, this process is represented by Equation (4): where the modal matrix φ s×m is a solution for placing s sensors in optimal sensor placement; X n×1 is the binary coding corresponding to a solution.For a simple example, substituting n = 4, m = 2, s = 3 and X 4×1 = (1, 0, 1, 1) T into Equation ( 4), and take as the input modal matrix of function g, the output modal matrix of g is × X into Equation ( 4), and take 4 2 as the input modal matrix of function g, the output modal matrix of g is and can be easily obtained by deleting the second row of The core of the centroid algorithm (CA) is that unknown nodes estimate its location according to the geometric center combined with all its communications anchor nodes [11].The principle of centroid algorithm is shown in Figure 2. Select three nodes close to D to form trigon. Determine the trigon centroid.This is the location to be determined, which is expressed as: where n is the number of anchor nodes.The location ( , )  X Y of the nodes to be located is estimated based on the distance centroid method.Let T the uniform distributed random number between 0 and 1. Generate the initial fish swarm: as the input modal matrix of function g, the output modal matrix of g is and can be easily obtained by deleting the second row of The core of the centroid algorithm (CA) is that unknown nodes estimate its location according to the geometric center combined with all its communications anchor nodes [11].The principle of centroid algorithm is shown in Figure 2. In Figure 2, solid dots Select three nodes close to D to form trigon. Determine the trigon centroid.This is the location to be determined, which is expressed as: where n is the number of anchor nodes.The location ( , )  X Y of the nodes to be located is estimated based on the distance centroid method.Let T the uniform distributed random number between 0 and 1. Generate the initial fish swarm: The core of the centroid algorithm (CA) is that unknown nodes estimate its location according to the geometric center combined with all its communications anchor nodes [11].The principle of centroid algorithm is shown in Figure 2.
as the input modal matrix of function g, the output modal matrix of g is and can be easily obtained by deleting the second row of The core of the centroid algorithm (CA) is that unknown nodes estimate its location according to the geometric center combined with all its communications anchor nodes [11].The principle of centroid algorithm is shown in Figure 2. Select three nodes close to D to form trigon. Determine the trigon centroid.This is the location to be determined, which is expressed as: where n is the number of anchor nodes.
The location ( , ) X Y of the nodes to be located is estimated based on the distance centroid method.Let T the uniform distributed random number between 0 and 1. Generate the initial fish swarm:  In Figure 2, solid dots A(x 1 , y 1 ), B(x 2 , y 2 ) and C(x 3 , y 3 ) are the anchor nodes, and hollow dot D(X, Y)is the unknown nodes to be located.a, b, c are the distances between D and A, B, and C respectively.
Select three nodes close to D to form trigon. Determine the trigon centroid.This is the location to be determined, which is expressed as: where n is the number of anchor nodes.The location (X, Y) of the nodes to be located is estimated based on the distance centroid method.Let T the uniform distributed random number between 0 and 1. Generate the initial fish swarm: where The weighed centroid algorithm (WCA) rationally distributes the weights to make the location more precise.The less distance between the unknown node and anchor node, the greater the impact of the anchor node on the unknown node [14].WCA can be expressed as: where w ij is the weight of anchor node j to unknown node i, and w ij = 1/(d ij ) n ; P i (x, y) is the estimated location of unknown node i; B j (x, y) is the location of the anchor node j; d ij is the distance between the anchor node j and the unknown node i; n is weight coefficient ranging from 1 to 4; N is the number of the anchor nodes.
The average error location can be expressed as: where (x i , y i ) is the actual location of the unknown node; (x i , y i ) is the estimate location of the unknown node; R is the radio range of WSNs.
Figure 3 shows 50 WSNs nodes uniformly distributed with 100 × 100 m area.Suppose R is 50 m.From Figure 4, the error of CA is larger than that of WCA.The location determined by WCA is closer to actual location and more accurate.
x y is the actual location of the unknown node; ( , ) x y is the estimate locatio unknown node; R is the radio range of WSNs.
Figure 3 shows 50 WSNs nodes uniformly distributed with 100 100  m area.Suppose R From Figure 4, the error of CA is larger than that of WCA.The location determined by WC ser to actual location and more accurate.  .

Swarm Behavior
An artificial fish tends to move toward the central location of fish swarm.This is the swa avior.Swarm behavior is the main process for search local optimization, and the search tim er.step and the maximum iterations max N affect the accuracy and convergence speed of rithm.The larger step and the smaller max N , the faster convergence speed but lower precisi proper step should be determined.Here, we adopt one kind of adaptive step.In the ea tion, large step is used to accelerate convergence speed.With the increase of the number tions, the optimum solution is gradually approximated, then adopt a small step to refine ch and improve search precision.Assuming that the current iteration number is max N N  , the current state of an artificial fis Its fitness function is ( ) i f x .A new state within visual is j x , and the fitness function is ( ) Step rand x x ( ) . Adding the function rand ( ) i into the local optimum in order to prevent its convergence too quickly.
. Follow Behavior When one or several fish find a field where there is more food and it is not crowded, the rby will follow and move toward the food.This is the follow behavior.For the i-fish, cedure of follow behavior is as follows:

Swarm Behavior
An artificial fish tends to move toward the central location of fish swarm.This is the swarm behavior.Swarm behavior is the main process for search local optimization, and the search time is longer.step and the maximum iterations N max affect the accuracy and convergence speed of the algorithm.The larger step and the smaller N max , the faster convergence speed but lower precision.So, proper step should be determined.Here, we adopt one kind of adaptive step.In the early iteration, large step is used to accelerate convergence speed.With the increase of the number of iterations, the optimum solution is gradually approximated, then adopt a small step to refine the search and improve search precision.
Assuming that the current iteration number is N < N max , the current state of an artificial fish is x i .Its fitness function is f (x i ).A new state within visual is x j , and the fitness function is f (x j ).If f (x j ) < f (x i ), then we choose the moving Step = rand( ) × x j − x i .Adding the function rand ( ) is to get into the local optimum in order to prevent its convergence too quickly.

Follow Behavior
When one or several fish find a field where there is more food and it is not crowded, the fish nearby will follow and move toward the food.This is the follow behavior.For the i-fish, the procedure of follow behavior is as follows: Step 1: Randomly generate new location of artificial fish within x i on the interval [x ij − visual, x ij + visual], j = 1, 2, . . ., n; Step 2: Compute food concentration f (x i ).
, the new fish moves toward a new location; Step 3: Repeat (1), ( 2) until N max is reached.

Prey Behavior
An artificial fish follows the direction with high food concentration in prey behavior.Suppose the current state of an artificial fish is x i .Randomly select a new state x j within visual.If the food concentration is f (x j ) < f (x i ), the artificial fish moves one step toward x j ; otherwise, randomly reselect x j and judge whether it satisfies the condition of moving forward.If the condition cannot be satisfied until try_number is reached, the artificial fish randomly moves one step within visual.

Advantage Analysis of the Adaptive Step
The AFSA has a strong global search ability.However, in later iterations, the fish swarm gathers near the peak value, which makes the bot search precision and convergence speed slow.If the fixed step is large, it is easy to jump out of the optimal solution, but the accuracy of calculation is low.If the fixed step is small, the precision is improved, but the convergence speed is slow, it is easy to fall into the local optimum and difficult to jump out.
To solve the above problems, an adaptive step is introduced.In the initial optimization, the artificial fish, which is far away from the optimal value, adopts larger step to approach the optimum value quickly.When approaching the optimal value, make use of smaller step to improve the accuracy.The introduction of the adaptive step not only accelerates the convergence speed but also improves the accuracy of the solution.

Time Complexity Analysis
The effectiveness of the algorithm can be measured by time complexity.The basic operation count is regarded as the time complexity of the algorithm.We analyze the time complexity according to the implementation procedure of WCA-AFSA.

•
Initialization of N artificial fish needs N times.Time complexity is O(N).

•
Initialization of other parameters assigns once and compares N − 1 times.Time complexity is O(N).

•
Swarm behavior computes crowding factor N times, judges once, moves once, and swarms N times.Time complexity is O(N 2 + 2 × N).

•
Follow behavior searches the optimal value N times, computes crowding factor N times, judges once, moves once, and follows N times.Time complexity is O(2 × N 2 + 2 × N).

•
The frequency of prey behavior is, at most, try_number times, at least once.N artificial fishes prey N times.Time complexity is O(N × try_number).

Procedure of WCA-AFSA
Step 1: Initialize fish swarm.N is the size of artificial fish swarm.Set the number of maximum iterations, try the number of prey behavior, perception scope, initial step, and factor of crowding degree as N max , try_number, visual, a, and δ respectively.
Step 2: Obtain the maximum off-diagonal element of MAC.On the basis of modal matrix φ n×m , compute the objective function of each artificial fish according to Equation (2).
Step 3: Execute swarm and prey behavior.Move toward the direction of small objective function.If two behaviors both cannot satisfy the condition of moving forward, perform prey behavior.If try_number is reached and still cannot satisfy the condition of moving forward, carry out a random behavior.
Step 4: Re-compute the objective function value of each fish.If N max is reached then execute (5); otherwise execute (3).
Step 5: Determine the optimal solution according to Equation (2).The flow chart of WCA-AFSA is depicted in Figure 5.

WCA-AFSA Performance Test
Five benchmark functions, which include the Sphere function, Ackley function, Rastrigin function, Griewank function, and Rosenbrock function, are applied to verify the performance of the WCA-AFSA.These functions all have the features of multiple peaks and high dimension.

WCA-AFSA Performance Test
Five benchmark functions, which include the Sphere function, Ackley function, Rastrigin function, Griewank function, and Rosenbrock function, are applied to verify the performance of the WCA-AFSA.These functions all have the features of multiple peaks and high dimension.
(1) Sphere function: (2) Ackley's function: (3) Generalized Rastrigin's function: (4) Generalized Griewank's function: (5) Generalized Rosenbrock's function: Set the size of the artificial fish swarm N = 20, initial step = 0.5, and the number of maximum iterations N max = 120.The average value is listed in Table 1.From Table 1, the optimal actual average value by WCA-AFSA is smaller than that by AFSA.It demonstrates WCA-AFSA has higher convergence accuracy.The average time of WCA-AFSA is shorter than that by AFSA.It indicates WCA-AFSA is more effective.Figure 6 shows the comparison of the results.1, the optimal actual average value by WCA-AFSA is smaller than that by AFSA.It demonstrates WCA-AFSA has higher convergence accuracy.The average time of WCA-AFSA is shorter than that by AFSA.It indicates WCA-AFSA is more effective.Figure 6 shows the comparison of the results.
WCA-AFSA has better convergence precision and speed than AFSA.This means WCA-AFSA has better search ability.WCA-AFSA has better convergence precision and speed than AFSA.This means WCA-AFSA has better search ability.

Example of a Wind Turbine Blade
For a one megawatt level horizontal axis wind turbine blade, the length is 29 m.The blade material is glass fiber reinforced plastic.The density is 1950 kg/m 3 .The modulus of elasticity is 16.5 GPa.The Poisson ratio is 0.305.The first five mode shapes are shown in Figure 7.The first five mode frequencies and their mode shape features are listed in Table 2.The low order modes have major mode shapes contribution and can describe the structure dynamic characteristics.Thus, the first five modes are selected as the target modes.The low order modes are mainly in the form of waving vibration.The sensor placement focuses on the waving  The low order modes have major mode shapes contribution and can describe the structure dynamic characteristics.Thus, the first five modes are selected as the target modes.The low order modes are mainly in the form of waving vibration.The sensor placement focuses on the waving direction (Y direction in Figure 7) which is the main degrees of freedom (DOFs).There are a total of 1073 nodes (DOFs).Considering the difficulty of placing sensors in blade tip, the 36 DOFs in the blade tip are negligible.Therefore, there are a total of 1037 nodes (DOFs) which participate in computation.The first five mode matrix φ is a 1037 × 5 matrix.
Here, we place 10 WSNs nodes sensors.8a,b shows the MAC bar graph by AFSA and WCA-AFSA, respectively.Their maximum off-diagonal elements are 0.122655 and 0.008995 respectively.The values of MAC by AFSA and WCA-AFSA are shown in Tables 3 and 4. The above result shows that the improved algorithm has better performance.
Algorithms 2018, 11, x FOR PEER REVIEW 12 of 14 direction (Y direction in Figure 7) which is the main degrees of freedom (DOFs).There are a total of 1073 nodes (DOFs).Considering the difficulty of placing sensors in blade tip, the 36 DOFs in the blade tip are negligible.Therefore, there are a total of 1037 nodes (DOFs) which participate in computation.The first five mode matrix Φ is a 1037 × 5 matrix.
Here, we place 10 WSNs nodes sensors.Figure 8a,b shows the MAC bar graph by AFSA and WCA-AFSA, respectively.Their maximum off-diagonal elements are 0.122655 and 0.008995 respectively.The values of MAC by AFSA and WCA-AFSA are shown in Tables 3 and 4. The above result shows that the improved algorithm has better performance.

Optimal Sensor Placement Scheme
According to engineering practice and test experience, acceleration sensor is usually employed for the monitoring health state of the blade [15].The scheme of placing 10 WSNs node sensors on the blade is listed in Table 5.

Optimal Sensor Placement Scheme
According to engineering practice and test experience, acceleration sensor is usually employed for the monitoring health state of the blade [15].The scheme of placing 10 WSNs node sensors on the blade is listed in Table 5.

Figure 1 .
Figure 1.Visual and Step of an artificial fish.Xn1, Xn2: Locations of two fish within Visual

Figure 1 .
Figure 1.Visual andStep of an artificial fish.X n1 , X n2 : Locations of two fish within Visual

Figure 2 .
Figure 2. Principle of the centroid algorithm.

Figure 2 .
Figure 2. Principle of the centroid algorithm.
x y are the anchor nodes, and hollow dot D( , ) X Y is the unknown nodes to be located.a, b, c are the distances between D and A, B, and C respectively.
be easily obtained by deleting the second row of φ 4×2 .3.1.3.Fish Swarm Initialization through WCA

For
.3.Fish Swarm Initialization through WCA

Figure 2 .
Figure 2. Principle of the centroid algorithm.

Figure 2 .
Figure 2. Principle of the centroid algorithm.

Figure 4 .
Figure 4. Location error comparison of WCA and CA.
is the location of the anchor node j; ij d is tance between the anchor node j and the unknown node i; n is weight coefficient ranging f o 4; N is the number of the anchor nodes.The average error location can be expressed as: j B x, y 10), x i ∈ [−5.12, 5.12], f min = 0 and f 2 (x) used for testing convergence speed and precision are single modal functions with single extreme values.f 3 (x) and f 4 (x) used for testing the global search ability are multiple modal functions with nonlinear multiple extreme values.f 5 (x) is an abnormal function, which is applied for testing the algorithm performance.

Table 2 .
First five mode frequencies and their mode shape features.

Table 2 .
First five mode frequencies and their mode shape features.

Table 3 .
The values of MAC by AFSA.

Table 4 .
The values of MAC by WCA-AFSA.

Table 3 .
The values of MAC by AFSA.

Table 4 .
The values of MAC by WCA-AFSA.