Research Article

Development of an Automatic Dispensing System for Traditional Chinese Herbs

Algorithm 1

Iterative refinement method.
Input: Stipulated number of iterations I, current number of iterations i, previous retrieval equation y 1(x), current retrieval equation y 2(x), and corresponding R-squared values R 1 and R 2
Output: Target retrieval equation y(x)
(1) Designate retrieval weight, with 1 g as sampling point, retrieval from 5 g to 15 g;
(2) Calculate retrieval equation y 1(x) using LSR (Eq. (2));
(3) Retrieve designated quantity (weight) of herb using y 1(x);
(4) Calculate corresponding R-squared value R 1 based on retrieval results and formulate new retrieval equation y 2(x);
(5) Repeat Steps 3 and 4 using y 2(x) and obtain R-squared value R 2;
if R 2 > R 1, y 1(x) = y 2(x);
Current number of iterations i = i + 1;
if i < I, go to step 3;
else, y(x= y 1(x), return y(x);