Disclosure of Invention
The invention aims to provide a formula optimization method with strong global optimization capability aiming at some problems in beer formula optimization.
The technical scheme of the invention is to convert a continuous formula optimization problem into a discrete combined optimization problem, then adopt a bionic ant colony algorithm and adopt a variable-scale method to improve the algorithm optimization performance, shorten the calculation time and finally establish a beer production formula optimization method.
The method comprises the following specific steps:
step 1, obtaining parameters such as the yield, alpha amino nitrogen, saccharifying power, total soluble nitrogen, beta glucan, unit price and the like of main raw materials (including barley malt, special malt, wheat malt, auxiliary raw materials and the like) in a beer formula, wherein the data can be obtained by suppliers or statistics in the production process;
and 2, establishing a comprehensive production performance index estimation model according to the parameters of the raw materials, wherein the main comprehensive performance indexes considered are malt saccharification capacity, wort total nitrogen, wort alpha-amino nitrogen, wort beta-glucan and the thickness of a filter tank grain layer.
Malt saccharification ability
Under normal saccharification operation (30-45 min at 65-68 ℃), each kilogram of mixed raw materials should contain 1500-2000 WK of saccharification force. The upper limit value can shorten the refining time and obtain the wort with higher fermentation degree; the lower limit value of saccharification time is long, and the fermentation degree is low. If the weight is less than 1500WK, the saccharification operation is influenced, the utilization rate of raw materials is influenced, and the composition of wort is influenced. And the total soluble nitrogen of the malt can be estimated according to the following formula:
in the formula, T
i、X
iRespectively representing the saccharifying power intensity and mass fraction of the component i, wherein i is more than or equal to 1 and less than or equal to n;
② total nitrogen of wort
The total soluble nitrogen level of a typical beer wort is:
900-1200 mg/L whole malt wort
Adding 700-850 mg/L of concentrated alcohol beer wort as auxiliary material
550-700 mg/L of light beer wort added with auxiliary materials
Also, the total soluble nitrogen of wort can be estimated as follows:
in the formula,
is the total nitrogen mass concentration of component i; A. v is the total mass of raw materials required by a batch and the required wort yield, and the unit is kilogram and liter respectively; gamma, gamma,
The protein decomposition strength and the boiling nitrogen precipitation rate are respectively.
③ wort alpha amino nitrogen
The alpha amino nitrogen of the wort is related to the flavor substances of the beer, namely high-grade alcohol and diacetyl, and the control of the concentration of the alpha amino nitrogen of the wort is particularly important for controlling the flavor of the beer. Generally, the alpha amino nitrogen of the wort is preferably controlled within the range of 160-180 mg/L. And the alpha amino nitrogen content of the wort can be estimated by the following formula:
in the formula,
is the mass concentration of alpha amino nitrogen of component i, and kappa is the amino nitrogen coefficient.
Fourthly, the wheat juice beta glucan
The beer containing a proper amount of beta glucan is one of the substances for keeping the mellow feeling of the beer, but if the beta glucan is too much, the decomposition of the beta glucan in the malt is insufficient, and a series of related problems are brought about in the beer brewing process. Therefore, the content of beta glucan in the malting process is lower than 250 mg/L. And the wort beta glucan content can be estimated by the following formula:
in the formula,
is the beta glucan mass concentration of the component i, and nu is the glucan coefficient.
Fifth thickness of the groove layer of the filter tank
During mashing, the insoluble spent grain contained in the mash will form a layer of grains. The thickness of the grains is too thick, the filtration speed of the wort is slow, and the filtration time is prolonged; the thickness of the layer is too thin, which, although increasing the filtration rate, reduces the clarity of the wort. The thickness of the grain layer in the production is generally controlled to be 30-50 cm. And the thickness of the tank can be estimated by the following formula:
wherein D is the diameter of the filter tank equipment,
the yield of component i is the cell yield.
And 3, optimizing the beer formula model by using a variable-scale ant colony optimization method, and finally solving the production formula with the lowest cost. The method comprises the following specific steps:
firstly, initializing parameters, dividing each component into N equal parts by mass percentage, and performing discrete interval of each component
Wherein,
the upper and lower limits of the mass percentage of the components.
If max (h)1,h2,...,hn) Stopping the algorithm when the epsilon is less than or equal to epsilon, and outputting the current optimal scheme, wherein epsilon represents the ending condition; otherwise, turning to the step 3;
(r, i) is the ith node on the r component, and the numerical value is marked as Xr,i(ii) a (r +1, j) is the jth node on the r +1 component; [ (r, i), (r +1), j)]Is a connecting line from the node (r, i) to the node (r +1, j), the probability that the ant k transfers from the position (r, i) to the position (r +1, j) at the time t during the movement of the ant group with the number m of ants in the ant group is
<math><mrow><msubsup><mi>p</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow><mi>k</mi></msubsup><mrow><mo>(</mo><mi>t</mi><mo>)</mo></mrow><mo>=</mo><mfrac><mrow><msub><mi>τ</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow></msub><mrow><mo>(</mo><mi>t</mi><mo>)</mo></mrow></mrow><mrow><munderover><mi>Σ</mi><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><msub><mi>M</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msub></munderover><msub><mi>τ</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow></msub><mrow><mo>(</mo><mi>t</mi><mo>)</mo></mrow></mrow></mfrac></mrow></math>
In the formula: m
r+1Is the allowable value range of the r +1 component, and ensures that the sum of the proportions of all varieties is not more than 100 percent. If the r +1 th variety is not the last undetermined variety, M
r+1A value range of
But for the last breed, M
r+1Can only take values of
τ
[(r,i),(r+1,j)](t) at time t at [ (r, i), (r +1), j]The intensity of pheromone concentration remained on the connecting line is equal to that on each path under the initial condition, i.e. tau
[(r,i),(r+1,j)](0) C constant.
Ant k (k 1, 2.. m) is randomly selected according to the probability on each path. In the process of creating the solution, after ants visit the nodes, the pheromones on the paths traveled by the ants are updated by adopting a local pheromone updating rule
<math><mrow><msubsup><mi>τ</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow><mi>new</mi></msubsup><mo>=</mo><mrow><mo>(</mo><mn>1</mn><mo>-</mo><mi>ρ</mi><mo>)</mo></mrow><msubsup><mi>τ</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow><mi>old</mi></msubsup><mo>+</mo><mi>ρ</mi><mo>·</mo><mi>Δτ</mi></mrow></math>
Where ρ is an information amount attenuation parameter, (0 < ρ < 1), let
Q is a constant, J
nnThe formula cost of the ant obtaining scheme is shown. Each ant is recurred in this way and finally generates a respective formulation.
Fourthly, eliminating the infeasible schemes which do not meet the production indexes by using the index model, calculating formula cost J of the feasible schemes according to the following formula, comparing the formula cost J with the best scheme, and recording the scheme as the best scheme if the formula cost J is less than the formula cost in the best scheme;
wherein M is
iIs the unit price of the starting component i.
Fifthly, when all ants construct a formula scheme, the pheromone is globally updated according to the following formula to obtain the concentration intensity of the pheromone
In the formula: j. the design is a squaremin gbThe lowest value of the objective function obtained at the start of the iteration.
Sixthly, updating iteration times t ← t + 1; if t is more than or equal to tmaxTurning to the step 3; otherwise, find the best scheme at present, update xr0、wrWherein w isr=2·hrAnd correcting the upper and lower search limits x according to the following formularupper、xrlowerGo to step 1, where xr0Is the best quality percentage of the r component in the best scheme.
<math><mfenced open='{' close=''><mtable><mtr><mtd><msubsup><mi>x</mi><mi>r</mi><mi>upper</mi></msubsup><mo>←</mo><mn>1</mn><mo>,</mo><msubsup><mi>x</mi><mi>r</mi><mi>lower</mi></msubsup><mo>←</mo><mn>1</mn><mo>←</mo><msub><mi>w</mi><mi>r</mi></msub></mtd><mtd><mi>if</mi><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>+</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>></mo><mn>1</mn></mtd></mtr><mtr><mtd><msubsup><mi>x</mi><mi>r</mi><mi>upper</mi></msubsup><mo>←</mo><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>+</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>,</mo><msubsup><mi>x</mi><mi>r</mi><mi>lower</mi></msubsup><mo>←</mo><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>-</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac></mtd><mtd><mi>if</mi><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>+</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>≤</mo><mn>1</mn><mi>and</mi><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>-</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>></mo><mn>0</mn></mtd></mtr><mtr><mtd><msubsup><mi>x</mi><mi>r</mi><mi>upper</mi></msubsup><mo>←</mo><msub><mi>w</mi><mi>r</mi></msub><mo>,</mo><msubsup><mi>x</mi><mi>r</mi><mi>lower</mi></msubsup><mo>←</mo><mn>0</mn></mtd><mtd><mi>if</mi><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>-</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>≤</mo><mn>0</mn></mtd></mtr></mtable></mfenced></math>
Compared with the prior art, the invention has the following beneficial effects: the method has the characteristics of openness, robustness, parallelism, global convergence, no special requirement on the mathematical form of the problem and the like.
Detailed Description
The invention will be further described with reference to the accompanying drawings.
The method comprises the following steps:
step 1, obtaining parameters such as the yield, alpha amino nitrogen, saccharifying power, total soluble nitrogen, beta glucan, unit price and the like of main raw materials (including barley malt, special malt, wheat malt, auxiliary raw materials and the like) in a beer formula, wherein the data can be obtained by suppliers or statistics in the production process;
and 2, establishing a comprehensive production performance index estimation model according to the parameters of the raw materials, wherein the main comprehensive performance indexes considered are malt saccharification capacity, wort total nitrogen, wort alpha-amino nitrogen, wort beta-glucan and the thickness of a filter tank grain layer.
Malt saccharification ability
Under normal saccharification operation (30-45 min at 65-68 ℃), each kilogram of mixed raw materials should contain 1500-2000 WK of saccharification force. The upper limit value can shorten the refining time and obtain the wort with higher fermentation degree; the lower limit value of saccharification time is long, and the fermentation degree is low. If the weight is less than 1500WK, the saccharification operation is influenced, the utilization rate of raw materials is influenced, and the composition of wort is influenced. And the total soluble nitrogen of the malt can be estimated according to the following formula:
in the formula, Ti、XiRespectively representing the saccharifying power intensity and mass fraction of the component i, wherein i is more than or equal to 1 and less than or equal to n;
② total nitrogen of wort
The total soluble nitrogen level of a typical beer wort is:
900-1200 mg/L whole malt wort
Adding 700-850 mg/L of concentrated alcohol beer wort as auxiliary material
550-700 mg/L of light beer wort added with auxiliary materials
Also, the total soluble nitrogen of wort can be estimated as follows:
in the formula,
is the total nitrogen mass concentration of component i; A. v is the total mass of raw materials required by a batch and the required wort yield, and the unit is kilogram and liter respectively; gamma, gamma,
The protein decomposition strength and the boiling nitrogen precipitation rate are respectively.
③ wort alpha amino nitrogen
The alpha amino nitrogen of the wort is related to the flavor substances of the beer, namely high-grade alcohol and diacetyl, and the control of the concentration of the alpha amino nitrogen of the wort is particularly important for controlling the flavor of the beer. Generally, the alpha amino nitrogen of the wort is preferably controlled within the range of 160-180 mg/L. And the alpha amino nitrogen content of the wort can be estimated by the following formula:
in the formula,
is the mass concentration of alpha amino nitrogen of component i, and kappa is the amino nitrogen coefficient.
Fourthly, the wheat juice beta glucan
The beer containing a proper amount of beta glucan is one of the substances for keeping the mellow feeling of the beer, but if the beta glucan is too much, the decomposition of the beta glucan in the malt is insufficient, and a series of related problems are brought about in the beer brewing process. Therefore, the content of beta glucan in the malting process is lower than 250 mg/L. And the wort beta glucan content can be estimated by the following formula:
in the formula,is the beta glucan mass concentration of the component i, and nu is the glucan coefficient.
Fifth thickness of the groove layer of the filter tank
During mashing, the insoluble spent grain contained in the mash will form a layer of grains. The thickness of the grains is too thick, the filtration speed of the wort is slow, and the filtration time is prolonged; the thickness of the layer is too thin, which, although increasing the filtration rate, reduces the clarity of the wort. The thickness of the grain layer in the production is generally controlled to be 30-50 cm. And the thickness of the tank can be estimated by the following formula:
wherein D is the diameter of the filter tank equipment,
the yield of component i is the cell yield.
And 3, optimizing the beer formula model by using a variable-scale ant colony optimization method, and finally solving the production formula with the lowest cost. The method comprises the following specific steps:
firstly, initializing parameters, dividing each component into N equal parts by mass percentage, and performing discrete interval of each component
Wherein,
the upper and lower limits of the mass percentage of the components.
As shown in fig. 1, each vertical stripe represents a material and is discretized into N equal parts, and the discretized nodes represent the mass fraction of the component. After discrete processing, the formula optimization problem is changed into a problem of finding an optimal path. Ants start from a start point, gradually pass through nodes on each variety, and finally reach an end point, so that one circulation is completed, and a complete formula is formed.
If max (h)1,h2,...,hn) Stopping the algorithm when the epsilon is less than or equal to epsilon, and outputting the current optimal scheme, wherein epsilon represents the ending condition; otherwise, turning to the step 3;
(r, i) is the ith node on the r component, and the numerical value is marked as Xr,i(ii) a (r +1, j) is the jth node on the r +1 component; [ (r, i), (r +1), j)]Is a connecting line from the node (r, i) to the node (r +1, j), the probability that the ant k transfers from the position (r, i) to the position (r +1, j) at the time t during the movement of the ant group with the number m of ants in the ant group is
<math><mrow><msubsup><mi>p</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow><mi>k</mi></msubsup><mrow><mo>(</mo><mi>t</mi><mo>)</mo></mrow><mo>=</mo><mfrac><mrow><msub><mi>τ</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow></msub><mrow><mo>(</mo><mi>t</mi><mo>)</mo></mrow></mrow><mrow><munderover><mi>Σ</mi><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><msub><mi>M</mi><mrow><mi>r</mi><mo>+</mo><mn>1</mn></mrow></msub></munderover><msub><mi>τ</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow></msub><mrow><mo>(</mo><mi>t</mi><mo>)</mo></mrow></mrow></mfrac></mrow></math>
In the formula: m
r+1Is the allowable value range of the r +1 component, and ensures that the sum of the proportions of all varieties is not more than 100 percent. If the r +1 th variety is not the last undetermined variety, M
r+1A value range of
But for the last breed, M
r+1Can only take values of
At time t in [ (r, i), (r +1), j]The intensity of pheromone concentration remained on the connecting line is equal to that on each path under the initial condition, i.e. tau
[(r,i),(r+1,j)](0) C constant.
Ant k (k 1, 2.. m) is randomly selected according to the probability on each path. In the process of creating the solution, after ants visit the nodes, the pheromones on the paths traveled by the ants are updated by adopting a local pheromone updating rule
<math><mrow><msubsup><mi>τ</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow><mi>new</mi></msubsup><mo>=</mo><mrow><mo>(</mo><mn>1</mn><mo>-</mo><mi>ρ</mi><mo>)</mo></mrow><msubsup><mi>τ</mi><mrow><mo>[</mo><mrow><mo>(</mo><mi>r</mi><mo>,</mo><mi>i</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><mi>r</mi><mo>+</mo><mn>1</mn><mo>,</mo><mi>j</mi><mo>)</mo></mrow><mo>]</mo></mrow><mi>old</mi></msubsup><mo>+</mo><mi>ρ</mi><mo>·</mo><mi>Δτ</mi></mrow></math>
Where ρ is an information amount attenuation parameter, (0 < ρ < 1), let
Q is a constant, J
nnShowing the formula cost of the ant obtaining scheme. Each ant is recurred in this way and finally generates a respective formulation.
Fourthly, eliminating the infeasible schemes which do not meet the production indexes by using the index model, calculating formula cost J of the feasible schemes according to the following formula, comparing the formula cost J with the best scheme, and recording the scheme as the best scheme if the formula cost J is less than the formula cost in the best scheme;
wherein M is
iIs the unit price of the starting component i.
Fifthly, when all ants construct a formula scheme, the pheromone is globally updated according to the following formula to obtain the concentration intensity of the pheromone
In the formula: j. the design is a squaremin gbThe lowest value of the objective function obtained at the start of the iteration.
Sixthly, updating iteration times t ← t + 1; if t is more than or equal to tmaxTurning to the step 3; otherwise, find the best scheme at present, update xr0、wrWherein w isr=2·hrAnd correcting the upper and lower search limits x according to the following formularupper、xrlowerGo to step 1, where xr0Is at bestThe optimal mass percentage of the component r in the scheme.
<math><mfenced open='{' close=''><mtable><mtr><mtd><msubsup><mi>x</mi><mi>r</mi><mi>upper</mi></msubsup><mo>←</mo><mn>1</mn><mo>,</mo><msubsup><mi>x</mi><mi>r</mi><mi>lower</mi></msubsup><mo>←</mo><mn>1</mn><mo>←</mo><msub><mi>w</mi><mi>r</mi></msub></mtd><mtd><mi>if</mi><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>+</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>></mo><mn>1</mn></mtd></mtr><mtr><mtd><msubsup><mi>x</mi><mi>r</mi><mi>upper</mi></msubsup><mo>←</mo><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>+</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>,</mo><msubsup><mi>x</mi><mi>r</mi><mi>lower</mi></msubsup><mo>←</mo><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>-</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac></mtd><mtd><mi>if</mi><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>+</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>≤</mo><mn>1</mn><mi>and</mi><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>-</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>></mo><mn>0</mn></mtd></mtr><mtr><mtd><msubsup><mi>x</mi><mi>r</mi><mi>upper</mi></msubsup><mo>←</mo><msub><mi>w</mi><mi>r</mi></msub><mo>,</mo><msubsup><mi>x</mi><mi>r</mi><mi>lower</mi></msubsup><mo>←</mo><mn>0</mn></mtd><mtd><mi>if</mi><msub><mi>x</mi><mrow><mi>r</mi><mn>0</mn></mrow></msub><mo>-</mo><mfrac><msub><mi>w</mi><mi>r</mi></msub><mn>2</mn></mfrac><mo>≤</mo><mn>0</mn></mtd></mtr></mtable></mfenced></math>