*Article* **Constrained Parameter Estimation for a Mechanistic Kinetic Model of Cobalt–Hydrogen Electrochemical Competition during a Cobalt Removal Process**

**Yiting Liang, Yuanhua Zhang and Yonggang Li \***

School of Automation, Central South University, Changsha 410083, China; liang\_yiting@csu.edu.cn (Y.L.); 184612192@csu.edu.cn (Y.Z.)

**\*** Correspondence: liyonggang@csu.edu.cn

**Abstract:** A mechanistic kinetic model of cobalt–hydrogen electrochemical competition for the cobalt removal process in zinc hydrometallurgical was proposed. In addition, to overcome the parameter estimation difficulties arising from the model nonlinearities and the lack of information on the possible value ranges of parameters to be estimated, a constrained guided parameter estimation scheme was derived based on model equations and experimental data. The proposed model and the parameter estimation scheme have two advantages: (i) The model reflected for the first time the mechanism of the electrochemical competition between cobalt and hydrogen ions in the process of cobalt removal in zinc hydrometallurgy; (ii) The proposed constrained parameter estimation scheme did not depend on the information of the possible value ranges of parameters to be estimated; (iii) the constraint conditions provided in that scheme directly linked the experimental phenomenon metrics to the model parameters thereby providing deeper insights into the model parameters for model users. Numerical experiments showed that the proposed constrained parameter estimation algorithm significantly improved the estimation efficiency. Meanwhile, the proposed cobalt–hydrogen electrochemical competition model allowed for accurate simulation of the impact of hydrogen ions on cobalt removal rate as well as simulation of the trend of hydrogen ion concentration, which would be helpful for the actual cobalt removal process in zinc hydrometallurgy.

**Keywords:** cobalt removal process; mechanistic kinetic model; parameter estimation; constrained parameter estimation

Current zinc production is mainly based on zinc pyrometallurgy and zinc hydrometallurgy with the latter accounting for more than 80% of zinc production capacity [1]. Zinc hydrometallurgy consists of four processes: calcination, leaching, purification, and electrolysis. In the purification process, zinc dust is added for displacement deposition of impurity elements such as cobalt, nickel, and copper in the leaching solution thereby preventing co-deposition of impurity ions with zinc during the electrolysis process and the consequent decrease in electrolysis efficiency. The purification process involves the removal of copper, cobalt, and cadmium ions; cobalt ions are the most difficult to remove thereby making the cobalt removal step the most crucial.

The main reaction in the cobalt removal step is generally the electrochemical reaction of zinc–copper microcells [2–4]. Exposed zinc on the microcell surface undergoes oxidation to become zinc ions while cobalt ions obtain electrons and are reduced to elemental cobalt accompanied by reduction of hydrogen ions to hydrogen molecules. Low pH conditions (pH = 3–5) are usually adopted for cobalt removal to avoid zinc ions from forming basic zinc sulfate, which would deactivate the zinc dust by absorbing it onto its surface [5]. However, hydrogen ions have greater reactivity than cobalt ions on the zinc surface thereby making high-concentration hydrogen ions compete with cobalt ions for electrons result in a significant drop in the removal rate of cobalt [6]. To circumvent this competition, it is necessary to add copper salts, antimony salts, or arsenic salts as a catalyst to reduce the competitive reduction of hydrogen ions.

**Citation:** Liang, Y.; Zhang, Y.; Li, Y. Constrained Parameter Estimation for a Mechanistic Kinetic Model of Cobalt–Hydrogen Electrochemical Competition during a Cobalt Removal Process. *Entropy* **2021**, *23*, 387. https://doi.org/10.3390/ e23040387

Academic Editor: Jing Na

Received: 22 February 2021 Accepted: 21 March 2021 Published: 24 March 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

Despite such catalyst application, zinc dust in an amount twice the theoretically required amount should be used to decrease the concentration of cobalt ions to a proper level. The excess consumption of zinc dust arises from the competitive reduction of hydrogen ions. Given the large consumption of zinc dust in the purification process, how to model and estimate the cobalt removal process to achieve model-based optimal control of the cobalt removal process is an important research topic [7–10].

To model cobalt removal in the purification process of zinc hydrometallurgy, Wang [7] developed a first-order reaction kinetic model of cobalt removal assuming that the cobalt removal rate was proportional to the surface area of the zinc dust. They further used this model to develop a cobalt removal process model for continuous stirred-tank reactors (CSTRs) in series. Sun et al. [8] used the electrochemical mechanism of microcells in the cobalt removal process and treated the cathodic and anodic reactions in the cobalt removal process as independent processes under mixed potential control. They proposed a firstorder electrochemical kinetic model based on mixed potential and seed concentration for the first time. Sun [9] proposed a modeling framework for strongly nonlinear processes based on multi-mechanism model synthesis, which nicely simulated the removal process of cobalt by arsenic salts. Li et al. [10] modeled cobalt removal via several interacting CSTR (ICSTR) systems with multiple time delays based on a mechanism of sharing the surface area of zinc dust in view of the competitive reduction of multiple ions in the cobalt removal process as well as the use of multiple stirred reactors in series. However, there remain multiple reactions in the zinc sulfate solution during the cobalt removal process: (1) competitive reduction of hydrogen ions and cobalt ions on the microcell surface; and (2) zinc ion hydrolysis that compensates for the loss of hydrogen ions due to reductive hydrogen evolution thereby slowing the rise of pH and affecting the cobalt removal rate. However, the cobalt removal process models proposed by Wang [7] and Sun [8,9] did not consider the competitive inhibitory effect of hydrogen ions on cobalt displacement, and the competitive reaction model was based on a mechanism of sharing the surface area of zinc dust [10]; it ignored the electrochemical nature of the competitive reaction. In addition, the impact of zinc hydrolysis on the concentration of hydrogen ions was ignored when modeling hydrogen reaction rates. These shortcomings are unfavorable for accurate assessment of the impact of pH fluctuation on zinc dust consumption and cobalt ion concentration during the cobalt removal process thereby adversely affecting optimal control of the cobalt removal process. Therefore, it is necessary to develop a kinetic model that not only incorporates the underlying electrochemical mechanism of the cobalt–hydrogen competitive reaction in the cobalt removal process but also reveals the trend of hydrogen ion concentration.

In addition to the difficulty in laying out the model structure, parameter estimates for the cobalt removal kinetic model also face many other challenges. The electrochemical reaction of various ions in the cobalt removal process and the coupling of hydrogen evolution with zinc ion hydrolysis are highly nonlinear processes. Parameter estimates for such strongly nonlinear dynamic systems usually occur through two classes of approaches.

The first class of approach estimate directly identifies the dynamic equations based on the time series of full-state values rather than solving the dynamic system [11,12]. For example, the SINDy algorithm [11] is a sparse estimation algorithm for nonlinear systems and estimates the first-order or even higher-order derivatives of the state according to available data. It then substitutes the derivatives into the state equation to estimate parameters. This approach is advantageous in that it avoids the strong nonlinearity arising from the integration of the dynamic system, but the disadvantage is that it requires highfrequency sampling of full-state data. For systems whose measurement values are partially missing or whose states are not all measurable, the state distribution at each time point can be recursively estimated through filtering and expectation-maximization followed by model parameter estimation through a state recursion equation [12,13]. However, this algorithm ensures convergence only when the initial estimates of parameters are relatively accurate.

The second class of approach is to solve the dynamic system and estimate model parameters by minimizing the differences between predicted outputs and measurements, which are usually unconstrained or simple constraints, like the upper and lower bounds of the parameters to be estimated. Different optimization algorithms may be involved in this approach—namely gradient-based optimization algorithms such as a sequential quadratic programming algorithm) versus heuristic optimization algorithms. Chai et al. [14] proposed a parameter estimation scheme for nonlinear time-delay dynamic systems that adopted a variational method to derive a formula for rapid gradient calculation greatly improving parameter estimation efficiency. However, gradient-based parameter estimation algorithms can only find locally optimal parameters and are not suitable for estimating model parameters of strongly nonlinear dynamic systems. Therefore, heuristic optimization algorithms such as particle swarm optimization (PSO) algorithms [15], state transition algorithms [16], differential evolution algorithms [17] and bee colony algorithm [18] have been widely used in parameter estimation of nonlinear systems. For example, Zhang [19] used a PSO algorithm to estimate parameters for a non-linear model of copper removal in the purification process of zinc hydrometallurgy. Deng et al. [20] used a state transition algorithm to estimate model parameters for the electrolysis process of zinc hydrometallurgy. In addition to heuristic optimization algorithms, additional prior information was incorporated into the estimation framework to narrow the parameter search space thus improving estimation efficiency and accuracy. Liu et al. [21] constructed a parameter optimization framework for a model of microbial batch fermentation that incorporated continuous state constraints according to the process mechanism and adopted an improved differential evolution algorithm to solve the estimation optimization problem. The continuous state constraints provide additional prior information for model parameter estimation to improve the reliability of estimation results. Improved differential evolution algorithms are more likely than gradient-based optimization algorithms to find globally optimal solutions, but they still use constraint penalty functions, which leads to a low estimation efficiency.

High-frequency sampling of state data is difficult for the cobalt removal process. Meanwhile, the kinetic and thermodynamic parameters in chemical databases only apply to specific experimental conditions (e.g., temperature, solution composition, and reactive electrode material) and model structures, which makes it difficult to accurately estimate the value range of a given parameter using chemical databases. These limitations prevent the algorithms above from being directly used in estimating the parameters of a given mechanistic kinetic model of the cobalt removal process. In the case of an unknown range of parameter values, a wide range of parameter searching is required to improve the solution accuracy. However, the non-linear dynamic system is solved each time that the objective function is calculated making the wide-range search time-consuming and inefficient and thereby limiting the estimation accuracy.

To overcome the obstacles to kinetic model development and parameter estimation of the cobalt removal process, firstly, this study developed a mechanistic kinetic model of cobalt–hydrogen electrochemical competition during the cobalt removal process. This model was composed of three models for the cobalt removal process: an electrochemical rate model, a mixed potential model of zinc dust, cobalt ions, and hydrogen ions, and a hydrolysis rate model of zinc ions. These models were all constructed in accordance with the principles of microcells and electrochemical kinetics. Secondly, this study proposed a constrained estimation scheme for model parameters. Specifically, mechanistic equations were simplified according to experimental data, and were then used to obtain approximate estimation equations for experimental metrics. Next, value ranges of experimental metrics were estimated according to experimental data to impose constraints on parameter estimation and narrow the parameter search space followed by transforming such constrained parameter estimation problem to an easy-to-solve box-constrained optimization problem through quasi-linear mapping of the parameters to be estimated. That is, the estimation problem of a given parameter with a difficult-to-estimate value range was transformed to the estimation problem of an experimental metric whose value range would be easily estimated from available experimental data. Meanwhile, the constraint conditions provided a relational expression directly linking the experimental metrics to the model parameters thereby providing deeper insights into the model parameters for model users.

The proposed parameter estimation scheme has three advantages. First of all, compared with the conventional unconstrained identification algorithm, the proposed constrained parameter estimation scheme does not depend on the information about the possible range of the parameters to be estimated. It obtains the searching space of parameters by building constraints of parameters based on a reasonable approximation of the experimental metrics of which rough ranges are easy to be obtained from available experimental data. As a result, the time consumption for searching optimal parameter value is dramatically reduced. Secondly, compared to the identification algorithms based on high-frequency sampling data, such as SINDy or filtering-based parameter estimation methods, it requires only low-frequency sampling experimental data. Thirdly, the constraint conditions provided by the scheme directly link the experimental phenomenon metrics to the model parameters, which provide a sense of intuition about how to adjust the parameters while the phenomenon changes in actual processes for model users.

The rest of this paper is organized as follows. In Section 1, a mechanistic kinetic model of cobalt–hydrogen electrochemical competition in the cobalt removal process is developed. In Section 2, a state-space model for cobalt removal in batch-type reactors is established based on the kinetic model and the principle of conservation of matter followed by introducing constraints into the model to construct a constrained parameter estimation problem and then transforming the problem into an easy-to-solve box-constrained optimization problem. In Section 3, the accuracy and efficiency of the proposed constrained parameter estimation algorithm in estimating model parameters based on experimental data are verified versus a conventional algorithm.

#### **1. Cobalt–Hydrogen Electrochemical Competition Model for the Cobalt Removal Process**

#### *1.1. Mechanism Analysis of Cobalt Removal Process*

During zinc hydrometallurgy, the zinc ore is calcined and dissolved to form a zinc sulfate solution that is purified and sent for electrolysis to obtain pure zinc products. However, the zinc sulfate solution usually contains copper, cobalt, nickel, and other impurity ions. Of these, cobalt ions are the most difficult to remove, and excessive cobalt ions will cause a serious decrease in the efficiency of zinc electrolysis. Therefore, the cobalt removal step is a core step in the purification process of zinc metallurgy. The cobalt removal step is generally considered to involve electrochemical reactions on the surface of microcells as illustrated in Figure 1 [2–4]. Hydrogen ions have a high reactivity on the zinc and cobalt surfaces allowing hydrogen ions to compete with cobalt ions for electrons and thereby inhibit the displacement of cobalt. It is often necessary to add catalysts such as copper and antimony salts in the cobalt removal process to suppress the competitive hydrogen evolution on the zinc dust surface.

During the process of catalytic removal of cobalt by copper and antimony salts, the first reaction is the displacement of copper and antimony, which are deposited on the zinc dust surface to form active microcells. The displacement deposition of copper and antimony is very fast (complete within 5 min as reported by Lew [4]). Generally, the copper-antimony deposition is complete before cobalt begins to be deposited with cobalt deposition and hydrogen evolution on the microcells as well as zinc ion hydrolysis being the main reactions afterwards. The displacement of copper does not occur at the same time as that of copper and antimony; the competitive inhibitory effect of hydrogen ions on cobalt removal was the main focus of this study—we only investigated the electrochemical reactions of cobalt and hydrogen ions as well as zinc ion hydrolysis generating hydrogen ions. Three reversible half-cell reactions occur on the zinc-based microcell (Figure 1):

$$\text{Zn}^{2+} + 2\text{e}^- \leftrightarrow \text{Zn} \tag{1}$$

$$\text{Co}^{2+} + 2\text{e}^- \leftrightarrow \text{Co} \tag{2}$$

$$\text{2H}^+ + \text{2e}^- \leftrightarrow \text{H}\_2\tag{3}$$

Zinc ion hydrolysis occurs in the main solution as shown by the following formula:

$$\text{Zn}^{2+} + 2\text{H}\_2\text{O} \leftrightarrow \text{Zn(OH)}\_2 + 2\text{H}^+ \tag{4}$$

In the actual process of cobalt removal, the net direction of half-cell Reaction (1) is to the left providing the electrons required for the evolution of hydrogen and displacement deposition of cobalt. Cobalt ions are displaced and deposited through a half-cell Reaction (2). Hydron evolution occurs through half-cell Reaction (3) in which hydrogen ions compete with cobalt ions for electrons reducing the cobalt removal rate. Zinc ion hydrolysis replenishes hydrogen ions as they are reduced and evolve as hydrogen gas exerting a buffering effect and indirectly affecting the cobalt removal rate.

**Figure 1.** The micro-battery reaction mechanism of the cobalt removal process.

#### *1.2. Reaction Kinetics of Cobalt Removal*

Almost all the data published [2–6] showed that the activation energy of cobalt removal reaction was higher than 40 kJ/mol, so it must be a chemically controlled process rather than a diffusion-controlled one. The electrochemical reaction for cobalt removal occurs on the microcell surface and is driven by the potential difference between the microcell surface and the solution. Given the very small diameters of the microcells and the high electrical conductivity of zinc and copper as the major microcell electrodes, we assumed that the potential at different areas on the microcell surface is identical, which is referred to as mixed potential and denoted as *E*(*t*) in V. According to the principles of electrochemical kinetics—assuming that the total reactive surface area of microcells is proportional to the elemental zinc concentration—one can express the reverse rate of half-cell Reaction (1):

$$\sigma\_1(c(t), E(t)) = k\_1 c\_{\text{Zn},0}(c\_{\text{Zn}^{2+}}(t) \exp(-\frac{(\mathfrak{2}-\beta\_1)FE(t)}{RT}) - b\_1 \frac{c\_{\text{Zn}}(t)}{c\_{\text{Zn,0}}} \exp(\frac{\beta\_1 FE(t)}{RT})) \tag{5}$$

where *c*(*t*) represents the reactant concentration vector, *c*(*t*) = [*c*Zn2<sup>+</sup> (*t*), *c*Zn(*t*), *c*Co2<sup>+</sup> (*t*), *c*Co(*t*), *cH*<sup>+</sup> (*t*), *c*Zn(OH)<sup>2</sup> (*t*)] *T* ; *<sup>c</sup>M*(*t*), <sup>M</sup> = Zn2+, Zn, Co2+, Co, H+, Zn(OH)<sup>2</sup> is the concentration of reactant M in mol/L; *r<sup>i</sup>* , *i* = 1, . . . , 4 is the rate of reaction (i), which is a function of *c*(*t*) and *E*(*t*); *c*Zn,0 is the initial concentration of elemental zinc in mol/L; *k*<sup>1</sup> is the rate constant of Reaction (1); *b*<sup>1</sup> is the equilibrium constant of Reaction (1); *β*<sup>1</sup> is the anode transfer coefficient of Reaction (1); *F* is the Faraday constant (96,485 C/mol); *R* is the gas constant (8.314); and *T* is the reaction temperature (346 K in this study).

Assuming that cobalt displacement is determined by the electrochemical reaction and that the number of electrons involved is 2, the reaction rate of half-cell Reaction (2) can be expressed as:

$$r\_{\rm 2}(c(t), \mathbf{E}(t)) = k\_{\rm 2} c\_{\rm Zn,0}(c\_{\rm Co^{2+}}(t) \exp(-\frac{a\_{\rm 2}\mathbf{E}(t)\mathbf{F}}{RT}) - b\_{\rm 2} \frac{c\_{\rm Co}(t)}{c\_{\rm Zn,0}} \exp(\frac{(2-a\_{\rm 2})\mathbf{E}(t)\mathbf{F}}{RT})) \tag{6}$$

where *k*<sup>2</sup> is the rate constant of Reaction (2), *b*<sup>2</sup> is the equilibrium constant of Reaction (2), and *α*<sup>2</sup> is the cathode transfer coefficient of Reaction (2).

Given that the reverse of hydrogen evolution Reaction (3) is usually weak and can be ignored, only the forward reaction is considered in this study. Accordingly, the rate of hydrogen evolution reaction is:

$$r\_3(c(t), E(t)) = k\_3 c\_{\text{Zn,0}} c\_{H^+}(t) \exp(-\frac{a\_3 FE(t)}{RT}) \tag{7}$$

where *k*<sup>3</sup> is the rate constant of Reaction (3), *b*<sup>3</sup> is the equilibrium constant of Reaction (3), and *α*<sup>3</sup> is the cathode transfer coefficient of Reaction (3).

According to the principle of an electric double layer (EDL), the rate of change of mixed potential of a microcell is proportional to the total electrochemical current on the microcell as follows:

$$\dot{E}(t) = \mathcal{C}^{-1} F \sum\_{i=1}^{3} \mathcal{D}r\_i(c(t), E(t)) \tag{8}$$

where *C* is the capacitance of the EDL. The rate of hydrolysis Reaction (4) of zinc ions is:

$$r\_4(c(t), E(t)) = k\_4(c\_{\text{Zn}^{2+}}(t) - b\_4 c\_{\text{Zn(OH)}\_2}(t) c\_{H^+}(t)^2) \tag{9}$$

where *k*<sup>4</sup> is the rate constant of Reaction (4), and *b*<sup>4</sup> is the equilibrium constant of Reaction (4).

Formulas (5)–(9) constitute a kinetic model of cobalt–hydrogen electrochemical competition in the cobalt removal process, which contain many unknown parameters and whose estimation algorithms will be elaborated in the next section.

#### **2. Constrained Parameter Estimation Algorithms for The Cobalt–Hydrogen Electrochemical Competition Model**

For the cobalt–hydrogen electrochemical competition model, the value of hydrolysis rate constant *<sup>k</sup>*<sup>4</sup> was set to <sup>1</sup> <sup>×</sup> <sup>10</sup><sup>8</sup> in this study considering that its fluctuation within a certain range would have little impact on modeled concentration of cobalt and hydrogen ions. In addition, the charge and discharge time of a microcell was assumed to be less than the reaction characteristic time, i.e., *FC*−<sup>1</sup> was relatively large. In such a scenario, the fluctuation of *FC*−<sup>1</sup> within a certain range would have little impact on model results and accordingly its value was set to 1 <sup>×</sup> <sup>10</sup><sup>4</sup> . The important parameter vector to be estimated to be:

$$p^{(0)} = \begin{bmatrix} \beta\_1, a\_2, a\_3, k\_1, k\_2, k\_3, b\_1, b\_2, b\_4 \end{bmatrix} \tag{10}$$

In view of the great order of magnitudes in the fluctuation of reaction rate constants and equilibrium constants, the last six constants in *p* (0) were logarithm-transformed thereby leading to the following estimates of the parameter vector:

$$p^{(1)} = \left[\beta\_1, \alpha\_2, \alpha\_3, \ln(k\_1), \ln(k\_2), \ln(k\_3), \ln(b\_1), \ln(b\_2), \ln(b\_4)\right] \tag{11}$$

Lew and colleagues [4] performed experimental tests under 20 conditions to explore the impacts of copper and antimony contents, pH, zinc dust dosage, and zinc dust particle size on the efficiency of batch removal of cobalt under catalysis by copper and antimony. They obtained abundant kinetic data on the cobalt removal process. Experimental data under five conditions regarding the impact of pH on cobalt removal rate in that study were taken as source data to estimate the parameters of the present mechanistic kinetic

model. These experimental data were the monitored values of cobalt ion concentration at constant pH values of 3.0, 3.6, 4.0, and 4.4 as well as the monitored values of cobalt ion concentration and pH under an uncontrolled pH condition (Page 62, Figure 4-31; Page 47, Figure 4-10; page 42, Figure 4-4). Since the cobalt removal tests by Lew [4] were performed in batch reactors, a state-space model will be developed in Section 2.1 based on the cobalt–hydrogen competition model developed in Section 1 to describe the batch removal process of cobalt. Section 2.2 will construct a parameter estimation problem based on the state-space model and address the difficulty in solving the problem. Section 2.3 proposes constraint conditions to make the above parameter estimation problem become a constrained parameter estimation problem. Section 2.4 further transforms the problem into an easy-to-solve box-constrained optimization problem.

#### *2.1. State Space Model for the Batch Removal Process of Cobalt*

For a given half-cell reaction, its state function is constructed in terms of the cumulative concentration change of the reactant as follows:

$$\dot{x}\_i(t) = r\_i(c(t), E(t)), i = 1, \dots, 4 \tag{12}$$

where *t* represents time in min, and *xi*(*t*) the cumulative concentration changes of the reactant of reaction (*i*) in mol/L. The material balance equation in the batch reactor is:

$$\mathcal{L}(t) = \mathcal{c}\_0 + \Lambda \mathfrak{x}(t) \tag{13}$$

where *c*<sup>0</sup> is the vector of the initial concentration of reactants added in batch:

$$\mathbf{c}\_{0} = \left[ \mathbf{c}\_{\text{Zn}^{2+}, 0^{\prime}} \mathbf{c}\_{\text{Zn}, 0^{\prime}} \mathbf{c}\_{\text{Co}^{2+}, 0^{\prime}} \mathbf{c}\_{\text{Co}, 0^{\prime}} \mathbf{c}\_{H^{+}, 0^{\prime}} \mathbf{c}\_{\text{Zn}(\text{OH})\_{2}, 0} \right]^{T}$$

Here, *cM*,0 (M = Zn2+, Zn, Co2+, Co, H<sup>+</sup> , Zn(OH)2) is the initial concentration of reactant M in mol/L, and Λ is a stoichiometric coefficient matrix where column *i* represents the stoichiometric coefficients of all the six reactants for reaction (*i*), *i* = 1, 2, 3, and 4, based on Equations (1)–(4):

$$
\Lambda \,\,=\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & -1 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & -2 & 2 \\
0 & 0 & 0 & 1
\end{bmatrix} \tag{14}
$$

According to Equations (8) and (12), the mixed potential in the batch reactor is:

$$E(t) = E\_0 + FC^{-1} \begin{bmatrix} \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \end{bmatrix} x(t) \tag{15}$$

where *E*<sup>0</sup> is the initial mixed potential in V. Considering that the experimental data used for model parameter estimation in this study included cobalt ion concentration and pH, the model output is:

$$y(t) = \begin{bmatrix} c\_{\mathbb{G}o^2}(t) \\ c\_{H^+}(t) \end{bmatrix} = \begin{bmatrix} 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 \end{bmatrix} c\_0 + \begin{bmatrix} 0 & -1 & 0 & 0 \\ 0 & 0 & -2 & 2 \end{bmatrix} \mathbf{x}(t) \tag{16}$$

Equations (12)–(16) constitute a state-space model of the batch removal process of cobalt where the state vector is *x* and the output is *y*. For the convenience of description, function *G* is introduced to represent the relationship between the parameters, the initial concentration of reactants, and the model output in the state-space model (13) of the batch removal process of cobalt as follows:

$$y(t) = G(t|p, c\_0) \tag{17}$$

Since the experimental data used for model parameter estimation in this study also included the experimental data of batch removal of cobalt under constant-pH conditions, it is necessary to develop a state-space model for such removal processes under constant-pH conditions. Accordingly, the hydrogen ion concentration is set to a constant value in the state space model Equation (13) followed by solving the equations to obtain the model output. Specifically, Equations (13) and (16) are replaced by Equations (18) and (19), respectively:

$$\mathcal{L}(t) := \mathcal{c}\_0 + \Lambda^\* \mathfrak{x}(t) \tag{18}$$

$$y(t) = \begin{bmatrix} c\_{\text{Co}^{2+}}(t) \\ c\_{H^{+}}(t) \end{bmatrix} = \begin{bmatrix} 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 \end{bmatrix} c\_{0} + \begin{bmatrix} 0 & -1 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} \mathbf{x} \tag{19}$$

In Equation (18), one has:

$$
\Lambda^\* = \begin{bmatrix} -1 & 0 & 0 & -1 \\ 1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \tag{20}
$$

To simplify subsequent expressions, the relationship between the parameters obtained based on Equations (12), (15), (18), (19) and (20), the initial concentration of the reactants, and the model output is expressed as:

$$y(t) := G^\*(t|p, c\_0) \tag{21}$$

*2.2. Parameter Estimation Problem of Cobalt–Hydrogen Electrochemical Competition System*

For electrochemical rate Equations (5)–(7), the cathode and anode reaction transfer coefficients are confined in the following ranges:

$$
\beta\_1 \in [0.7, 1.5], \alpha\_2 \in [0.2, 0.8], \alpha\_3 \in [0.2, 0.8]
$$

In order to identify the model parameters, experimental data published in Lew [4], a doctoral thesis on the mechanism of the copper-antimony activated cobalt removal from zinc sulphate solutions, were used in this paper. In Lew [4], the cobalt removal experiments were carried out in a batch stirred reactor, as shown in Figure 2. The volume of the reactor is 4 L, and the stirring speed is 700 RPM. The main component of the reaction solution was ZnSO4, and a certain amount of copper, antimony and cobalt ions were added one time in advance according to the design of each experiment. Zinc powder was added at one time at the initial stage of the reaction. During the experiments, the cobalt ion concentration was measured by sampling using a 50-mL pipette at intervals of 5, 15, 30, 45, 60 and 90 min, and the pH values are monitored online. The data from five experiments are selected from Lew [4] for model identification: experiment with natural pH (initial pH = 3.7), controlled pH (pH = 3.0), controlled pH (pH = 3.6), controlled pH (pH = 4.0), and controlled pH (pH = 4.4). In general, the experimental setup of the data used by this study was performed under the following conditions:


**Figure 2.** The batch reactor for cobalt removal experiments of Lew [4].

Accordingly, the following parameter estimation problem is proposed:

$$\begin{array}{c|c|c}\min & \sum\_{j=1}^{5} \sum\_{i=1}^{n\_{\rm Co}} \left( \frac{1}{n\_{\rm Co}} \left| \ln \left( \frac{c^{(j)}\_{\rm Co^{2+},0}}{c^{(j)}\_{\rm Co^{2+}} + \left(t^{(j)}\_{i,\rm Co^{2+}}\right)} \right) - \ln \frac{c^{(j)}\_{\rm Co^{2+},0}}{c^{(j)}\_{\rm Co^{2+},j}} \right| \right) \\ & + \frac{\lambda\_{\rm pH}}{n\_{\rm pH}} \sum\_{l=1}^{\rm NH} \left| -\log\_{10} (c^{(1)}\_{\rm H^{+}} \left( t^{(1)}\_{l,H^{+}} \right)) - \rm \rm H\_{l} \right| \\ & \text{s.t.} \begin{bmatrix} \mathcal{E}^{(j)}\_{\rm Co^{2+}}(t) \\ \mathcal{E}^{(l)}\_{\rm O^{+}}(t) \end{bmatrix} = \begin{cases} & G(t \left| p^{(1)}, c^{(j)}\_{0} \right), \text{if } j=1, \\\ G^{\*}(t \left| p^{(1)}, c^{(j)}\_{0} \right), \text{if } j>1, \end{cases} \\ & \mathcal{J}\_{1} \in [0.7, 1.5], \mathcal{a}\_{2} \in [0.2, 0.8], \mathcal{a}\_{3} \in [0.2, 0.8]. \end{array} \tag{22}$$

where *j* = 1,2,3,4,5 represent natural pH, controlled pH (pH = 3.0), controlled pH (pH = 3.6), controlled pH (pH = 4.0), and controlled pH (pH = 4.4), respectively. For the natural pH condition, cobalt concentration data (Page 47, Figure 4-10) and pH values (page 42, Figure 4-4) were collected while for the other four controlled-pH conditions (*j* = 2,3,4,5) only cobalt concentration data were collected (Page 62, Figure 4-31). *c* (*j*) 0 represents the initial concentration in test *j*; *c*ˆ (*j*) Co2<sup>+</sup> (*t*) and *<sup>c</sup>*<sup>ˆ</sup> (*j*) *<sup>H</sup>*<sup>+</sup> (*t*) represent the model-predicted concentration of cobalt ion and hydrogen ion in test *j*, respectively; *c* (*j*) Co2+,*i* , and pH*<sup>l</sup>* represent the *i*-th measurement value of cobalt ion concentration and the *l*-th measurement value of pH in test *j*, respectively; *t* (*j*) *<sup>i</sup>*,Co2<sup>+</sup> and *<sup>t</sup>* (*j*) *<sup>l</sup>*,*H*<sup>+</sup> represent the measurement time of cobalt ion concentration and pH in test *j*, respectively; *λ*pH is the weight coefficient of pH; *n*pH is the number of collected pH values in test 1; and *n*Co,*<sup>j</sup>* is the number of collected concentration values of cobalt ions in test *j*.

The model parameters can be estimated by solving Equation (22), which is very difficult to solve. The nonlinearity of mechanistic kinetic Equations (5)–(9) makes Equation (22) a non-convex optimization problem, which is difficult to directly solve via gradientbased optimization algorithms (such as sequential quadratic programming algorithms and interior-point algorithms); however, it is usually solvable by heuristic optimization algorithms only when the ranges of parameter values are known. However, since the kinetic and thermodynamic parameters in the standard chemical databases apply to specific experimental conditions, such as temperature, solution composition, electrode matrix composition, and kinetic models, it is difficult to find corresponding values from chemical databases for the present model parameters (i.e., *k*1, *k*2, *k*3, *b*1, *b*2, *b*4) thereby making it impossible to estimate the reasonable value ranges of the parameters. To ensure that the optimal parameters are found, it is necessary to give a large parameter search range, but a large range search will result in low optimization efficiency. A more serious issue is that there is coupling between the competitive electrochemical reactions, the hydrogen

evolution, and the zinc ion hydrolysis in the cobalt–hydrogen electrochemical competition mechanism model, which forms a highly nonlinear process. As a result, there would be large differences in reaction characteristic time between reactions (1)–(4) when model parameters are randomly set to a value, thereby causing the state-space model of batch reactor to achieve a very stiff dynamic system. A trial solution of such a system is time-consuming and results in low optimization search efficiency.

The key to overcoming the limitations above is to accurately determine the parameter value ranges. Although it is impossible to directly obtain the value ranges of the model parameters, it is still possible to experimentally estimate a reasonable value range using some experimental data measured under certain conditions such as the mixed potential within a certain period of time, the apparent first-order reaction rate constant, the equilibrium concentration, and the change of the rate of solid deposition or gas evolution at a certain time. Provided that an approximate relationship between these experimental data and the model parameters is obtained, it would be possible to further impose constraints on the parameters to rapidly determine a reasonable range of parameter values and improve the solution efficiency.

In the next sub-section, assumptions are made based on experimental data to simplify the mechanistic equations so that they can be partially yet directly solved. The solutions are directly used to establish approximate expressions linking the model parameters to some experimental metrics. Next, constraints are introduced for the model parameters by specifying value ranges of the experimental metrics based on experimental data, thereby leading to a constrained parameter estimation scheme.

#### *2.3. Constrained Parameter Estimation Algorithm*

#### 2.3.1. Constraints on Electrochemical Parameters

In this sub-section, the cobalt removal experimental data at pH 3 reported by Lew [4] (Section 4, Page 60–62) will be analyzed in view of the test conditions so as to introduce proper consumptions for simplifying the reaction kinetic models. Next, the mixed potential, the apparent first-order reaction rate constant, and equilibrium cobalt concentration were estimated as experimental metrics according to the simplified kinetic equations to impose constraints on relevant electrochemical parameters of cobalt and hydrogen. The mixedpotential change rate Equation (8) is simplified. Based on the assumption that the charge and discharge of the EDL capacitor are fast (i.e., *FC*−<sup>1</sup> is sufficiently large), the charge and discharge time is ignored thereby allowing Equation (8) to be approximated by a balance equation:

$$\sum\_{i=1}^{3} r\_i(c(t), E(t)) = \begin{array}{c} \text{0} \end{array} \tag{23}$$

As indicated by the above equation, the total number of electrons lost through oxidation on a microcell is equal to the total number of electrons obtained through reduction. According to Lew [4] (Page 61, Table 4-2), the first-order reaction rate constant of cobalt was about <sup>489</sup> <sup>×</sup> <sup>10</sup>−<sup>6</sup> sec−<sup>1</sup> pH 3. The first-order reaction rate constant of hydrogen was estimated here to be <sup>767</sup> <sup>×</sup> <sup>10</sup>−<sup>5</sup> sec−<sup>1</sup> based on the early-stage portion (0–5 min) of the hydrogen evolution curve reported by Lew [4] (Page 70, Figure 4-42) with zero initial concentration of zinc ions. This was about 15 times that of cobalt. In the test at pH 3, the hydrogen ion concentration was approximately 2.26-times the cobalt ion concentration (26 mg/L). Considering that two electrons are consumed to displace a single cobalt ion while one electron is required for the reduction of a single hydrogen ion, the current of hydrogen evolution Reaction (3) is approximately 15 × 2.26/2 that of cobalt reduction (2). The concentration of cobalt ions became smaller with the passage of time. However, the concentration of hydrogen ions remained nearly constant under constant-pH conditions, which makes the current of Reaction (3) increasingly large relative to that of Reaction (2). Consequently, the current of Reaction (2) would have little impact on the mixed potential, which was largely affected by Reaction (3) and zinc dissolution Reaction (1). That is, the coefficient *r*<sup>2</sup> in Equation (23) can be ignored. In addition, the reverse rate of zinc dissolution Reaction (1) is assumed to be ignorable when estimating the mixed potential thereby allowing Equation (23) to be further simplified:

$$k\_1 c\_{\rm Zn,0} (-b\_1 \frac{c\_{\rm Zn}}{c\_{\rm Zn,0}} exp(\frac{\beta\_1 FE}{RT})) + k\_3 c\_{\rm Zn,0} c\_{H^+} exp(-\frac{a\_3 FE}{RT}) = 0 \tag{24}$$

The mixed potential can be estimated from Equation (24):

$$E\_{\rm est} = RTF^{-1}(\beta\_1 + \mathfrak{a}\_3)^{-1}(\ln(k\_3 c\_{\rm Zn,0} c\_{H^+}) - \ln(b\_1 k\_1 c\_{\rm Zn})) \tag{25}$$

The experimental data of Lew [4] (Page 61, Figure 4-29) showed that the potentiometer reading was approximately <sup>−</sup>0.6 V for sludge at pH 3 (*cH*<sup>+</sup> <sup>=</sup> <sup>10</sup>−<sup>3</sup> mol/L); thus, we assumed that *E*est ∈ [−0.7, −0.5]. In addition, the amount of zinc dust added during the cobalt removal reaction is excessive (more than 20 times the amount of zinc dust theoretically required for displacement of copper, antimony, and cobalt ions). Thus, we assumed that the content of zinc dust is roughly constant, namely *c*Zn ≈ *c*Zn,0. Substitution of this expression in Equation (25) leads to the following constraint:

$$-\left(\beta\_1 + \alpha\_3\right)^{-1} \left(\ln\left(b\_1 k\_1 k\_3^{-1}\right) + 3 \ln(10)\right) \in \left[-0.7 F(RT)^{-1}\right.\\ -0.5 F(RT)^{-1}\right] \tag{26}$$

Considering that the reverse rate of the displacement reaction of cobalt ions at the early stage is negligible compared to the forward rate, the displacement reaction rate of cobalt ions can be estimated using mixed-potential estimation Equation (25) as follows:

$$r\_2 \approx \left. k\_{2} c\_{\text{Zn,0}} c\_{\text{Co}^{2+}} \left( b\_1 k\_1 c\_{\text{Zn}} \right)^{\frac{a\_2}{\beta\_1 + a\_3}} \left( k\_{3} c\_{\text{Zn,0}} c\_{H^+} \right)^{-\frac{a\_2}{\beta\_1 + a\_3}} \tag{27}$$

Assuming that the content of zinc dust is roughly constant, namely *c*Zn ≈ *c*Zn,0, the apparent first-order reaction rate constant of cobalt displacement reaction can be calculated as follows:

$$
\tilde{k}\_2 \approx k\_2 c\_{\rm Zn,0} (b\_1 k\_1)^{\frac{a\_2}{\beta\_1 + a\_3}} (k\_3 c\_{H^+})^{-\frac{a\_2}{\beta\_1 + a\_3}} \tag{28}
$$

The experimental data of Lew [4] (Page 61, Table 4-2) showed that at pH 3, the apparent first-order reaction rate constant of cobalt displacement reaction was 0.02934 min−<sup>1</sup> . Considering the model simplification error, one may let <sup>e</sup>*k*<sup>2</sup> <sup>∈</sup> [0.015 min−<sup>1</sup> , 0.060 min−<sup>1</sup> ]. Based on Equation (28), the following constraint is obtained:

$$\begin{array}{c} \mathfrak{a}\_2(\mathfrak{f}\_1 + \mathfrak{a}\_3)^{-1}(\ln(k\_1) + \ln(b\_1) - \ln(k\_3) + 3\ln(10)) + \ln(k\_2) + \ln(c\_{\text{Zn},0}) \\ \in \left[ \ln(0.015), \ln(0.060) \right] \end{array} \tag{29}$$

The rate of hydrogen evolution reaction is:

$$r\_3 \approx k\_3 c\_{\text{Zn,0}} c\_{H^+} (b\_1 k\_1 c\_{\text{Zn}})^{\frac{a\_3}{\overline{\rho}\_1 + a\_3}} (k\_3 c\_{\text{Zn,0}} c\_{H^+})^{-\frac{a\_3}{\overline{\rho}\_1 + a\_3}} \tag{30}$$

Accordingly, the apparent first-order rate constant of hydrogen evolution reaction is:

$$
\widetilde{k}\_3 \approx \left. k\_3 c\_{\rm Zn,0} (b\_1 k\_1 c\_{\rm Zn})^{\frac{a\_3}{\beta\_1 + a\_3}} (k\_3 c\_{\rm Zn,0} c\_{H^+}) \right\}^{-\frac{a\_3}{\beta\_1 + a\_3}} \tag{31}
$$

As shown by the earlier analysis of the experimental data of Lew [4] in this sub-section, the rate constant of hydrogen evolution reaction was about 15 that of cobalt reduction at pH = 3. In view of the estimation error, the following constraint assumption is introduced for parameter estimation: At pH 3, the apparent pseudo-first-order rate of hydrogen evolution reaction is between 5–50 times the apparent first-order rate of cobalt reduction,

namely e*k*<sup>3</sup> e*k*2 −<sup>1</sup> ∈ [5, 50]. Taking logarithms of both sides based on Equations (31) and (28) while assuming that *c*Zn ≈ *c*Zn,0 yields the following constraint:

$$(\mathfrak{a}\_3 - \mathfrak{a}\_2) \left(\beta\_1 + \mathfrak{a}\_3\right)^{-1} \left(\ln(b\_1 k\_1 k\_3^{-1}) + 3 \ln(10)\right) + \ln(k\_3 k\_2^{-1}) \in \left[\ln(5), \ln(10)\right] \tag{32}$$

Substituting mixed-potential estimation expression (25) into the reaction rate Equation (6) of cobalt displacement Reaction (2) and letting *r*<sup>2</sup> = 0, the equilibrium concentration of cobalt can be calculated as:

$$c\_{\text{Co}^{2+},\text{eq}} = \frac{b\_{2}(k\_{3}c\_{\text{Zn},0}c\_{H^{+}})^{\frac{2}{\overline{\beta\_{1}}+a\_{3}}}(b\_{1}k\_{1}c\_{\text{Zn}})^{-\frac{2}{\overline{\beta\_{1}}+a\_{3}}}}{b\_{2}(k\_{3}c\_{\text{Zn},0}c\_{H^{+}})^{\frac{2}{\overline{\beta\_{1}}+a\_{3}}}(b\_{1}k\_{1}c\_{\text{Zn}})^{-\frac{2}{\overline{\beta\_{1}}+a\_{3}}}+c\_{\text{Zn},0}}c\_{\text{Co}^{2+},0} \tag{33}$$

According to the experimental data of Lew [4] (Page 47, Figure 4-10), *c*Co2+,eq ≤ 0.1*c*Co2+,0. Accordingly, the first term in the denominator of the above equation can be ignored. Moreover, assuming *c*Zn ≈ *c*Zn,0:

$$\mathcal{c}\_{\text{Co}^{2+},\text{eq}} \approx b\_2 (k\_3 c\_{H^+})^{\frac{2}{\overline{\rho}\_1 + a\_3}} (b\_1 k\_1)^{-\frac{2}{\overline{\rho}\_1 + a\_3}} c\_{\text{Zn,0}} \, ^{-1} \mathcal{c}\_{\text{Co}^{2+},0} \tag{34}$$

According to the experimental data of Lew [4] (Page 47, Figure 4-10), the logarithmic ratio (*ln*(*c*Co2+,0*c* −1 Co2+,eq )) of the equilibrium to the initial concentration of cobalt ions was approximately 4.2 at pH 3. It is assumed that *ln*(*c*Co2+,0*c* −1 Co2+,eq ) ∈ [3, 8] considering the model simplification error. Accordingly, the following constraint can be imposed:

$$\mathcal{Q}(\beta\_1 + \alpha\_3)^{-1} \left( \ln(k\_1 b\_1 k\_3^{-1}) + \Im \ln(10) \right) - \ln(b\_2) + \ln(c\_{\text{Zn,0}}) \in [\text{3,8}] \tag{35}$$

Moreover, the forward rate of zinc dissolution Reaction (1) considered in the mixedpotential equation is assumed to be less than the reverse rate thereby leading to the following constraint:

$$c\_{\rm Zn^{2+}} \exp(-\frac{(2-\beta\_1)FE\_{\rm est}}{RT}) \le \frac{1}{2} b\_1 \frac{c\_{\rm Zn}}{c\_{\rm Zn,0}} \exp(\frac{\beta\_1 FE\_{\rm est}}{RT}) \tag{36}$$

Mixed-potential estimation Equation (16) is substituted into the above equation while assuming *c*Zn ≈ *c*Zn,0. Meanwhile, given that the initial concentration of zinc ions (151 g/L) is far greater than the initial concentration of elementary zinc (4 g/L), it is further assumed that *c*Zn2<sup>+</sup> ≈ *c*Zn2+,0, i.e., the concentration of zinc ions remains constant. Accordingly, the following constraint can be imposed:

$$2\left(\beta\_1 + a\_3\right)^{-1}\left(\ln(b\_1 k\_1 k\_3^{-1}) + 3\ln(10)\right) - \ln(b\_1) + \ln(c\_{\text{Zn}^{2+},0}) \le -\ln(2)\tag{37}$$

#### 2.3.2. Constraints on Hydrolysis Parameters

The hydrolysis Reaction (4) affects the rate of cobalt displacement reaction mainly by releasing hydrogen ions and consequently alleviating the decreasing trend of hydrogen ion concentration. Hereinafter, the simplified model is analyzed to derive an equation to estimate the attenuation coefficient for the apparent rate of hydron ion consumption in the presence of zinc ion hydrolysis. Next, the estimation equation is used to derive a constraint on hydrolysis parameter *b*4. The hydrolysis Reaction (4) generally has large forward and reverse rate constants and thereby can be treated as a quasi-equilibrium reaction namely *r*<sup>4</sup> = 0. Therefore:

$$c\_{\rm Zn^{2+}} - b\_{\rm 4}c\_{\rm Zn(OH)\_2}c\_{H^+}^2 = 0 \tag{38}$$

Taking the total differential of the above equation:

$$
\delta c\_{\rm Zn^{2+}} - b\_4 c\_{H^+}^2 \delta c\_{\rm Zn(OH)\_2} - 2b\_4 c\_{\rm Zn(OH)\_2} c\_{H^+} \delta c\_{H^+} = 0 \tag{39}
$$

Taking the total differential of state Equation (12) and material balance Equation (13):

$$\begin{cases} \delta \mathbf{x}\_i(t) = r\_i \delta t\_i \dot{t} = 1, 2, 3\\ \delta \mathbf{c}\_{\mathbf{Zn}^{2+}} = -\delta \mathbf{x}\_1(t) - \delta \mathbf{x}\_4(t) \\ \delta \mathbf{c}\_{H^+} = -2\delta \mathbf{x}\_3(t) + 2\delta \mathbf{x}\_4(t) \\ \delta \mathbf{c}\_{\mathbf{Zn}(OH)\_2} = \delta \mathbf{x}\_4(t) \end{cases} \tag{40}$$

Substitution of Equation (40) into Equation (39) leads to:

$$\frac{\delta\mathbf{x}\_4(t)}{\delta t} = \frac{4b\_4c\_{\text{Zn(OH)}\_2}c\_{H^+}}{\left(1 + b\_4c\_{H^+}^2 + 4b\_4c\_{\text{Zn(OH)}\_2}c\_{H^+}\right)}r\_3 - \frac{1}{\left(1 + b\_4c\_{H^+}^2 + 4b\_4c\_{\text{Zn(OH)}\_2}c\_{H^+}\right)}r\_1 \tag{41}$$

A combination of Equation (41) with Equation (23) of equilibrium mixed potential:

$$\frac{\delta\mathbf{x}\_4(t)}{\delta t} = \frac{4b\_4c\_{\text{Zn(OH)}\_2}c\_{H^+} + 1}{\left(1 + b\_4c\_{H^+}^2 + 4b\_4c\_{\text{Zn(OH)}\_2}c\_{H^+}\right)}r\_3 + \frac{1}{\left(1 + b\_4c\_{H^+}^2 + 4b\_4c\_{\text{Zn(OH)}\_2}c\_{H^+}\right)}r\_2 \tag{42}$$

According to Equations (40) and (42), the rate of change of hydrogen ion concentration with time is:

$$\begin{array}{rcl} \dot{c}\_{H^{+}} &=& \frac{\delta c\_{H^{+}}}{\delta t} = \frac{-2\delta \mathbf{x}\_{3}(t) + 2\delta \mathbf{x}\_{4}(t)}{\delta t} \\ \dot{r}\_{1} &=& -\frac{2b\_{4}c\_{H^{+}}^{2}}{\left(1 + b\_{4}c\_{H^{+}}^{2} + 4b\_{4}c\_{\text{Zn(OH)}\_{2}}c\_{H^{+}}\right)}r\_{3} + \frac{2}{\left(1 + b\_{4}c\_{H^{+}}^{2} + 4b\_{4}c\_{\text{Zn(OH)}\_{2}}c\_{H^{+}}\right)}r\_{2} \end{array} \tag{43}$$

The second term in equation (43) incorporates the impact of cobalt removal rate *r*<sup>2</sup> on the rate of change of hydrogen ion concentration. Close examination of the experimental data of Lew [4] (Page 58, Figure 4-27) reveals that the pH evolution curve is only slightly affected by cobalt ion concentration thereby allowing one to ignore the second term of the above equation. In addition, rearrangement of hydrolysis equilibrium Equation (38) gives:

$$c\_{\text{Zn(OH)}\_2} = b\_4^{-1} c\_{\text{Zn^{2+}}} c\_{H^+}^{-2} \tag{44}$$

Substitution of Equation (44) into Equation (43) leads to Equation (45):

$$\dot{c}\_{H^{+}} = -2b\_{4}c\_{H^{+}}^{2} \left(1 + b\_{4}c\_{H^{+}}^{2} + 4c\_{\text{Zn}^{2+}}c\_{H^{+}}^{-1}\right)^{-1}r\_{3} \tag{45}$$

As shown above, zinc ion hydrolysis (4) alleviates the declining trend of hydrogen ion concentration. Therefore, the attenuation coefficient for the apparent consumption rate of hydrogen ions relative to the rate of hydrogen ion reduction (3) is less than one:

$$
\lambda\_{H^{+}} = b\_{4}c\_{H^{+}}^{2} \left( \left( 1 + b\_{4}c\_{H^{+}}^{2} + 4c\_{\text{Zn}^{2+}}c\_{H^{+}}^{-1} \right) \right)^{-1} \tag{46}
$$

The t-pH curve generated under the condition of zero initial concentration of zinc ions by Lew [4] (Page 70, Figure 4-42) showed that the rising slope of pH was much greater when the initial concentration of zinc ions was low than when it was high in the early stage (0–5 min) (Page 42, Figure 4-4). This trend suggests that the presence of zinc ions has a significant impact on the apparent rate of hydrogen evolution. Therefore, the attenuation coefficient *λH*<sup>+</sup> should be much less than 1 in the presence of zinc ions. Moreover, the third term of the denominator, which is a zinc ion-related term, is the largest one among the three terms: 4*c*Zn2<sup>+</sup> *c* −1 *<sup>H</sup>*<sup>+</sup> . Accordingly, the attenuation coefficient can be approximated as:

$$
\lambda\_{H^{+}} \approx b\_{4} c\_{H^{+}}^{2} \left( 4c\_{\text{Zn}^{2+}} c\_{H^{+}}^{-1} \right)^{-1} \tag{47}
$$

The experimental data of Lew [4] (Page 42, Figure 4-4) showed that when the pH was above 4.4, the slope of the pH curve was much smaller than that in the initial stage. It is assumed here that *λH*<sup>+</sup> |pH=4.4 ∈ [0.01, 0.1] and *c*Zn2<sup>+</sup> ≈ *c*Zn2+,0. Taking the logarithm of *λH*<sup>+</sup> , one has the following constraint on hydrolysis rate constant *b*4:

$$\ln(b\_4 c\_{\text{Zn}^{2+},0}^{-1}) \in \left[11.2 \times \ln(10) + \ln(4), 12.2 \times \ln(10) + \ln(4)\right] \tag{48}$$

In this section, to reduce the searching space of parameters, the constraints on parameters are derived based on the approximation of experimental phenomenon metrics. However, the approximation formula of experimental phenomenon metrics can also be useful in parameter adjustment and optimizing. For example, Equation (28) for apparent first-order reaction rate of cobalt removal, can be used for determining the rough range of the required zinc loading and pH setting value under the constraints about cobalt removal rates. Equations (28), (31), (34), (47) also provide some intuitive information about the relation between the model parameters and process dynamical behavior, and thus would be useful for adjustment of model parameters while the dynamic changes in practical cobalt removal process.

#### 2.3.3. Constrained Parameter Estimation Problem

Introduction of constraints (Equations (26), (29), (32), (35), (37) and (48)) into the parameter estimation problem (22) leads to a constrained parameter estimation problem:

*min p* (1) 5 ∑ *j*=1 *n*Co,*<sup>j</sup>* ∑ *i*=1 1 *n*Co,*<sup>j</sup> ln*( *c* (*j*) Co2+,0 *c*ˆ (*j*) Co2+ *t* (*j*) *i*,Co2+ ) − *ln*( *c* (*j*) Co2+,0 *c* (*j*) Co2+,*i* ) ! + *λ*pH *n*pH *n*PH ∑ *l*=1 <sup>−</sup>*log*10(*c*<sup>ˆ</sup> (1) *H*+ *t* (1) *l*,*H*+ ) − pH*<sup>l</sup>* s.t." *c*ˆ (*j*) Co2<sup>+</sup> (*t*) *c*ˆ (*j*) *<sup>H</sup>*<sup>+</sup> (*t*) # = *G*(*t p* (1) , *c* (*j*) 0 ), if *j* = 1, *G* ∗ (*t p* (1) , *c* (*j*) 0 ), if *j* > 1, *β*<sup>1</sup> ∈ [0.7, 1.5], *α*<sup>2</sup> ∈ [0.2, 0.8], *α*<sup>3</sup> ∈ [0.2, 0.8], (26),(29),(32),(35),(37),(48). (49)

Equation (49) contains nonlinear constraints (Equations (26), (29), (32), (35), (37) and (48)). Gradient-based constrained optimization algorithms such as the sequential quadratic programming algorithm and the interior-point algorithm can only handle convex constrained optimization or quasi-convex constrained optimization problems while Equation (49) is a non-convex constrained optimization problem and cannot be solved using such algorithms. Heuristic optimization algorithms are effective in solving non-convex, box-constrained optimization problems; i.e., each decision variable is bounded by two constant values as the upper and lower limits. However, because nonlinear constraints generally come in different forms and are difficult to handle in a unified manner, parameter optimization would be far less satisfactory under nonlinear constraints than under box constraints. A more serious problem is that most intelligent constrained optimization methods require sampling outside the feasible region such as various heuristic optimization algorithms with penalty functions.

In Equation (49), however, most of the parameters outside the feasible region are rigid parameters, which will cause the state-space model to be unsolvable and thus seriously affect the optimization efficiency. Therefore, the constraints contained in Equation (49) will be analyzed in the next sub-section to transform Equation (49) into an easy-to-solve boxconstrained optimization problem so that a general heuristic optimization algorithm can be used to iteratively optimize the parameters within the feasible region of the constraints to achieve higher solution efficiency and accuracy.

#### *2.4. Parameter Transformation before Estimation*

Constraints (Equations (26), (29), (32), (35), (37) and (48)) will be linear constraints in which are linearly combined if are ignored. Optimization problems with linear constraints can be transformed to a box-constrained optimization problem through linear mapping of the parameters to be estimated. Let:

$$p^{(1)} = \left[ \, \_\prime \ln(k\_1), \ln(k\_2), \ln(k\_3), \ln(b\_1), \ln(b\_2), \ln(b\_4) \right]^T \tag{50}$$

It is obvious that the following equation holds:

$$p^{(1)} = \left[\beta\_{1\prime} a\_{2\prime} a\_{3\prime} \left(P^{(1,2)}\right)^{T}\right] \tag{51}$$

Equation (49) is now re-formulated as:

*min β*1 ,*α*2,*α*3,*p* (1,2) 5 ∑ *j*=1 *n*Co,*<sup>j</sup>* ∑ *i*=1 1 *n*Co,*<sup>j</sup> ln*( *c* (*j*) Co2+,0 *c*ˆ (*j*) Co2+ *t* (*j*) *i*,Co2+ ) − *ln*( *c* (*j*) Co2+,0 *c* (*j*) Co2+,*i* ) ! + *λ*pH *n*pH *n*PH ∑ *l*=1 <sup>−</sup>*log*10(*c*<sup>ˆ</sup> (1) *H*+ *t* (1) *l*,*H*+ ) − pH*<sup>l</sup>* s.t." *c*ˆ (*j*) Co2<sup>+</sup> (*t*) *c*ˆ (*j*) *<sup>H</sup>*<sup>+</sup> (*t*) # = *G*(*t p* (1) , *c* (*j*) 0 ), if *j* = 1, *G* ∗ (*t p* (1) , *c* (*j*) 0 ), if *j* > 1, *β*<sup>1</sup> ∈ [0.7, 1.5], *α*<sup>2</sup> ∈ [0.2, 0.8], *α*<sup>3</sup> ∈ [0.2, 0.8], *A*(*β*1, *α*2, *α*3)*p* (1,2) <sup>+</sup> *<sup>B</sup>*(*β*1, *<sup>α</sup>*2, *<sup>α</sup>*3) <sup>∈</sup> [*zmin*, *<sup>z</sup>max*] (52)

where

$$A(\beta\_1, a\_2, a\_3) = \begin{bmatrix} -(\beta\_1 + a\_3)^{-1} & 0 & (\beta\_1 + a\_3)^{-1} & -(\beta\_1 + a\_3)^{-1} & 0 & 0\\ a\_2(\beta\_1 + a\_3)^{-1} & 1 & -a\_2(\beta\_1 + a\_3)^{-1} & a\_2(\beta\_1 + a\_3)^{-1} & 0 & 0\\ (a\_3 - a\_2)(\beta\_1 + a\_3)^{-1} & -1 & (\beta\_1 + a\_2)(\beta\_1 + a\_3)^{-1} & (a\_3 - a\_2)(\beta\_1 + a\_3)^{-1} & 0 & 0\\ 2(\beta\_1 + a\_3)^{-1} & 0 & -2(\beta\_1 + a\_3)^{-1} & 2(\beta\_1 + a\_3)^{-1} & -1 & 0\\ 2(\beta\_1 + a\_3)^{-1} & 0 & -2(\beta\_1 + a\_3)^{-1} & 2(\beta\_1 + a\_3)^{-1} - 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 \end{bmatrix} \tag{53}$$

$$B(\beta\_1, \alpha\_2, \alpha\_3) = \begin{bmatrix} -\frac{\ln(10^3)}{\beta\_1 + \alpha\_3} \\ \frac{\ln(10^3)\alpha\_2}{\beta\_1 + \alpha\_3} + \ln(c\_{\text{Zn},0}) \\ \frac{\ln(10^3)(\alpha\_3 - \alpha\_2)}{\beta\_1 + \alpha\_3} \\ \frac{\ln(10^6)}{\beta\_1 + \alpha\_3} + \ln(c\_{\text{Zn},0}) \\ \frac{\ln(10^6)}{\beta\_1 + \alpha\_3} + \ln(c\_{\text{Zn}^{2+},0}) \\ -\ln(c\_{\text{Zn}^{2+},0}) \end{bmatrix} \tag{54}$$

$$z\_{\min} = \left[ -0.7 \frac{F}{RT}, \ln(0.015), \ln(5), 3, -\infty, 11.2 \times \ln(10) + \ln(4) \right]^T \tag{55}$$

$$z\_{\max} = \left[ -0.5 \frac{F}{RT}, \ln(0.060), \ln(10), 8, -\ln(2), 12.2 \times \ln(10) + \ln(4) \right]^T \tag{56}$$

The parameters to be estimated in Equation (52) are transformed through quasilinear mapping:

$$z = A(\beta\_1, \mathfrak{a}\_2, \mathfrak{a}\_3) p^{(1,2)} + B(\beta\_1, \mathfrak{a}\_2, \mathfrak{a}\_3) \tag{57}$$

As indicated by the structure of *A*(*β*1, *α*2, *α*3), this matrix is an invertible matrix. Accordingly:

$$p^{(1,2)} = A(\beta\_1, \alpha\_2, \alpha\_3)^{-1} (z - B(\beta\_1, \alpha\_2, \alpha\_3)) \tag{58}$$

Equation (52) now can be transformed to problem Equation (59) as follows:

*min β*1 ,*α*2,*α*3,*z* 5 ∑ *j*=1 *n*Co,*<sup>j</sup>* ∑ *i*=1 1 *n*Co,*<sup>j</sup> ln*( *c* (*j*) Co2+,0 *c*ˆ (*j*) Co2+ *t* (*j*) *i*,Co2+ ) − *ln*( *c* (*j*) Co2+,0 *c* (*j*) Co2+,*i* ) ! + *λ*pH *n*pH *n*PH ∑ *l*=1 <sup>−</sup>*log*10(*c*<sup>ˆ</sup> (1) *H*+ *t* (1) *l*,*H*+ ) − pH*<sup>l</sup>* s.t." *c*ˆ (*j*) Co2<sup>+</sup> (*t*) *c*ˆ (*j*) *<sup>H</sup>*<sup>+</sup> (*t*) # = *G*(*t A β*1, *α*2, *α*3) −1 (*z* − *B*(*β*1, *α*2, *α*3)), *c* (*j*) 0 , if *j* = 1, *G* ∗ (*t A β*1, *α*2, *α*3) −1 (*z* − *B*(*β*1, *α*2, *α*3)), *c* (*j*) 0 , if *j* E 1, *β*<sup>1</sup> ∈ [0.7, 1.5], *α*<sup>2</sup> ∈ [0.2, 0.8], *α*<sup>3</sup> ∈ [0.2, 0.8], *z* ∈[*zmin*, z*max*] (59)

Equation (59) is a pure box-constrained optimization problem and such a problem can be solved using the general PSO algorithm [14]. Meantime, as indicated by the constraint construction process in Sections 2.3.1 and 2.3.2, some parameters of *z* are actually linearly related to some experimental metrics (e.g., mixed potential, apparent first-order reaction rate constant of cobalt, equilibrium concentration); *zmin* and *zmax* are the transformed lower and upper limits of the experimental metrics, respectively. Therefore, the proper solution of Equation (59) is an estimation of value ranges for experimentally measurable metrics that are transformed from kinetic model parameters whose value ranges are difficult to estimate directly.

In summary, the proposed parameter estimation algorithm for cobalt–hydron electrochemical competition is as follows (Algorithm 1):

#### **Algorithm 1:** Constrained parameter estimation algorithm (CPEA)

The inputs include the following: monitored cobalt ion concentration, monitored pH *c* (*j*) Co2+,*i* , *j* = 1, . . . , 5, *i* = 1, . . . , *n*Co,*<sup>j</sup>* , pH*<sup>l</sup>* , *l* = 1, . . . , *n*pH initial concentration vector *c* (*j*) 0 initial mixed potential *E*<sup>0</sup> weight coefficient *λ*pH Npop (the population size of the PSO algorithm), and MaxIters (the maximum number of iterations). (1)

Output: Cobalt–hydrogen electrochemical competition model parameters *p* Steps:


#### **3. Model and Algorithm Verification**

The solution of Equation (59) requires one to know the initial concentration of the reactants and the initial mixed potential in each set. The initial concentration vector of test (*j*) is as follows:

$$c\_0^{(j)} = \left[2.310, 6.12 \times 10^{-2}, 0.44 \times 10^{-3}, 0, 10^{-pH\_{0j}}, 2.310 b\_4^{-1} \left(c\_{H^+,0}^{(j)}\right)^{-2}\right]^T \text{mol/L} \tag{60}$$

where *pH*<sup>0</sup> is the initial pH vector:

$$pH\_0 = \begin{bmatrix} \text{3.7 } \text{3.0 } \text{3.6 } \text{4.0 } \text{4.4} \end{bmatrix}^T \tag{61}$$

The fifth term of Equation (60) represents the initial Zn(OH)<sup>2</sup> concentration, which can be calculated from the equilibrium Equation (38): *c*Zn(OH)<sup>2</sup> ,0 = *c*Zn2+,0*b* −1 4 *c* −2 *<sup>H</sup>*+,0. The initial mixed potential can be estimated by solving the equilibrium mixed-potential Equation (23) as follows:

$$E\_0 = \underset{E}{\arg\left(\sum\_{i=1}^3 2r\_i(c\_0, E) = 0\right)}{\arg\left(\sum\_{i=1}^3 2r\_i(c\_0, E)\right)} \tag{62}$$

The weight coefficient *λ*pH is set to 50. The PSO algorithm is used to optimally solve Equation (59) with Npop set to 50 and MaxIters set to 50. The state-space model (13) is solved using the stiff differential equation solver ode15s in Matlab 2016a. During the optimization process, some randomly generated parameters may make the state-space model very stiff. To avoid wasting too much time on the solution of strongly stiff problems, the time step of the ode15s solver is set to 1 <sup>×</sup> <sup>10</sup>−<sup>8</sup> .

Table 1 lists the model parameters optimized by the constrained parameter estimation algorithm. Meanwhile, to evaluate the impact of constraints on the solution, the original parameter estimation problem PRO-1 without constraints is also solved by using the PSO algorithm directly but under two setting conditions—namely Npop = 50 and MaxIters = 50 versus Npop = 500 and MaxIters = 50. The PSO algorithm requires a pre-specified range of parameter values, but Equation (22) only specifies value ranges for *β*1, *α*2, and *α*3. Therefore, the search range of *p* (1,2) is specified for the original parameter estimation problem using the results of the constrained parameter estimation:

$$p^{(1,2)} \in \left[ p^{(1,2)}\_{\text{best}} - 10, p^{(1,2)}\_{\text{best}} + 10 \right] \tag{63}$$

**Table 1.** Results of constraints guide identification.


Here, *p* (1,2) best is the result of constrained parameter estimation with its component values listed in Table 1.

The curves of the best fitness values versus the number of iterations are compared between the proposed constrained parameter estimation algorithm and the original parameter estimation algorithm(OPEA) (Figure 3), and the two algorithms are also compared in terms of estimation accuracy and optimization time (Table 2). Table 2 shows that the original parameter estimation algorithm achieved a relative fitting error of 74.1% for the cobalt concentration curve under the setting condition of Npop = 50 and MaxIters = 50; this failed to find a meaningful solution. Only when the population size Npop increased to 500 could a meaningful solution be found, but the spent time substantially increased by nearly a factor of 8 versus the constrained parameter estimation algorithm. Meanwhile, the mean relative fitting error for the logarithmic concentration of cobalt ions was also larger for the conventional PSO algorithm. These observations indicated that the constrained parameter estimation algorithm significantly improved the estimation efficiency. Moreover, as shown by the curves in Figure 3, the original PSO algorithm with Npop = 50 failed to converge to a good solution. Only when the population size was increased to 500 could the conventional PSO algorithm achieve a parameter estimation accuracy close to that of the constrained PSO algorithm. However, the former algorithm still gave a slightly higher best fitness value than the latter algorithm indicating that constrained parameter estimation is more accurate. It was also reflected on the mean relative errors for fitting the curves of cobalt ion concentrations (Table 2): the MSE from the CPEA, 7.142%, was lower than that of the OPEA,8.775%.


**Table 2.** Performances of parameter-identification algorithms.

1. Constrained parameter estimation algorithm (CPEA) with Npop = 50 and MaxIter s = 50; 2. Original parameter estimation algorithm (OPEA) with Npop = 50 and MaxIters = 50; 3. Original parameter estimation algorithm (OPEA) with Npop = 500 and MaxIters = 50; MSE: mean relative error; Rsq: goodness-of-fit; Ts, solution time.

**Figure 3.** The iteration curves of identification algorithms. CPEA: constrained parameter estimation algorithm, OPEA: original parameter estimation algorithm.

The simulation was performed based on the results of constrained parameter estimation. Model-fit values versus experimentally measured values of cobalt ion concentration were plotted in Figures 4 and 5. The model accurately fitted the curves of cobalt ion concentration versus time under different pH conditions with a mean relative fitting error of 7.142%. The cobalt displacement rate was the lowest at pH 3. The model accurately predicted the inhibitory effect of the competitive hydrogen evolution on cobalt removal when the pH was too high. The model was accurate in predicting the cobalt removal rate at pH 3 and pH 3.6. However, the model had a large error in predicting the cobalt removal rate at pH 4.4, which may be related to the "passivation" effect in the actual cobalt removal process. In other words, Zn(OH)<sup>2</sup> is formed and covers the zinc dust surface at high pH, which causes the zinc dust to partially lose reactivity thereby decreasing the cobalt removal rate. The proposed model failed to consider this process and thereby overestimated the cobalt removal rate. The cobalt displacement Reaction (2) gradually reached equilibrium with time as the decrease in cobalt ion concentration gradually leveled off (Figure 4); this trend was well fit by the model.

**Figure 4.** Comparing of the model-fit and experimental [14] dynamical cobalt concentration curves (experimental data come from Lew [4], Page 47, Figure 4-10) with uncontrolled pH started from 3.7; experimental time: 250 min.

**Figure 5.** Comparing model-fit and experimental dynamical cobalt concentration curves (experimental data from Lew [4], Page 62, Figure 4-31). The pH is controlled to be a constant value. Symbols 1, 3, 5, and 7 represent experimental data at pH 3, pH 3.6, pH 4, and pH 4.4, respectively; lines 2, 4, 6, and 8 represent fitted lines at pH 3, pH 4, pH 4, and pH 4.4, respectively.

The curve of monitored pH versus time was well fitted by the proposed model (Figure 6) with a mean relative fitting error of 0.729% and a goodness-of-fit of 0.86. In the initial stage, the pH rapidly increased due to massive hydrogen evolution. The addition of zinc dust promoted the forward reaction of zinc hydrolysis (4), which replenished hydrogen ions. As a result, the apparent consumption rate of hydrogen ions was far less than the actual hydrogen evolution rate, which led to a dramatic decrease in the rate of change of pH with time thereby leading to a monotonic and concave-down curve.

**Figure 6.** Comparing the model-fit and experimental [14] dynamical pH curves (experimental data come from Lew [4], Page 42, Figure 4-4) with uncontrolled pH started from 3.7.

#### **4. Conclusions**


proposed algorithm had a lower MSE on fitting the cobalt ion concentration curves than the conventional parameter estimation algorithm (7.142% vs. 8.775%).


**Author Contributions:** Conceptualization, Y.L. (Yiting Liang) and Y.L. (Yonggang Li); methodology, Y.L. (Yiting Liang); software, Y.Z.; validation, Y.L. (Yiting Liang); formal analysis, Y.L. (Yiting Liang); investigation, Y.L. (Yiting Liang); resources, Y.L. (Yonggang Li); data curation, Y.Z.; writing—original draft preparation, Y.L. (Yiting Liang); writing—review and editing, Y.L. (Yonggang Li); visualization, Y.L. (Yiting Liang); supervision, Y.L. (Yonggang Li); project administration, Y.L. (Yonggang Li); funding acquisition, Y.L. (Yonggang Li). All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported by the National Key R&D Program of China(2019YFB1704703), the Natural Science Foundation of Hunan Province (Grant No. 2019JJ50823).

**Data Availability Statement:** Publicly available datasets were analyzed in this study, reference number [4]. It can be found here: https://open.library.ubc.ca/cIRcle/collections/ubctheses/831/ items/1.0078522.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

