disclosure of Invention
In order to overcome the defects of the prior art, the invention provides an efficient flapping wing motion parameter optimization method based on a proxy model, and the flapping wing motion parameter optimization under different target aerodynamic coefficients is effectively realized.
In order to achieve the above purpose, the solution of the invention is:
a method of optimizing flapping wing motion parameters, the method comprising:
(1) presetting sampling points: presetting sampling points in a parameter space formed by flapping wing motion parameters to form a sampling point set X1。
(2) Acquiring training data:
selecting a plurality of sets of calculation grids with different grid densities as grids with different accuracies, and calculating aerodynamic coefficients corresponding to the sampling points x preset in the step (1) by adopting a numerical simulation method respectively
Obtaining aerodynamic coefficients with different precisions to form a training sample set
t denotes the accuracy class, i denotes the different aerodynamic coefficients, X ∈ X
1。
(3) Constructing a proxy model:
according to the obtained training sample set SiAnd constructing a proxy model through multi-precision Gaussian process regression. The input of the proxy model is a motion parameter, the output of the proxy model is an aerodynamic coefficient, and the multi-precision Gaussian process regression comprises two assumptions: all the aerodynamic coefficients follow Gaussian distribution, and the distribution of samples with different accuracies meets the following relation:
Zt(x)=ρt-1(x,γ)Zt-1(x)+δt(x)
δt(x)⊥Zt-1(x)
Zt(x) Is composed ofOne of the aerodynamic coefficients C corresponding to all x in the t precision gradet(x) And (3) obeying a Gaussian distribution function, wherein rho (x, gamma) is a parameter function, gamma is a hyperparameter, and delta (x) is an independent Gaussian distribution. Gaussian distribution Z of lowest precision class samples1(x) The independent gaussian distribution formula is as follows:
fT(x) For regression functions, η and σ are hyper-parameters, r (x, x') is a covariance function, and commonly used covariance functions are gaussian functions or radial basis functions, etc.
Combining the Gaussian distributions of the samples with different precisions to construct a combined Gaussian distribution for writing
For a joint Gaussian distribution, mu
(t)For the expectation of the joint Gaussian distribution, V
(t)Is a covariance matrix of the joint gaussian distribution. The specific formula is as follows:
cov represents the corresponding covariance matrix for the a priori expectation of one of the aerodynamic coefficients with an accuracy rating t.
For gaussian process regression, the hyperparameters may be calculated by minimizing the negative log-edge likelihood function:
Θ is a hyper-parameter set, comprising γ, η and σ. NLML is a negative log-edge likelihood function.
A priori joint gaussian distribution of known multi-precision samples
For any motion parameter input x, probability posterior distribution can be calculated through Bayes theorem to obtain a proxy model, and then expected mu corresponding to the aerodynamic coefficient is obtained
postAnd variance
And R is a motion parameter space. According to different aerodynamic coefficients
Establishing a corresponding agent model:
to obtain the corresponding expected mu
post(i)And variance
Expectation of mu
post(i)Namely the output aerodynamic coefficient C of the proxy model of the motion parameter x
i'(x)。
Fourthly, optimizing flapping wing motion parameters: the method comprises the following steps of optimizing flapping wing motion parameters by taking the realization of a specific aerodynamic coefficient as an optimization target, calculating the relative error between the true aerodynamic coefficient of an optimal point and the optimization target in the optimization process, and judging whether the error requirement is met, wherein the method comprises the following steps:
(4.1) searching an optimal point and a candidate sampling point:
set of points X in the space of motion parameters2Finding the optimal point. The point set X2Consists of three parts: the method comprises the steps of a point set based on a grid search theory, a point set based on a random search theory and a point set based on a disturbance theory.
Based on an agent model, combining a Bayesian optimization theory, optimizing motion parameters to realize a specific aerodynamic coefficient, wherein the Bayesian optimization uses an expecteimprovement strategy as an acquisition function:
Fb(x)=min(abs(Ci'(x)-<Ci>O(x) ) is the current minimum value.
abs represents the absolute value of the signal and,<C
i>
O(x) Representing the target value of aerodynamic coefficient, i represents different aerodynamic coefficients, m is the number of aerodynamic coefficients, S
iFor the training sample set, μ
i(x) Phi (M) is the absolute value of the difference between the aerodynamic coefficient of the motion parameter x and the target value, and sigma is the probability distribution function
post(i)(x) Is the variance of the received signal and the received signal,
for the probability density function, use C
μAnd C
σTwo parameters control the weight of the expectation and variance, respectively, C
μ+C
σ=1,C
μ≥0.5。
And selecting a point with the largest EI value as an optimal point, sequencing the sampling points according to the variance from large to small based on an active learning strategy, and selecting any previous sampling point as a candidate sampling point.
(4.2) optimizing convergence judgment;
and calculating the relative error between the true aerodynamic coefficient of the optimal point and the optimization target, and judging whether the error requirement is met. If the error requirement is not met, performing numerical simulation calculation on the aerodynamic coefficient of the optimal point by using the highest precision numerical value in the step two, performing numerical simulation calculation on the aerodynamic coefficients of the candidate sampling points by using the rest numerical values with different precision levels, adding the optimal point and the corresponding aerodynamic coefficient into the sample with the highest precision level, adding the selected sampling point and the aerodynamic coefficient into the sample with the corresponding precision level to form a new training sample set, repeating the steps (3) to (4), updating the modified proxy model and optimizing the motion parameter until the error requirement is met, completing the optimization of the motion parameter, and obtaining the motion parameter of the optimal point as the optimized motion parameter.
Further, the flapping wings move in the following mode:
y(t)/c=hcos(2πft)
and under the coordinate system of the machine body, the motion form is composed of three-degree-of-freedom motion. y (t)/c is the pitching oscillating movement in the y direction, c is the wing chord length, h is the amplitude of the pitching movement, 0.05<h<1.25; f is the flapping frequency, 0.06<f<0.3. x (t) is oscillatory motion in the x direction, the amplitude of which is controlled by the amplitude of the pitching motion h and the stroke angle beta, 50 °<β<135 deg. Alpha (t) is an oscillatory rotation about a rotation axis o on the wing chord, alpha (t) being a sinusoidal-like rotation in the first half-cycle, alpha0To the amplitude of rotation, 0<α0<50 degrees; the value is constant at zero in the second half cycle. In the ground coordinate system, the flapping wing follows the fuselage at a constant velocity to the left. Alpha (t) is the included angle between the direction of the wing chord line and the motion direction, and theta (t) is the included angle between the wing chord line and the horizontal line. T is the moment corresponding to the instantaneous vorticity field, T is the flapping cycle of the flapping wing, and the value is the reciprocal of the flapping frequency. The motion parameters comprise: flapping frequency f, pitching motion amplitude h, stroke angle beta and rotation amplitude alpha0(ii) a The motion parameter space is composed of flapping wing motion parameters which meet the formula and the constraint condition.
Further, in the step (1), sampling points are preset in a parameter space formed by flapping wing motion parameters by using a Latin hypercube sampling method.
Further, in the step (2), the numerical simulation adopts a dynamic grid method or an immersion boundary method based on radial basis function interpolation.
Further, the optimization objective comprises a time-averaged lift coefficient and a time-averaged thrust coefficient; lift coefficient calculation formula
Thrust coefficient calculation formula
L and T are lift and thrust, ρ is fluid density, S is characteristic area, U
∞Is the free incoming flow velocity.
The invention has the following beneficial effects: the invention effectively utilizes samples with different precisions to improve the precision of the proxy model; candidate sampling points are selected from the parameter space efficiently to improve the accuracy of the proxy model, so that the motion parameters of the flapping wings can be optimized by the proxy model efficiently; the method can obtain the optimal motion parameter under the specific aerodynamic coefficient, and the aerodynamic coefficient of the flapping wing aircraft is closer to the target aerodynamic coefficient under the motion parameter. The obtained optimal motion parameters have an auxiliary effect on the control aspect of the flapping wing aircraft, for example, the corresponding optimal motion parameters are obtained by taking the corresponding aerodynamic coefficients required by the hovering and hovering tasks of the aircraft as target aerodynamic coefficients according to the optimization method of the invention, and the aircraft is set to the corresponding optimal motion parameters, so that the aircraft can well execute the tasks.
Detailed Description
The present invention will be described in detail below with reference to the accompanying drawings.
FIG. 1 is a flow chart of the optimization of flapping wing motion parameters provided by the present application.
The motion parameter optimization method of the embodiment comprises the following steps:
s1: presetting sampling points in a parameter space of the flapping wing by using experimental design;
fig. 2 shows the motion form of the flapping wing of the present embodiment, but is not limited thereto. The mathematical expression of the motion form is as follows:
y(t)/c=hcos(2πft)
and under the coordinate system of the machine body, the motion form is composed of three-degree-of-freedom motion. y (t)/c is the pitching oscillating movement in the y direction, c is the wing chord length, h is the amplitude of the pitching movement, 0.05<h<1.25; f is the flapping frequency, 0.06<f<0.3. x (t) is oscillatory motion in the x direction, the amplitude of which is controlled by the amplitude of the pitching motion h and the stroke angle beta, 50 °<β<135 deg. Alpha (t) is an oscillatory rotation about a rotation axis o on the wing chord, alpha (t) being a sinusoidal-like rotation in the first half-cycle, alpha0To the amplitude of rotation, 0<α0<50 degrees; the value is constant at zero in the second half cycle. In the ground coordinate system, the flapping wing follows the fuselage at a constant velocity to the left. Alpha (t) is the included angle between the direction of the wing chord line and the motion direction, and theta (t) is the included angle between the wing chord line and the horizontal line. T is the moment corresponding to the instantaneous vorticity field, T is the flapping cycle of the flapping wing, and the value is the reciprocal of the flapping frequency. The motion parameters comprise: flapping frequency f, pitching motion amplitude h, stroke angle beta and rotation amplitude alpha0(ii) a The motion parameter space is composed of flapping wing motion parameters which meet the formula and the constraint condition.
As an optional implementation mode of the invention, the sampling point experiment is designed to be Latin hypercube sampling. T groups of sampling points are obtained through t times of sampling to form a sampling point set X1And the number of sampling points in each group is sequentially reduced, and t is the highest precision level of the multi-precision proxy model. In this embodiment, t is 2.
S2: and calculating the aerodynamic coefficient corresponding to the sampling point by using a numerical simulation method.
The flapping wing flow field can be numerically simulated by using a dynamic grid method or an immersion boundary method based on radial basis function interpolation, in the embodiment, the dynamic grid method based on open source software OpenFOAM is adopted for simulation, grid independence verification is carried out, appropriate t grids with different accuracies are selected from the dynamic grid method and are respectively used as grids with high accuracy and low accuracy, and aerodynamic coefficients of sampling points are calculated according to lift force, thrust force and the like obtained through numerical simulation and are used as training samples S
i(x,
) I denotes the different aerodynamic coefficients, X ∈ X
1. As an alternative implementation manner of the present invention, the aerodynamic coefficient includes a lift coefficient and a thrust coefficient. Lift coefficient calculation formula
Thrust coefficient calculation formula
L and T are lift and thrust, ρ is fluid density, S is characteristic area, U
∞Is the free incoming flow velocity.
It should be noted that, the higher the accuracy level of the numerical simulation, the lower the number of sampling points corresponding to the sampling point group.
S3: a proxy model is constructed using the multi-precision samples.
The method for constructing the proxy model is multi-precision Gaussian process regression. The input of the proxy model is a motion parameter, and the output is an aerodynamic coefficient. The multiple precision gaussian process regression includes two important assumptions. All aerodynamic coefficients follow a gaussian distribution, and the distribution of samples of different accuracies satisfies the following relationship:
Zt(x)=ρt-1(x,γ)Zt-1(x)+δt(x)
δt(x)⊥Zt-1(x)
Z
t(x) One of high-precision samples
Of a Gaussian distribution function of, Z
t-1(x) Is one of low-precision samples
The gaussian distribution function of (1) is marked with different precision levels, ρ (x, γ) is a parameter function, and the embodiment adopts a constant function, and takes γ as a hyperparameter, and δ (x) is an independent gaussian distribution. Gaussian distribution Z of lowest precision class samples
1(x) With said independent Gaussian fractionThe cloth formula is as follows:
fT(x) In this embodiment, the values are set to zero, η and σ are hyper-parameters, r (x, x') is a covariance function, and the common covariance function is a gaussian function or a radial basis function.
Combining the Gaussian distributions of the samples with different precisions to construct a combined Gaussian distribution for writing
With combined Gaussian distribution, mu, of high and low precision
(t)For the expectation of the joint Gaussian distribution, V
(t)Is a covariance matrix of the joint gaussian distribution.
The specific formula is as follows:
cov represents the corresponding covariance matrix for the a priori expectation of one of the aerodynamic coefficients with an accuracy rating t.
For gaussian process regression, the hyperparameters may be calculated by minimizing the negative log-edge likelihood function.
Θ is a hyper-parameter set, comprising γ, η and σ. NLML is a negative log-edge likelihood function.
A priori joint gaussian distribution of known multi-precision samples
For any motion parameter input x, probability posterior distribution can be calculated through Bayes theorem to obtain a proxy model, and then expected mu corresponding to the aerodynamic coefficient is obtained
postAnd variance
And R is a motion parameter space. Establishing corresponding proxy models according to different aerodynamic coefficients:
to obtain the corresponding expected mu
post(i)And variance
Expectation of mu
post(i)Namely the output aerodynamic coefficient C of the proxy model of the motion parameter x
i'(x)。
S4: and performing multi-objective aerodynamic coefficient optimization on the flapping wings, wherein the optimization problem can be expressed as:
abs represents the absolute value of the signal and,<Ci>O(x) Representing the target value of the aerodynamic coefficient, according to the stress requirement of the aircraft, and the value of m is 2.
In the optimization process, calculating the relative error between the true aerodynamic coefficient of the optimal point and the optimization target, and judging whether the error requirement is met, wherein the method comprises the following steps:
(4.1) searching an optimal point and a candidate sampling point:
set of points X in parameter space2Finding the optimal point. The point set X2Is composed of three parts
A point set based on a grid search theory, wherein points in the point set are uniformly distributed in a parameter space;
a point set based on a random search theory, wherein points in the point set are randomly distributed in a parameter space;
and based on the point set of the perturbation theory, the points in the point set are randomly distributed near the optimal point in the parameter space.
Based on a proxy model, combining a Bayes optimization theory, optimizing motion parameters to realize specific aerodynamic coefficients, wherein the optimized aerodynamic coefficients comprise time-averaged lift coefficients and time-averaged thrust coefficients. The Bayesian optimization uses an expectedprovement strategy as an acquisition function:
Fb(x)=min(abs(Ci'(x)-<Ci>O(x) ) is the current minimum value.
S
iFor the training sample set, μ
i(x) Phi (M) is the absolute value of the difference between the aerodynamic coefficient of the motion parameter x and the target value, and sigma is the probability distribution function
post(i)(x) Is the variance of the received signal and the received signal,
for the probability density function, use C
μAnd C
σTwo parameters control the weight of expectation and variance respectively, in this embodiment, C
μ=0.5,C
σ=0.5。
And selecting a point with the largest EI value as an optimal point, sequencing the sampling points according to the variance from large to small based on an active learning strategy, and selecting any previous sampling point as a candidate sampling point.
(4.2) optimizing convergence judgment; and (3) calculating the real aerodynamic coefficient of the optimal point by using high-precision numerical simulation, and judging whether the relative error between the real value and the target aerodynamic coefficient meets the error requirement, wherein the error requirement is that the relative error is less than 10%.
And (3) performing numerical simulation calculation on the aerodynamic coefficient of the optimal point by using the highest precision numerical value in the step two, performing numerical simulation calculation on candidate sampling point aerodynamic coefficients by using the rest numerical values with different precision grades, adding the optimal point and the corresponding aerodynamic coefficient into the sample with the highest precision grade, adding the selected sampling point and the aerodynamic coefficient into the sample with the corresponding precision grade to form a new training sample set, repeating the steps (3) to (4), updating and correcting the proxy model and optimizing the motion parameters until the error requirements are met, and completing the optimization of the motion parameters.
The optimization results of this embodiment, in which the time-averaged lift coefficient is 3 and the time-averaged thrust coefficient is 0 as the optimization target, are shown in the following table:
table 1: optimization results table
Number of iterations
|
1
|
Optimum flapping frequency (Hz)
|
0.1660
|
Optimal amplitude of pitching motion
|
1.1166
|
Optimum stroke angle (rad)
|
0.9972
|
Optimum rotation amplitude (rad)
|
0.6271
|
Time-average lift coefficient
|
2.8694
|
Time-averaged thrust coefficient
|
-0.0126 |
It can be seen that after one iteration, the aerodynamic coefficient at the optimal point already meets the error requirement. Fig. 3-4 show the optimization results of the simulation of this embodiment, from which the instantaneous flow field vortex diagram of the flapping wing after optimization, the trajectory diagram of the flapping wing in one cycle, and the aerodynamic vector arrows can be seen. Under the motion parameter, the aerodynamic coefficient of the flapping wing aircraft is closer to the target aerodynamic coefficient. The motion parameters of the flapping wing air vehicle are set to the numerical values in the table, so that the air vehicle can well execute the hovering task. The method effectively utilizes the samples with different precisions to improve the precision of the proxy model, and simultaneously selects the candidate sampling points in the parameter space efficiently to improve the precision of the proxy model, thereby optimizing the flapping wing motion parameters by efficiently utilizing the proxy model. The obtained optimal motion parameters have an auxiliary effect on the control of the flapping wing aircraft.