h2. Data Analysis


h3. Objective

To develop an analysis tool that can be used to characterize experimental datasets from tube flocculator experiments
{composition-setup}
cloak.toggle.exclusive=false
{composition-setup}

h3. {toggle-cloak:id=Methods} Methods

{cloak:id=Methods}

h4. Data source

The description of the experiments can be viewed in the [previous reports|Overall Tube Floc Research and Past Report]. All of experimental data (i.e time, pressure, turbidity, flow rates, etc) was collected using [Process Controller|Process Controller] and saved in Excel files. Data of interest (i.e. effluent turbidity) was stored corresponding to the date of experiment run and the status file indicated the state of treatment process (i.e. flocculation state, settling state, etc).

The dataset was extracted using [Meta Data|Meta Data] algorithm and analyzed in the steps provided below.

h4. Model fitting

In the settling state (state 4 or 5, depending on the experimental and software setup), the analysis of settling dataset starts from its maximum turbidity reading. This will eliminate the data fluctuation due to a sudden stop of flow. Data is normalized to the maximum reading of dataset and converted to a positive hyperbolic curve for data interpretation. The dataset will now read as the amount of settling in the tube. A hyperbolic curve can be linearized using double reciprocal method (or _Lineweaver-Burke_ plot), where the Y-axis is the reciprocal of the cumulative amount of settling and X-axis is the terminal velocity. The distance of column above turbiditimeter is assumed to be 5 cm.

h4. Data repeatability

The details of the experiment conducted to test data repeatability can be viewed [here|Data Fluctuation].

h4. Equations

Assuming the dataset follows a hyperbolic curve function, therefore it can be represented as:

*Equation 1*
{latex}
$$
1 - {N \over {N_0 }} = {{\left( {{N \mathord{\left/
 {\vphantom {N {N_0 }}} \right.
 \kern-\nulldelimiterspace} {N_0 }}} \right)_{\max } t} \over {K_S  + t}}
$$
{latex}
where
_N_ is the effluent turbidity \[-\]
_No_ is the maximum/initial effluent turbidity during settling state \[-\]
_t_ is the time \[T\]
_K_ is the rate of settling flocs \[T\].

This simplification will enable the team to extract important parameters of the curve (i.e. _K_ and ) and to use these parameters in comparing with other curves.

In order to linearize the hyperbolic function, double reciprocal on both axes can be applied. By using terminal velocity as the reciprocal of time, we can quantify the data using a meaningful parameter instead of using frequency.

Terminal velocity is the velocity of the flocs settling in the column.
{latex}
$$
v = {L \over t}
$$
{latex}
where
_v_ is the terminal velocity \[L/T2\]
_L_ is the distance of the column above turbditimeter \[L\]

_t_ can be redefined as:

*Equation 2*
{latex}
$$
t = {d \over v}
$$
{latex}
substitution of Equation (2) in Equation (1) yields:

*Equation 3*
{latex}
$$
\displaylines{
1 - {{NTU} \over {NTU_{\max } }} = {d \over {Kv + d}} \cr
{{NTU} \over {NTU_{\max } }} = {{Kv} \over {Kv + d}} \cr}
$$
{latex}
Double reciprocal equation

*Equation 4*
{latex}
$$
{1 \mathord{\left/
{\vphantom {1 {\left( {1 - {{NTU} \over {NTU_{\max } }}} \right)}}} \right.
\kern-\nulldelimiterspace} {\left( {1 - {{NTU} \over {NTU_{\max } }}} \right)}} = {{Kv} \over d} + 1
$$
{latex}
Equations can also be viewed [here|TubeFloc - Equations].

h4. Window average

In statistics, a moving average is used to analyze time series data.

Algorithm and equations of window average is attached in Algorithm MathCad file. Here, we specify the specific window for the program to take an average from.

For the experimental data that is less than number of window specify, Equation 5 is used.

*Equation 5*
{latex}
$$
{{\sum\limits_{j = 0}^{2i} {Y_j } } \over {2i + 1}}
$$
{latex}
*Equation 6*
{latex}
$$
{{\sum\limits_{j = 2i - n + 1}^{n - 1} {Y_j } } \over {2n - 2i - 1}}
$$
{latex}
For any other experimental data in between these two condition, Equation 7 is used.
*Equation 7*
{latex}
$$
{{\sum\limits_{j = i - m}^{i + m} {Y_j } } \over w}
$$
{latex}
where
_w_ is the number of window (odd number)
_Y_ is the data
_m_ is (w+1)/2

h4. Mathcad files

Two Mathcad files
•	Algorithm: This file stores information on algorithm, such as double reciprocal method, window average and minor calculations.
•	Settling Analysis: This is the main file and it contains sections for metafilter, plots, etc.
{cloak}

h3. {toggle-cloak:id=Results and Discussions} Results and Discussions

{cloak:id=Results and Discussions}

h4. Model fitting

By extracting the data using Meta Data files, we were able to choose any set of settling data of interest, plot and analyze them individually or collectively to see any if there is any [trend|First Look into the Data] to the data. At the beginning, we proposed polynomial fit as an option to evaluate the data and [error analysis algorithm|Error Analysis] was utilized to see which equations fit each datasets the best.

[Another datasets example|Another example...] is also analyzed to determine which polynomial fit suits the best. From sum squared error analysis, the third and fourth degree of polynomial were found to be the best.[Another raw sedimentation data|Raw Data of Settling Column] was evaluated to get a better sense of parameters that actually effect the curve.

The limitation of using polynomial fit in the data analysis is to specify any parameter that would be responsible for every dataset. Each time a dataset was modeled, the polynomial coefficients were changing and we couldn't find any trend that best described the settling data. It is also hard to fix one _n_ th degree of polynomial for the entire set because each individual dataset gives different error analysis.

A hyperbolic fit was proposed and a sample of experimental dataset was [normalized|Data Normalization] to its maximum turbidity reading to determine the percentage of flocs that has been settled over a period of time. _Lineweaver-Burke_ or double reciprocal method was applied.

Examples of [data linearization|Data Linearization] using _double reciprocal_ analysis.

Here, we analyzed one set of data from iterating flow rate experiment (50 ft tube flocculator, 50NTU initial turbidity and 25 mg/L alum).
Presented here is the result from flow rate of 2.95 mL/s for 600 s.

Figure 1 shows the raw data of settling state normally that is normally obtained in the experiment. The initial drop in every curve represents the bigger flocs that drop faster than the smaller flocs. On the other hand, the tailing of the curve represents the settling of the smaller particles in the settling column. Ideally, the drop should be very steep and the tailing should approach 0. The raw data is normalized in order to compare the percentage of turbidity drop with other sets of data in the experiments, since the initial turbidity at the inlet could fluctuate. The turbidity drop of 5NTU in one run would not mean the same as the drop in the other run. The normalization would also enable the team to look at the efficiency of the tube flocculator.

!Tube Floc Pictures and Graphs^normalizedraw.JPG!
*Figure 1* Typical raw data in the settling column

As previously mentioned, the experimental data was flipped on horizontal axis to look at the data as a "positive growth". Now the data is translated as the amount of particles settle. In order to quantify what parameter that best describe the data, we linearized the data by reciprocate both of the axes. The time axis (x-axis) was transformed into velocity by dividing the length of the tube above turbiditimeter to the time. The result of the linearization is illustrated in Figure 2 and Figure 3.

!Tube Floc Pictures and Graphs^reciprocal2.JPG!
*Figure 2*

!Tube Floc Pictures and Graphs^model2.JPG!
*Figure 3*

The R{^}2^ value obtained from the linearization was low (0.622) for this data considering the fluctuation in the raw data and the effects of reciprocation, which amplify the lower end and compress the upper end of the original data. This also will result in amplification of error of the fluctuated data.

In this example, we did data smoothing with frame window of 33 (w=33). Moving average managed to increase the R{^}2^ value to 0.870. However, we can see that the Ks and N/N0 didn't have any improvement.

!Tube Floc Pictures and Graphs^modelsmooth2.JPG!
*Figure 4*

Table 1 shows the _K_ values of 10 repeatable experimental runs to determine the efficiency of the previous system.

*Table 1*
| K{~}s~ | (N/N{~}0~)~max~ | R{^}2^ | K{~}s~ | (N/N{~}0~)~max~ | R{^}2^ |
|	0.009072	|	1.297	|	0.443	|	0.00895	|	1.32	|	0.428	|
|	0.003308	|	0.495	|	0.43	|	0.002897	|	0.498	|	0.844	|
|	0.002995	|	0.515	|	0.332	|	0.0018	|	0.456	|	0.913	|
|	0.004368	|	0.667	|	0.781	|	0.005162	|	0.773	|	0.862	|
|	0.001389	|	0.294	|	0.407	|	0.0009337	|	0.288	|	0.714	|
|	0.006498	|	0.803	|	0.39	|	0.003274	|	0.539	|	0.721	|
|	0.002424	|	0.469	|	0.34	|	0.002774	|	0.538	|	0.785	|
|	0.001575	|	0.461	|	0.79	|	0.001774	|	0.501	|	0.938	|
|	0.00353	|	0.508	|	0.619	|	0.004171	|	0.598	|	0.744	|


_K_ values and its corresponding R{^}2^ values for different flow rates of raw data and window averaged data (w=33).

From the [data linearization|Data Linearization] results, we can that even though the linearization of raw data yields good range of R{^}2^ values, it gives different output when substituting into the original. This could be due to the effect of dataset reciprocal and recirculation problem that is occurring in the settling tube in settling state.

*Table 2* From new setup
| K{~}s~ | (N/N{~}0~)~max~ | R{^}2^ | K{~}s~ | (N/N{~}0~)~max~ | R{^}2^ |
| 0.0003305 | 0.922 | 0.765 | 0.00038 | 0.941 | 0.931 |
| 0.004047 | 1.615 | 0.491 | 0.004915 | 1.86 | 0.567 |
| 0.001198 | 1.007 | 0.696 | 0.001279 | 1.035 | 0.845 |
| 0.001714 | 1.053 | 0.243 | 0.001612 | 1.111 | 0.856 |
| 0.001342 | 1.088 | 0.781 | 0.001435 | 1.118 | 0.868 |
| 0.001591 | 1.007 | 0.347 | 0.001549 | 1.054 | 0.87 |
| 0.00102 | 1.019 | 0.702 | 0.00105 | 1.035 | 0.876 |
| 0.001844 | 1.21 | 0.497 | 0.003508 | 1.633 | 0.324 |
| 0.00209 | 1.161 | 0.632 | 0.002078 | 1.174 | 0.867 |
| 0.00209 | 1.161 | 0.632 | 0.002078 | 1.174 | 0.867 |

*Table 3* Iterating flow rates

h4. Data repeatability

The results and discussion of data fluctuation for previous experimental setup can be viewed [here|Data Fluctuation].
{cloak}

h2. {toggle-cloak:id=Progress} Progress

{cloak:id=Progress}
Apart from analyzing past datasets, the team also interested to analyze datasets from new setup, which addresses some of the problems encountered in the previous setup. The new setup can be viewed here and the analysis of experimental runs can be viewed [here|Data Analysis on New Setup].
{cloak}
Back to [Tube Floc Home Page|Tube Floc]