A substantial part of corrosion research relies on the analysis of polarization curves to obtain corrosion currents, Tafel slopes, and other parameters, such as exchange current densities. This, often manual, analysis remains highly subjective, which hampers the reproducibility of corrosion research and makes a comparison of reported Tafel slopes, corrosion rates, or exchange current densities from different literature sources difficult. One reason is that the analysis is strongly influenced by the selected range of the measured data. To improve this, we developed a Python library for the reliable analysis of polarization curves. A particular novelty is an algorithm designed to fit polarization curves under mixed activation-diffusion control, which is a situation often encountered in corrosion research. This algorithm reduces the subjectivity related to the measured or selected potential range. Moreover, the algorithm offers the possibility to diagnose and quantify the accuracy of the fit. We use experimentally measured polarization curves to test the proposed approach and show that for curves without a clear, purely activation-controlled Tafel region in the cathodic branch, accurate and consistent analysis is only possible by applying the mixed activation-diffusion control technique. Re-evaluation of literature data shows that by applying the library the variability in reported Tafel slopes can be greatly reduced. Thus, here the proposed approach and the related open-access Python library for the analysis of polarization curves may foster reproducibility and enhance the comparability of data measured in corrosion research.

## INTRODUCTION

**T**he measurement of polarization curves to obtain information such as Tafel slopes, corrosion rates, and exchange current densities is common practice in corrosion science and engineering. The use of these curves and parameters varies from understanding the corrosion process, showing the effect of corrosion inhibitors,^{1-2 } applying them in electrochemical techniques such as linear polarization resistance (LPR) and Tafel extrapolation,^{3-5 } to using them in (macro-cell) corrosion modeling.^{6-10 } However, it is well known that the extraction of information from polarization curves is not straightforward. Often experimentally measured polarization curves deviate from the ideal shape expected from theory, due to, for instance, the influence of the polarization on the metal surface and environment during the measurement, changes in the (non) uniformity of the corrosion process, and time effects related to a changing environment.^{11 } This forces scholars to manually select a certain range from the measured data for further analysis. Not surprisingly, the documentation of extracted parameters from these polarization curves shows huge variation in the literature.

^{12 }In the anodic branch of the polarization curve, the anodic Tafel slope, β

_{an}, can be determined by:where E is the potential and i is the current density. The cathodic Tafel slope, β

_{cath}, is found in the Tafel region of the cathodic branch:

^{13 }to around −0.12 V/dec,

^{14-15 }to over −0.2 V/dec.

^{16,-17 }Of course, found spread might be caused by different measurement environments. However, even when comparing studies with similar environments, the variability is still very high. We evaluated 21 different studies, where measured polarization curves for mild steel in sodium chloride solution at neutral pH and room temperature were reported, along with the Tafel slopes determined from these curves. As can be seen in Figure 1, the found spread of the reported cathodic Tafel slope is significant. One important factor, often poorly documented, might be the amount of convection in the solution, which directly influences the diffusion layer. This can influence the shape of the cathodic branch significantly and thus potentially complicate the interpretation and analysis of polarization curves. If the supply of oxygen to the surface is heavily limited, this cathodic Tafel slope might even be the Tafel slope of the hydrogen evolution reaction (HER). Other factors might include the scan rate and scan direction, which are known to influence the Tafel slopes.

^{18-20 }However, something to not overlook, is that these polarization curves were all evaluated by different scholars. Therefore, a large factor contributing to this spread might be the subjectivity in the determination of the parameters from the polarization curves.

The subjectivity in this analysis is mainly caused by choices made by the scholar concerning the range of data and the technique applied to evaluate the polarization curve. Traditionally, Tafel slopes are determined by linear fitting of the Tafel region. However, this method is very subjective to the researcher, who first must identify and select this Tafel region. The deviation caused by this subjectivity increases when the linear Tafel region is less obvious or not visible at all, when the currents are not purely under activation control of a single half-cell reaction.

Nowadays, it is more common to apply techniques that use a mathematical fitting of a theoretical representation of the current-potential relationship to the measured polarization curve, also outside of the Tafel region. These techniques have the potential to reduce the subjectivity in the determination of Tafel slopes. Mansfeld^{21-22 } developed a method to fit the polarization curve at small over-potentials, in the pre-Tafel region, which formed the basis of a later developed software (POLFIT^{†}) to analyze polarization curves.^{23 } In the pre-Tafel region around the corrosion potential, the semilogarithmic curve is not linear yet, as currents are controlled by both the anodic and cathodic reactions. Numerous other authors expanded on this idea, increasing the accuracy of the fitting, and finding novel (mathematical) approaches to obtain the Tafel slopes and corrosion current from the nonlinear part of the polarization curve.^{24-27 } The main purpose of most of these methods was to increase the accuracy of the LPR method, used for the determination of corrosion rates, or even to define the corrosion rate directly, without using the polarization resistance.

The fitting of the pre-Tafel region only uses a relatively small part of the polarization curves to determine both the Tafel slopes and the corrosion rate. Rybalka, et al.,^{28 } showed that these parameters can only be obtained accurately when a sufficient portion of the measured polarization curve is used in the fitting. For most fitting techniques, including also higher over-potentials beside the pre-Tafel regime, and thus using a larger range of data for the fitting, can increase the accuracy of the determined Tafel slopes, as long as the voltage drop related to the resistance of the electrolyte (IR-drop) is properly taken care of. However, the discussed techniques can only be accurately applied when all fitted data is solely under activation control. Agbo and Danilovic ^{29 } developed a procedure that takes into account higher over-potentials in the fit, and at the same time excludes any current data that is under diffusion control. However, this method will not be able to obtain accurate Tafel slopes for data that are already at relatively low over-potentials under mixed activation and diffusion control. Polarization curves that show domains of such mixed activation and diffusion control are frequently encountered when one of the cathodic reactions is the reduction of oxygen. If there is limited oxygen available at the surface of a metal sample, the cathodic branch of the polarization curve will reach the plateau with currents under diffusion control at low over-potentials.

To be able to also fit data under both activation and diffusion control, we developed a library for the Python programming language, named “PolCurveFit”, which is freely available through GitHub.^{30 } The library contains a procedure that fits a theoretical curve that includes both activation and diffusion-controlled currents in the cathodic branch of the polarization curve. Because this technique can still be dependent on the range of data included by the user, the procedure applies a certain weight distribution, to limit the subjectivity of the choice of the potential range.

In the present work, we describe the Python library “PolCurveFit,” which contains functions to apply different techniques: the “traditional” Tafel extrapolation technique, the fitting of a theoretical curve to data under pure activation control, and finally an algorithm for the fitting of data under mixed activation and diffusion control, minimizing human factors. This library enables to obtain corrosion currents, Tafel slopes, and other parameters, such as exchange current densities, from measured polarization curves. We test the library with two measured polarization curves, one with a clearly defined Tafel region and one where this Tafel region is overshadowed by the diffusion-controlled domain. Using these curves, we show the effectiveness of the algorithm of applying a specific weight distribution to fit data under mixed activation-diffusion control.

## EXPERIMENTAL PROCEDURES

### Methodology Behind the Python Library “PolCurveFit”

^{31 }that uses nonlinear least squares to fit a theoretical curve to the measured data. The optimization method applied is the Trust Region Reflective algorithm, a general robust optimization method for sparse problems. The library “PolCurveFit” offers three techniques to fit measured polarization curves as described in the following sections (schematically shown in Figure 2). All input and output are in SI units. Electrical potentials are given against a user-defined reference. For a detailed documentation on the application of the library, please refer to the source code on GitHub and its documentation.

^{30 }

#### Tafel Extrapolation (Linear Fit)

The simplest technique is the “traditional” fitting of a linear line to the data. This option is suitable for data that is solely under activation control on the anodic or on the cathodic branch, meaning one can fit the Tafel slope in a by the user-defined Tafel region. Note that only one branch of data, either the anodic or cathodic can be selected for the fitting (see Figure 2). The standard output consists of the Tafel slope (V). Optionally, the corrosion potential can be given as additional input. In this case, the algorithm yields the corrosion rate, as extrapolated from the Tafel line.

#### “Activation Control” Fit

^{21 }and further developed by Mansfeld.

^{22 }It fits the following theoretical description of experimental data, representative for the activation-controlled domain in Figure 2:which is derived from the Butler-Volmer equation under the assumption of the mixed potential theory.

^{32 }Here, i is the measured current density and E is the measured potential. The corrosion potential E

_{corr}is obtained by the algorithm from the polarization curve; that is, the potential where |i| is minimal. The Tafel slopes of the anodic and cathodic branches, β

_{an}and β

_{cath}, respectively, and the corrosion current density i

_{corr}are the parameters to be fitted, and are, together with E

_{corr}, the standard output of this function. This technique is suitable for data that is solely under activation control of a single oxidation and a single reduction reaction.

#### “Mixed Activation-Diffusion Control” Fit

^{12 }The plateau is given by the limiting current density i

_{L}. The constants R, T, n, and F are the gas constant, temperature, number of electrons transferred, and Faraday’s constant, respectively.

^{33 }Here, γ is an integer curvature-defining constant, controlling the sharpness of the curve in the transition from the activation-controlled to the diffusion-controlled currents (Figure 2). Dao, et al.,

^{33 }suggest a value for γ of 3. Therefore, during the fitting, it is allowed to vary from 2 to 4. The parameters that are fitted in Equation (5) are the Tafel slopes, β

_{an}and β

_{cath}, the corrosion current density, i

_{corr}, and the limiting current density, i

_{L}. The user is recommended to give a value for i

_{L}as input. This is used as a starting point of the fitting algorithm and can lead to a more accurate fit. Alternatively, the algorithm allows the user to fix i

_{L}.

By including the diffusion-controlled currents, a large part of the measured polarization curve can be fitted, and there is no need to select part of the data. However, including the purely diffusion-controlled domain also introduces an additional problem. While most information about the anodic and cathodic Tafel slopes is contained in the purely activation-controlled domain, the fitting algorithm tends to give the most weight to the domain that includes the biggest amount of data points. The number of data points can be significantly different, depending on the actual experimental data, e.g., the potential range over which measurements were taken. For curves that only contain a very small activation-controlled domain for the cathodic branch, this domain may be under-represented with respect to the diffusion-controlled domain (see Figure 2), especially when long cathodic branches are experimentally measured. This may be counteracted by simply cutting off some of the diffusion-controlled data. However, to not lose any information, we propose a different approach described below, allowing the user to apply a certain weight distribution to the data, giving the data in the purely activation-controlled domain a larger weight.

^{31 }where i

_{obs}are the measured current densities and f(E, *params) is the theoretical curve, a function of the potential, E, and the to-be-fitted parameters, *params, which include the Tafel slopes, corrosion current density, and limiting current density. σ contains the error of the data points, and therefore allows us to give weight to each data point. We propose to distribute the weight as shown in Figure 3. The user can define the data window, “window activation control” w

_{ac}(V), in vicinity of E

_{corr}, which receives the most weight, and which represents mostly the activation-controlled part. The percentage of the total weight distributed to the data points in this window is defined by W (%), while data points outside of this window have accordingly a weight percentage of 100 – W (%).

#### Additional Options

_{0,an}and i

_{0,cath}, when the reversible potential, E

^{rev}, of the respective anodic and/or cathodic reaction is given as additional input. These exchange current densities are computed from the obtained Tafel slopes and corrosion current density:

### Validation Data

To validate the “PolCurveFit” library and show the effect of the specific weight distribution for the “mixed activation-diffusion control” fit, two polarization curves were measured with a rotating disk electrode (RDE) of carbon steel in a 0.3 M NaCl solution. The exposed surface of the carbon steel disk (S235JR) had a diameter of 8 mm. Before the measurement, the sample surface was ground and polished with diamond paste down to 1 μm, until the sample had a mirror-like surface.

The polarization curve was measured by linear sweep voltammetry (LSV) in a three-electrode setup, with an Ag/AgCl/Sat.KCl reference electrode and a stainless steel counter electrode, with an equal surface area to the carbon steel sample. The linear sweep had a scan rate of 0.5 mV/s, starting at −1.5 V_{Ag/AgCl/Sat.KCl} up to −0.3 V_{Ag/AgCl/Sat.KCl}. Before the measurement of the polarization curve, the sample was polarized at −1.5 V_{Ag/AgCl/Sat.KCl} for 5 min. The first polarization curve was measured with a rotation speed of 300 rpm. The second curve was measured with a rotation speed of 3,000 rpm and the solution was aerated, by bubbling it with air, to ensure that the Tafel region of the oxygen reduction would clearly be visible. Both curves were measured three times to ensure reproducibility. To be able to correct for the IR-drop in the three-electrode setup, electrical impedance spectroscopy (EIS) was applied to obtain the solution resistance, R. For all experiments, this resistance was approximately 40 Ω.

## RESULTS

### The Validation Data

^{17 }The cathodic branch clearly shows the transition from activation-controlled (A) to diffusion-controlled (B) currents. Both curves also show a third domain (C) in the cathodic branch, which is related to the HER. This domain is excluded from the fitting in the tests described in this section.

The plateau (B) for the curves of both rotation rates defines the limiting current density, i_{L}, which is related to the diffusion of oxygen to the surface of the sample. For a rotation rate of 3,000 rpm and aeration of the solution, the diffusion layer is smaller and the bulk oxygen concentration is higher compared to the measurement at 300 rpm, thus resulting in a higher i_{L}. As a result, the Tafel region of oxygen reduction (A) is more clearly visible in the “3,000 rpm aerated” curve, and the Tafel slope of oxygen reduction can be more easily determined. By applying the “traditional Tafel extrapolation” (linear fit) to the branch in domain A of the “3,000 rpm aerated” curves (Figure 4), a cathodic Tafel slope of approximately 0.24 V/dec is obtained, a value corresponding well to the range measured for polarization curves in similar environments by other authors.^{17 } Note that the linear part of the “3,000 rpm aerated” curves in domain A in Figure 4, even for this extreme case of high rotation speed and additional bubbling with air, only spans over less than one order of magnitude on the current axis. The “Tafel extrapolation” technique is recommended to be used only when the linear Tafel region spans over at least one order of magnitude.^{4 }

For the curves obtained with a rotation speed of 300 rpm, i_{L} is lower, which masks the activation-controlled part. Thus, the Tafel region is hardly visible and a linear fit cannot be correctly applied in the activation-controlled domain (A). Instead, the Tafel slope can only be defined with one of the nonlinear curve fitting procedures. The polarization curves measured for different rotation rates allow us to validate the curve-fitting procedure. As both curves should theoretically have a similar Tafel slope for oxygen reduction, the curve “3,000 rpm aerated” can be used to check if the correct Tafel slope can be obtained for the curve “300 rpm.”

### The “Activation Control Fit”

_{c}(see Figure 3), starting at −15 mV up to −70 mV from the corrosion potential (E

_{corr}). These are windows that visually seem to include only currents under activation control and of which the smallest absolute values are in the pre-Tafel region. Figure 5 shows the average of the obtained Tafel slopes for the “300 rpm” and “3,000 rpm” curves, for the different windows. Figures 5(a) and (b) show the cases, where +20 mV and +40 mV from E

_{corr}of the anodic branch are included in the fitting, respectively.

The original “activation control” fit, as defined by Mansfeld,^{21 } was developed to be used in the pre-Tafel region. The results here show that for the curves measured at 3,000 rpm, the obtained Tafel slopes are relatively consistent and close to the value of 0.24 V/dec, obtained with the Tafel extrapolation technique. At a very small cathodic window, the technique results in more accurate values when more pre-Tafel data of the anodic branch is included in the fitting.

On the other side, for the curves measured at 300 rpm, the obtained Tafel slopes are very dependent on the cathodic and anodic window, and the values have a much larger standard deviation. Moreover, when 40 mV of the anodic branch is included, the obtained Tafel slopes are consistently overestimated. Apparently, for the polarization curves measured at 300 rpm, the “activation control” fit cannot be applied reliably. The fitting is highly sensitive to the parts of the anodic and cathodic branches that are included in the fitting and there is limited confidence in whether the chosen data yields adequate results. This is most likely because for this condition of a lower rotation speed of the RDE, there is less pronounced hydrodynamic flow and the currents close to the OCP are already under mixed activation and diffusion control.

### “Mixed Activation-Diffusion Control” Fit

By taking into account the diffusion-limited currents, the mixed activation-diffusion control fit should be able to obtain accurate results, also for curves that do not show a clear Tafel region. Furthermore, by applying a specific weight distribution (see *“Mixed Activation Diffusion Control” Fit* section), the obtained results should be independent of the amount of measured data in the purely diffusion-controlled domain (domain B in Figure 4). Therefore, in the following section, the results are evaluated on two main points: First, the results should show accurate values for the obtained parameters (e.g., a cathodic Tafel slope close to 0.24 V/dec as obtained for the “3,000 rpm” curve in the Tafel region). Second, they should show good stability, or limited “variability,” where the “variability” is in this work defined as the dependency of the results on the cathodic window, w_{c} (for a more quantitative treatment of the “variability,” please refer to the *Sensitivity Analysis: Finding W and w _{ac}* section).

_{O2}, and limiting current densities, i

_{L}, respectively, as a function of the chosen cathodic window, w

_{c}, and for different weight percentages, W, applied to the data in window activation control, w

_{ac}. These results were obtained by setting w

_{ac}to 40 mV and including 40 mV of the anodic branch. A first observation is that for the curve measured at 3,000 rpm, the weight distribution, W, only has a minor effect on the obtained Tafel slopes. Second, at a large enough w

_{c}(from around −0.19 V from E

_{corr}), the obtained Tafel slopes and limiting current densities show limited variability. For these values of w

_{c}, the “mixed activation-diffusion control” technique can reliably obtain Tafel slopes for this polarization curve, which are very close to the target value of 0.24 V/dec (obtained with the Tafel extrapolation technique for the same curve). The obtained Tafel slopes lie closer to this target value, when besides a cathodic window of at least −0.19 V from E

_{corr}, a weight percentage, W, of 70 % or higher is considered.

On the other side, for the curves measured at 300 rpm, the effect of the weight distribution is much more pronounced. Figure 6(a) shows that when the data is not weighted, the obtained cathodic Tafel slopes are very unstable. The obtained results fluctuate strongly with varying “size” of the polarization curve used as input data, even at high cathodic windows, w_{c}. When applying the weight distribution, the variability decreases for w_{c} larger than around 0.17 V. Moreover, at higher weight percentages, W, the obtained Tafel slopes are closer to the target value of 0.24 V/dec.

Besides showing the importance of the application of the weight distribution, Figure 6 also shows for both types of curves, that the cathodic window, w_{c}, should be large enough to obtain reliable and stable results. For the curve measured at 3,000 rpm, as noted before, w_{c} should be larger than −0.19 V. Smaller w_{c} result in highly variable values for i_{L} (compared to the value visually obtained in Figure 4) and β_{O2}. Similarly, for the curve measured at 300 rpm, depending on W, the values become stable at w_{c} larger than approximately −0.17 V. According to Figure 4, this means that accurate results can only be obtained when at least part of the purely diffusion-controlled domain (domain B in Figure 4), is included in the fitting.

_{c}, another important setting is the window activation control, w

_{ac}. Figure 7 shows the obtained β

_{O2}for the “300 rpm” and “3,000 rpm aerated” curves, as a function of w

_{c}and for different w

_{ac}and W. The values for the “window activation control,” w

_{ac}, as visualized in this figure, are all within domain A of Figure 4. That is, the window w

_{ac}does not include purely diffusion-controlled currents. The influence of w

_{ac}for the polarization curve measured at 3,000 rpm is minimal. However, for the 300 rpm curve the influence is significant. Figure 7 shows that the higher W, the larger the influence of w

_{ac}becomes. At the same time, a higher W leads to less variable results. From Figure 7, one can deduct that to obtain “correct” Tafel slopes (close to the value of 0.24 V/dec), W should be larger than 70% and w

_{ac}relatively small, up to around 40 mV depending on W. Simultaneously, the figure shows that the most accurate results coincide with very stable curves, which are mostly independent on the cathodic window (at large cathodic window).

## DISCUSSION

The most important reason to apply a rigorous mathematical curve-fitting method over the “traditional” Tafel extrapolation is to obtain results that are less influenced by subjective choices made by the user. The “activation control” fit describes the most commonly applied fitting procedure. However, as Figure 5 has shown, this only works for data that has a clear Tafel region. When the measured curve has a low i_{L}, masking the Tafel region, the results depend heavily on the amount of data that was fitted. Moreover, even at very small over-potentials, where one would assume the currents to be solely under activation control, it was not possible to obtain accurate results for the Tafel slopes, for these curves without a visible Tafel region. Data without a clear Tafel region can only be fitted correctly by including the diffusion-controlled domain in the fitting, thus using the “mixed activation-diffusion control” fit. Applying a weight distribution to the different portions of the measured polarization curve can largely decrease the subjectivity in the fitting. However, as especially Figure 7 shows, it is very important to define the window activation control w_{ac} and the applied weight percentage in this window, W, correctly.

In this work, we have measured polarization curves for the same material in similar environments, apart from the oxygen content available at the sample surface. This allows us to test the accuracy of the “mixed activation-diffusion” fit, for curves without a clear Tafel region, and to optimize the settings for W and w_{ac}. The Tafel slope of the curve measured at 300 rpm, which does not show a clear Tafel region, should, in the case of proper fitting, be similar to the Tafel slope determined for the “3,000 rpm” curve, which does show a clear Tafel region. Based on the results shown in Figures 6 and 7, accurate Tafel slopes can be obtained with for example a W of 90% and a w_{ac} of 30 mV for the “300 rpm” curve. This means that almost all of the weight is put on the data points very close to the corrosion potential, in the activation-controlled domain. Still, we can be confident in a correct fit, as the resulting i_{L} (see Figure 6) corresponds well to the visually determined i_{L} from Figure 4. This means that although very little weight is applied to the diffusion-controlled domain, it is still able to perform a correct fit in this domain, as long as part of the purely diffusion-controlled data is included in the fitting.

The difficulty is to obtain “correct” settings for W and w_{ac}, without any prior knowledge about the Tafel slopes. From the measured curves in this work, we observed that accurate Tafel slopes were generally obtained, when the obtained Tafel slopes reach a stable value at a higher cathodic window, e.g., the results for W = 90% and w_{ac} = 30 mV, show Tafel slopes with little variability (independent of the cathodic window), at a cathodic window larger than around −0.19 V (see Figure 7[c]). Therefore, to obtain a good estimation for appropriate settings of W and w_{ac}, we propose performing a sensitivity analysis described below, which aims to find the settings that result in stable and accurate results for the limiting current density and the least variable, and thus most stable results for the cathodic Tafel slope.

### Sensitivity Analysis: Finding W and w_{ac}

The proposed sensitivity analysis first performs a multiparameter-sweep, computing the cathodic Tafel slopes for different combinations of the window activation control, w_{ac}, the applied weight percentage in this window, W, and the cathodic window, w_{c}. Second, the optimal combination of W and w_{ac} is determined, namely the combination that yields the least variable results for the cathodic Tafel slope. Here, “least variable,” means the least dependency on the chosen cathodic window.

Figure 8 gives an overview of the main steps of the sensitivity analysis. The applied ranges for w_{c} and w_{ac} are first visually determined from the polarization curve. These ranges are then fed into the algorithm to perform the multiparameter-sweep. The following ranges are considered:

*The window activation control*, w_{ac}, ranges from 0.01 V up to w_{dc}. For the sweep, we suggest an increment of 0.01 V. w_{dc}[V/E_{corr}] is defined as the visually determined start of the purely diffusion-controlled domain (see Figure 8). w_{ac}is only varied up to w_{dc}, because the goal of the applied weight distribution is to give higher importance to activation-controlled currents. This means that w_{ac}should always be well in the activation-controlled domain. This domain is not clearly visible for all curves, so we recommend not choosing values for w_{ac}higher than w_{dc}. For the curves in this work, w_{dc}is 0.17 V for the “300 rpm” curve and 0.19 for the “3,000 rpm” curve (see Figure 4).*The weight percentage*, W, is suggested to generally be taken in the range of 50% up to 95% with an increment of 5% for the sweep.*The cathodic window*, w_{c}, ranges from w_{dc}to the maximum cathodic window (max. w_{c}). Here it is assumed that at w_{c}larger than the start of the purely diffusion-controlled domain, w_{dc}, the cathodic Tafel slopes start to reach stable values (as can be observed in Figures 6 and 7). For the sweep we suggest an increment of 10 mV. The maximum value for w_{c}should solely contain domains A and B of the polarization curve (see Figure 8). In the examples given in this work, this is approximately −0.44 V/E_{corr}and −0.60 V/E_{corr}for the curves measured at 300 rpm and 3,000 rpm, respectively. At higher overpotentials, a new reaction comes into play, namely the HER. As this reaction is not considered in the fitted equation, this part has to be excluded.

_{ac}that, first, results in the least variability of the values for the cathodic Tafel slope, that is, showing the least dependency on the cathodic window, and second, results in an accurate value for the limiting current density. By visualization of the data generated in the parameter sweep, similar to Figures 6 and 7, the range with the smallest variability may already be identified. However, for a quantitative determination of this variability, it is evaluated as the standard deviation of the results associated with a certain combination W and w

_{ac}and the cathodic window, w

_{c}, which was varied in the sweep range indicated above. This standard deviation for a certain combination of W and w

_{ac}, σ

^{W,wac}, is computed with the following equation:where is the ith cathodic window of the total number N of evaluated values in the sweep of w

_{c}; is the cathodic Tafel slope computed for this window and for a certain combination of W and w

_{ac}; and is the mean of the cathodic Tafel slopes, computed for the combination of W and w

_{ac}, averaged over the sweep of w

_{c}. Hereafter, the standard deviation, σ

^{W,wac}, is referred to as the “variability.” The smaller the variability, the more “stable” the results associated with this combination of W and w

_{ac}.

_{ac}, both within their sweep ranges indicated above, the optimal settings for the weight distribution can be determined. This procedure is shown in Figure 9 for the curves measured at 300 rpm and 3,000 rpm and summarized in Figure 8. First, the mean and standard deviation of the variability, associated with a certain W and as a function of w

_{ac}(σ

^{W}(w

_{ac})), is evaluated and visualized for each W. The optimal weight percentage, W, can now be determined, as the value corresponding to the minimum mean variability. Figure 9(a) shows that for the curve measured at 300 rpm, the smallest value is found for W = 90%. This W is then used to visualize the variability for the selected W, σ

^{W=90%}(w

_{ac}), so that the optimal value for w

_{ac}can be selected. From Figure 9(b) it can be determined that the least variable results are obtained for w

_{ac}= 30 mV. The selected values for W and w

_{ac}correspond well to the earlier determined optimal settings, which were able to obtain a Tafel slope, close to the target value of 0.24 V/dec, as measured for the “3,000 rpm curve” (see also Figure 9[c]). These optimal settings result in a limiting current density of 1.06 A/m

^{2}, which corresponds well to the visually determined value in Figure 4.

For the curve measured at 3,000 rpm, the curves are more stable, and the variability is similar between different settings, as the effect of the weight distribution is smaller. The choice for an optimal W and w_{ac} is therefore also less critical. However, the same procedure can be applied here. Figure 9(a) shows that the most stable results are obtained around W = 80%. Larger W have similar values for the mean variability, but a larger standard deviation is associated with the range of w_{ac}. Figure 9(b) shows that for a W of 80%, there is an initial minimum around 70 mV, and an absolute minimum at 190 mV. In combination with Figure 9(c), this shows the importance of taking a value of w_{ac} smaller than at least half of w_{dc} (see Figure 8), to ensure that the currents in the window activation control are dominantly under activation control. Figure 9(c) shows that using the absolute minimum at 190 mV, larger than w_{dc}, as the value for w_{ac}, would lead to an underestimation of the Tafel slope. Using the settings of W = 80% and w_{ac} = 0.07 V, a limiting current density of 3.72 A/m^{2} is obtained, which corresponds to the value determined in Figure 4.

The library PolCurveFit contains a function to perform the above-described sensitivity analysis, visualizing both the dependency of the Tafel slopes on the cathodic window, W and w_{ac}, as well as the standard deviation, quantifying the variability of the obtained Tafel slopes. We believe that performing this sensitivity analysis is not only good practice to obtain proper settings for the weight distribution, but will simultaneously supply the user with a sense of confidence about the obtained results. First, it will show if the measured polarization curve includes enough data to obtain stable results, e.g., if the data includes a sufficient part of the purely diffusion-controlled domain, such that limiting current densities and Tafel slopes are obtained, that are independent of the amount of purely diffusion-controlled currents included. Even though you would visually be able to indicate the limiting current density and therefore assume enough data for an accurate fit are included, this might not necessarily be true. Second, by performing the sensitivity analysis, one also obtains an indication of the uncertainty of the obtained parameters. The more sensitive the fit is to the settings of the weight distribution, the larger the uncertainty of the obtained parameters. For instance, the determination of the optimal settings for the “300 rpm” curve shows that similarly stable results can be obtained with a w_{ac} of 30 mV. However, a slight change in this setting of only 10 mV causes a change of almost 0.04 V for the determined cathodic Tafel slope. This information is especially important when one wants to compare obtained parameters to literature values, or other experiments.

### Re-Evaluation of Literature

The evaluated polarization curves were all measured for mild steel in a sodium chloride solution. However, the range in documented values is relatively large. The measurement environment and methodology certainly play a role in explaining this observed range. The bulk oxygen concentration and diffusion layer are most certainly different for the varying studies and factors such as the scan rate influence the shape of the measured polarization curve. However, Figure 10 shows that a major part of the spread can be explained by inconsistent analysis of the polarization curves. The cathodic Tafel slope is often largely overestimated for curves that showed diffusion-controlled domains in the cathodic branch. By applying the PolCurveFit library to analyze these polarization curves, the total range is reduced to less than one thirds.

The evaluated literature works consist primarily of inhibitor studies. Here, multiple polarization curves are analyzed and compared to show the effect of the inhibitor. For this relative comparison, obtaining accurate values for the Tafel slopes is often not necessary, as the curves are evaluated by the same author. However, to be able to compare different works, consistent evaluation of polarization curves by different authors is necessary. Moreover, in fields such as corrosion modeling, accurate values for these Tafel slopes are often important. For instance, for the case of modeling of macrocell corrosion, Ge and Isgor^{34 } showed that parameters such as the Tafel slopes and exchange current densities have a considerate effect on the modeled corrosion rate. The current spread in literature makes it difficult to find reliable values for these parameters. The library PolCurveFit could be the first step toward the consistent evaluation of polarization curves between different works, allowing us to increase our knowledge of these parameters.

Finally, even with consistent analysis of polarization curves, there will remain a visible spread of Tafel slopes. As highlighted before, these parameters are still strongly dependent on the measurement methodology. The local environment at the metal surface, as well as scan direction and scan rate, influence the shape of the polarization curve, and therefore directly the Tafel slopes and other fitted parameters. Furthermore, other uncertainties may arise when the main kinetics at the surface consists of more than one dominant anodic and one dominant cathodic reaction. All fitting procedures are limited by the assumed theoretical curve. The described techniques will only work correctly, as long as the assumed theoretical curve is a good representation of the measured kinetics. This means the technique cannot be applied correctly on polarization curves containing multiple anodic or cathodic reactions overlaying each other.

## CONCLUSIONS

The presented work described a novel approach for the reliable analysis of polarization curves. This approach was implemented in the open- access Python library “PolCurveFit,” which was developed to make the analysis of polarization curves convenient and straightforward for scholars working in the field of corrosion research. Besides implementing existing fitting procedures, like “Tafel extrapolation” and the fitting of purely activation-controlled curves, the library also includes a new technique to accurately fit mixed activation-diffusion-controlled polarization curves, by applying a specific weight distribution. Tests were performed on two types of polarization curves, with and without a clearly defined Tafel region, which were measured in similar environments, save the available oxygen content. These tests showed that fitting both the diffusion and activation-controlled domain of the polarization curves is the only reliable option to obtain Tafel slopes for curves without a clear Tafel region in the cathodic branch. Based on this study, the following major conclusions and recommendations can be derived.

To obtain consistent and reliable results with the “mixed activation-diffusion control” fit, we recommend applying a specific weight distribution, where data close to the corrosion potential (E

_{corr}) is assigned a higher weight than data in the purely diffusion-controlled domain. The results presented in this work have shown that this weight distribution results in both more accurate and more stable values for the cathodic Tafel slope, meaning they are independent of the amount of purely diffusion-controlled data taken into account in the fitting. Thus, the application of the weight distribution largely reduces the subjectivity, which arises from the otherwise generally manual choice of the range of potentials measured, in the analysis of the polarization curve.To gain confidence in the obtained results and to be able to quantify the associated error range, we strongly recommend performing a sensitivity analysis for the fitting procedure. This ensures that the obtained fitting results are independent of the portion of the polarization curve selected for the analysis. Such a sensitivity analysis is included in the Python library “PolCurveFit.” Especially for curves without a clear Tafel region, it is important to identify optimal fitting procedure settings, to be able to obtain accurate values for parameters such as the cathodic Tafel slopes. Moreover, for all types of curves, it is important to identify if a sufficient part of the purely diffusion-controlled domain was included in the fitting.

Analyzing polarization curves and obtaining parameters such as the Tafel slopes and corrosion rate remains a challenge, especially for curves that do not show a clear, purely activation-controlled Tafel region. The presented algorithm and technique of fitting mixed activation-diffusion-controlled curves, try to overcome the problem of an “overshadowed” Tafel region and to reduce the subjectivity inherent to the generally manual approach of selecting data from a measured curve for Tafel slope or curve fitting.

^{†}

Trade name.

## ACKNOWLEDGMENTS

The authors are grateful to the Swiss National Science Foundation for the financial support (Projects No. PP00P2_163675 and No. PP00P2_194812).