Disclosure of Invention
The invention aims to provide a multi-dimensional interpolation scheme based on Taylor expansion and an inter-dimensional point value taking method thereof, aiming at further simplifying compressed storage for a deep storage tree, reducing memory occupation and facilitating the use of a nested loop algorithm; a more general interpolation method based on a first-order multivariate Taylor expansion is provided, so that the calculated amount is further reduced; and an inter-dimensional point value taking method of the multi-dimensional interpolation table is provided, so that more economic scientific guidance is provided for making the interpolation table.
In order to achieve the purpose, the invention provides the following technical scheme:
a multi-dimensional interpolation scheme based on Taylor expansion and an inter-dimensional point value taking method thereof comprise the following steps: the interpolation method comprises a multivariate Taylor expansion and data calling algorithm, the interpolation table storage method is characterized in that data storage is carried out through a two-dimensional interval array A [ I ] [ N ] and a one-dimensional value domain array B [ K ], the interpolation table storage data are obtained through a numerical simulation or experiment means, the two-dimensional interval array only stores independent inter-dimension point values among dimensions, the independent inter-dimension points refer to the number and the numerical value of inter-dimension points of N + 1-dimensional multi-dimensional tree diagram branches corresponding to each inter-dimension point of the nth dimension, the interpolation table inter-dimension value taking method adopts the steps of solving the order of each dimension independent variable through dimensional analysis of a target function, and the number of the least inter-dimension points is selected according to the order;
the two-dimensional interval array A [ I ]][N]Representing a two-dimensional array with rows I and columns N, where A [0 ]][n]Represents the minimum value of the nth dimension, A [ I ] n -1][n]Representing the maximum value of the nth dimension, constructed to implement a full range interpolation within the limit, I n Represents the nth dimensionNumber of discrete points between dimensions of variable, and I ═ max { I ═ I 1 ,I 2 ,…,I n ,…,I N };
The multi-dimensional interpolation scheme based on Taylor expansion is characterized in that the interpolation method takes multi-element Taylor expansion as a carrier, a data calling algorithm is needed in the process of solving the multi-element Taylor expansion, wherein f is a point
At any point in a field of
The first order expansion of the discrete form multivariate taylor of (1) is:
wherein,
the function value is to be calculated;
for the nth dimension, i
n Coordinate value of point between dimensions, i.e. two-dimensional interval array A [ I ]][N]N th column of (1), i th
n A row;
is f pairs
A partial increase function value of; eta
n For the coordinate increment to be solved of the nth dimension variable, the above formula represents lower boundary value field index interpolation, or upper boundary value field index interpolation, which are equal on the premise that each dimension variable is an independent inter-dimension point, wherein the upper boundary value field index interpolation formula is (wherein, the definition of each variable is the same as that of the lower boundary value field index interpolation):
the data calling algorithm takes the following boundary value domain index interpolation formula as an example and comprises the following steps:
firstly, according to the coordinate value to be solved, adopting golden section method to make A [ I ]][N]Performing double nested loop search to calculate the coordinate increment eta of n dimensional variables to be solved 1 ,η 2 ,…,η n And coordinates (i) 1 ,i 2 ,…,i N );
② according to the coordinate (i)
1 ,i
2 ,…,i
N ) To calculate a value range index value h
N Here, the method of double nested loop search is also used, where a parameter Δ is defined, where n > 0, and Δ ═ 0 denotes the evaluation
Is the function value index of (a) n, which means that the solution is the partial increase function value
When Δ ≠ n, it is necessary to determine the coordinate (i)
1 ,i
2 ,…,i
n +1,…,i
N ) Calculating a value domain index value, and embedding a judgment statement in the loop statement to judge whether the coordinate of the nth dimension is added with 1;
the value of f to be searched, which is associated with the one-dimensional value range array B [ h ] N -1]Corresponds to the value of (b), wherein h of the nth dimension n The calculation formula of (A) is as follows:
h n =(h n-1 -1)·I n-1 +i n .
wherein h is n Represents the nth dimension interpolation value domain index to be solved, h n-1 Denotes an n-1-dimensional interpolation value domain index, I n-1 Representing a two-dimensional interval array A [ I ]][N]The number of n-1 th columns;
solving interpolation function values according to the items;
as an option of the invention with higher interpolation precision, the method can adopt the multivariate Taylor expansion of a high-order form instead of the multivariate Taylor expansionPrice is higher calculation amount and memory resource, and because of the definition of discrete high-order derivative, the order is increased once, and an additional data point is needed to be added on each dimension, the cost of interpolation table data is increased, if the calculation amount of the first-order multivariate Taylor is N, the Q order is
The advantages of the present invention are lost with the use of a high order taylor expansion, where the Q order taylor expansion is:
wherein,
expressed as a variable x of the nth dimension
n The higher order requires recursive solution with discrete forms of the lower order.
The Taylor expansion-based multi-dimensional interpolation scheme and the inter-dimensional point value taking method thereof are characterized in that the inter-dimensional point value taking method of the interpolation table solves the order of each dimension independent variable through dimension analysis of an objective function, and selects the minimum number of the inter-dimensional points according to the order so as to reduce the manufacturing economic cost of the interpolation table;
the dimension analysis comprises the following steps:
firstly, the main influencing factors of the researched phenomenon are selected manually according to experience
Selecting independent variables which can completely cover the basic physical quantity according to the dimension of the basic physical quantity of the described phenomenon and recording the variables as m variables;
writing out expression of n-m similarity criterion pi according to pi theorem, in which any one similarity criterion pi
i Can be expressed as a function of the remaining n-m-1 similarity criteria, requiring the selection of a phase containing the objective functionSimilarity criterion pi
i Thus, the expression of the objective function is solved as:
wherein the analysis can be performed by means of an existing expression of the target parameter in order to obtain f
1 With respect to intermediate variables
Constitutive relation of (f)
1 (x
1 ,x
2 ,…,x
N );
The constitutive relation f
1 (x
1 ,x
2 ,…,x
N ) It is difficult to determine that f is x when other dimensional variables are constants
n If the independent function is a linear constitutive relation, there is
I.e. f
1 (x
n ) C, but the real case is due to the influence of other dimensional parameters, complex functions
The structure of (a) is much more complicated, and f (x) can be approximated when no constitutive relation is analyzed
1 ,x
2 ,…,x
N ) The description is as follows:
wherein, g n >1,a n ,g 0 ,a 0 B, c are unknown coefficients that may vary with variations in other dimensional variables, a 0 B, only the curve is translated left and right and up and down, and the selection of the number of discrete points is not influenced;
order for independent variable is g n And g is n Greater than 0, the number of interdimensional points is at least g n + 1; order g for independent variable n When the number is less than 0, the number of the inter-dimensional points is at least 3;
when the nth dimension variable can be approximated to a periodic function with the period of T, the change rule of the nth dimension variable cannot be damaged at least by setting the simulation or experiment data interval of T/2 according to the fragrance concentration sampling theorem.
Compared with the prior art, the invention has the advantages that: based on the first-order multivariate Taylor expansion, the calculation amount of interpolation calculation is N +1, compared with the calculation amount of a recursive calculation method from leaves to roots
Obviously reducing: the complexity of a data storage space and a data calling algorithm is reduced through a two-dimensional interval array, and the storage space is from the original deep storage tree
To reduce to
In the aspect of complexity of a data calling algorithm, the nested loop algorithm only needs to set a two-dimensional interval array A [ I ]][N]The row and column circulation can realize the search calculation of the increment of each dimension; finally, a method for obtaining the order of each dimension variable and the minimum discrete point of the inter-dimension points corresponding to each order by using dimension analysis is provided, so that the most economical number of the inter-dimension points is selected on the premise of not damaging the change rule.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, in an embodiment of the present invention, a multi-dimensional interpolation scheme based on taylor expansion and a method for evaluating points between dimensions thereof include: the interpolation method comprises a multivariate Taylor expansion and data calling algorithm, the interpolation table storage method is characterized in that data storage is carried out through a two-dimensional interval array A [ I ] [ N ] and a one-dimensional value domain array B [ K ], the interpolation table storage data are obtained through a numerical simulation or experiment means, the two-dimensional interval array only stores independent inter-dimension point values among dimensions, the independent inter-dimension points refer to the number and the numerical value of inter-dimension points of N + 1-dimensional multi-dimensional tree diagram branches corresponding to each inter-dimension point of the nth dimension, the interpolation table inter-dimension value taking method adopts the steps of solving the order of each dimension independent variable through dimensional analysis of a target function, and the number of the least inter-dimension points is selected according to the order;
the two-dimensional interval array A [ I ]][N]Representing a two-dimensional array with rows I and columns N, where A [0 ]][n]Represents the minimum value of the nth dimension, A [ I ] n -1][n]Representing the maximum value of the nth dimension, constructed to implement a full range interpolation within the limit, I n Denotes the number of discrete points between dimensions of the nth dimension variable, and I ═ max { I 1 ,I 2 ,…,I n ,…,I N };
The multi-dimensional interpolation scheme based on Taylor expansion is characterized in that the interpolation method takes multi-element Taylor expansion as a carrier, a data calling algorithm is needed in the process of solving the multi-element Taylor expansion, wherein f is a point
At any point in a field of
The first order expansion of the discrete form multivariate taylor of (1) is:
wherein,
the function value is to be calculated;
for the nth dimension, i
n Point coordinate value between dimensions, i.e. two-dimensional interval array A [ I ]][N]N th column of (1), i th
n A row;
is f to
A partial increase function value of; eta
n For the coordinate increment to be solved of the nth dimension variable, the above formula represents lower boundary value field index interpolation, or upper boundary value field index interpolation, which are equal on the premise that each dimension variable is an independent inter-dimension point, wherein the upper boundary value field index interpolation formula is (wherein, the definition of each variable is the same as that of the lower boundary value field index interpolation):
referring to fig. 2, in the embodiment of the present invention, the data call algorithm, for example, has the following boundary value domain index interpolation formula, and includes the following steps:
firstly, according to the coordinate value to be solved, adopting golden section method to make A [ I ]][N]Performing double nested loop search to calculate the coordinate increment eta of n dimensional variables to be solved 1 ,η 2 ,…,η n And coordinates (i) 1 ,i 2 ,…,i N );
② according to the coordinate (i)
1 ,i
2 ,…,i
N ) To calculate the value range index value hN, here againUsing a double nested loop search method, defining a parameter delta, wherein n is greater than 0, and delta is 0 to obtain
Is the function value index of (a) n, which means that the solution is the partial increase function value
When Δ ≠ n, it is necessary to determine the coordinate (i)
1 ,i
2 ,…,i
n +1,…,i
N ) Calculating a value domain index value, and embedding a judgment statement in the loop statement to judge whether the coordinate of the nth dimension is added with 1;
the value of f to be searched, which is associated with the one-dimensional value range array B [ hN-1 ]]Corresponds to the value of (b), wherein h of the nth dimension n The calculation formula of (A) is as follows:
h n =(h n-1 -1)·I n-1 +i n .
wherein h is n Representing the nth-dimensional interpolation value domain index, h, to be solved n-1 Denotes the n-1-dimensional interpolation value domain index, I n-1 Representing a two-dimensional interval array A [ I ]][N]The number of n-1 th columns;
solving interpolation function values according to the items;
as an option of the invention with higher interpolation precision, the multivariate Taylor expansion in a high-order form can be adopted, the cost is higher calculation amount and memory resource, meanwhile, because the definition of discrete high-order derivatives, each time the order is increased once, an additional data point needs to be added on each dimension, the cost of interpolation table data can be increased, if the calculation amount of the first-order multivariate Taylor is N, the Q order is N
The advantages of the present invention are lost with the use of a high order taylor expansion, where the Q order taylor expansion is:
wherein,
expressed as a variable x of the nth dimension
n The higher order requires recursive solution with discrete forms of the lower order.
Referring to fig. 3, in the embodiment of the present invention, the taylor expansion-based multidimensional interpolation scheme and the inter-dimensional point value taking method thereof are characterized in that the inter-dimensional point value taking method of the interpolation table solves the order of each dimension independent variable through dimensional analysis of an objective function, and selects the minimum number of inter-dimensional points according to the order to reduce the economic cost for manufacturing the interpolation table;
the dimension analysis comprises the following steps:
firstly, the main influencing factors of the researched phenomenon are selected manually according to experience
Selecting independent variables which can all cover the basic physical quantity according to the dimension of the basic physical quantity of the described phenomenon and recording the independent variables as m variables;
writing out expression of n-m similarity criterion pi according to pi theorem, in which any one similarity criterion pi
i Can be expressed as a function of the remaining n-m-1 similarity criteria, requiring the selection of a similarity criterion π comprising the objective function
i Thus, the expression of the objective function is solved as:
wherein the analysis can be performed by means of an existing expression of the target parameter in order to obtain f
1 With respect to intermediate variables
Constitutive relation of (f)
1 (x
1 ,x
2 ,…,x
N );
The constitutive relation f
1 (x
1 ,x
2 ,…,x
N ) Is difficult to determine atWhen other dimensional variables are constants, f is x
n If the independent function is a linear constitutive relation, there is
I.e. f
1 (x
n ) C, but the real case is due to the influence of other dimensional parameters, complex functions
The structure of (a) is much more complicated, and f (x) can be approximated when no constitutive relation is analyzed
1 ,x
2 ,…,x
N ) The description is as follows:
wherein, g n >1,a n ,g 0 ,a 0 B, c are unknown coefficients that may vary with variations in other dimensional variables, a 0 B is only to translate the curve left and right and up and down without affecting the selection of the number of discrete points, wherein, the figure 3 is for the nth dimension variable x n G of n =4,a n =3,g 0 =2,a 0 The equidistant distance of 1, 0, 1 and c is the discrete interpolation effect of 5 discrete points;
order for independent variable is g n And g is n Greater than 0, the number of interdimensional points is at least g n + 1; order g for independent variable n When the number is less than 0, the number of the inter-dimensional points is at least 3;
when the nth dimension variable can be approximated to a periodic function with the period of T, the change rule of the nth dimension variable cannot be damaged at least by setting the simulation or experiment data interval of T/2 according to the fragrance concentration sampling theorem.
The dimensional analysis is performed below with specific examples:
according to observation and analysis, factors influencing the pressure loss of the flow in the pipe comprise the average flow velocity V in the pipe, the flow density rho, the diameter d of the pipeline, the length l of the pipe, the dynamic viscosity mu of the fluid and the roughness delta of the pipe wall. The pressure loss Δ p of the pressure line placed horizontally is determined experimentally.
Solution: according to the theme, the main factors influencing the pressure flow in the pipe are 7, namely the average flow velocity V in the pipe, the flow density rho, the diameter d of the pipe, the length l of the pipe, the dynamic viscosity mu of the fluid, the roughness delta of the pipe wall and the pressure loss delta p of the pipe.
V, d and rho three independent variables are selected as basic physical quantities, and the three basic dimensions comprise length [ L ], mass [ M ] and time [ t ]. Writing an expression of 7-3 ═ 4 π:
according to the principle that the dimensions of the numerator denominator are the same, the index (a) in each pi term can be calculated 1 ,b 1 ,c 1 ) …, of equal value, now pi 1 For example, as
Substituting the original formula to obtain a similarity criterion pi related to pressure loss 1 =Δp/(ρV 2 )=Eu
Similarly, can get pi 2 =μ/(ρVd)=1/Re,π 3 =l/d,π 4 =Δ/d。
Selecting a similarity criterion comprising an objective function, which is pi 1 We can relate the similarity criterion pi to pressure loss 1 Expressed as a function of the remaining 3 criteria:
π 1 =f(π 2 ,π 3 ,π 4 ) I.e. Eu ═ f (1/Re, l/d, Delta/d)
For the in-line flow given in this example, it was found experimentally that the pressure loss Δ p is proportional to the relative tube length l/d, and the above equation can be rewritten as
Then pressure loss of pipe flow
Wherein, λ ═ f is defined 1 (1/Re, Δ/d), the following is an empirical formula obtained by experimental measurements:
for laminar flow λ 64/Re
For turbulent transition asperity zone λ 0.11(Δ/d +68/Re) 0.25
Lambda for turbulent completely rough tube area ═ 2lg (Δ/d) +1.72 -2
It can be seen that the dependence of the dimension analysis method on theoretical experience is high, in the case that the Reynolds number and the relative roughness are determined, the precise discrete point taking of the average flow velocity V, the flow density rho, the pipe length l and the dynamic viscosity mu of the fluid can be independently carried out, and for the parameters of other dimensions, the function can be used
To approximate the analysis.
The present invention is not limited to the above embodiments, and based on the technical solutions disclosed in the present invention, those skilled in the art can make some simple modifications, equivalent changes and modifications to some technical features without creative efforts based on the disclosed technical contents, and all fall into the technical solution of the present invention.