AN ELECTROCHEMICAL PROCESS FOR DECENTRALIZED TREATMENT OF HIGH - STRENGTH WASTEWATER By Gustavo Aburto Vazquez A THESIS Submitted to Michigan State University in partial fulfillment of the requirements for the degree of Biosystems Engineering – Master of Science 2023 ABSTRACT As water shortages grow increasingly common worldwide, the need to explore decentralized wastewater treatment options to address water pollution has also increased. Electrocoagulation (EC) is a potential technology for decentralized treatment systems due t o its convenience and effectiveness. This study investigated the development of a pilot-scale electrocoagulation treatment system to treat source-separated blackwater. Bench-scale EC experiments effectively removed COD, TP, and turbidity. Pulse-width modulation also proved capable of decreasing the energy demand of EC. However, NH 3 -N was not removed effectively. Bench-scale air stripping experiments revealed that an NH 3 -N removal efficiency of 67.7% was achievable by increasing the pH of the electrocoagulation-treated blackwater to 11 with calcium hydroxide. In addition, pilot-scale EC experiments showed that utilizing electroflotation with sludge separation units is an essential mechanism for separating solids from the liquid phase of the EC effluent. The pilot-scale study also demonstrated that reducing the distance between electrodes decreases the energy demand of the treatment. Improvements to the pilot-scale EC treatment system decreased the EC reactor's power consumption to 2.64 Wh/L blackwater and reduced the COD, TP, TN, and TSS in the treated water by 90.3%, 98.4%, 85.1%, and 94.8%, respectively. An economic assessment concluded that the treatment system could treat 2,720 L of blackwater per day at a treatment cost of $5.65 per day. A sensitivity analysis showed that a 25% reduction in CapEx could reduce the average treatment cost by 21%, from $5.65/1000 L to $4.50/1000 L Copyright by GUSTAVO ABURTO VAZQUEZ 2023 ACKNOWLEDGEMENTS I want to take this opportunity to thank the various individuals who made it possible to write this thesis. Conducting the research and finishing this project would have been impossible without the assistance and knowledge you provided to me. I will begin by thanking my major advisor, Dr. Wei Liao. Thanks to you, I had the opportunity to work on groundbreaking and exciting research. Your boundless enthusiasm and passion helped me remember the joy in my work, even during the most stressful times. I want to thank Dr. Yan (Susie) Liu for serving on my committee. You opened the door to this wonderful opportunity for me, and I will never forget that. I thank Dr. James Dusenbury for serving on my committee. Your invaluable guidance and expertise helped elevate this project to new heights. I want to thank all of the friends I made along the way; whether you studied engineering or animal science, you were always there to lend a hand. I also want to thank everyone in the Liao Research Group. I thank Blake Smerigan, Daniel Aburto, Annaliese Marks, Jacob Willsea, Nathan VandeWeert, John Grivens, Lindsey Hassel, Emilia Emmerson, Meicai Xu, Yuri Zheng, Benjamin Thomas, and Katherine McCullen. I could always count on all of you to help me struggle through the day. A special thanks to Dr. Sibel Uludag-Demirer. Completing this work without your unending kindness, knowledge, and assistance would have been impossible. Finally, I need to thank my family. Pursuing a graduate degree would not have been possible without your unconditional love and support. Thank you for always encouraging me to grow and improve myself. iv TABLE OF CONTENTS CHAPTER 1: LITERATURE REVIEW.................................................................................... 1 CHAPTER 2: COMBINED EC AND AERATION ................................................................ 18 CHAPTER 3: PILOT-SCALE EC EXPERIMENTS.............................................................. 60 CHAPTER 4: OPTIMIZATION OF THE PILOT EC SYSTEM ......................................... 85 CHAPTER 5: CONCLUSIONS AND FUTURE WORK ..................................................... 110 BIBLIOGRAPHY ..................................................................................................................... 112 APPENDIX A: SUPPLEMENTAL TABLES AND FIGURES............................................ 123 APPENDIX B: R CODE AND STATISTICS ........................................................................ 127 v CHAPTER 1: LITERATURE REVIEW INTRODUCTION According to the World Health Organization, roughly 2.2 billion people globally cannot access clean water (World Health Organization, 2019). This is a critical problem in developing nations (World Health Organization, 2019). Large, modern wastewater treatment plants are not feasible for communities in developing nations and rural communities in developed countries (Fach & Fuchs, 2010). Activated sludge wastewater treatment plants can cost over $1,400,000 in construction costs alone (Jafarinejad, 2017). One promising yet inexpensive technology that could aid in decentralizing water treatment is electrocoagulation (EC) (Mollah et al., 2001). Electrocoagulation (EC) as a form of wastewater treatment is not a new technology. It has been implemented in numerous applications since the 19 th century. Electrolytic sludge treatment plants operated in the United States as early as 1911 (Holt et al., 2005). Due to high operating costs and available chemical treatment methods, the electrocoagulation treatment plants to treat municipal wastewater were discontinued by the 1930s (Holt et al., 2005). The operating expenses were primarily due to the high electricity costs in this period (Hakizimana et al., 2017). In modern times, EC technology has found renewed interest due to its successful implementation in treating wastewater produced by the paper, mining, and metal industries. Recent studies have shown that EC can also significantly reduce chemical oxygen demand, phosphate, and turbidity of liquid digestate from anaerobic digestion (Chen et al., 2016). This study reviews the theory behind electrocoagulation, EC design and operation considerations, and its current applications. 1 EC BACKGROUND Treatment mechanisms EC can effectively treat wastewater through the combined mechanisms of coagulation, flocculation, and settling or electroflotation. This process works by suspending electrodes in wastewater while an electric current is passed through these electrodes (Uludag-Demirer et al., 2020). One electrode is the sacrificial anode, while the other is the cathode. The anode is dissolved through electrolytic oxidation, releasing metal ions into the water, while the cathode produces hydrogen gas (H2 ) and hydroxyl ions (OH-) (Uludag-Demirer et al., 2020). The main reactions in the EC process are listed in Table 1. Table 1. General EC reactions Electrode Reaction Anode Me0 (s) → Men+ + ne Cathode 2H2 O + 2e- → H 2 (g) + 2OH - The metal ions hydrolyze to form metal hydroxides depending on the anode’s material and the water’s pH (Aguilar Ascon, 2020). Iron and aluminum are the most common materials for electrodes used in EC. Their reactions under different conditions are presented in Table 2. These metal hydroxides serve as coagulating agents and are produced in situ rather than by adding chemicals (Mollah et al., 2004). 2 Table 2. Specific anode reactions Conditions Reactions Alkaline conditions (Aluminum) Al3+ +3OH -→Al(OH)3 Acidic conditions (Aluminum) Al3+ +3H2 O → Al(OH)3 +3H+ Alkaline conditions (Iron) Fe2++3OH -→Fe(OH)2 Acidic conditions (Iron) 4Fe2++O2 +2H2 O→4Fe3++4OH- The hydroxides formed in the EC process strongly attract the colloidal particles (Mollah et al., 2004). Coagulation begins when the coagulating agents destabilize colloidal particles by neutralizing the surface charge of the particles (Aguilar Ascon, 2020). After the destabilization, the size of the particles increases through particle collisions brought about by Brownian motion (Metcalf & Eddy Inc. et al., 2013). Then, these floc particles and trapped pollutants can be removed from the wastewater solution through various physical separation processes such as settling and electroflotation (Mousazadeh, Niaragh, et al., 2021). The aggregation of the floc particles allows them to settle more quickly through the force of gravity. This settling process can happen within the EC reactor in a batch process or a secondary settling unit in a continuous process. A summary of the EC process can be seen in Figure 1 (Sandoval et al., 2021). Electroflotation is another removal mechanism possible with EC. Electroflotation relies on the hydrogen gas bubbles generated at the cathode in the EC process to remove pollutants. These bubbles float the floc particles with the trapped contaminants up to the top of the reactor, forming a thick sludge layer that is easy to separate and remove (Djerroud et al., 2018; Uludag- Demirer et al., 2020). The effectiveness of electroflotation is determined by mixing and the size of the bubbles generated at the cathode. Smaller bubbles increase the effectiveness of 3 contaminant removal due to the increased surface area for the attachment of particles (Mollah et al., 2004). Figure 1. Summary of the EC process (Sandoval et al., 2021) EC DESIGN CONSIDERATIONS Batch and continuous reactors According to Holt et al. (2005), EC reactors can generally be classified whether they are designed to run continuously or in batch operation. Figure 2 shows EC in a batch and continuous mode of operation (Nguyen et al., 2017). A continuous EC reactor is advantageous from a design and operational perspective because it operates under steady-state or pseudo-steady-state conditions, and its coagulant doses are fixed (Holt et al., 2005). EC's electrolysis time and energy consumption in the continuous mode are less compared to batch mode. This reduces sludge production and operating costs (Mousazadeh, Niaragh, 2021). Holt also states that batch reactors benefit from operating with a fixed wastewater volume to treat per cycle. Another advantage is 4 that installing and operating a batch reactor is comparatively more accessible than a continuous reactor. However, they have the perceived disadvantage of changing pollutant and coagulant levels over time. Since the bulk fluid in a batch reactor will generally be stagnant, a rapid mixing mechanism may be necessary to help improve the contact between the solution and the coagulants (Castañeda et al., 2021). Figure 2. Example of a batch and continuous EC reactor. (a). Model of a batch reactor; (b). Model of a continuous reactor (Nguyen et al., 2017) 5 Holt claims batch reactors are a more straightforward, low-cost option for localized water treatment facilities. This study used a lab-scale batch EC reactor of 7.1 L to treat water polluted with potter’s clay. The reactor used vertical plate electrodes with aluminum anodes, stainless- steel cathodes, and electroflotation as the primary removal mechanism instead of settling. The study identified three clear stages in batch operation: a lag stage, a reactive stage, and a stabilizing stage. When considering turbidity removal, most of the reduction occurs during the reaction stage. At the same time, little happens in the lag stage, and the removal rate decreases until it levels out in the stabilizing phase. Over 60 minutes, the batch EC reactor removed over 95% of turbidity from an initial value of 631 nephelometric turbidity units (NTU). The study also looked at cumulative mass removed through electroflotation as a function of time and pollutant loading and mass removal as a function of pollutant loading and current density. The study concluded that the batch reactor system was highly effective in treating various loading rates, with only a slight decrease in performance at the highest loading rates. The batch reactor proved to be most effective at higher current densities with only a slight difference in performance between 27 and 14 A/m2 . However, EC performance was much lower at a current density of 3.4 A/m2 . Overall, the batch reactor system demonstrated that it could effectively handle various operational conditions while maintaining effective treatment (Holt et al., 2005). In contrast to Holt’s paper, Kambuyi et al. (2021) found a continuous reactor to be more effective than a batch reactor treating a mixture of distilled water and clay. The study reports that when the reactor did achieve a steady state, it removed 82.27% of the initial turbidity value compared to a turbidity removal rate of 72.05% from a control batch reactor. Additionally, the coagulant requirements of the continuous reactor remained fixed. On the other hand, the study states that the conditions in the batch reactor constantly changed due to the reactor being 6 continuously fed with aluminum cations as the electrodes dissolved (Kambuyi et al., 2021). These findings align with the statements made in the paper mentioned previously by Holt et al. (2005). Continuous EC reactors are easier to maintain than batch reactors. Vertical shear stress in upward-flow reactors can help prevent the build-up of sludge and hydroxides on the electrodes (Nguyen et al., 2017). The drawback to easier maintenance and pollutant removal offered by continuous reactors is slightly offset by greater power consumption (Nguyen et al., 2017). These two studies suggest that batch EC reactors could be easier to set up than continuous reactors. However, they may not achieve the same level of performance in terms of wastewater treatment as continuous reactors. In contrast, EC continuous reactors offer better control than batch reactors since they can achieve steady-state conditions. This makes them more suitable for continuously treating wastewater (Mousazadeh, Niaragh, et al., 2021). Therefore, this review will mainly focus on continuous reactors for these reasons. Electrode arrangement When designing a continuous EC reactor, it is vital to consider the arrangement of the electrodes within the reactor. This is important because the placement of the electrod es in the reactor can greatly influence flow patterns in the reactor. Good flow patterns are necessary to avoid poor treatment caused by stagnant zones (Mousazadeh, Niaragh, et al., 2021). Arranging electrodes in a staggered horizontal stack to create channels will allow the bulk fluid to flow in a serpentine pattern. Serpentine flow through EC reactors is desirable because it eliminates stagnant zones (López et al., 2019; Song et al., 2018). The serpentine flow of wastewater means that it is sure to encounter both the anode and cathode sections of the reactor, improving treatment (Mollah et al., 2004). However, it is essential to note that reactors designed to 7 accommodate this electrode arrangement may require complex construction methods and can be prone to leaks (Mollah et al., 2004). The arrangement of the electrodes in the EC reactor can also affect the pollutant removal efficiency. It is theorized that the optimal placement of the electrodes within an EC reactor depends mainly on the characteristics of the wastewater (Nasrullah et al., 2018; Zaied et al., 2020). For oily wastewater, electrodes arranged horizontally seem able to remove both COD and turbidity more effectively than reactors that had electrodes arranged vertically (Fadali et al., 2016; Genc & Eryilmaz, 2017). Horizontal electrode arrangements may have higher demands (Genc & Eryilmaz, 2017). EC reactors that relied on electrodes arranged vertically were more effective in removing chromium from wastewater (Khalaf et al., 2016). Electrodes in a vertical arrangement also proved to be more effective at treating palm oil mill effluent, and chicken processing plant wastewater (Gomes et al., 2018; Nasrullah et al., 2018) Effectiveness of electrode materials The type of coagulant formed in the EC process depends on the electrode material. The two most common electrode materials used in EC are aluminum and iron due to being relatively inexpensive and easy to obtain (Igwegbe et al., 2021). One study compared the effectiveness of aluminum and iron electrodes effectiveness for removing a highly soluble acid dye (Chafi et al., 2011). The authors found that iron electrodes provided a higher decolorization yield than aluminum electrodes at a lower current density. This would suggest that iron electrodes can decrease energy requirements and operating costs. The study also found that the iron electrodes achieved higher decolorization yields at higher pH ranges. EC treatment with iron electrodes was more resistant to pH changes than EC treatment with aluminum electrodes making iron more reliable (Chafi et al., 2011). 8 In the study by Uludag-Demirer et al. (2020), the authors investigated the effectiveness of treating anaerobic digestion effluent using EC with iron and aluminum electrodes separately and in different combinations. The study found that with a fixed current of 2A, a Fe-Fe electrode combination outperformed the Al-Al combination in total chemical oxygen demand (tCOD), TP (total phosphorus), and turbidity removal. The Fe-Fe combination was able to reduce the tCOD of the AD effluent from 3853.3 mg/L down to an average of 206.7 mg/L compared to a reduction down to 313.3 mg/L for the Al-Al combination. Fe-Fe was also significantly more effective at reducing turbidity. It decreased turbidity from an initial value of 4663.3 NTU to an average of 32.6 NTU, while the Al-Al combination only reduced it to an average of 284 NTU. Despite the effectiveness of the Fe-Fe combination, the study found that it was second in effectiveness to a combination using Al as the anode and Fe as the cathode (Al-Fe). This combination decreased all previously mentioned parameters more effectively than all other combinations tested (Fe-Fe, Al- Al, Fe-Al). For comparison, it dropped the tCOD value to 156.7 mg/L (Uludag-Demirer et al., 2020). Another study by Ajoud et al. (2015) tested the removal of chromium (VI) and fluoride from semiconductor industry wastewater with EC using hybrid aluminum and iron electrodes as the anodes paired with inert stainless-steel cathodes. They tested the effectiveness of the anodic hybrid by varying the number and type of material of the anode plates. The combinations were as follows: four aluminum anodes, three aluminum anodes and one iron anode, two aluminum anodes and two iron anodes, one aluminum anode and three iron anodes, and four iron anodes. The study found that fluoride removal was poorest using only iron for the anodes and increasingly improved by substituting aluminum electrodes. However, the opposite trend was 9 observed for removing Cr (VI), with pure aluminum plates providing the poorest removal and substituting in iron plates increasingly improved it (Aoudj et al., 2015). The results of these studies suggest that no single most effective electrode material can be used for all cases. Instead, the effectiveness of the electrode material in the EC treatment will depend on the type of wastewater to be treated and the pollutants targeted for removal. Electrode configuration The electrode configuration within a reactor is essential to consider because it influences several factors, such as energy consumption, electrode consumption, and pollutant removal efficiency (Kobya et al., 2011). Electrodes within the EC reactor can be connected to the power supply in either a monopolar or bipolar configuration. In a monopolar configuration, pairs of electrodes are each individually connected to a power supply. The electrodes connected to the positive outlet of the power supply serve as the sacrificial anodes (Asselin et al., 2008). Additionally, reactors in monopolar configuration can be set up with the electrodes in parallel or series arrangements (Nugroho et al., 2020). With a monopolar series arrangement, a higher potential difference is necessary to overcome the higher resistance for a given current (Lu, Zhang, et al., 2021). In this configuration, the outer electrodes are connected to the power supply and the internal sacrificial electrodes are connected to each other (Hakizimana et al., 2017). All the electrodes would have the same current flowing through them, however. In a parallel arrangement, the current is divided evenly between all electrodes (Mollah et al., 2004). In a bipolar electrode configuration, only the two outer electrodes are directly connected to the power supply (Golder et al., 2007). The electrodes in between the outermost electrodes behave as cathodes on one side and as anodes on the other (Golder et al., 2007). This is possible due to the 10 transfer of ions in the solution, which allows current to reach the inner electrodes (Asselin et al., 2008). These configurations can be seen in Figure 3 (Kobya et al., 2011). Figure 3. Electrode configurations. (a). Monopolar-parallel; (b). Monopolar-series; (c). bipolar- series configuration (Kobya et al., 2011) Regarding pollutant removal performance, several studies have demonstrated that bipolar configuration is more effective than monopolar configuration (Ghosh et al., 2008; Golder et al., 2007; Jin et al., 2021; Kobya et al., 2011). Bipolar configurations achieve higher pollutant removal rates in less time (Golder et al., 2007). Despite the better treatment performance of bipolar configurations, connecting electrodes in monopolar configurations may be the better choice for EC when considering costs. Monopolar configurations are more cost-effective because electrodes tend to last longer. This is because bipolar electrodes dissolve more rapidly (Golder et al., 2007). Additionally, EC reactors in monopolar configurations typically lower power consumption, decreasing operating costs (Hakizimana et al., 2017). 11 Power supply The two most common types of power supplies used in EC tests found in the literature are direct current (DC) and alternating current (AC), with DC generally being more common. Despite this, multiple studies claim AC is a better choice for EC (Ingelsson et al., 2020; Karamati-Niaragh et al., 2019; Moussa et al., 2017). Moussa et al. reported that DC not only corrodes and consumes the anode but can also cause the formation of an impermeable oxide layer of the cathode. This is known as passivation, and it decreases the current flow between the anode and cathode, decreasing the efficiency of EC. As a result, it leads to higher power consumption and operating costs. In the study by Karamati-Niaragh et al., the authors evaluated the performance of AC and DC for removing nitrate using EC. The study concluded AC was more effective at removing nitrate in 80% of the experiments. AC also had significantly lower operational costs due to the high electrode consumption found using DC. The study reported that DC’s average electrode consumption was four times higher than EC with AC (Karamati-Niaragh et al., 2019). The review paper by Inglesson et al. offers an in-depth discussion of the benefits of relying on AC or reversing polarity with EC instead of simply using DC. AC differs from DC because the current causes the electrodes to alternate between anodic and cathodic polarity. This can lead to a more uniform consumption of anodes which would increase the lifespan of the electrodes. In addition, this paper reports that AC can also delay electrode passivation, reduce sludge formation, and lower energy consumption, which agrees with the results found in the study by Karamati-Niaragh et al. Inglesson et al. also discuss polarity reversal. Polarity reversal with EC involves periodically switching the direction of a direct current and has similar benefits as using AC (Ingelsson et al., 2020). 12 OTHER IMPORTANT PARAMETERS Current density In addition to the design considerations for EC already mentioned, other important factors must be considered to achieve optimal EC treatment. Current density determines the cathodic and anodic reaction rate, influencing the EC cell's coagulant dosage and bubble generation rate (Mousazadeh, Naghdali, et al., 2021). Current density is described as the current per area of the electrode, and metal ion dissociation is directly proportional to the applied current (Sen et al., 2019). The mass of the ions released into the solution during EC can be estimated using Faraday’s law of electrolysis, Eq. 1 (Mohtashami & Shang, 2019). 𝐼𝑡𝑀 𝑚= 𝑍𝐹 Eq. 1 In this equation, 𝑚 is the mass of ions released into the solution, 𝐼 is the applied electrical current (A), 𝑡 is time (s), 𝑀 is the molar mass of the anode material (g/mol), 𝑍 is the number of electrons transferred, and 𝐹 is Faraday’s constant (96486 C/mol) (Mohtashami & Shang, 2019). This means the higher the current per electrode area, the greater the concentration of coagulant species released into the bulk fluid. A higher current density also increases production in smaller hydrogen gas bubbles, increasing the effectiveness of electroflotation (Attour et al., 2014). On the other hand, increasing current density too much can lead to wasting electrical energy in the form of heat (Moussa et al., 2017). For these reasons, current density plays the most crucial role in EC treatment. EC cell resistance and conductivity Another factor discussed in the literature that significantly influences the performance of EC is the electrical resistance in the cell. Resistance in the cell can be affected by the gap between electrodes and the conductivity of the solution being treated (Attour et al., 2014; Mollah 13 et al., 2004). An increase in resistance negatively impacts the pollutant removal efficiency. This is because the amount of metal and coagulant dissolved in the solution decreases as the resistance increases. One way to mitigate this issue is to reduce the gap distance between electrodes because electrical conductivity is inversely related to the gap between electrodes. The solution to be treated should also be measured for conductivity to ensure it is high enough for EC. Adding an electrolyte is sometimes considered necessary to increase the conductivity of the wastewater. However, this can cause secondary contamination of the treated effluent if the EC process cannot remove it (Mousazadeh, Naghdali, et al., 2021). The addition of various supporting electrolytes during EC to increase the conductivity of wastewater has been studied by multiple authors. Regardless of the electrode combination or wastewater being treated, the use of chloride salts results in decreased specific energy consumption and increased removal efficiency when compared to sulfate salts at the same concentrations (El-Ghenymy et al., 2020; Izquierdo et al., 2010; Trompette & Vergnes, 2009; Yilmaz et al., 2005). The relatively lower effectiveness of EC in the presence of sulfate ions is because they inhibit the corrosion of electrodes, which decreases current efficiency and pollutant removal (Hu et al., 2003). On the other hand, the corrosive strength of chloride ions helps prevent passivation and increases the rate at which the electrodes dissolve, subsequently improving pollutant removal (Tchamango et al., 2021) EC cell pH The pH during the EC process is another factor that should be considered. The effects of pH on the process can vary depending on the characteristics of the wastewater being treated, the material of the electrode, the initial pH, and the target pollutants (Mousazadeh, Naghdali, et al., 2021). 14 The pH in the EC cell will affect electrodes differently depending on the material used. One mechanism affected by the pH is the solubility of the anode (Moradi et al., 2021). Aluminum electrodes are consumed at a greater rate at higher pH ranges (Mouedhen et al., 2008; Yuksel et al., 2012). This means the anodes will be replaced more often, increasing operating costs (Yuksel et al., 2012). Iron anodes seemingly demonstrate the opposite behavior. The concentration of iron ions in the bulk solution will increase as pH decreases, with the highest concentrations observed at pH levels below 7 (Lynn et al., 2019). Iron anodes are more effective at higher pH values. This is because ferrous and ferric hydroxide coagulants are present in high concentrations in alkaline solutions (Jing et al., 2021). As mentioned previously, the removal efficiency of a targeted substance is also influenced by pH values. When using EC to remove algae from surface water, it was found that algae removal was highest at pH values less than 7 (Gao et al., 2010). The treatment time to achieve higher removal rates decreases at more acidic pH ranges (Gao et al., 2010). Turbidity removal is also very sensitive to pH changes. Removing turbidity from synthetic wastewater is highest around pH values of 8 and decreases sharply at pH values higher or lower than 8 (Merzouk et al., 2009). For wastewater with heavy metals such as zinc, copper, nickel, and magnesium, the removal rate of these pollutants is better at alkaline pH values. (de Mello Ferreira et al., 2013; Hanay & Hasar, 2011). This is likely due to improved metal hydroxide precipitation (de Mello Ferreira et al., 2013). Temperature Another factor mentioned in the literature that can influence the effectiveness of EC is the temperature inside the EC cell. Increasing the temperature in the EC cell can positively affect the removal rate depending on the targeted pollutant (Demirci & Özbeyaz, 2019). When increasing 15 the temperature in the EC cell past 20 °C, studies have demonstrated that the removal rates of boron and phosphate increase (Vasudevan et al., 2009; Yilmaz et al., 2007). When removing COD and phenol from paper mill wastewater, increasing the temperature higher than 20 °C steadily decreased the removal efficiencies of the two pollutants (Katal & Pahlavanzadeh, 2011). Increasing the temperature also decreased COD and sulfate removal efficiency in petroleum wastewater. This is likely because aluminum sulfate will not precipitate effectively at higher temperatures (El-Naas et al., 2009). LIMITATIONS AND GAPS IN THE LITERATURE Although EC has proven effective at removing a wide variety of pollutants, it is not very successful at removing ammonia from wastewater. Studies have shown that EC alone is typically only able to remove 20-40% of ammonia from landfill leachate (Ghanbari et al., 2020; Le et al., 2021; Lu, Zhuo, et al., 2021). To overcome this deficiency, EC must be coupled with additional treatment methods, such as ozonation or biofiltration, to remove most ammonia (Asaithambi et al., 2020; Bilińska et al., 2019; Dia et al., 2018). Another notable gap in the literature is that most of the pilot-scale EC studies focus on the treatment of various kinds of industrial wastewater, such as metallurgical wastewater, pulp mill wastewater, or contaminated groundwater (Bandaru et al., 2020; Kuokkanen et al., 2021; Perng & Wang, 2013). No studies were found that test the effectiveness of using EC to treat blackwater, high-strength wastewater sourced from toilets or latrines. CONCLUSION AND OBJECTIVES Utilizing EC as a form of wastewater treatment offers many benefits over more common biological and chemical treatments, such as producing effective coagulant agents through the electrolytic dissolution of metal electrodes. In addition, EC is an adaptable technology. As such, 16 it can be used in various configurations, and factors such as electrode material, arrangement, and current density can be controlled to treat a variety of wastewater. Furthermore, EC can be paired with other treatments for better ammonia removal. Overall, EC is a simple and cost-effective technology that efficiently removes several types of pollutants from wastewater. Further steps should include looking at the effectiveness of EC in treating blackwater. The goal of such a project should be to develop a pilot-scale treatment system to treat blackwater electrochemically via EC. Success in this endeavor would provide another option for decentralized wastewater treatment. Therefore, the objectives of this research are to: 1. Set up bench-scale experiments to test EC’s effectiveness for blackwater treatment, identify ideal operating conditions, and identify methods for ammonia removal. 2. Design and test a pilot-scale continuous EC reactor for treating blackwater using the data gathered from the lab-scale tests. 3. Complete a techno-economic assessment for the pilot-scale operation after optimizing the EC reactor. 17 CHAPTER 2: COMBINED EC AND AERATION INTRODUCTION EC is a flexible, convenient, and effective wastewater treatment method. A notable gap in the literature was that no studies investigated using EC to treat blackwater. Blackwater is source- separated wastewater from toilets and latrines and can account for as much as 50%-60% of COD, 50%-57% of TP, and 90% of TN in sewage (Li et al., 2023). This study investigates the feasibility of EC for blackwater treatment, as it could provide a simple and inexpensive option for decentralized wastewater treatment. Before testing the feasibility of EC for the blackwater treatment at a pilot-scale level, it would be necessary to perform bench-scale experiments to understand the overall effectiveness of EC alone for the blackwater treatment since no research has been conducted on this topic. It is also necessary to determine which additional treatments would be suitable to address the limitations of EC found in the literature review. The bench-scale experiments are also needed to understand the power consumption of the EC unit. Based on information found in the literature review, a continuous EC reactor was fabricated with a DC power supply and iron electrodes for laboratory trials. The effectiveness of different blackwater flow rates and corresponding hydraulic retention times in the reactor for the removal of various nutrients were investigated in these trials. Additionally, a settling period was implemented directly following EC treatment to allow floc particles to increase in size and settle. Voltage regulation via pulse width modulation was investigated as a method of reducing the electrical power supplied to the EC reactor. Pulse width modulation (PWM) switches the signal from a power source on and off at a given frequency. The ratio of the on-time (𝑇𝑜𝑛) of the signal to the corresponding period given by the frequency (𝑇𝑠) is known as the duty ratio or duty cycle (Eq. 2). It is typically expressed as a percentage (Alex Q. Huang & Xu She, 2018). Thus, 18 the average voltage and corresponding current output to the EC reactor will depend on the duty cycle. This study examined the impacts of different duty cycles and frequencies on the current output and subsequent blackwater treatment performance and energy consumption. 𝑇𝑜𝑛 𝑑= Eq. 2 𝑇𝑠 One post-EC treatment step was selected to address the limitations of EC: aeration of the EC effluent for air stripping. Air stripping is a well-known wastewater treatment technique that effectively removes ammonia (N. Değermenci & Yildiz, n.d.; Zangeneh et al., 2021). This is significant because nitrate and ammonia accelerate eutrophication, but ammonia is considerably more toxic to aquatic life than nitrate (5.7 Nitrates | Monitoring & Assessment | US EPA, n.d.). This study investigated and compared different aeration setups and pH levels to determine the ideal method for reducing NH 3 -N in EC-treated blackwater. Limited or no addition of other chemicals is desirable to avoid secondary pollution and the need for an added treatment step. Jar tests were employed in this study to assess chemical doses to achieve adequate removal of NH 3 -N during aeration. Calcium hydroxide was selected for its known applications as a coagulant (Mohamad et al., 2021) and as a method of chemical pH control (Postacchini et al., 2018) in wastewater treatment. 19 MATERIALS AND METHODS Bench Blackwater Preparation The synthetic blackwater for these laboratory trials was made using sludge obtained from the East Lansing Waster Resource Recovery Facility’s primary clarification settling. The sludge was collected from the plant in buckets. The strength of blackwater varies naturally, but in this case, the sludge was diluted with East Lansing tap water by a factor of 10. Following the bench- scale EC flow rate experiments, the blackwater was dosed with 0.89 g/L of ammonium chloride (NH 4 Cl) to increase the blackwater’s ammonia nitrogen (NH 3 -N) concentration. This was done as analysis of real blackwater samples revealed that the ammonia nitrogen concentration was higher than that of synthetic blackwater. Results of the real blackwater analysis can be found in Appendix A. A sample of synthetic blackwater was analyzed for each trial (Table 3). The synthetic blackwater had notably high COD, TP, and NH 3 -N after adding NH 4 Cl. Table 3. Characteristics of the synthetic blackwater with NH 4 Cl added Parameters Value pH 7.6 ± 0.20 COD (mg/L) 3028.3 ± 706.1 TP (mg/L) 130.5 ± 27.6 TN (mg/L) 504.1 ± 38.2 NH3 -N (mg/L) 298.0 ± 25.1 NO3 -N (mg/L) 12.8 ± 5.6 20 Parameter analysis Total phosphorous (TP), chemical oxygen demand (COD), ammonia nitrogen (NH 3 -N), nitrate nitrogen (NO 3 -N), and total nitrogen (TN) were measured using the United States Environmental Protection Agency (USEPA) approved HACH standard methods. Colorimetric results for these nutrients were obtained with a HACH DR3900 spectrophotometer. The turbidity of samples was determined with a HACH 2100Q Portable Turbidimeter. The pH of the wastewater at various stages in the treatment was measured using a HACH IntelliCAL PHC201 pH probe. Bench EC reactor A benchtop EC unit was fabricated to determine the parameters of power demand and hydraulic retention time for a pilot EC unit (Figure 4). The bench-scale EC treatment was done in a continuous reactor made of PVC with a working volume of 800 mL. The treated EC effluent exited the reactor through a sampling port built into the side. A larger outlet at the top of the reactor allowed the sludge to accumulate and fall into a bucket. This study used two iron electrodes that are 40.64 cm (16 inches) long, 2.54 cm (1 inch) wide, and 0.16 cm (1/16 inch) thick. The electrodes were spaced 1 cm apart in the reactor in a monopolar-parallel configuration. A rubber stopper was included at the top of the reactor to hold and seal the electrodes in place. The DC was applied to the electrodes using a TekPower TP6010E switching power supply. 21 Figure 4. The bench-scale continuous EC reactor with blackwater EC flow rate experiments To study the impact of flow rate on the effectiveness of EC treatment of blackwater, two volumetric flow rates of blackwater were tested: 160 mL/min and 250 mL/min, which correspond to hydraulic retention times (HRTs) of 5, and 3.2 minutes respectively. The reactor would be filled with blackwater before turning the power supply on. Once the reactor was filled, the power supply would be turned on, and the system would be allowed to warm up for 5 minutes to begin treating the blackwater. The current was maintained at a constant 2.0 A while the voltage would vary depending on the flow rate and was recorded. The reactor was fed manually once a minute following the 5-minute warm-up time. At the same rate, the sampling port collected a sample every minute. The total runtime of the EC was 100 minutes. After the EC treatment, the effluent samples were allowed to settle for 10 minutes to allow the flocs to 22 increase in size and separate from the liquid phase. Settling took place in Imhoff cones. Turbidity was measured for the samples after settling. Aeration of EC effluent Before the aeration, it was first necessary to produce EC effluent. EC was carried out like the flow rate experiments with some alterations. Firstly, the blackwater was dosed with (NH 4 Cl) as described in the blackwater preparation section to increase the ammonia content. Secondly, the sampling port of the reactor was modified to allow the effluent to overflow out of the reactor instead of manually opening the port every minute to collect the effluent. This was done by taping the port higher on the reactor and allowing the outlet to hang over a bucket. The modified EC reactor can be seen in Figure 5. Thirdly, blackwater was fed into the reactor continuously, as opposed to feeding it once a minute. In order to accomplish this task, 150 mL of blackwater was placed into beakers and then gradually poured into the reactor over the course of one minute, timed with a stopwatch. Five liters of blackwater were fed to the reactor each time. The collected EC effluent was allowed to settle for one hour. After settling, the clarified portion of the effluent was taken for analysis and use in aeration treatments. The pH and turbidity of the solution were measured, and the removal of COD, TP, TN, and NH3 -N was evaluated. Finally, the effluent’s pH was adjusted with 2N sodium hydroxide (NaOH). 23 Figure 5. The modified EC reactor with blackwater Two different aeration setups at pH levels 9 and 11 (4 treatments) were tested for removing NH3-N from the EC effluent. The pH adjustment was made with 2N sodium hydroxide. The first setup consisted of a 700 mL air stripping column. The column was made with furniture-grade clear PVC pipe and was packed with P-series 16 pall rings for increased surface area. Two stainless steel fittings were added to the top and bottom of the column. A vacuum pump (Gast Manufacturing, Inc., DOA-P708-AA, Benton Harbor, MI) was used to pump air into one of the stainless-steel fittings at the bottom of the column. Before this, however, the air would pass through a gas flow meter (OMEGA, FMA, LP1620A-V2, DIGITAL, Stamford, CT) to measure the flow. The airflow rate from the pump was kept constant at 25 L/min using a small clamp on the tubing connected to the outlet of the vacuum pump. The air would exit from one of the fittings at the top of the column. A metering pump (Iwaki America 24 Inc., EWN-BI6PCUR, Holliston, MA) was used to pump 1000 mL of EC effluent into the top of the column at 25 mL/min. The pall rings would disperse the liquid before reaching the bottom of the column. The effluent would drain into a beaker through the other fitting at the bottom. The column setup can be seen in Figure 6. This effluent was sampled and analyzed. Figure 6. The experimental column aeration setup for ammonia stripping (vacuum pump not pictured) The other aeration setup tested for removing NH3 -N used stainless-steel trays to test the merits of surface aeration. The trays are 23.5 cm (9.25 in) long and 17.78 cm (7 in) wide for a corresponding surface area equaling 417.74 cm2 (64.75 in2 ). From the collected EC effluent, 150 25 mL was added to two metal trays placed before a fan (Figure 7). The fans were turned on, set to their lowest speed, and left on for 60 minutes. The airspeed was 3.2 m/s and was measured with a UEi DAFM3 Anemometer. To simulate steady-state conditions, 25 mL of the solution was removed and added to the trays every 5 minutes for an equivalent 5 mL/min flow rate. The major assumption was that the evaporation in the tray during this process was negligible. The tray’s effluent volume was measured after the contus aeration to verify the assumption. Samples were taken every 20 minutes for analysis. Figure 7. The stainless-steel tray aeration setup 26 Calcium hydroxide jar tests Jar tests were conducted to determine the smallest dose of calcium hydroxide necessary to achieve adequate NH 3 -N removal through aeration. The tray aeration setup was selected to investigate the impacts of adding calcium hydroxide before aeration. After allowing the EC effluent to settle for one hour, four beakers were filled with 500 mL of the EC supernatant, not disturbing the solids settled at the bottom. Calcium hydroxide was added to each beaker at 0.9 or 1.8 g/L. This was done to increase the pH of the EC supernatant before aeration and to help settle any remaining suspended solids. The solution in the beakers was then agitated for 5 minutes at 47 RPM with a Phipps & Bird 77900-400 Stirrer and left to settle for an additional 55 minutes. The solution was then aerated with the tray aeration setup via the abovementioned procedure. EC with pulse width modulation A PWM signal generator (MiYOOW 1Hz-150KHz 1-Channel Adjustable PWM Pulse Frequency Generator Module) was connected to a solid-state relay to switch the higher current from the external power supply. The setup also contained a battery to power the circuitry of the signal generator. This setup allowed for control of the voltage, frequency, and duty cycle. The EC treatment was performed over 20 minutes in the same 800 mL PVC reactor described in the prior sections. With this power supply setup, eleven combinations of frequencies, voltages, and duty cycles were tested to assess these factors impacts on the EC treatment (Table 4). Four combinations were operated at 100% duty cycle and served as controls. Each combination was performed twice. The current on the power supply display during the EC process was recorded. Following EC, the effluent was allowed to sit for 1 hour to enable flocs to grow and settle as before. After settling, the EC effluent's turbidity, COD, TP, NH 3 -N, and TN were analyzed. Additionally, the energy consumption was calculated with Eq. 3 where 𝐸 is the energy 27 consumption (Wh/mg/L COD removed), 𝑉 is voltage (V), I is current (A), dc is duty cycle (%), and c is COD concentration removed (g/L). 𝑉∗𝐼∗𝑑𝑐 𝐸= Eq. 3 𝑐 Table 4. EC PWM trials Combination Voltage (V) Frequency (Hz) Duty cycle (%) 1 10 100 50 2 10 100 80 3 6 100 50 4 6 100 80 5 10 200 50 6 10 200 80 7* 6 200 50 8 6 200 80 9 6 100 100 10 6 200 100 11 10 100 100 12 10 200 100 *Combination 7 rendered EC treatment ineffective, so these data were not analyzed Statistical analysis All statistical analysis was performed in RStudio (Version 4.1.1). Significance was set to P<0.01 for all tests. The data were checked for normality with the Shapiro-Wilk test, and skewness was reviewed to determine the necessary transformations with the “moments” package. Square root, log, and inverse transformations were used to transform data depending on the severity of the skew. Data were checked for homoscedasticity with Bartlett’s test. Non- parametric Mann-Whitney tests were performed on voltage and turbidity to determine the 28 significant differences flow rate had on the EC treatment. Depending on whether the equal variance assumption was met, Welch’s t-tests or Student’s t-tests were conducted on turbidity, TN, and NH 3 -N to determine significant differences between aeration setups and pH levels. Statistically significant differences among the two calcium hydroxide doses tested for surface tray aeration were determined by Mann-Whitney and t-tests. ANOVA and Tukey tests were performed to determine if voltage, frequency, duty cycle, and their interactions significantly impacted the COD, TP, turbidity, and energy consumption. RESULTS AND DISCUSSION EC flow rate results The continuous EC reactor was fed at flow rates of 160 mL/min (5-minute HRT) and 250 mL/min (3.2-minute HRT). The voltage required by the power supply to maintain 2.0 A depended on the flow rate of blackwater through the reactor (Figure 8). Notably, the average voltage at 160 mL/min was 20.0 ± 0.35 V, which was significantly different (P<0.01) from the average at 250 mL/min (14.0 ± 0.31 V). This could mean that more sludge would settle on the electrodes due to the lower flow rate, thus increasing cell resistance. Meanwhile, the highest flow rate (250 mL/min) likely helped dislodge some of the solids settling on the electrodes through the faster velocity of the blackwater, allowing current to flow freely between them. It is also worth noting that the voltage stayed relatively constant during the EC tests. This is seen in Figure 8 below, as the voltages at both flow rates have minimal standard deviations. This would imply that steady-state conditions were achieved during the process. The effluent exiting the reactor was a dark shade of green, but this color rapidly turned a rust-orange color during the settling process (Figure 8). This was likely due to the ferrous iron in the solution oxidizing to ferric iron. Most suspended floc particles would settle rapidly during 29 this oxidation, leaving a thin layer of suspended solids floating near the top of the solution. It should also be noted that the sludge separation via electrolocation during these tests was not prominent. Therefore, the settling process was critical, as it was the dominant method for separating the solids from the liquid phase of the EC effluent. Samples were taken from the clarified portion of the effluent (Figure 8), taking care not to disturb the solids, and had their turbidity measured. There is a clear difference in turbidity between the two groups, confirmed by the non-parametric Mann-Whitney test (P<0.01). The turbidity at 160 mL/min and 250 mL/min were 54.1 ± 15.8 NTU and 139.3 ± 80.6 NTU, respectively. Not only was the turbidity less at the lower flow rate, but the EC performance was also more stable, evident from the smaller error bars. Therefore, it is possible that the lower turbidity and higher voltage seen in the lower flow rate were caused by increased solids settling on the electrodes and reactor during the process. The experiment results suggest that the lower flow rate provided better treatment for the blackwater than the higher flow rate overall. For this reason, the flow rate of 160 mL/min with an HRT of 5.33 minutes was selected for further experiments. Additionally, it was postulated that modifying the reactor and operation procedure to achieve more accurate continuous flow, rather than feeding once a minute, would gain more stable performance. To this end, the reactor and operating procedure were modified, as discussed in the previous section. 30 b a Figure 8. The EC effluent. (a). EC effluent after exiting the reactor; (b). EC effluent after 10 minutes of settling 31 Figure 9. Average turbidity (a) and voltage (b) results from the flow rate tests. Error bars indicate standard deviation from the mean unless stated otherwise Modified EC treatment Producing EC effluent with the new EC reactor setup provided the chance to evaluate several more parameters to gain improved insight into the performance of EC in treating blackwater. The characteristics of the EC effluent after one hour of settling are found in Table 5. The pH of the was notably higher than that of the blackwater. This increase is most likely due to the generation of OH - ions from the reduction reaction at the cathode. In addition, the EC 32 exhibited high COD and TP removal. The average concentrations of COD and TP decreased from 3028.3 ± 706.1 mg/L and 130.5 ± 27.6 mg/L (Table 5) to 562.7 ± 13.6 mg/L and 2.12 ± 0.11 mg/L, respectively. This corresponds to removals of 81.4% and 98.4% for COD and TP, regardless of the initial blackwater strength. This suggests EC is a consistent and reliable treatment and can effectively treat blackwater of varying strength when considering COD and TP. Additionally, the EC treatment decreased the NO 3 -N concentration from an average of 12.8 ± 5.6 mg/L to 1.45 ± 1.2 mg/L, corresponding to an average removal of 88.7%. This demonstrates that EC is also effective at consistently reducing the nitrate concentration of blackwater. Other studies have reported similar results for nitrate reduction via EC (Emamjomeh et al., 2017; Hashim et al., 2017; Nazlabadi et al., 2019; Yehya et al., 2014). In addition, authors report that some nitrate is removed through adsorption onto the metal hydroxides produced during the EC process (Koparal & Öütveren, 2002; Nazlabadi et al., 2019; Yehya et al., 2014). Table 5. EC effluent characteristics after 1 hour of settling (HRT = 5.33 minutes). Results are presented as the average ± standard deviation Parameters Value pH 8.5 ± 0.86 Turbidity (NTU) 88.9 ± 39.1 COD (mg/L) 562.7 ± 13.6 TP (mg/L) 2.12 ± 0.11 TN (mg/L) 363.9 ± 46.5 NH3 -N (mg/L) 268.0 ± 11.7 33 Table 5. (cont’d) NO 3 -N (mg/L) 1.45 ± 1.2 On the other hand, the EC was not very effective at removing NH3 -N from the blackwater. This is significant because the NH3 -N consisted of nearly 60% of the TN in the blackwater with NH 4 -Cl added. In fact, the average concentration of 268.0 ± 11.7 mg/L in the EC effluent represents a removal of just 10% of the initial NH 3 -N concentration in the synthetic blackwater. The inability of EC to reduce the NH 3 -N concentration is unsurprising, as it was an explicit limitation of the technology discussed in the literature review. However, the 10% removal in this study was even less than the typical 20-40% seen in the literature (Ghanbari et al., 2020; Le et al., 2021; Lu, Zhuo, et al., 2021). This limitation of EC is often discussed in the literature, but its actual reason is not well documented. It may be due to nitrogen compounds being very electronegative, making them difficult to remove (Liu et al., 2015; Nazlabadi et al., 2019; Uludag-Demirer et al., 2020). In addition, the high solubility of NH3 -N in water may be another reason that it is difficult to remove by EC (Liu et al., 2015). Furthermore, it should be noted that the voltage necessary to maintain 2.0 A for these experiments was 5.0 V compared to an average of 20.0 ± 0.35 V in the previous EC experiment. This means the cell resistance in the reactor was lower. This can most likely be attributed to the addition of NH 4 Cl to the blackwater since it has been used as a supporting electrolyte in other EC studies (Izquierdo et al., 2010). This means energy demand was also lower than in the previous EC experiments. However, NH4 Cl may not be a good choice for a supporting electrolyte because the resulting NH 3 -N must be removed via additional treatment steps. 34 Aeration of EC effluent Two aeration setups and pH levels were tested and evaluated to determine the better choice for stripping ammonia from the EC-treated blackwater. Figure 10 shows the EC supernatant after aeration with the column setup. This effluent was slightly yellow and appeared hazy. The average turbidity values seen in Figure 11 suggest that the initial pH of the EC effluent feed did not impact the turbidity of the aerated EC supernatant for the column aeration setup. A two-sample t-test confirmed that the average turbidities of the two pH levels tested with the column were not significantly different (P>0.01). Overall, the turbidity removal of the column setup was low. The average turbidities of the EC supernatant after aeration with the column setup are 79.9 ± 15.1 NTU and 75.5 ± 34.1 NTU at pH levels 9 and 11, respectively. These correspond to turbidity removals of 10% and 15%. Figure 10. EC supernatant after the column aeration at 25 mL/min 35 Figure 11. Comparison of final turbidity after the two setups between the two aeration setups and pH levels On the other hand, Figure 11 suggests that the tray setup was far more effective in decreasing the EC supernatant's turbidity than the column. The two-sample t-test confirmed that the tray aeration turbidities (20.3 ± 2.6 NTU and 13.1 ± 0.6 NTU at pH 9 and 11, respectively) were much lower (P<0.01) than the abovementioned turbidity values observed in the column effluent. Additionally, unlike the column aeration, the turbidity of the effluent aerated at pH 11 with the tray setup was significantly lower (P<0.01) than that of the effluent aerated at pH 9. Various factors may have contributed to the tray setup’s improved turbidity removal. First, the tray setup was likely more conducive for further settling. Figure 12 clearly shows solids that have settled to the bottom of the trays at both pH levels tested. These flocs are rust-colored, 36 meaning it is likely that some of the ferric iron in the EC effluent settled out of the solution. This oxidized iron is responsible for the color of the EC effluent, so it makes sense that the turbidity of the effluent after aeration would be lower. At the same time, it is clear from Figure 12 that the trays at pH 11 have more solids settled at the bottom. The improved settling is likely due to the higher alkalinity of the solution, as the relationship between flocculation efficiency and pH has been studied previously (Phasey et al., 2017; Wu et al., 2012). This phenomenon may be due to iron (III) ions in the solution hydrolyzing to form ferric hydroxide (Wu et al., 2012). As a result, the ferric hydroxide precipitated and removed more contaminants and color from the solution. Furthermore, it is possible that the flow rate through the column (25 mL/min) was too high to achieve better turbidity removal. Unlike the tray setup, these conditions may not have allowed ferric hydroxide to form. a b Figure 12. The surface tray aeration of pH 9 (a) and pH 11 (b) after 60 minutes The NH 3 -N in the solution was measured to determine the viability of air stripping as a post-EC treatment. Regarding NH 3 -N, the tray aeration setup at pH 11 reduced the ammonia concentration the most (Figure 13). The average NH 3 -N concentration at these conditions was 93.5 ± 12.3 mg/L, corresponding to a removal efficiency of 65.1% of the NH 3 -N concentration in 37 the EC effluent (Table 5). This result was confirmed to be substantially different from all other treatments (P<0.01). Meanwhile, the NH 3 -N concentrations of the EC effluent after the column aerations were at pH 9 and 11 were not statistically significant from each other. Furthermore, the two had removal efficiencies of 5.3% and 9.1% of the NH 3 -N in the EC effluent. Most notably, however, the tray setup at pH 9 seemingly had the poorest performance of any other treatment, with an average NH 3 -N concentration of 303.5 ± 11.9 mg/L. This was higher than the average NH3 -N concentration in the EC effluent. Despite this, the result was not statistically different from the NH 3 -N concentration observed in the EC effluent aerated with the column setup at pH 9 (P>0.01). Overall, the tray aeration setup at pH 11 was the most successful setup for stripping NH 3 - N from the EC effluent. This is unsurprising as a pH greater than 9.25 is one of the primary factors impacting ammonia stripping described in the literature, along with temperature and stripping gas flow rate (Palakodeti et al., 2021). In addition, the pH is critical because it determines the balance of the ammonium ion (NH 4 +) to free ammonia (NH 3 ), and this equilibrium is shown in Equation 4 (G. D. Değermenci, 2022). As the pH increases, the equilibrium seen in Equation 4 shifts to the right, increasing free ammonia in the solution (Palakodeti et al., 2021). NH 4 + + OH - ↔ NH 3 + H 2 O Eq. 4 The free ammonia concentration must be greater than the ammonium ion, as only free ammonia can be removed from the liquid phase by gas stripping (Palakodeti et al., 2021). Furthermore, studies have shown that ammonia stripping removal is most effective at a pH level of 11, which further explains the success of the tray setup at this pH (G. D. Değermenci, 2022; Lin et al., 2009). On the other hand, NH 4 + is dominant at a pH of 9, which would explain why the aerations 38 done at that pH level were ineffective (G. D. Değermenci, 2022). However, a discussion of the impact of pH alone does not explain why the column setup at pH 11 was not as effective as the tray aeration at the same pH. Instead, it could be possible that the flow rate through the column was not high enough to sufficiently decrease the mass transfer resistance (Arogo et al., 1999). Figure 13. Comparison of NH 3 -N concentrations after the two setups between the two aeration setups and pH levels In addition to the turbidity and NH 3 -N, the TN of the effluent after aeration was also measured (Figure 14). The results are partially consistent with NH3 -N removal results. The tray aeration at pH 11 also provided the lowest average TN measurement (120.4 ± 20.5 mg/L), which was significantly lower than the average TN concentrations seen in all other treatments (P<0.01). This amounts to a removal efficiency of 66.9%. Another similarity between the TN and NH 3 -N 39 results was that the average TN concentration after the tray aeration at pH 9 was 466.4 ± 18.2 mg/L. This result was confirmed to be significantly higher than the results of the other treatments (P<0.01). Overall, these results strongly suggest that adding chemicals to the EC effluent is necessary to increase the pH of the solution, as the increase in pH due to EC alone is not enough to facilitate the removal of NH 3 -N from the effluent via air stripping. In addition, increasing the temperature of the effluent during aeration is another option for increasing the removal efficiency of air stripping, but this is unlikely to be economically feasible at small scales due to being energy intensive (G. D. Değermenci, 2022). Figure 14. Comparison of TN concentrations after aeration between the two aeration setups and pH levels 40 Aeration with calcium hydroxide The results of the abovementioned aeration experiments indicate that adding chemicals for pH increase to facilitate the removal of NH 3 -N is necessary. Considering this conclusion, the decision to switch from sodium hydroxide was made as a Life Cycle Assessment study found that as a pH agent, calcium hydroxide was a better choice than sodium hydroxide regarding environmental impact and cost (Postacchini et al., 2018). Furthermore, the tray aeration setup was selected to investigate the effectiveness of calcium hydroxide in facilitating the removal of NH3 -N from the EC effluent, as this setup at pH 11 outperformed all other treatments. As mentioned in the materials and methods section, two calcium hydroxide doses were tested: 0.9 g/L and 1.8 g/L. The visual quality of the EC effluent batches before the addition of calcium hydroxide, immediately after the addition of calcium hydroxide, and after 55 minutes of settling following the 5-minute mixing period are seen in Figure 15. The EC effluent progresses from having a dark green color, characteristic of iron (II) ions, to being primarily clear of color regardless of the calcium hydroxide dose. However, the effluent with 1.8 g/L of calcium hydroxide was slightly hazier than that with 0.9 g/L. This is most likely due to the higher concentration of dissolved solids in the effluent from the higher dose of calcium hydroxide. Additionally, the settling characteristics of the EC effluent-calcium hydroxide mixtures were promising. After the 5-minute mixing period, large floc formations were visible in the beakers. These large flocs settled quickly, leaving the beakers clear of visible suspended solids. The resulting sludge from this settling can also be seen in Figure 15, with the beaker containing the mixture with 1.8 g/L of calcium hydroxide correspondingly containing a more considerable amount. This process happened in less than 30 minutes, meaning the 55-minute settling time was excessive. The reason for the effective settling in this situation is likely the same as the reason 41 for the settling observed in the tray aeration setup. This means that additional ferric hydroxide formed and precipitated, removing contaminants from the solution. As before, this was likely facilitated by a pH increase caused by calcium hydroxide. 42 (a) (b) Figure 15. The addition of calcium hydroxide to the EC effluent. (a). EC effluent before 0.9 g/L of calcium hydroxide was added; (b). EC effluent before adding 1.8 g/L of calcium hydroxide; (c). EC effluent immediately after adding 0.9 g/L of calcium hydroxide; (d ). EC effluent after adding 1.8 g/L of calcium hydroxide; (e). EC effluent with 0.9 g/l of calcium hydroxide after 55 minutes of settling; (f). EC effluent with 1.8 g/L of calcium hydroxide after 55 minutes of settling 43 Figure 15. (cont’d) (c) (d) 44 Figure 15. (cont’d) (e) (f) 45 Figure 16 illustrates the difference in average pH levels of the EC effluent-calcium hydroxide mixtures during aeration. The pH of the solutions remained constant during the tray aeration, suggesting steady-state conditions developed during the process. The average pH of the effluent with 0.9 g/L of calcium hydroxide was 10.8 ± 0.05, while the effluent with 1.8 g/L was 11.0 ± 0.01. The difference did not seem significant. However, the values were confirmed to be different from each other (P<0.01). Overall, the pH of the effluent with 1.8 g/L of calcium hydroxide was very similar to its sodium hydroxide counterpart. Figure 16. The average pH of the two EC effluent-calcium hydroxide mixtures during aeration The turbidity of the EC effluent-calcium hydroxides mixtures was also measured during the tray aeration. Figure 17 shows the average turbidity of the EC effluent during the aeration. The figure illustrates that the average turbidity of the effluent with 1.8 g/L of calcium hydroxide 46 was significantly lower than that with 0.9 g/L, which was confirmed by Welch’s t-test (P<0.01). Also, the standard deviation of the turbidity of the effluent with 1.8 g/L was smaller than that at 0.9 g/L, which suggests that the treatment at the higher dose was more consistent. Both treatments demonstrated good turbidity removal from the EC effluent (69.9% and 84% removal efficiencies at 0.9 g/L and 1.8 g/L, respectively), with 1.8 g/L of calcium hydroxide performing better at the cost of requiring double the dose of calcium hydroxide. Figure 17. The average Turbidity of the two EC effluent-calcium hydroxide mixtures during aeration The TP of the EC effluent was also reduced after tray aeration with calcium hydroxide added (Figure 18). The results indicate that the TP of the solution with 1.8 g/L of calcium hydroxide was again lower than that with 0.9 g/L. The average TP concentration of the two 47 treatments was 0.75 ± 0.15 mg/L and 0.48 ± 0.04 mg/L for 0.9 g/L and 1.8 g/L of calcium hydroxide, respectively, corresponding to removal efficiencies of 64.6% and 77.4 %. A Mann- Whitney test confirmed that the TP concentration of the solution with 1.8 g/L was lower (P<0.01). These results strongly suggest that the remainder of the TP present in the EC effluent is primarily present in solid form. Therefore, the TP is easily removed through settling facilitated by adding calcium hydroxide. Figure 18. The average TP of the two EC effluent-calcium hydroxide mixtures during aeration Unlike turbidity and TP, COD was not effectively removed during the aeration. The average COD concentration of the EC effluent-calcium mixture at 0.9 g/L was 545.3 ± 15.4 mg/L and 552.8 ± 44.8 mg/L at 1.8 g/L (3.1% and 1.8% removal efficiency, respectively). The significant disparity in removal efficiency between TP and COD during the aeration strongly 48 implies that the remaining COD in the EC effluent is primarily dissolved in the liquid phase of the EC effluent, unlike the TP. Also noteworthy is that there appears to be no difference in the COD concentration during aeration between the two treatments investigated . A non-parametric Mann-Whitney test confirmed no significant differences in the COD results visualized in Figure 19 (P>0.01). This may imply that enhanced settling with calcium hydroxide followed by air stripping is not an effective method for reducing the COD of the EC effluent. Figure 19. The average COD of the two EC effluent-calcium hydroxide mixtures during aeration The NH 3 -N concentration during aeration with the calcium hydroxide produced similarly trending results to those seen in the average turbidity and TP results discussed in this section, with aeration at 1.8 g/L of calcium hydroxide producing better results than at 0.9 g/L (Figure 20). The average concentration at 0.9 g/L was 207.9 ± 42.8 mg/L (22.4% removal efficiency) and 49 86.5 ± 44.6 mg/L (67.7% removal efficiency) at 1.8 g/L. A Student’s t-test found the two treatments to be significantly different concerning NH3 -N (P<0.01), which emphasizes the importance of maintaining the pH of the solution at 11. Indeed, the difference between an average pH of 10.8 and 11 amounts to triple the removal efficiency concerning NH 3 -N. On the other hand, the average TN concentrations (Figure 21) during the aeration between the two treatments were not significantly different by Welch’s t-test (P>0.01). This implies the difference between 0.9 g/L and 1.8 g/L of calcium hydroxide, and by extension, the difference between a pH of 10.8 and 11, respectively, does not substantially impact TN removal. It should also be noted that the removal efficiency of TN at 1.8 g/L during the aeration was 54.1%, which is lower than the removal efficiency for NH 3 -N under the same conditions (67.7%). This could mean that some of the NH 3 -N was oxidized into nitrite-nitrogen (NO 2 -N) or NO3 -N instead of being removed entirely by air stripping. 50 Figure 20. The average NH 3 -N of the two EC effluent-calcium hydroxide mixtures during aeration 51 Figure 21. The average NH 3 -N of the two EC effluent-calcium hydroxide mixtures during aeration EC with pulse width modulation The bench EC system was tested under the conditions in Table 4 to investigate the impacts of pairing EC with pulse width modulation on the turbidity, TP, COD, and energy demand. The three-way ANOVA found a highly significant difference in average turbidity from the voltage, duty cycle, the interaction between duty cycle and frequency, and the interaction between voltage and duty cycle. (P<0.01). Voltage was the most significant factor, followed by the duty cycle and the interaction between the duty cycle and frequency. Figure 22 presents the turbidity results collected during the EC with pulse width modulation experiments. At 100 Hz, turbidity decreases as the voltage and duty cycle increase. At 200 Hz, the same trend was also observed. Concerning turbidity, the highest average value observed was 284.3 ± 80.7 NTU at 6 52 V-100 Hz-50% duty cycle. A Tukey post-hoc test revealed that the turbidity under these conditions was statistically different (P<0.01) from all other combinations except that at 6 V-100 Hz-80% duty cycle. Therefore, these conditions should be avoided if turbidity removal is the primary goal. At the same time, the lowest average turbidity observed was also at 100 Hz and was 26.6 ± 2.9 NTU at 10 V and 100% duty cycle. Tukey’s post-hoc test revealed that turbidity at 100 Hz and 100% duty cycle was not significantly different (P>0.01) from that at 200 Hz and 100% duty cycle or 200 Hz and 80% duty cycle. This means that running the EC at 200 Hz and 80% duty cycle could be a good alternative for removing turbidity since it would be less energy intensive. Concerning the average TP of the EC effluent, the three-way ANOVA detected that the voltage, duty cycle, and the interaction between voltage and frequency had a significant impact (P<0.01). Therefore, Figure 23 suggests running the EC at 200 Hz, 10 V, and 80% duty cycle will provide favorable results for TP removal while being less energy intensive than running at 100% duty cycle. The Tukey test supports this proposal; it did not detect significant differences between 100% duty cycle and 80% duty cycle (P>0.01). 53 Figure 22. EC effluent turbidity at 100 Hz (a) and 200 Hz (b) after the pulse width modulation EC tests 54 Figure 23. EC effluent TP concentration at 100 Hz (a) and 200 Hz (b) after the pulse width modulation EC tests Figures 24 and 25 illustrate the COD concentrations of the EC effluent after the treatment and the energy consumption normalized to the concentration (g/L) of COD removed from the blackwater. Concerning COD, all factors and interactions were highly significant (P<0.01) except for the interaction between voltage and frequency. The lowest average COD 55 concentration measured was 213.25 ± 25.3 mg/L at 200 Hz, 10 V, and 100% duty cycle conditions. The Tukey test did not detect significant differences between the lowest average COD and the COD at 10 V, 100 Hz, 80% duty cycle, and 10 V, 100 Hz, 50% duty cycle (P>0.01). However, COD at the stated conditions significantly differed from the other treatments (P<0.01). When considering the energy consumption of the treatment, it is evident that it is generally lower than that at 100 Hz, especially when comparing the energy consumption at 10 V. For example, the energy demand of the treatment at 100 Hz, 10 V, and 80% duty cycle was 5.7 ± 0.84 Wh/g/L of COD removed, compared to an energy consumption of 2.84 ± 0.31 Wh/g/L of COD removed at 200 Hz and the same voltage and duty cycle. Furthermore, the ANOVA found significant differences in average energy consumption by voltage, duty cycle, the interaction between voltage and duty cycle, and the interaction between voltage and frequency (P<0.01). Performing a Tukey test revealed that the interaction between voltage and frequency at 10 V, 200 Hz, was significantly different from that at 10 V, 100 Hz (P<0.01) but not significantly different from the energy consumption at 6 V, 200 Hz (P>0.01). Considering the entire discussion of this section, the best overall operating conditions for the EC reactor are 200 Hz, 10 V, and 100% duty cycle. These conditions balance removing turbidity, TP, COD, and the treatment’s energy consumption. If necessary, however, the conditions can be changed to prioritize removing contaminants or minimizing energy consumption. In addition, implementing pulse width modulation with EC treatment makes an already highly adaptable technology even more flexible. 56 Figure 24. EC effluent COD concentrations at 100 Hz (a) and 200 Hz (b) after the pulse width modulation EC tests 57 Figure 25. Energy consumption during the EC treatment at 100 Hz (a) and 200 Hz (b) CONCLUSION Five conclusions were drawn from the results of these bench-scale tests. First, HRTs between 5 and 5.33 minutes for the EC treatment were more effective for reducing the turbidity of the blackwater. Second, the bench-scale EC treatment consistently achieved removal efficiencies of 81.4% and 98.4% for COD and TP, regardless of the initial blackwater strength. 58 However, EC only removed 10% of the NH 3 -N, less than the removal efficiencies observed in the literature. This means that a post-EC treatment targeting NH 3 -N is a necessity. Third, the tray aeration setup at pH 11 was the most effective for stripping NH 3 -N from the EC effluent. This confirms that adding chemicals for pH control is necessary for post-EC treatment to facilitate NH3 -N removal. Fourth, for this purpose, calcium hydroxide is a more environmentally and less costly alternative to sodium hydroxide. However, calcium hydroxide has the added drawback of producing more sludge than sodium hydroxide. Finally, utilizing pulse width modulation for EC is a viable method for increasing the energy efficiency of the process. It adds an additional layer of flexibility to the treatment by allowing the control of the voltage, frequency, and duty cycle supplied during the treatment. 59 CHAPTER 3: PILOT-SCALE EC EXPERIMENTS INTRODUCTION The bench-scale tests revealed that EC for the blackwater treatment is an effective and consistent option for removing COD, turbidity, and TP. However, a pilot-scale study was needed to test the practicality of EC at larger scales for blackwater treatment. Therefore, this study aimed to utilize the lessons learned from the bench-scale experiments in the previous section to construct and test a pilot-scale EC system to treat blackwater for a small community. The effective use of electroflotation for sludge removal is vital to the success of a pilot- scale EC treatment system for blackwater. Preliminary pilot-scale tests revealed that the hydrogen gas generated by the cathode flowed into the settling tank resulting in a mixing effect. This mixing prevented floc particles from settling and, in some cases, destroyed the flocs (Figure 28). Overall, this worsened the quality of the EC effluent and needed to be addressed. Effective sludge settling through electroflotation would remove much of the solids from the liquid phase of the EC effluent before a settling step. This would mean less time could be dedicated to settling, allowing the system to operate at higher flow rates. This study assessed the feasibility of such a solution by designing and evaluating three sludge separator designs. Additionally, this study investigated the effects different flow rates and distances between electrodes had on the performance of a pilot-scale EC system for blackwater treatment. Special attention was also paid to the effectiveness of the selected power source and pumps employed for the system. 60 MATERIALS AND METHODS Blackwater preparation The blackwater used in the pilot-scale experiments was produced differently from the bench experiments. First, raw sewage from Michigan State University’s Brody Neighborhood (East Lansing, MI) was pumped to the pilot site into a buffer tank. Then, a grinder pump sent the sewage through an incline plate clarifier with a nominal capacity of 60.5 L/min (20 GPM) (M.W. WATERMARK, SCPC-20, New Holland, MI) to settle the solids from the sewage. Next, this sludge was stored in a buffer tank. Finally, the sludge was pumped into a mixing tank via a diaphragm pump to blend with the clarified sewage in a separate mixing tank to make blackwater. The concentrated sludge was diluted with the clarified sewage by a factor of 10. The synthetic blackwater was not dosed with NH 4 Cl, as NH 3 -N removal was not the focus of this study. Blackwater samples were taken from the mixing tank and were analyzed for COD, TP, TN, and total solids (TS) for each run. The blackwater setup can be seen in Figure 26, and the blackwater characteristics are found in Table 6. 61 c a c b Figure 26. The blackwater setup. (a). The incline plate clarifier; (b). The sludge buffer tank; (c). The mixing tank Table 6. Pilot blackwater characteristics Parameter Value COD (mg/L) 2217.6 ± 691.8 TN (mg/L) 37.93 ± 6.3 TP (mg/L) 25.06 ± 7.6 TS (g/L) 2.38 ± 0.91 Parameter analysis The COD, TN, TP, and turbidity were measured as described in Chapter 2. The colorimetric results for the parameters were again measured with a HACH DR3900 spectrophotometer. TS content was measured using the gravimetric method. 62 Pilot-scale EC reactor and setup Using the data collected from the benchtop EC tests, a pilot-scale, continuous EC reactor made from PVC was designed to treat blackwater. The reactor is cylindrical, with a volume of 8 L. Iron electrodes (Figure 27) 58.42 cm long with 2.54 cm and 5.08 cm widths were arranged inside the reactor in a monopolar configuration and held in place by an adjustable titanium basket. Fifteen electrodes were placed on each side of the basket (four 2-inch-wide electrodes and eleven 1-inch-wide electrodes) for a total of 30 electrodes in the EC reactor. The basket kept the electrodes spaced 5.08 cm apart (2 in) and was later adjusted to 2.54 cm (1 in) apart. In addition, the EC unit was fixed within a metal frame for more accessible transportation. Drawings of the EC reactor are found in Appendix A. The reactor was first fitted with a flat top. However, it was later modified to have a conical shape to facilitate sludge removal and help avoid clogging in the reactor. The blackwater was pumped into the reactor with an electric double diaphragm plastic pump (Edson, Model 25200, New Bedford, MA). 63 a b c Figure 27. The pilot-scale EC reactor and iron electrodes. (a). A 3D CAD model of the EC reactor; (b). The actual EC reactor in its metal frame; (c). The iron electrodes 64 A B&K Precision 9115 DC power supply initially supplied power to the unit. The AC- DC converter on this power supply malfunctioned during the operations. A temporary power supply unit was used until a Mean Well RPB-1600-48 power supply unit was implemented. The polarity of the current was reversed every 15 minutes to help prevent electrode passivation. The EC effluent initially flowed into a 76-liter settling tank to help settle the sludge and floc particles formed during the EC process. Next, the settler was designed such that the solids would settle to the bottom, leaving the clean EC effluent to flow out from the top of the settler. The equipment used in the EC treatment is pictured in Figure 28. b c a d Figure 28. Equipment used in the EC treatment. (a). The DC power supply; (b). The 76-liter settling tank; (c). The EC reactor; (d); The blackwater feed pump 65 EC with sludge separator testing Three sludge separators were fabricated and tested to evaluate which would most effectively remove sludge via electrolocation (Figure 29). All three versions of the sludge separators were made with PVC pipes. Sludge separator version 2 was built with a container for sludge accumulation, while a bucket was used to catch the sludge from versions 1 and 3. The other notable difference is that version 3 was built with a clear PVC piece for the effluent outlet. The sludge separators were connected to the EC reactor outlet with camlock fittings, each with high and low outlets. The hydrogen gas would float the sludge layer formed into the reactor through the sludge separator and out through the higher outlet. The lower outlet on the separator allowed the liquid phase of the EC effluent to flow into the 76-liter settling tank through a 2.54- centimeter hose. To start the operation, blackwater was pumped into the EC reactor until it was filled. Once filled, the power supply was turned on for 15 minutes without running the feed pump. This was done for two reasons: to allow the current to climb to appropriate levels and stabilize and to release iron and hydrogen gas to begin the treatment of the blackwater. The voltage would be manually set to 80 V at the start of the operation. However, the voltage was not fixed, so the voltage and current would fluctuate during the operation. After this startup time, the EC was operated continuously for 5 hours. The flow rate of the blackwater for these tests was maintained at 1.1 L/min. The voltage and current displayed on the power supply during the operation were recorded every 30 minutes. Samples were taken from the outlet of the 76-liter settling tank described earlier. After the operation, the electrodes and reactor were rinsed with clean water. The samples were immediately placed in refrigerated storage following the conclusion of each test. The samples were analyzed for COD, TP, TN, TS, and turbidity the following day. 66 a b c Figure 29. Three sludge separators. (a). Version 1; (b). Version 2; (c). Version 3 Electrode gap distance and flow rate testing Sludge separator version three was selected to test the effectiveness of the pilot-scale EC treatment at different flow rates. Version three had an outlet with an adjustable height, which helped prevent clogging. Three flow rates were tested: 1.1 L/min, 1.5 L/min, and 1.9 L/min, corresponding to HRTs of 7.02 minutes, 5.30 minutes, and 4.23 minutes in the EC reactor, respectively. The other factor this study investigated was electrode distance. Electrode gap distances of 2.54 cm and 5.08 cm were tested at each flow rate listed above. The EC with 5.08 cm between electrodes was tested first. The titanium electrode baskets in the EC reactor were then modified, reducing the distance between electrodes to 2.54 cm (Figure 30). Samples were taken and analyzed for COD, TP, and turbidity. The removal efficiencies for COD and TP were also 67 calculated. Besides changing the flow rate and gap distance, the operation of the pilot EC system was the same as discussed in the sludge separator section. a b Figure 30. The two titanium electrode baskets used in the tests. (a). The basket with a 5.08- centimeter gap; (b). The basket with a 2.54-centimeter gap Statistical analysis All analysis was conducted in RStudio. The normality of data was evaluated with Shapiro-Wilk’s test, and the equal variance assumption was checked with Bartlett’s test. ANOVA and Tukey tests were used to find differences among the three sludge separators when data met normality and equal variance assumptions. When normality and equal variance were not met, the non-parametric Kruskal-Wallis and Conover tests were used instead. The non- parametric Mann-Whitney test was used to find differences between flow rates and electrode gap distances since the data were not normal. All statistical analysis is found in Appendix B. 68 RESULTS AND DISCUSSION Pilot EC with sludge separators Throughout the tests, the electric pump used to feed the reactor with blackwater generally performed well. However, there were instances where the measured flow rate was lower than the setting on the pump. Solids in the blackwater likely settled in the hose because the velocity of the blackwater was too low to keep the solids suspended at 1.1 L/min. The settled solids subsequently decreased the flow rate through the system. To solve the issue, the pump setting was quickly raised to dislodge the solids in the hose and then brought back to 1.1 L/min. The addition of a sludge separation unit to the EC reactor made a vast improvement in the quality of the EC effluent. Figures 31 (a) and (b) picture the EC effluent in the 76-liter settling tank before and after incorporating sludge separator version 1. In the initial tests conducted without a sludge separator, solids would remain suspended in the settling tank, as they were prevented from settling by the hydrogen gas flowing in with the effluent. Therefore, including the sludge separator allowed for the utilization of hydrogen gas to remove the sludge layer from the liquid phase of the effluent efficiently. Figure 31 (b) clearly shows that electroflotation removed most of the solids from the effluent. Despite the notable difference in the effluent quality compared to not using a sludge separator, some larger suspended solids were still flowing into the settling tank with the effluent. However, unlike in the tests with no separator, these solids settled effectively in the 76- liter tank since hydrogen gas was not mixing the effluent. Separator versions 2 and 3 also effectively removed sludge from the effluent (Figures 31 (c) and (d)). The suspended solids that remained also settled rapidly with the formation of ferric hydroxide from exposure to oxygen in the air. The average TS value of the EC effluent samples from the tests with version 3 was the 69 lowest (0.33 ± 0.16 mg/L), and Figure 32 (a) seems to imply that it was the most effective for reducing TS in the influent, but this is not the case. Examining Figure 32 (b) reveals that all three sludge separators had similar average TS removal efficiencies (78.9± 7.0%, 81.6 ± 5.9%, and 78.8 ± 7.0% for sludge separators 1, 2, and 3, respectively), meaning that the most likely reason for differences in the average TS concentrations in Figure 32 (a) is due to variations in the initial TS content of the blackwater. An ANOVA confirmed that EC effluent from the three sludge separators was not significantly different with respect to TS (P>0.01). a b c Figure 31. EC effluent from each sludge separator. (a). EC effluent with no sludge separation; (b). EC effluent using sludge separator version 1; (c) EC effluent samples with blackwater (far left) from sludge separator version 2 tests; (d) EC effluent samples with blackwater from sludge separator version 3 tests 70 Figure 31. (cont’d) d Figure 32. Average TS concentrations and removal efficiencies following EC with sludge separation and settling. (a). Average TS concentrations; (b). Average TS removal efficiencies 71 Despite the above points, the turbidity of EC effluent samples suggests a difference in performance among the sludge separators (Figure 33). The average turbidity of EC effluent from tests using sludge separator version 1 was 254.8 ± 102.6 NTU, much higher than the turbidity of the tests with versions 2 and 3 (P<0.01). Turbidity this high may pose problems. The United States Geological Survey claims that higher turbidity indicates a higher concentration of particulate matter, which provides attachment places for pollutants (Turbidity and Water | U.S. Geological Survey, n.d.). This seemingly contradicts the idea that there is no significant difference in the TS removal efficiency between the sludge separators. One possible explanation for this discrepancy is that the solids remaining in the EC effluent from tests with version 1 of the sludge separator were being dissolved back into the liquid phase of the EC effluent somehow, making the effluent hazier, which does appear to be the case looking at Figure 31 (b). In addition, sludge separator version 1 was smaller in diameter than versions 2 and 3, so the sludge flow through the separator may have been restricted at times, creating slight clogs. These issues could have allowed some of the sludge to mix back into the liquid phase of the EC effluent, creating the haze described above. 72 Figure 33. Turbidity comparisons among the three sludge separators On the other hand, the turbidity of EC effluent from versions 2 and 3 was reasonably low. The turbidity of the EC effluent from version 2 was 41.8 ± 2.3 NTU, and that from version 3 of the sludge separator was 36.8 ± 1.8 NTU. These results are 83.6% and 85.6% lower than the turbidity from version 1, a considerable improvement. In addition, the statistical analysis also confirmed that the turbidity of effluent from version 3 significantly differed from version 2’s (P<0.01). This can be explained by considering the average current supplied to the EC reactor during the operation (Table 7). The current provided to the EC reactor during the tests with version 3 of the sludge separator was higher than in tests with version 2. The relationship between current density and turbidity removal has been extensively studied in the literature, and studies agree that the turbidity removal efficiency increases as the current density increases (Favero et al., 2020; Mores et al., 2016; Solak et al., 2009). This is because there is a direct 73 relationship between the current supplied and the mass of metal ions released (Eq. 1). Therefore, the high current density may also contribute to the lower turbidity in version 3. Table 7. The average voltage and current during the tests with EC and sludge separators Parameter Version 1 Version 2 Version 3 Voltage (V) 79.9 80.0 80.0 Current (A) 10.1 7.93 9.25 Concerning COD, the EC process was equally effective with all three sludge separator versions (P>0.01). The average COD concentrations following EC with sludge separation and settling were 215.0 ± 17.2 mg/L, 192.8 ± 50.2 mg/L, and 220.5 ± 178.8 mg/L. EC with sludge separator version 3 seemingly produced more inconsistent results in terms of COD (Figure 34 (a)). However, it is likely this variation was due to variations in the initial COD concentration of the blackwater influent due to being made with real sewage. This is supported by Figure 34 (b), which illustrates that the removal efficiency of COD with all three sludge separators was similar. Specifically, the average COD removal efficiencies were 87.8 ± 0.9%, 90.1 ± 1.0%, and 87.0 ± 8.5% for EC with sludge separator versions 1, 2, and 3, respectively. Considering the initial COD concentration in blackwater, these results are promising. The fact that the removal efficiencies are all around 90% means that the performance of the EC treatment with sludge separation was better than or similar to the performance found in other studies that investigated the use of EC with iron electrodes for other high-strength wastewaters (Chezeau et al., 2020; Mahesh et al., 2006; Marmanis et al., 2021; Tanyol et al., 2018; Yavuz & Ögütveren, 2018). 74 Figure 34. Average COD concentrations and removal efficiencies following EC with sludge separation and settling. (a). Average COD concentrations; (b). Average COD removal efficiencies Also promising were the TP results (Figure 35); the removal efficiencies were even higher than those for COD. Similar to the COD results, the effectiveness of EC with sludge separation for reducing TP was equally effective regardless of the separator used (P>0.01). Similar to the COD results, Figure 35 displays significant error bars that were likely caused by the natural variation in the sewage composition. The TP concentrations following EC with sludge separation and settling for sludge separator versions 1, 2, and 3 were 1.01 ± 0.75 mg/L, 75 1.14 ± 0.33 mg/L, and 1.40 ± 1.21 mg/L (Figure 35 (a)), respectively, corresponding to removal efficiencies of 93.0 ± 5.21%, 95.9 ± 1.49%, and 94.7 ± 5.68%. The removal efficiencies are visualized below in Figure 35 (b). Like the COD results, the performance of the EC process with sludge separation was comparable to or exceeded the removal efficiencies for TP reported in other studies using EC with iron electrodes (Mores et al., 2018; Nguyen et al., 2016; Qi et al., 2020). Figure 35. Average TP concentrations and removal efficiencies following EC with sludge separation and settling. (a). Average TP concentrations; (b). Average TP removal efficiencies 76 The reason for the combined EC and sludge separation process’ effectiveness in reducing the TP and COD in the blackwater can be attributed to the fact that most of the COD and TP in the blackwater is present in the solid particles (Uludag-Demirer et al., 2020). Therefore, EC with electroflotation followed by settling is an excellent method for reducing TP and COD since most of the solids were removed with the sludge separators, and most of the large, suspended solids remaining in the liquid phase of the effluent settled quickly in the 76-liter tank. On the other hand, EC with sludge separation and settling was not very effective at removing TN in the blackwater (Figure 36). These results agree with the lackluster performance of the bench-scale EC for removing TN and NH 3 -N discussed earlier. This limitation of EC was discussed in the literature review, and similar observations have been reported in several other studies (Aguilar Ascon, 2020; Ricordel & Djelal, 2014). This limitation of EC was discussed in greater depth in the context of NH 3 -N removal. 77 Figure 36. Average TN concentrations and removal efficiencies following EC with sludge separation and settling. (a). Average TN concentrations; (b). Average TN removal efficiencies Flow rate and electrode distance effects Following the tests with the sludge separators, version 3 was selected to investigate the effectiveness of the pilot-scale EC at different flow rates and the impact the electrode distance would have on the turbidity, COD, and TP. Additionally, the energy consumption of the EC unit for both electrode gap distances (2.54 and 5.08 cm) was calculated and compared. The third version of the sludge separator was selected for use in these tests because it produced the EC effluent with the lowest turbidity and was the least prone to clogging during the operation. The 78 EC effluent within the sludge separator and the flow pattern of the sludge and effluent are found in Figure 37. a b Figure 37. Design of the third sludge separator version. (a). EC effluent in the sludge separator; (b). The flow pattern within the third sludge separator version The voltage, current, and energy demand of the EC operation for both electrode gap distances tested are found below in Table 8. The average energy consumption of the pilot-scale EC unit for electrode gaps at 2.54 cm and 5.08 cm was 1.17 ± 0.1 kWh/g/L of COD removed and 1.31 ± 0.2 kWh/g/L of COD removed, respectively. The energy consumption of the EC system with 2.54 cm between electrodes was significantly lower than that with a 5.08-inch gap (P<0.01). Other authors have similarly reported a decrease in specific energy consumption when interelectrode distance decreases (El-Ashtoukhy et al., 2020; Martínez-Villafañe et al., 2009). The specific energy consumption decrease is because the cell resistance in the EC reactor decreases as the interelectrode distance decreases (Mousazadeh, Naghdali, et al., 2021), a topic 79 discussed in the literature review. The voltage observed during the two sets of experiments verifies this theory. It was much lower during the EC operation when the electrodes were 2.54 cm apart than 5.08 cm apart. Table 8. Comparison of the average voltage, current, and energy consumption at the two electrode gap distances tested Parameter 2.54 cm 5.08 cm Voltage (V) 59.8 ± 0.2 79.7 ± 0.7 Current (A) 11.3 ± 0.8 9.32 ± 1.4 Energy consumption (kWh/g/L COD removed) 1.17 ± 0.1 1.31 ± 0.2 Three flow rates were tested in conjunction with the two electrode gap distances: 1.1 L/min, 1.5 L/min, and 1.9 L/min (HRTs of 7.02 minutes, 5.30 minutes, and 4.23 minutes, respectively). The turbidity results are found in Figure 38. The general trend seen in Figure 39 suggests that the average turbidity of the samples increased as the flow rate and interelectrode distance increased. Despite this, no significant differences in turbidity were found among the flow rates and interelectrode distances examined (P>0.01). On the other hand, this would mean operating the EC system at 1.9 L/min rather than 1.5 L/min or 1.1 L/min without compromising good turbidity removal at a shorter HRT is possible since the turbidity of the EC effluent for all flow rates tested at an electrode gap distance of 2.54 cm was less than 50 NTU except that at 1.9 L/min, which was slightly over 50 NTU. It is also worth mentioning that the turbidity reduction was far more stable in the tests where the interelectrode distance was 2.54 cm which is evident in the error bars in Figure 38. 80 Figure 38. Effects of different flow rates and electrode gap distance on turbidity During these tests, the COD (Figure 39) and TP (Figure 40) generally followed the same trend observed for turbidity. No significant differences were found for COD or TP under any conditions tested (P>0.01). Figure 39 (b) shows that all COD removal efficiencies were above 80%. The highest removal efficiency was 94.4 ± 0.03% at 1.1 L/min and electrode gap distance at 2.54 cm. At the same electrode gap distance, the COD removal efficiency at flow rates of 1.5 L/min and 1.9 L/min was also high, around 90%. Higher flow rates are preferable since it would mean larger volumes of blackwater could be treated in a shorter period. The TP results (Figure 40) suggest the same conclusion. It is worth mentioning that other studies that reviewed EC for 81 treating high-strength wastewater reported similar removal efficiencies for TP and COD but at much higher HRTs than this study (Benazzi et al., 2016; Ehsani et al., 2022; Thirugnanasambandham et al., 2015). Therefore, when considering the three flow rates and two electrode gap distances investigated, the ideal conditions for EC with sludge separation seem to be 1.9 L/min with an electrode distance of 2.54 cm. Figure 39. Effects of different flow rates and electrode gap distance on COD and removal efficiency. (a). Average COD concentrations; (b). Average COD removal efficiencies 82 Figure 40. Effects of different flow rates and electrode gap distance on TP and removal efficiency. (a). Average TP concentrations; (b). Average TP removal efficiencies CONCLUSION This study successfully operated a continuous, pilot-scale EC reactor to treat blackwater. In addition, the study found that pairing EC with sludge separators facilitated the removal of EC sludge via electroflotation which vastly improved the quality of the EC effluent. The COD and TP removal was excellent for all three sludge separator versions, as COD removal was around 90% and over 90% for TP. Like the bench-scale EC, the pilot-scale EC was ineffective in reducing the blackwater TN. Sludge separator version 3 was slightly preferred to sludge separator version 2 since it achieved turbidity of less than 40 NTU and was the sludge separator 83 least likely to clog. Additionally, a flow rate of 1.9 L/min and an electrode gap distance of 2.54 cm were the ideal conditions for the pilot-scale EC. This increases the quantity of blackwater that can be treated at once and minimizes the energy consumption for the EC unit. 84 CHAPTER 4: OPTIMIZATION OF THE PILOT EC SYSTEM INTRODUCTION The pilot-scale EC operations demonstrated that EC could effectively treat blackwater at short HRTs with systems larger than those used in a lab setting. However, there was room for several major improvements. This study seeks to make necessary improvements and optimize the system. First, the synthetic blackwater used in the pilot-scale tests needed a higher salinity content to represent real blackwater better, as real blackwater samples contained up to 660 mg/L of chloride (Appendix A). Therefore, real blackwater is more conductive than synthetic blackwater, so it was hypothesized that EC would be more effective in treating real blackwater than the synthetic blackwater used in the previous experiments. Another area requiring improvement was the sludge separator, which needed to be optimized to allow for uninterrupted sludge flow and prevent clogs. Enhancing the design of the separator would result in reduced maintenance efforts for clearing clogs and removing excess sludge following an operation. Third, the flow rate of blackwater through the system needed to be stabilized. In the previous pilot-scale tests, the flow rate of the blackwater was not always consistent, which may have been because the velocity of the blackwater within the hose was not high enough to avoid depositing solids. Including a buffer tank to recirculate the blackwater into the feeding tank at a high flow rate may solve this problem. Fourth, the energy efficiency of the EC system needed improvement. It was hypothesized that a current of 20 A could be sustained at lower voltages by modifying the electrodes, further decreasing electrode gap distance, and modifying the power supply. Achieving this would mean the EC treatment would be improved due to the higher current while reducing energy demand 85 and therefore operating costs of the system. It was also postulated that maintaining a higher current than previously possible meant that larger volumetric flow rates of blackwater could be treated effectively. Lastly, it was speculated that the removal of suspended solids from the EC effluent could be increased through improvements to the settling process. Instead of a simple settling tank, it was theorized that a tank with inclined plates is better suited for settling out the smaller suspended solids and flocs remaining in the EC effluent following the sludge separation. Other improvements included constructing the aluminum-alloy sludge separator, increasing the volume of the EC reactor, implementing a control panel into the system, and fitting the entire system into a Tricon shipping container. In addition to improving the EC system, this study also focuses on conducting a comprehensive techno-economic analysis to investigate the cost-effectiveness of the EC treatment system as an option for decentralized blackwater treatment. MATERIALS AND METHODS Parameter analysis The HACH methods described in the preceding chapters measured parameters such as COD, iron (Fe), TP, TN, NH3-N, and turbidity. In addition, TS and total suspended solids (TSS) were measured with the gravimetric method. A pH probe (Thermo Scientific, Orion Star A215, Waltham, MA) was used to measure the pH of the samples. Finally, the samples' 5-day biochemical oxygen demand concentration (BOD5) was measured using the respirometric method (HACH, DOC316.553.01201_2ed), a method proposed for approval by USEPA to analyze wastewater. EC effluent samples were filtered with 8 µm filter paper. 86 Blackwater preparation For blackwater preparation, 9.46 L (2.5 gallons) of primary settling sludge was added into a 208-liter barrel (55 gallons) and blended with 198.7 L (52.5 gallons) of water to dilute the sludge by a factor of 20 to account for the higher strength of the sludge. Additionally, 60 g of NaCl was added to the mixture to increase the concentration of NaCl in the blackwater to 300 mg/L. Finally, the mixture was blended and kept suspended during the EC treatment with an agitator (Dayton Electric, 32V142, Niles, IL). The blackwater mixing setup is seen below in Figure 41. Figure 41. The blackwater mixing setup 87 EC system equipment Like in the previous pilot tests, the blackwater was pumped into the EC system with an electric pump (Edson, Model 25200, New Bedford, MA). The EC reactor (Figure 42 (a)) was constructed out of PVC like the previous unit but had an effective volume of 16 L compared to a previous volume of 8 L. The EC reactor was fed from a 37.9-liter PVC equalization tank (Figure 47). The electrodes used in the reactor were also modified. Instead of several iron strips, two large iron plates were used instead. The plates were 44.45 cm long, 20.32 cm wide, and 0.64 cm thick. The electrodes were bolted 0.64 cm apart and were kept separate by two PVC strips (Figure 42 (b)). a b Figure 42. The EC reactor and new electrodes. (a). The new EC reactor; (b). The larger electrodes separated by PVC strips A temperature probe (XTP50N-030-0100C, ProSense) was used to measure the temperature inside the EC reactor. A Mean Well UHP-1000-48 power supply provided DC to the EC reactor. The temperature probe and power supply were connected to a control panel (Figure 88 43) which displayed the current, voltage, and temperature of the EC reactor and allowed users to set the current supplied to the reactor manually. Figure 43. The control panel display for the EC system A new sludge separator was also designed and fabricated for the new EC reactor (Figure 44). This sludge separator was constructed from aluminum and was connected to the EC reactor with PVC unions. The separator was designed with three chambers separated by steel dividers. The influent chamber was in the center where EC effluent and sludge would flow in through a pipe. Next, the EC effluent and sludge would flow out of the pipe and fill the influent chamber until the sludge and effluent flow into the two chambers on either side. The divider separating the sludge chamber from the influent chamber is higher than the outlets that lead into the effluent chamber, so the sludge could be lifted by the hydrogen gas and pushed into the chamber. In addition, a Teflon-coated plate was incorporated near the entry to the sludge chamber to facilitate 89 sludge flow and help prevent clogs. Finally, the sludge would flow from the separator through a soft hose into a bucket. On the other hand, the liquid phase of the EC effluent would flow into the other side chamber, where it would collect until it overflowed into a PVC pipe and out of the separator. It is also worth noting that the sludge separator was built with drains that opened by turning valves for easier maintenance. Finally, it is also worth noting that the equalization tank, EC reactor, sludge separator, and control panel were all mounted on an aluminum frame. c a d b e Figure 44. The new sludge separator. (a). The outside of the sludge separator; (b). The entry chamber of the separator; (c). The chamber for the liquid effluent; (d). The Teflon-coated plate; (e). The sludge chamber Following the sludge separation, the liquid phase of the EC effluent flowed into the incline plate separator (Figure 45) (SPC-5, M.W. WATERMARK, Holland, MI). The plate 90 separator has a max design flow rate of 19 L/min (5 GPM). The EC treatment system in the Tricon unit can be seen below in Figure 46 (a), and a 3D model of the system can be found in Figure 46 (b) and Figure 46 (c). It should be noted that the 3D models include an electrodialysis reversal unit that was not utilized in this study. Figure 45. The SPC-5 incline plate clarifier 91 * a b c Figure 46. The new EC treatment system. (a). The treatment system inside the Tricon container; (b). A 3D model of the EC treatment system; (c). Rear view of the EC system. *: The electrodialysis unit was not used in the system 92 EC operation The blackwater in the barrel was pumped into the 37.9-liter PVC equalization tank (Figure 47) again with an electric pump (Edson, Model 25200, New Bedford, MA) at 18.9 L/min (5 GPM). The blackwater in this tank was continuously recirculated back into the mixing barrel. Recirculating the blackwater at a high flow rate kept the solids suspended, prevented them from settling in the hoses, and decreased the effective flow rate. This solved the flow control problem encountered in the previous pilot-scale tests. Figure 47. The PVC tank used to recirculate blackwater and feed the EC reactor After starting the recirculation of the blackwater and filling the equalization tank, the EC reactor was fed from the tank by opening a valve. Before the continuous operation, the EC reactor was filled with blackwater, and then the power was turned on for five minutes. Following this start-up period, the valve on the equalization tank was opened a third of the way. This fed blackwater into the system via gravity at a steady flow rate of 1.9 L/min (0.5 GPM). This flow 93 rate through the reactor corresponds to an HRT of 8.50 minutes. The power supply provided a constant 20 A to the system. The current supplied was higher than that supplied during the previous pilot-scale tests. The corresponding current density with the new electrodes was 22.2 mA/cm2 . Additionally, the polarity of the current was switched every 15 minutes to prevent sludge buildup on the electrodes. After the EC treatment, the EC-treated blackwater flowed into the sludge separator, and the liquid phase of the effluent was separated from the sludge. The liquid phase of the effluent and the suspended solids that were not removed then flowed into the incline plate separator through another soft hose. The EC effluent would slowly fill the chambers of the clarifier during the treatment until it flowed up through the plates and finally through the outlet of the clarifier. Economic analysis An economic analysis was conducted using the data gathered from the new pilot-scale EC operation to understand the viability of the proposed treatment system. First, mass and energy balances were carried out to elucidate the treatment system's mass flow and energy demand. The mass balance included the blackwater influent, the iron produced during the EC process, the EC sludge, and the clarified EC effluent. The energy balance included the energy demand for the EC reactor, the electric pump, and the control panel. The treatment system's capital expenditure (CapEx) and Operational Expenditure (OpEx) were identified as two key parameters and were found and utilized. The OpEx includes the energy demand for the treatment, replacement of electrodes, and system maintenance. Furthermore, the lifespan of the system was assumed to be 20 years. 94 The Modified Accelerated Cost Recovery System (MACRS) was used to calculate the annual depreciation of CapEx. Next, the net cash flow considering depreciated CapEx, inflated OpEx, and the system’s lifespan was calculated to determine the treatment cost per liter of blackwater. The MACRS annual depreciation rates are 0.100, 0.188, 0.144, 0.115, 0.092, 0.074, 0.066, 0.065, 0.065, 0.065, 0.033, and 0.033 (after ten years). Additionally, an annual inflation rate of 3.2% was set for the OpEx calculation based on the five-year average inflation rate in the United States. Finally, A sensitivity analysis was also conducted to investigate the impact of the CapEx and OpEx on the treatment cost. To this end, the base values of the CapEx and OpEx were adjusted by 25% of their base values to evaluate how changes in these parameters affected the treatment cost. RESULTS AND DISCUSSION EC operation The new EC treatment system ran smoothly with the new equipment and operational methods. Recirculating the blackwater at 18.9 L/min ensured the blackwater was well-mixed and prevented solids from settling in the hoses. The recirculation also ensured that the equalization tank provided a steady 1.9 L/min to the EC reactor without any issues. It was initially speculated that there could be clogging issues in the reactor due to the significantly smaller gap between electrodes used in the system, but no such problem occurred. This suggests that reversing the polarity of the current worked as intended and helped prevent sludge buildup on the electrodes. It is also possible that operating at a higher current than before (20 A) helped prevent clogging issues since the higher current means more hydrogen gas would be produced, and the bubbles would be finer. The greater amount of hydrogen produced under these conditions may have helped remove any solids settling on the electrodes through enhanced electroflotation. Also 95 notable was the fact that the voltage output from the power supply was approximately 15 V during the entirety of the EC treatment. This is substantially lower than the voltage required by the EC reactor in the earlier pilot tests (approximately 80 V). Consequently, the average power consumption for this unit was 2.6 Wh/L blackwater, about seven times less than the first pilot-scale tests, a substantial improvement. Three factors likely contributed to the lower voltage and corresponding power consumption. First, adding sodium chloride to the blackwater acted as an electrolyte and decreased the resistance in the EC reactor (Dires & Saroha, 2022; Silva et al., 2022). Second, decreasing the interelectrode distance to 0.64 cm also reduced the resistance in the EC reactor, as observed in previous pilot-scale experiments. Third, it is possible that the new electrode design with the two large electrode plates was more efficient in utilizing the current provided by the power supply. This may be because the smaller iron strips used previously shifted during the EC treatment, causing increased cell resistance. The new EC sludge separator also worked well during the entirety of the EC treatment. No clogging issues arose during the treatment, and the sludge flowed out of the separator continuously and smoothly. This would suggest that the Teflon-coated plate played a significant role in facilitating the removal of sludge from the separator (Figure 48). 96 Figure 48. The sludge removal with the Teflon-coated plate Despite the effective and consistent performance of the sludge separator, some black floc particles remained suspended in the liquid phase of the EC effluent. These flocs can be seen in Figure 49 (a). Fortunately, the incline plate clarifier effectively settled out these larger flocs. The EC effluent notably changed color during the settling process (Figure 50 (b)), indicating the oxidation of ferrous hydroxide to ferric hydroxide like before. Figure 50 (c) shows that the small black floc particles settled out during the clarification leaving the clarified EC effluent mostly free of suspended solids. The effects the EC treatment and settling had on the characteristics of the EC effluent are discussed in the following sections. 97 a b c Figure 49. The EC effluent before and after clarification. (a). EC effluent before clarification; (b). EC effluent in the clarifier; (c) EC effluent after clarification EC treatment The blackwater, EC effluent, clarified EC effluent, filtered clarified effluent, and EC sludge were analyzed to measure how effective EC and settling were for treating the blackwater. The pH, COD, BOD5, TP, TN, and NH 3 for the different types of wastewater mentioned are found in Table 9. The synthetic blackwater is again characterized by an average COD of over 2000 mg/L and has a high BOD5. In addition, the TP and TN of the blackwater were also high. These results emphasize the high strength of blackwater. 98 As seen in Table 9, the new EC treatment system was again very effective in reducing COD. The COD of the EC effluent directly following sludge separation but before clarification was 278 ± 4.95 mg/L, which corresponds to a removal efficiency of 86.7%. This is similar to the COD removal efficiency of the previous EC system after the settling step. These results indicate that the sludge separator efficiently removed the solids from the liquid phase of the EC effluent. In this case, the settling with the incline plate clarifier was even more effective than the simple settling tank used in the previous tests. The average COD of the EC effluent following the clarification was 203 ± 2.12 mg/L. This settling increased overall removal efficiency from 86.7% to 90.3%. This is a notable result considering the reactor’s low HRT of 8.50 minutes. Additionally, the lower COD following the clarification indicates that the black floc particles that remained in the EC effluent following the sludge separation contributed a fair amount to the total COD. This emphasizes the importance of the clarification step for improving the quality of the EC effluent. On the other hand, the filtration proved ineffective in further reducing the COD of the EC effluent, meaning that the remaining COD comes from dissolved solids in the EC effluent. This emphasizes that the EC treatment was ineffective for removing dissolved constituents in blackwater. Equally important was the EC’s effectiveness in reducing the BOD5 in the blackwater. The BOD5 removal efficiency after the clarification step was 68.4%. This was not as high as the COD removal efficiency but still noteworthy. Also notable was that the average BOD5 concentration EC effluent following clarification (226 ± 65.6 mg/l) was similar to the respective COD concentration. This would indicate that the clarified EC effluent is highly biodegradable (Kumar et al., 2010). Nevertheless, the BOD5 still exceeds the 30-day and 7-day EPA average secondary treatment standards (30 mg/L and 45 mg/L, respectively) (US EPA, n.d.). Like the 99 COD, the BOD that remains in the EC-treated blackwater is likely in the dissolved solids not removed by the EC process. The BOD5 and NH 3 -N removal efficiencies discussed earlier are two limitations that must be addressed by including additional treatment steps after EC. Table 9. Wastewater characteristics from the EC operation Wastewater pH COD BOD TP NH3 -N TN Fe (mg/L) (mg/L) (mg/L) (mg/L) (mg/L) (mg/L) Blackwater 7.55 2090 ± 127 717.4 ± 87.6 ± 13.5 ± 122 ± - 29.8 4.38 0.64 4.24 EC effluent 8.67 278 ± 4.95 - 4.64 ± 13.1 ± 20.4 ± 8.58 ± 0.11 0.50 1.27 0.7 Clarified EC 8.84 203 ± 2.12 226 ± 1.36 ± 12.5 ± 18.2 ± - effluent 65.6 1.38 0.21 0.00 Clarified - 200 ± 0.71 152 ± 0.78 ± 11.8 ± 17.5 ± - and filtered 17.9 0.15 0.35 2.83 effluent EC sludge 7.66 20400 ± - 747 ± 18.7 ± 890 ± 2120 ± 4525 34.6 0.63 185 184 Another significant result was the pH increase in the EC-treated blackwater. The initial pH of the blackwater was 7.55, roughly neutral. However, the pH of the EC effluent at the end of the treatment had increased to 8.84. As discussed, the iron hydroxides formed during the EC process are responsible for the pH increase. Therefore, increasing the current density further may not be a good idea, as this could increase the pH to 9 or higher. This would be a problem because the EPA’s secondary treatment standards state that the pH must be within the limits of 6.0-9.0 (US EPA, n.d.). Like in the last bench and pilot tests, the new EC system effectively reduced the TP in blackwater. Table 9 shows that most of the TP in the blackwater was removed following the EC and sludge separation. This agrees with the conclusion that most of the TP is present in the solids of the blackwater. Following the clarification, the TP of the EC-treated blackwater was 1.36 ± 100 1.38 mg/L, corresponding to 98.4% removal efficiency. These results further support the idea that sludge separation and settling are vital to the EC treatment of blackwater. The TN and NH 3 -N before and after the treatment process were also measured. Interestingly, after the EC treatment and clarification, the average TN decreased from 122 ± 4.24 mg/L to 18.2 ± 0.00 mg/L. This amounts to a removal efficiency of 85.1%, which is higher than the TN removal efficiencies observed in the previous EC tests. Furthermore, it is clear from Table 9 that the nitrogen removal is not from the removal of NH 3 -N, which was negligible. Considering these results, there may be two factors that contributed to the improved TN removal. First, it is possible that more of the nitrogen in the synthetic blackwater was present in the solid particles due to natural variations in the composition of the sludge used to prepare the blackwater. Additionally, this work has already established that the EC treatment excels at removing solid particles in the wastewater by combining coagulation and electroflotation. Therefore, the improved nitrogen removal is because the solid particles containing nitrogen compounds were removed in the sludge separation. Second, the higher current (20 A) used during these tests could have improved the TN removal due to increased production in the iron hydroxide coagulant species. This conjecture is supported by the average iron concentration measured in the sludge (Table 9), which was over 2000 mg/L. Despite this notable improvement, further treatment is needed to remove NH 3 -N from the blackwater. Other essential parameters measured in this study include turbidity, TS, and TSS (Table 10). Considering the TS results, the EC treatment and clarification were seemingly not as effective as they had been in the previous studies. The removal efficiency after EC and clarification was only 31.2%. However, this decrease in the effectiveness of the treatment process can be explained by the addition of 300 mg/L of NaCl to the blackwater. As discussed 101 previously, the EC treatment under the current conditions was ineffective in removing dissolved constituents from the blackwater. Therefore, it stands to reason that the higher concentration of TS in the EC-treated blackwater comes mainly from the NaCl and other dissolved substances in the wastewater. This is also confirmed by the fact that when the clarified EC effluent samples were filtered, the total concentration of TS increased. This suggests that the dissolved solids in the EC-treated blackwater were concentrated due to filtration. This means that although increasing the salinity of the blackwater reduced the system’s power consumption, it also creates the necessity of finding a way to remove the added NaCl in subsequent treatment steps. Table 10. Turbidity and solids characteristics of the wastewater types Wastewater Turbidity (NTU) TS (mg/L) TSS (mg/L) Blackwater - 1040 ± 217 763 ± 41.6 EC effluent 76.7 ± 2.47 855 ± 63.6 91.7 ± 7.64 Clarified EC effluent 26.4 ± 0.08 716 ± 95.5 40 ± 0.0 Clarified and filtered 2.28 ± 3.42 918 ± 14.1 - EC effluent EC sludge - 13013 ± 453 - Despite the issues the EC treatment system had in removing dissolved solids in the blackwater, it proved very effective in reducing turbidity and TSS. Figure 50 illustrates the progression in the quality of the blackwater during the treatment process. Following the EC treatment and sludge separation, the effluent is significantly cleaner than the blackwater. To emphasize the apparent difference, the average TSS concentration in the blackwater was reduced from 763 ± 41.6 mg/L to 91.7 ± 7.64 mg/L, corresponding to a removal efficiency of 87.9%. However, as mentioned previously, the EC effluent following the sludge separation process is still hazy due to the suspended black floc particles visible in Figure 50 (b). Fortunately, the incline plate clarifier effectively reduced the turbidity and TSS remaining in the wastewater 102 following EC and sludge separation. The clarification step decreased the average turbidity of the EC effluent from 76.7 ± 2.47 NTU to 26.4 ± 0.08 (65.6% removal efficiency). Most notable, however, is that the average TSS concentration in the EC effluent decreased to 40 ± 0.0 mg/L (94.8% removal efficiency). This result is highly significant because it means the EC treatment system met the EPA’s 7-day average secondary treatment standard for TSS (45 mg/L) without using biological treatment processes. (US EPA, n.d.). Further testing is required to verify if the EC treatment system can meet the 30-day TSS secondary treatment standard (30 mg/L). a b c Figure 50. Progression of the blackwater treatment. (a). The blackwater; (b). The EC effluent before clarification; (c). The EC effluent after clarification Mass and energy balance The experimental results indicate that the pilot EC treatment system can treat 113 L of blackwater per hour when considering an HRT of 8.5 minutes. Assuming an operational time of 24 hours per day, the system can treat 2,720 L of blackwater daily. The mass balance showed that the treatment consumed 312 grams of iron per day to reclaim 2,584 L/day of water, resulting in a 95% water recovery rate. As mentioned in the sections above, the reclaimed water has a turbidity of 26 NTU, TSS of 40 mg/L, COD of 203 mg/L, TN of 18 mg/L, and TP of 1.4 mg/L. 103 The detailed mass balance of the pilot EC system is shown in Figure 51. The pilot EC system generated 136 L of sludge, which contains 13,013 mg/L TS, 20,400 mg/L COD, 890 mg/L TN, and 747 mg/L TP. Since this sludge is rich in COD, TN, and TP, it could be an ideal feedstock in anaerobic digestion for biogas production. Figure 51. Mass balance of the pilot EC system*. *: The mass balance does not include the sludge and other solids that remain in the clarifier The energy balance analysis further concluded the detailed energy consumption of the treatment process (Table 11). To treat 2,720 L/day blackwater, the total energy demand of the EC process was 10.5 kWh/day. The EC unit demanded 7.2 kWh/day, while the electric feeding pump consumed 3.3 kWh/day to circulate the blackwater at 20 L/min to the feeding tank for the gravity feeding of the EC unit. The overall energy consumption to treat the blackwater is 3.86 Wh/L blackwater. Compared to the conventional active sludge (CAS) treatment process that uses approximately 0.45 Wh/L to treat the wastewater with a COD of 500 mg/L (Guerrini et al., 2017), the energy consumption per unit COD of the EC treatment is 1.85 Wh/g COD, which is more than twice the energy consumption (0.9 Wh/g COD) of the CAS treatment. However, since the EC process has a much shorter HRT (the CAS treatment HRT is 24 hours), the EC only 104 needs 16 L of the effective reactor volume to treat 2,720 L of blackwater per day, which is at least 170 times smaller than the aeration tank of the CAS process. The small footprint of the EC process, coupled with its ability to treat high-strength wastewater, provides a significant advantage for the technology to be adopted by decentralized wastewater treatment applications. Table 11. Energy balance of the EC treatment system Unit operations Electricity demand (Wh/day) Electrocoagulation a 7,200 Feeding pumps b 3,300 Total energy demand 10,500 a: The electricity consumption of the electrocoagulation is 2.65 Wh/L wastewater b: The feeding pump is a diaphragm pump with 0.55 kW. The power output to feed the blackwater is 0.138 kW. The pump ran 24 hours per day. The total energy demand for the pump is 3.3 kWh/day Economic assessment An economic assessment is an equally critical factor to mass and energy balance analysis for determining the commercial applicability of a technology. Therefore, the CapEx and OpEx of the EC treatment process were examined to determine the cost of the treatment during the lifespan of the process. The results presented in Table 12 show that the CapEx of the process implementation was $47,900, including costs such as the EC unit ($7,750), sludge separator ($5,750), supporting frame ($5,250), feeding pump ($4,850), control panel with power supply ($2,500), clarifier ($10,800), installation cost ($10,000), and pipeline and other miscellaneous items ($1,000). The OpEx of the system is $1,112 per year, which includes the cost of the iron 105 electrodes, energy, and maintenance. In addition, the electricity required for the EC costs $498/year. Concerning maintenance, the cost of changing pipelines and pump maintenance is $500. 106 Table 12. The economic analysis Unit Unit description Cost ($) Capital expenditure (CapEx) a EC reactor vessel 1 15 L effective volume, PVC material $7,750 Three-chamber aluminum sludge/liquid $5,750 Sludge separator 1 separator Aluminum frame to support the EC $5,250 Supporting frame 1 reactor and separator Feeding pump 1 Edson diaphragm pump $4850 Control panel with power supply 1 $2,500 Clarifier 1 M.W. Watermaker Model SPC-5 $10,800 Pipelines and other $1,000 1 PVC pipes, fittings, and valves miscellaneous items Installation 1 Labor to install the system $10,000 Total CapEx cost $47,900 Operational expenditure (OpEx) b Iron electrodes c 312 g/day of iron consumed by the EC $114/year Energy cost d $498/year Maintenance e $500/year Total OpEx cost $1,112/year The overall treatment cost ($/m3 $5.65 blackwater) a. The costs were obtained from suppliers to build the pilot EC system at the MSU Anaerobic Digestion Research and Education Center (ADREC) b. The values in the OpEx are all current values c. The market price of iron steel sheet is $1,000/metric ton d. The price of electricity is $0.13, according to the Energy Information Administration (EIA) data e. The cost of the maintenance includes the replacement of pipelines and valves The cash flow analysis indicates that, with the operational conditions of the EC at 20 A and considering an HRT of 8.5 minutes followed by settling in a clarifier, the average treatment cost in 20 years of its lifespan was $5.65 per 1,000 L of blackwater. A sensitivity analysis was 107 conducted to determine the impacts of two key parameters (CapEx and OpEx) on the average blackwater treatment cost (Table 13). The results show that the CapEx is a more sensitive factor than the OpEx. A 25% reduction on CapEx could reduce the average treatment cost by 21%, from $5.65/1000 L to $4.50/1000 L. Regarding the OpEx, the average treatment cost was slightly reduced to $5.40/1000 L with a 25% reduction. The sensitivity analysis clearly indicates that reducing the CapEx to fabricate the EC system is critical to further improving the economic performance of the EC treatment of blackwater. This could be accomplished by simplifying the manufacturing process for building the EC reactor and supporting frame. Table 13. Sensitivity analysis of key parameters on the average cost of blackwater treatment a Values Corresponding Change on the Key Base Sensitivity average cost to treat average cost to Item parameter value range the blackwater treat the ($/1,000 L) blackwater (%) $35,925- EC process CapEx ($) $47,900 $4.50-$6.80 ±21% $59,875 $834- EC process OpEx ($) $1,112 $5.40-5.90 ±5.5% $1,390 a. All values are adjusted by ±25% of their base values CONCLUSIONS This study utilized lessons from the previous pilot-scale EC study to modify and improve the treatment system. The modifications led to notable improvements in the EC treatment. First, the power consumption of the EC reactor dropped to 2.6 Wh/L blackwater, which is 70% lower than the power consumption of the reactor used in the previous pilot-scale study. Second, the new EC treatment system effectively reduced COD, TP, TN, turbidity, and TSS in the blackwater. The COD, TP, TN, and TSS reduction in the reclaimed water was 90.3%, 98.4%, 108 85.1%, and 94.8%, respectively. The turbidity of the reclaimed water was 26.4 NTU. Third, the techno-economic assessment revealed that the 16-liter EC reactor can treat 2720 L of blackwater per day. Consequently, the treatment cost was calculated to be $5.65 per day. Finally, the EC treatment system was ineffective in removing dissolved constituents in blackwater, such as the NH3 -N and NaCl. Future work must focus on finding and implementing non-biological treatments to remove the dissolved solids in EC-treated blackwater. 109 CHAPTER 5: CONCLUSIONS AND FUTURE WORK This study focused on developing a pilot-scale EC treatment system to treat source- separated blackwater. Bench-scale tests revealed that EC followed by a settling step could effectively decrease the blackwater’s COD, TP, and turbidity. The bench-scale study also revealed that implementing pulse-width modulation into the treatment could reduce the energy consumption of the EC treatment. The EC was not effective in reducing the TN and NH 3 -N, however. Bench-scale air stripping was able to reduce the NH 3 -N by 67.7%. However, this was only possible by increasing the pH of the EC-treated blackwater with pH agents such as sodium hydroxide and calcium hydroxide. A successful pilot-scale study was designed using lab-scale data and revealed that utilizing EC’s electroflotation removal mechanism by including sludge separators with the EC reactor produced EC effluent with a turbidity of 40 NTU and effectively decreased the concentration of solids in the EC effluent. This study also revealed that decreasing the interelectrode distance in the EC reactor could decrease the energy demand of the EC reactor and make it possible to treat higher flow rates of blackwater. A subsequent pilot-scale study seeking to optimize the treatment system was able to decrease the power consumption of the EC reactor to 2.6 Wh/L blackwater and reduce the COD, TP, TN, and TSS in the reclaimed water by 90.3%, 98.4%, 85.1%, and 94.8%, respectively. An economic assessment concluded that the treatment system could treat 2,720 L of blackwater per day at a treatment cost of $5.65 per day. Future work should address the most pressing issue discovered with the EC treatment system: the inability to remove NH3 -N and other dissolved substances and organics in the blackwater. Electrodialysis reversal technology has been identified as a potential solution for removing and concentrating the NH3 -N in EC-treated blackwater. Therefore, a bench-scale 110 electrodialysis system (BED 2-2, PCCell, Heusweiler, Germany) will be tested to evaluate its potential for extracting NH 3 -N. The electrodialysis system is shown in Figure 52. Figure 52. The bench-scale electrodialysis system A life cycle assessment (LCA) comparing the EC treatment system to other decentralized wastewater treatment systems would be another critical study to understand the potential advantages and disadvantages of choosing EC over other treatment technologies. Finally, a risk assessment for the EC blackwater treatment system could also be a beneficial future study. Source-separated blackwater is more concentrated than typical sewage, so handling and treating blackwater may pose a considerable risk to human health. A risk assessment could quantify the microbial and chemical risks to human health and present intervention methods to help decrease the risk. 111 BIBLIOGRAPHY 5.7 Nitrates | Monitoring & Assessment | US EPA. (n.d.). Retrieved March 7, 2023, from https://archive.epa.gov/water/archive/web/html/vms57.html Aguilar Ascon, E. (2020). Removal of Nitrogen and Phosphorus from Domestic Wastewater by Electrocoagulation: Application of Multilevel Factorial Design. Journal of Ecological Engineering, 21(7). https://doi.org/10.12911/22998993/125439 Alex Q. Huang, & Xu She. (2018). Standard Handbook for Electrical Engineers. (S. Santoso & H. W. Beaty, Eds.; 17th ed). McGraw-Hill Education. Aoudj, S., Khelifa, A., Drouiche, N., Belkada, R., & Miroud, D. (2015). Simultaneous removal of chromium(VI) and fluoride by electrocoagulation–electroflotation: Application of a hybrid Fe-Al anode. Chemical Engineering Journal, 267, 153–162. https://doi.org/10.1016/J.CEJ.2014.12.081 Arogo, J., Zhang, R. H., Riskowski, G. L., Christianson, L. L., & Day, D. L. (1999). Mass Transfer Coefficient of Ammonia in Liquid Swine Manure and Aqueous Solutions. Journal of Agricultural Engineering Research, 73(1), 77–86. https://doi.org/10.1006/jaer.1998.0390 Asaithambi, P., Govindarajan, R., Yesuf, M. B., Selvakumar, P., & Alemayehu, E. (2020). Enhanced treatment of landfill leachate wastewater using sono(US)-ozone(O 3 )- electrocoagulation(EC) process: role of process parameters on color, COD and electrical energy consumption. Process Safety and Environmental Protection, 142, 212–218. https://doi.org/10.1016/j.psep.2020.06.024 Asselin, M., Drogui, P., Benmoussa, H., & Blais, J.-F. (2008). Effectiveness of electrocoagulation process in removing organic compounds from slaughterhouse wastewater using monopolar and bipolar electrolytic cells. Chemosphere, 72(11). https://doi.org/10.1016/j.chemosphere.2008.04.067 Attour, A., Touati, M., Tlili, M., Ben Amor, M., Lapicque, F., & Leclerc, J.-P. (2014). Influence of operating parameters on phosphate removal from water by electrocoagulation using aluminum electrodes. Separation and Purification Technology, 123. https://doi.org/10.1016/j.seppur.2013.12.030 Bandaru, S. R. S., Roy, A., Gadgil, A. J., & van Genuchten, C. M. (2020). Long-term electrode behavior during treatment of arsenic contaminated groundwater by a pilot-scale iron electrocoagulation system. Water Research, 175. https://doi.org/10.1016/J.WATRES.2020.115668 Benazzi, T. L., Di Luccio, M., Dallago, R. M., Steffens, J., Mores, R., Do Nascimento, M. S., Krebs, J., & Ceni, G. (2016). Continuous flow electrocoagulation in the treatment of wastewater from dairy industries. Water Science and Technology, 73(6), 1418–1425. https://doi.org/10.2166/wst.2015.620 112 Bilińska, L., Blus, K., Gmurek, M., & Ledakowicz, S. (2019). Coupling of electrocoagulation and ozone treatment for textile wastewater reuse. Chemical Engineering Journal, 358. https://doi.org/10.1016/j.cej.2018.10.093 Castañeda, L. F., Rodríguez, J. F., & Nava, J. L. (2021). Electrocoagulation as an af fordable technology for decontamination of drinking water containing fluoride: A critical review. Chemical Engineering Journal, 413, 1385–8947. https://doi.org/10.1016/j.cej.2020.127529 Chafi, M., Gourich, B., Essadki, A. H., Vial, C., & Fabregat, A. (2011). Comparison of electrocoagulation using iron and aluminium electrodes with chemical coagulation for the removal of a highly soluble acid dye. https://doi.org/10.1016/j.desal.2011.08.004 Chen, R., Liu, Y., & Liao, W. (2016). Using an environmentally friendly process combining electrocoagulation and algal cultivation to treat high-strength wastewater. Algal Research, 16, 330–337. https://doi.org/10.1016/J.ALGAL.2016.03.032 Chezeau, B., Boudriche, L., Vial, C., & Boudjemaa, A. (2020). Treatment of dairy wastewater by electrocoagulation process: Advantages of combined iron/aluminum electrodes. Separation Science and Technology, 55(14), 2510–2527. https://doi.org/10.1080/01496395.2019.1638935 de Mello Ferreira, A., Marchesiello, M., & Thivel, P.-X. (2013). Removal of copper, zinc and nickel present in natural water containing Ca2+ and ions by electrocoagulation. Separation and Purification Technology, 107, 109–117. https://doi.org/10.1016/j.seppur.2013.01.016 Değermenci, G. D. (2022). Air stripping of ammonia using a gas-liquid contactor: Effect of pH, temperature, airflow rate, and initial ammonia concentration. Pamukkale University Journal of Engineering Sciences, 28(6), 863–868. https://doi.org/10.5505/PAJES.2021.19540 Değermenci, N., & Yildiz, E. (n.d.). Ammonia stripping using a continuous flow jet loop reactor: mass transfer of ammonia and effect on stripping performance of influent ammonia concentration, hydraulic retention time, temperature, and air flow rate. https://doi.org/10.1007/s11356-021-13005-6/Published Demirci, Y., & Özbeyaz, A. (2019). Wastewater treatment in electrocoagulation systems: investigation of the impact of temperature using a fuzzy logic control algorithm. Environmental Science and Pollution Research, 26(30), 30893–30906. https://doi.org/10.1007/s11356-019-06279-4 Dia, O., Drogui, P., Buelna, G., & Dubé, R. (2018). Hybrid process, electrocoagulation-biofiltration for landfill leachate treatment. Waste Management, 75, 391–399. https://doi.org/10.1016/j.wasman.2018.02.016 Dires, T. T., & Saroha, A. K. (2022). Electrocoagulation: operational parameters, sludge & economic analysis. https://doi.org/10.1080/03067319.2022.2085041 113 Djerroud, N., Adjeroud, N., Felkai-Haddache, L., Hammoui, Y., Remini, H., Dahmoune, F., Merzouk, B., & Madani, K. (2018). Enhanced electrocoagulation-electroflotation for turbidity removal by Opuntia ficus indica cladode mucilage. Water and Environment Journal, 32(3). https://doi.org/10.1111/wej.12328 Ehsani, H., Mehrdadi, N., Asadollahfardi, G., Bidhendi, G. N., & Azarian, G. (2022). Continuous electrocoagulation process for pretreatment of high organic load moquette industry wastewater containing polyvinyl acetate: a pilot study. International Journal of Environmental Analytical Chemistry, 102(10), 2260–2276. https://doi.org/10.1080/03067319.2020.1753716 El-Ashtoukhy, E. S. Z., Amin, N. K., Fouad, Y. O., & Hamad, H. A. (2020). Intensification of a new electrocoagulation system characterized by minimum energy consumption and maximum removal efficiency of heavy metals from simulated wastewater. Chemical Engineering and Processing - Process Intensification, 154, 108026. https://doi.org/10.1016/J.CEP.2020.108026 El-Ghenymy, A., Alsheyab, M., Khodary, A., Sirés, I., & Abdel-Wahab, A. (2020). Corrosion behavior of pure titanium anodes in saline medium and their performance for humic acid removal by electrocoagulation. Chemosphere, 246, 125674. https://doi.org/10.1016/J.CHEMOSPHERE.2019.125674 El-Naas, M. H., Al-Zuhair, S., Al-Lobaney, A., & Makhlouf, S. (2009). Assessment of electrocoagulation for the treatment of petroleum refinery wastewater. Journal of Environmental Management, 91(1), 180–185. https://doi.org/10.1016/j.jenvman.2009.08.003 Emamjomeh, M. M., Jamali, H. A., & Moradnia, M. (2017). Optimization of Nitrate Removal Efficiency and Energy Consumption Using a Batch Monopolar Electrocoagulation: Prediction by RSM Method. Journal of Environmental Engineering, 143(7). https://doi.org/10.1061/(ASCE)EE.1943-7870.0001210 Fach, S., & Fuchs, S. (2010). Design and development of decentralized water and wastewater technologies: a combination of safe wastewater disposal and fertilizer production. Water Science and Technology, 62(7). https://doi.org/10.2166/wst.2010.445 Fadali, O. A., Ebrahiem, E. E., El-Gamil, A., & Altaher, H. (2016). Investigation of the electrocoagulation treatment technique for the separation of oil from wastewater. Journal of Environmental Science and Technology, 9(1), 62–74. https://doi.org/10.3923/JEST.2016.62.74 Favero, A. C., Favero, B. M., Souza, F. S., & Taffarel, S. R. (2020). Treatment of re-refining effluent from lubricating oils by combining electrocoagulation and coagulation-flocculation processes. Journal of Environmental Science and Health, Part A, 55(4), 402–410. https://doi.org/10.1080/10934529.2019.1702407 114 Gao, S., Yang, J., Tian, J., Ma, F., Tu, G., & Du, M. (2010). Electro-coagulation–flotation process for algae removal. Journal of Hazardous Materials, 177(1–3), 336–343. https://doi.org/10.1016/j.jhazmat.2009.12.037 Genc, A., & Eryilmaz, C. (2017). Dependency of removal efficiency on electrode arrangements in the treatment of oily wastewaters by electrocoagulation. Separation Science and Technology, 1–8. https://doi.org/10.1080/01496395.2017.1295997 Ghanbari, F., Wu, J., Khatebasreh, M., Ding, D., & Lin, K.-Y. A. (2020). Efficient treatment for landfill leachate through sequential electrocoagulation, electrooxidation and PMS/UV/CuFe2O4 process. Separation and Purification Technology, 242, 116828. https://doi.org/10.1016/j.seppur.2020.116828 Ghosh, D., Medhi, C. R., & Purkait, M. K. (2008). Treatment of fluoride containing drinking water by electrocoagulation using monopolar and bipolar electrode connections. Chemosphere, 73(9), 1393–1400. https://doi.org/10.1016/j.chemosphere.2008.08.041 Golder, A. K., Samanta, A. N., & Ray, S. (2007). Removal of Cr3+ by electrocoagulation with multiple electrodes: Bipolar and monopolar configurations. Journal of Hazardous Materials, 141(3), 653–661. https://doi.org/10.1016/J.JHAZMAT.2006.07.025 Gomes, A. J. G., Atambo, D. O., Das, K. K., Cocke, D. L., & Das, K. P. (2018). Electrochemical remediation of chicken processing plant wastewater. Journal of Environmental Chemical Engineering, 6(5), 6028–6036. https://doi.org/10.1016/j.jece.2018.09.039 Guerrini, A., Romano, G., & Indipendenza, A. (2017). Energy Efficiency Drivers in Wastewater Treatment Plants: A Double Bootstrap DEA Analysis. Sustainability 2017, Vol. 9, Page 1126, 9(7), 1126. https://doi.org/10.3390/SU9071126 Hakizimana, J. N., Gourich, B., Chafi, M., Stiriba, Y., Vial, C., Drogui, P., & Naja, J. (2017). Electrocoagulation process in water treatment: A review of electrocoagulation modeling approaches. Desalination, 404, 1–21. https://doi.org/10.1016/j.desal.2016.10.011 Hanay, Ö., & Hasar, H. (2011). Effect of anions on removing Cu2+, Mn2+ and Zn2+ in electrocoagulation process using aluminum electrodes. Journal of Hazardous Materials, 189(1–2), 572–576. https://doi.org/10.1016/j.jhazmat.2011.02.073 Hashim, K. S., Shaw, A., Al Khaddar, R., Pedrola, M. O., & Phipps, D. (2017). Energy efficient electrocoagulation using a new flow column reactor to remove nitrate from drinking water – Experimental, statistical, and economic approach. Journal of Environmental Management, 196, 224–233. https://doi.org/10.1016/j.jenvman.2017.03.017 Hu, C. Y., Lo, S. L., & Kuan, W. H. (2003). Effects of co-existing anions on fluoride removal in electrocoagulation (EC) process using aluminum electrodes. Water Research, 37(18), 4513– 4523. https://doi.org/10.1016/S0043-1354(03)00378-6 115 Igwegbe, C. A., Onukwuli, O. D., Ighalo, J. O., & Umembamalu, C. J. (2021). Electrocoagulation- flocculation of aquaculture effluent using hybrid iron and aluminium electrodes: A comparative study. Chemical Engineering Journal Advances, 6, 100107. https://doi.org/10.1016/J.CEJA.2021.100107 Ingelsson, M., Yasri, N., & Roberts, E. P. L. (2020). Electrode passivation, faradaic efficiency, and performance enhancement strategies in electrocoagulation—a review. Water Research, 187. https://doi.org/10.1016/j.watres.2020.116433 Izquierdo, C. J., Canizares, P., Rodrigo, M. A., Leclerc, J. P., Valentin, G., & Lapicque, F. (2010). Effect of the nature of the supporting electrolyte on the treatment of soluble oils by electrocoagulation. Desalination, 255(1–3), 15–20. https://doi.org/10.1016/J.DESAL.2010.01.022 Jafarinejad, S. (2017). Cost estimation and economical evaluation of three configurations of activated sludge process for a wastewater treatment plant (WWTP) using simulation. Applied Water Science, 7(5), 2513–2521. https://doi.org/10.1007/S13201-016-0446- 8/TABLES/6 Jin, X., Xie, X., Zhang, S., Yang, C., Xu, L., Shi, X., Jin, P., & Wang, X. C. (2021). Insights into the electro-hybrid ozonation-coagulation process-Significance of connection configurations and electrode types. Water Research, 204, 117600. https://doi.org/10.1016/j.watres.2021.117600 Jing, G., Ren, S., Pooley, S., Sun, W., Kowalczuk, P. B., & Gao, Z. (2021). Electrocoagulation for industrial wastewater treatment: an updated review. Environmental Science: Water Research & Technology, 7(7), 1177–1196. https://doi.org/10.1039/D1EW00158B Kambuyi, T. N., Bejjany, B., Lekhlif, B., Mellouk, H., Digua, K., & Dani, A. (2021). Design of a continuous-flow single-channel reactor using optimal experimental data from batch reactor for turbidity removal by electrocoagulation. Journal of Environmental Chemical Engineering, 9(1), 104651. https://doi.org/10.1016/J.JECE.2020.104651 Karamati-Niaragh, E., Alavi Moghaddam, M. R., Emamjomeh, M. M., & Nazlabadi, E. (2019). Evaluation of direct and alternating current on nitrate removal using a continuous electrocoagulation process: Economical and environmental approaches through RSM. Journal of Environmental Management, 230, 245–254. https://doi.org/10.1016/J.JENVMAN.2018.09.091 Katal, R., & Pahlavanzadeh, H. (2011). Influence of different combinations of aluminum and iron electrode on electrocoagulation efficiency: Application to the treatment of paper mill wastewater. Desalination, 265(1–3), 199–205. https://doi.org/10.1016/j.desal.2010.07.052 Khalaf, A. M., Mubarak, A. A., & Nosier, S. A. (2016). Removal of Cr(VI) by Electrocoagulation Using Vertical and Horizontal Rough Cylinder Anodes. Int. J. Electrochem. Sci, 11, 1601– 1610. www.electrochemsci.org 116 Kobya, M., Ulu, F., Gebologlu, U., Demirbas, E., & Oncel, M. S. (2011). Treatment of potable water containing low concentration of arsenic with electrocoagulation: Different connection modes and Fe–Al electrodes. Separation and Purification Technology, 77(3), 283–293. https://doi.org/10.1016/J.SEPPUR.2010.12.018 Koparal, A. S., & Öütveren, Ü. B. (2002). Removal of nitrate from water by electroreduction and electrocoagulation. Journal of Hazardous Materials, 89(1), 83–94. https://doi.org/10.1016/S0304-3894(01)00301-6 Kumar, A., Dhall, P., & Kumar, R. (2010). Redefining BOD:COD ratio of pulp mill industrial wastewaters in BOD analysis by formulating a specific microbial seed. International Biodeterioration & Biodegradation, 64(3), 197–202. https://doi.org/10.1016/j.ibiod.2010.01.005 Kuokkanen, V., Kuokkanen, M., Hynynen, I., & Kuokkanen, T. (2021). Electrocoagulation treatment of metallurgical industry wastewater – A laboratory scale batch and pilot scale continuous study. Hydrometallurgy, 202, 105596. https://doi.org/10.1016/J.HYDROMET.2021.105596 Le, T. S., Dang, N. M., & Tran, D. T. (2021). Performance of coupling electrocoagulation and biofiltration processes for the treatment of leachate from the largest landfill in Hanoi, Vietnam: Impact of operating conditions. Separation and Purification Technology, 255, 117677. https://doi.org/10.1016/j.seppur.2020.117677 Li, J., Liu, X., Zhu, C., Song, T., Chen, Z., Jin, S., & Geng, B. (2023). Bacterial dynamics and functions driven by biomass wastes to promote rural toilet blackwater absorption and recycling in an ectopic fermentation system. Chemosphere, 316, 137804. https://doi.org/10.1016/j.chemosphere.2023.137804 Lin, L., Yuan, S., Chen, J., Xu, Z., & Lu, X. (2009). Removal of ammonia nitrogen in wastewater by microwave radiation. Journal of Hazardous Materials, 161(2–3), 1063–1068. https://doi.org/10.1016/J.JHAZMAT.2008.04.053 Liu, Z., Stromberg, D., Liu, X., Liao, W., & Liu, Y. (2015). A new multiple-stage electrocoagulation process on anaerobic digestion effluent to simultaneously reclaim water and clean up biogas. Journal of Hazardous Materials, 285, 483–490. https://doi.org/10.1016/j.jhazmat.2014.10.009 López, R. L., Coreño, O., & Nava, J. L. (2019). Abatement of hydrated silica and simultaneous removal of coexisting ions from deep well water by electrocoagulation using an up-flow reactor. Journal of Water Process Engineering, 32, 100923. https://doi.org/10.1016/j.jwpe.2019.100923 Lu, J., Zhang, P., & Li, J. (2021). Electrocoagulation technology for water purification: An update review on reactor design and some newly concerned pollutants removal. Journal of Environmental Management, 296, 113259. https://doi.org/10.1016/j.jenvman.2021.113259 117 Lu, J., Zhuo, Q., Ren, X., Qiu, Y., Li, Y., Chen, Z., & Huang, K. (2021). Treatment of wastewater from adhesive-producing industries by electrocoagulation and electrochemical oxidation. Process Safety and Environmental Protection. https://doi.org/10.1016/j.psep.2021.10.035 Lynn, W., Heffron, J., & Mayer, B. K. (2019). Electrocoagulation as a Pretreatment for Electroxidation of E. coli. Water, 11(12), 2509. https://doi.org/10.3390/w11122509 Mahesh, S., Prasad, B., Mall, I. D., & Mishra, I. M. (2006). Electrochemical degradation of pulp and paper mill wastewater. Part 1. COD and color removal. Industrial and Engineering Chemistry Research, 45(8), 2830–2839. https://doi.org/10.1021/IE0514096/ASSET/IMAGES/LARGE/IE0514096F00014.JPEG Marmanis, D., Thysiadou, A., Diamantis, V., Christoforidis, A., & Dermentzis, K. (2021). Performance of Electrocoagulation Processes for the Removal of COD and Ammonia from High Salinity Landfill-leachate using Iron or Aluminum Electrodes. Journal of Engineering Science and Technology Review, 14(4), 105–109. https://doi.org/10.25103/jestr.144.14 Martínez-Villafañe, J. F., Montero-Ocampo, C., & García-Lara, A. M. (2009). Energy and electrode consumption analysis of electrocoagulation for the removal of arsenic from underground water. Journal of Hazardous Materials, 172(2–3), 1617–1622. https://doi.org/10.1016/J.JHAZMAT.2009.08.044 Merzouk, B., Gourich, B., Sekki, A., Madani, K., & Chibane, M. (2009). Removal turbidity and separation of heavy metals using electrocoagulation–electroflotation technique. Journal of Hazardous Materials, 164(1), 215–222. https://doi.org/10.1016/j.jhazmat.2008.07.144 Metcalf & Eddy Inc., T. G. , B. F. L. , T. R. , Tchobanoglous, G., Burton, F. L., Tsuchihashi, R., & Stensel, H. D. (2013). Wastewater engineering: treatment and resource recovery (5th ed.). McGraw-Hill Professional. Mohamad, N. A., Hamzah, S., Che Harun, M. H., Ali, A., Rasit, N., Awang, M., Rahman, W. R. W. A., Azmi, A. A. A. R., Abu Habib, A. A., Amri Zahid, M. S., Fahmi Mustofa, A. A., Latfi, S. A., Aripin, S. M., & Saad, R. (2021). Integration of copperas and calcium hydroxide as a chemical coagulant and coagulant aid for efficient treatment of palm oil mill effluent. Chemosphere, 281, 130873. https://doi.org/10.1016/J.CHEMOSPHERE.2021.130873 Mohtashami, R., & Shang, J. Q. (2019). Electroflotation for Treatment of Industrial Wastewaters: A Focused Review. Environmental Processes, 6(2), 325–353. https://doi.org/10.1007/s40710-019-00348-z Mollah, M. Y. A., Morkovsky, P., Gomes, J. A. G., Kesmez, M., Parga, J., & Cocke, D. L. (2004). Fundamentals, present and future perspectives of electrocoagulation. Journal of Hazardous Materials, 114(1–3), 199–210. https://doi.org/10.1016/J.JHAZMAT.2004.08.009 Mollah, M. Y. A., Schennach, R., Parga, J. R., & Cocke, D. L. (2001). Electrocoagulation (EC) — science and applications. Journal of Hazardous Materials, 84(1). https://doi.org/10.1016/S0304-3894(01)00176-5 118 Moradi, M., Vasseghian, Y., Arabzade, H., & Mousavi Khaneghah, A. (2021). Various wastewaters treatment by sono-electrocoagulation process: A comprehensive review of operational parameters and future outlook. Chemosphere, 263, 128314. https://doi.org/10.1016/j.chemosphere.2020.128314 Mores, R., de Mello, P. A., Zakrzevski, C. A., Treichel, H., Kunz, A., Steffens, J., & Dallago, R. M. (2018). Reduction of soluble organic carbon and removal of total phosphorus and metals from swine wastewater by electrocoagulation. Brazilian Journal of Chemical Engineering, 35(4), 1231–1240. https://doi.org/10.1590/0104-6632.20180354S20170300 Mores, R., Treichel, H., Zakrzevski, C. A., Kunz, A., Steffens, J., & Dallago, R. M. (2016). Remove of phosphorous and turbidity of swine wastewater using electrocoagulation under continuous flow. Separation and Purification Technology, 171, 112–117. https://doi.org/10.1016/J.SEPPUR.2016.07.016 Mouedhen, G., Feki, M., Wery, M. D. P., & Ayedi, H. F. (2008). Behavior of aluminum electrodes in electrocoagulation process. Journal of Hazardous Materials, 150(1), 124–135. https://doi.org/10.1016/j.jhazmat.2007.04.090 Mousazadeh, M., Naghdali, Z., Al-Qodah, Z., Alizadeh, S. M., Karamati Niaragh, E., Malekmohammadi, S., Nidheesh, P. V., Roberts, E. P. L., Sillanpää, M., & Mahdi Emamjomeh, M. (2021). A systematic diagnosis of state of the art in the use of electrocoagulation as a sustainable technology for pollutant treatment: An updated review. Sustainable Energy Technologies and Assessments, 47, 101353. https://doi.org/10.1016/J.SETA.2021.101353 Mousazadeh, M., Niaragh, E. K., Usman, M., Khan, S. U., Sandoval, M. A., Al-Qodah, Z., Khalid, Z. Bin, Gilhotra, V., & Emamjomeh, M. M. (2021). A critical review of state-of-the-art electrocoagulation technique applied to COD-rich industrial wastewaters. Environmental Science and Pollution Research, 28(32), 43143–43172. https://doi.org/10.1007/s11356-021- 14631-w Moussa, D. T., El-Naas, M. H., Nasser, M., & Al-Marri, M. J. (2017). A comprehensive review of electrocoagulation for water treatment: Potentials and challenges. Journal of Environmental Management, 186, 24–41. https://doi.org/10.1016/J.JENVMAN.2016.10.032 Nasrullah, M., Singh, L., Krishnan, S., Sakinah, M., & Zularisam, A. W. (2018). Electrode design for electrochemical cell to treat palm oil mill effluent by electrocoagulation process. Environmental Technology & Innovation, 9, 323–341. https://doi.org/10.1016/J.ETI.2017.10.001 Nazlabadi, E., Reza, M., Moghaddam, A., & Karamati-Niaragh, E. (2019). Simultaneous removal of nitrate and nitrite using electrocoagulation/ floatation (ECF): A new multi-response optimization approach. https://doi.org/10.1016/j.jenvman.2019.109489 119 Nguyen, D. D., Ngo, H. H., Guo, W., Nguyen, T. T., Chang, S. W., Jang, A., & Yoon, Y. S. (2016). Can electrocoagulation process be an appropriate technology for phosphorus removal from municipal wastewater? Science of The Total Environment, 563–564, 549–556. https://doi.org/10.1016/J.SCITOTENV.2016.04.045 Nguyen, D. D., Yoon, Y. S., Bui, X. T., Kim, S. S., Chang, S. W., Guo, W., & Ngo, H. H. (2017). Influences of operational parameters on phosphorus removal in batch and continuous electrocoagulation process performance. Environmental Science and Pollution Research, 24(32), 25441–25451. https://doi.org/10.1007/s11356-017-0180-2 Nugroho, F., Sani, M. M., Apriyanti, F., Aryanti, P., Yani, A., & Ters Jend Sudirman, J. (2020). The Influence of Applied Current Strength and Electrode Configuration in Laundry Wastewater Treatment by Electrocoagulation. J. Phys, 52018. https://doi.org/10.1088/1742- 6596/1477/5/052018 Palakodeti, A., Azman, S., Rossi, B., Dewil, R., & Appels, L. (2021). A critical review of ammonia recovery from anaerobic digestate of organic wastes via stripping. Renewable and Sustainable Energy Reviews, 143, 110903. https://doi.org/10.1016/j.rser.2021.110903 Perng, Y.-S., & Wang, E. I.-C. (2013). Treatment of Pulp Mill D-Stage Bleaching Effluent Using a Pilot-Scale Electrocoagulation System. Water Environment Research, 88(3), 257–263. https://doi.org/10.2175/106143013X13807328848937/FORMAT/PDF Phasey, J., Vandamme, D., & Fallowfield, H. J. (2017). Harvesting of algae in municipal wastewater treatment by calcium phosphate precipitation mediated by photosynthesis, sodium hydroxide and lime. Algal Research, 27, 115–120. https://doi.org/10.1016/j.algal.2017.06.015 Postacchini, L., Ciarapica, F. E., & Bevilacqua, M. (2018). Environmental assessment of a landfill leachate treatment plant: Impacts and research for more sustainable chemical alternatives. Journal of Cleaner Production, 183, 1021–1033. https://doi.org/10.1016/J.JCLEPRO.2018.02.219 Qi, Z., You, S., Liu, R., & Chuah, C. J. (2020). Performance and mechanistic study on electrocoagulation process for municipal wastewater treatment based on horizontal bipolar electrodes. Frontiers of Environmental Science and Engineering, 14(3). https://doi.org/10.1007/S11783-020-1215-3 Ricordel, C., & Djelal, H. (2014). Treatment of landfill leachate with high proportion of refractory materials by electrocoagulation: System performances and sludge settling characteristics. Journal of Environmental Chemical Engineering, 2(3), 1551–1557. https://doi.org/10.1016/J.JECE.2014.06.014 Sandoval, M. A., Fuentes, R., Thiam, A., & Salazar, R. (2021). Arsenic and fluoride removal by electrocoagulation process: A general review. Science of The Total Environment, 753, 142108. https://doi.org/10.1016/J.SCITOTENV.2020.142108 120 Sen, S., Kumar Prajapati, A., Bannatwala, A., & Pal, D. (2019). Electrocoagulation treatment of industrial wastewater including textile dyeing effluent-a review. https://doi.org/10.5004/dwt.2019.24302 Silva, J. R., Carvalho, F., Vicente, C., Santos, A. D., Quinta-Ferreira, R. M., & Castro, L. M. (2022). Electrocoagulation treatment of cork boiling wastewater. Journal of Environmental Chemical Engineering, 10(3), 107750. https://doi.org/10.1016/J.JECE.2022.107750 Solak, M., Kiliç, M., Hüseyin, Y., & Şencan, A. (2009). Removal of suspended solids and turbidity from marble processing wastewaters by electrocoagulation: Comparison of electrode materials and electrode connection systems. Journal of Hazardous Materials, 172(1), 345– 352. https://doi.org/10.1016/J.JHAZMAT.2009.07.018 Song, P., Song, Q., Yang, Z., Zeng, G., Xu, H., Li, X., & Xiong, W. (2018). Numerical simulation and exploration of electrocoagulation process for arsenic and antimony removal: Electric field, flow field, and mass transfer studies. https://doi.org/10.1016/j.jenvman.2018.09.001 Tanyol, M., Ogedey, A., & Oguz, E. (2018). COD removal from leachate by electrocoagulation process: treatment with monopolar electrodes in parallel connection. Water Science and Technology, 77(1), 177–186. https://doi.org/10.2166/wst.2017.528 Tchamango, S. R., Wandji Ngayo, K., Belibi Belibi, P. D., Nkouam, F., & Ngassoum, M. B. (2021). Treatment of a dairy effluent by classical electrocoagulation and indirect electrocoagulation with aluminum electrodes. Separation Science and Technology, 56(6), 1128–1139. https://doi.org/10.1080/01496395.2020.1748889 Thirugnanasambandham, K., Sivakumar, V., & Prakasmaran, J. (2015). Optimization of process parameters in electrocoagulation treating chicken industry wastewater to recover hydrogen gas with pollutant reduction. Renewable Energy, 80, 101–108. https://doi.org/10.1016/J.RENENE.2015.01.030 Trompette, J. L., & Vergnes, H. (2009). On the crucial influence of some supporting electrolytes during electrocoagulation in the presence of aluminum electrodes. Journal of Hazardous Materials, 163(2–3), 1282–1288. https://doi.org/10.1016/J.JHAZMAT.2008.07.148 Turbidity and Water | U.S. Geological Survey. (n.d.). Retrieved March 23, 2023, from https://www.usgs.gov/special-topics/water-science-school/science/turbidity-and- water#overview Uludag-Demirer, S., Olson, N., Ives, R., Nshimyimana, J. P., Rusinek, C. A., Rose, J. B., & Liao, W. (2020). Techno-Economic Analysis of Electrocoagulation on Water Reclamation and Bacterial/Viral Indicator Reductions of a High-Strength Organic Wastewater—Anaerobic Digestion Effluent. Sustainability, 12(7). https://doi.org/10.3390/su12072697 US EPA. (n.d.). September 2010 NPDES Permit Writers’ Manual CHAPTER 5. Technology-Based Effluent Limitations. 121 Vasudevan, S., Lakshmi, J., Jayaraj, J., & Sozhan, G. (2009). Remediation of phosphate- contaminated water by electrocoagulation with aluminium, aluminium alloy and mild steel anodes. Journal of Hazardous Materials, 164(2–3), 1480–1486. https://doi.org/10.1016/j.jhazmat.2008.09.076 World Health Organization. (2019). Drinking-water. https://www.who.int/news-room/fact- sheets/detail/drinking-water Wu, Z., Zhu, Y., Huang, W., Zhang, C., Li, T., Zhang, Y., & Li, A. (2012). Evaluation of flocculation induced by pH increase for harvesting microalgae and reuse of flocculated medium. Bioresource Technology, 110, 496–502. https://doi.org/10.1016/J.BIORTECH.2012.01.101 Yavuz, Y., & Ögütveren, B. (2018). Treatment of industrial estate wastewater by the application of electrocoagulation process using iron electrodes. Journal of Environmental Management, 207, 151–158. https://doi.org/10.1016/J.JENVMAN.2017.11.034 Yehya, T., Chafi, M., Balla, W., Vial, Ch., Essadki, A., & Gourich, B. (2014). Experimental analysis and modeling of denitrification using electrocoagulation process. Separation and Purification Technology, 132, 644–654. https://doi.org/10.1016/j.seppur.2014.05.022 Yilmaz, A. E., Boncukcuoğlu, R., & Kocakerim, M. M. (2007). A quantitative comparison between electrocoagulation and chemical coagulation for boron removal from boron-containing solution. Journal of Hazardous Materials, 149(2), 475–481. https://doi.org/10.1016/j.jhazmat.2007.04.018 Yilmaz, A. E., Boncukcuoǧlu, R., Kocakerim, M. M., & Keskinler, B. (2005). The investigation of parameters affecting boron removal by electrocoagulation method. Journal of Hazardous Materials, 125(1–3), 160–165. https://doi.org/10.1016/J.JHAZMAT.2005.05.020 Yuksel, E., Gurbulak, E., & Eyvaz, M. (2012). Decolorization of a reactive dye solution and treatment of a textile wastewater by electrocoagulation and chemical coagulation: Techno- economic comparison. Environmental Progress & Sustainable Energy, 31(4), 524–535. https://doi.org/10.1002/ep.10574 Zaied, B. K., Rashid, M., Nasrullah, M., Zularisam, A. W., Pant, D., & Singh, L. (2020). A comprehensive review on contaminants removal from pharmaceutical wastewater by electrocoagulation process. Science of The Total Environment, 726, 138095. https://doi.org/10.1016/j.scitotenv.2020.138095 Zangeneh, A., Sabzalipour, S., Takdatsan, A., Yengejeh, R. J., & Khafaie, M. A. (2021). NC-ND license Ammonia removal form municipal wastewater by air stripping process: An experimental study. South African Journal of Chemical Engineering, 36, 1026–9185. https://doi.org/10.1016/j.sajce.2021.03.001 122 APPENDIX A: SUPPLEMENTAL TABLES AND FIGURES Table 14. Real blackwater sample data Analysis Method Unit Average BOD 5 SM 5210B mg/L 1478.0 COD EPA 410.4 mg/L 3360.0 TSS SM 2540D mg/L 801.2 Oil and Grease (HEM) EPA 1664A ug/L 22800.0 pH EPA 150.1 H 8.2 Hardness SM 2340B mg/L 211.8 Conductivity SM 2510B umho/cm 6480.0 Total Dissolved Solids (TDS) SM 2540C mg/L 1874.8 Turbidity EPA 180.1 NTU 641.8 Totla Kjeldahl Nitrogen (TKN) EPA 351.2 mg/L 319.8 Ammonia (NH3) SM 4500-NH3 mg/L 189.4 B/D Total Phosphorous EPA 365.1 mg/L 37.4 TOC EPA 415.3 mg/L 622.0 DOC EPA 415.3 mg/L 492.0 NO2, NO3 EPA 353.2 mg/L 0.31 Chloride (Cl) EPA 300 mg/L 660.00 Sulfate (SO4) EPA 300 mg/L 92.80 Chlorine (Total) Hach Test Strip mg/L 0.00 Chlorine (Free) Hach Test Strip mg/L 0.00 Chlorine (Residual) Hach Test Strip mg/L - MBAS (Surfactants) AM 5540C mg/L 38.70 123 Figure 53. Drawing of the 76-liter settling tank Figure 54. Drawing of EC reactor with the conical top used in the first pilot tests 124 Figure 55. Drawing of the conical top of the EC reactor Figure 56. The final design of the new EC sludge separator 125 Figure 57. A 3D model of the new EC sludge separator 126 APPENDIX B: R CODE AND STATISTICS Chapter 2 code ## Statistical analysis of the bench EC flow rate data ## Gus Aburto, February 6, 2022 ## Gus Aburto, February 11, 2022 ## Gus Aburto, February 23, 2022 # Loading Library and Tables ---------------------------------------------- library (MASS) library(ggplot2) ## Warning: package 'ggplot2' was built under R version 4.1.3 library(grid) library(gridExtra) ## Warning: package 'gridExtra' was built under R version 4.1.3 library(ggpubr) ## Warning: package 'ggpubr' was built under R version 4.1.3 library(plyr) ## Warning: package 'plyr' was built under R version 4.1.3 ## ## Attaching package: 'plyr' ## The following object is masked from 'package:ggpubr': ## ## mutate library(inferr) ## Warning: package 'inferr' was built under R version 4.1.3 library(extrafont) ## Warning: package 'extrafont' was built under R version 4.1.3 ## Registering fonts with R library(car) ## Warning: package 'car' was built under R version 4.1.3 ## Loading required package: carData ## Warning: package 'carData' was built under R version 4.1.3 library(dplyr) 127 ## Warning: package 'dplyr' was built under R version 4.1.3 ## ## Attaching package: 'dplyr' ## The following object is masked from 'package:car': ## ## recode ## The following objects are masked from 'package:plyr': ## ## arrange, count, desc, failwith, id, mutate, rename, summarise, ## summarize ## The following object is masked from 'package:gridExtra': ## ## combine ## The following object is masked from 'package:MASS': ## ## select ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(moments) ## Warning: package 'moments' was built under R version 4.1.3 windowsFonts(A = windowsFont("Times New Roman")) #vector of font family names ## the .txt file needs to be saved as the type of "Tab delimited". ## This script is for the statistical analysis of EC flow rate data. # a one-tailed t-test is meant to find the difference between the two flow ra tes testing by looking at the differences in turbidity removal. ## choose the Meta_data table should be .txt File name should be metadata_flo wrate con <- file.choose(new = FALSE) metadata_flow <- read.table(con, header = T, row.names = NULL) metadata_flow$Flow_rate <- factor(metadata_flow$Flow_rate) ##Factor Statement 128 data1<-metadata_flow[which(metadata_flow$Flow_rate=="160"),] data2<-metadata_flow[which(metadata_flow$Flow_rate=="250"),] ### Statistical analysis ## testing normality assumption for all parameters at 160 mL/min shapiro.test(metadata_flow$Turbidity) ## ## Shapiro-Wilk normality test ## ## data: metadata_flow$Turbidity ## W = 0.75123, p-value = 7.537e-07 shapiro.test(metadata_flow$Voltage) ## ## Shapiro-Wilk normality test ## ## data: metadata_flow$Voltage ## W = 0.72903, p-value = 3.017e-07 ## testing equal variance assumption var.test(data1$Voltage, data2$Voltage) # variances are equal ## ## F test to compare two variances ## ## data: data1$Voltage and data2$Voltage ## F = 1.2703, num df = 19, denom df = 19, p-value = 0.6072 ## alternative hypothesis: true ratio of variances is not equal to 1 ## 95 percent confidence interval: ## 0.5028095 3.2094100 ## sample estimates: ## ratio of variances ## 1.270323 var.test(data1$Turbidity, data2$Turbidity) # variances are not equal ## ## F test to compare two variances ## ## data: data1$Turbidity and data2$Turbidity ## F = 0.038544, num df = 19, denom df = 19, p-value = 1.824e-09 ## alternative hypothesis: true ratio of variances is not equal to 1 ## 95 percent confidence interval: 129 ## 0.01525603 0.09737857 ## sample estimates: ## ratio of variances ## 0.03854362 var.test(data1$Turb_rem, data2$Turb_rem) # variances are not equal ## ## F test to compare two variances ## ## data: data1$Turb_rem and data2$Turb_rem ## F = 0.038472, num df = 19, denom df = 19, p-value = 1.794e-09 ## alternative hypothesis: true ratio of variances is not equal to 1 ## 95 percent confidence interval: ## 0.01522761 0.09719713 ## sample estimates: ## ratio of variances ## 0.03847181 ## Mann-Whitney tests wilcox.test(data2$Turbidity, data1$Turbidity,exact=FALSE) ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2$Turbidity and data1$Turbidity ## W = 383, p-value = 7.948e-07 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data2$Voltage,data1$Voltage,exact=FALSE) ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2$Voltage and data1$Voltage ## W = 0, p-value = 6.179e-08 ## alternative hypothesis: true location shift is not equal to 0 ##PLOT BAR CHARTS ------------------------------------------- ## The following section involves finding the average and standard deviation of the variables and then plots the results with bar charts # voltage meta_datasummary<-metadata_flow %>% group_by(Flow_rate) %>% dplyr::summarize(mean=mean(Voltage), sd = sd(Voltage)) meta_datasummary 130 ## # A tibble: 2 x 3 ## Flow_rate mean sd ## ## 1 160 20.0 0.345 ## 2 250 14.0 0.306 box_flow_voltage <- ggplot(meta_datasummary, aes(x=Flow_rate, y=mean, fill = Flow_rate )) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Flow rate (mL/min)")+ ylab("Voltage (V)") + labs(fill ="Flow_rate") + ylim(0, 30) + labs(title = "", subtitle="a")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 18, family="A"), legend.title= element_text(size = 18, family="A")) r2 <- box_flow_voltage + theme(legend.position = "none") #r2 # Turbidity meta_datasummary2<-metadata_flow %>% group_by(Flow_rate) %>% dplyr::summarize(mean=mean(Turbidity), sd = sd(Turbidity)) meta_datasummary2 ## # A tibble: 2 x 3 ## Flow_rate mean sd ## ## 1 160 54.1 15.8 ## 2 250 139. 80.6 box_flow_Turbidity <- ggplot(meta_datasummary2, aes(x=Flow_rate, y=mean, fill = Flow_rate )) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position_dodge(0.9))+ xlab("Flow rate (mL/min)")+ ylab("Turbidity (NTU)") + labs(fill ="Flow_rate") + ylim(0, 250) + labs(title = "", subtitle="b")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = 131 "right", legend.text = element_text(size = 12, family="A"), legend.title= element_text(size = 12, family="A")) r1 <- box_flow_Turbidity + theme(legend.position = "none") #grid.arrange(r1 ,r2 ,nrow=1) ## Statistical analysis of aeration data comparing a stripping column and sur face tray aeration. ## Gus Aburto, February 23, 1223 ## 1. Loading libraries ---------- library (MASS) library(ggplot2) ## Warning: package 'ggplot2' was built under R version 4.1.3 library(grid) library(gridExtra) ## Warning: package 'gridExtra' was built under R version 4.1.3 library(ggpubr) ## Warning: package 'ggpubr' was built under R version 4.1.3 library(plyr) ## Warning: package 'plyr' was built under R version 4.1.3 ## ## Attaching package: 'plyr' ## The following object is masked from 'package:ggpubr': ## ## mutate library(inferr) ## Warning: package 'inferr' was built under R version 4.1.3 library(extrafont) ## Warning: package 'extrafont' was built under R version 4.1.3 ## Registering fonts with R library(car) ## Warning: package 'car' was built under R version 4.1.3 132 ## Loading required package: carData ## Warning: package 'carData' was built under R version 4.1.3 library(dplyr) ## Warning: package 'dplyr' was built under R version 4.1.3 ## ## Attaching package: 'dplyr' ## The following object is masked from 'package:car': ## ## recode ## The following objects are masked from 'package:plyr': ## ## arrange, count, desc, failwith, id, mutate, rename, summarise, ## summarize ## The following object is masked from 'package:gridExtra': ## ## combine ## The following object is masked from 'package:MASS': ## ## select ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(moments) ## Warning: package 'moments' was built under R version 4.1.3 windowsFonts(A = windowsFont("Times New Roman")) # 2. Loading data ------------ con2 <- file.choose(new = FALSE) #The file should be in the AerationAndOzoneM etaData folder (meta_data_column_and_tray.txt) metadata_air <- read.table(con2, header = T, row.names = NULL) head(metadata_air) ## row.names Treatment pH Turbidity TN NH3 Turb_rem TN_rem NH3_rem ## 1 1 Column 9 66.0 358.7 269 -11.86 5.90 -3.46 ## 2 2 Column 9 67.8 363.8 269 -14.92 4.56 -3.46 ## 3 3 Column 9 93.4 399.5 235 -47.68 5.58 9.44 ## 4 4 Column 9 92.7 391.2 242 -46.59 7.54 6.74 133 ## 5 5 Tray 9 19.4 441.0 292 62.18 -7.69 -1.21 ## 6 6 Tray 9 23.0 466.2 295 55.17 -13.85 -2.25 ## factor statements metadata_air$Treatment <- factor(metadata_air$Treatment) metadata_air$pH <- factor(metadata_air$pH) ## 3. Data summary---------- # TN summary datasummaryTN<-metadata_air %>% group_by(Treatment,pH) %>% dplyr::summarize(mean=mean(TN), sd = sd(TN)) ## `summarise()` has grouped output by 'Treatment'. You can override using th e ## `.groups` argument. datasummaryTN ## # A tibble: 4 x 4 ## # Groups: Treatment [2] ## Treatment pH mean sd ## ## 1 Column 9 378. 20.1 ## 2 Column 11 232. 49.2 ## 3 Tray 9 466. 18.2 ## 4 Tray 11 120. 20.5 # Turbidity datasummaryTurbidity<-metadata_air %>% group_by(Treatment,pH) %>% dplyr::summarize(mean=mean(Turbidity), sd = sd(Turbidity)) ## `summarise()` has grouped output by 'Treatment'. You can override using th e ## `.groups` argument. datasummaryTurbidity ## # A tibble: 4 x 4 ## # Groups: Treatment [2] ## Treatment pH mean sd ## ## 1 Column 9 80.0 15.1 ## 2 Column 11 75.5 34.1 ## 3 Tray 9 20.2 2.62 ## 4 Tray 11 13.1 0.629 #NH3 summary datasummaryNH3<-metadata_air %>% 134 group_by(Treatment,pH) %>% dplyr::summarize(mean=mean(NH3), sd = sd(NH3)) ## `summarise()` has grouped output by 'Treatment'. You can override using th e ## `.groups` argument. datasummaryNH3 ## # A tibble: 4 x 4 ## # Groups: Treatment [2] ## Treatment pH mean sd ## ## 1 Column 9 254. 17.8 ## 2 Column 11 244. 6.56 ## 3 Tray 9 304. 12.0 ## 4 Tray 11 93.5 12.3 ## 4. Normality, data transformations, and equal variance checks------- data_air1 <- metadata_air[which(metadata_air$Treatment=="Column"),] data_air2 <- metadata_air[which(metadata_air$Treatment=="Tray"),] # Turbidity normality check and transformation shapiro.test(metadata_air$Turbidity) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_air$Turbidity ## W = 0.83504, p-value = 0.00827 skewness(metadata_air$Turbidity) ## [1] 0.5332549 data_turb_air<-sqrt(metadata_air$Turbidity) # sqrt transformation shapiro.test(data_turb_air) ## ## Shapiro-Wilk normality test ## ## data: data_turb_air ## W = 0.85754, p-value = 0.01763 # TN normality check shapiro.test(metadata_air$TN) # normal ## ## Shapiro-Wilk normality test ## 135 ## data: metadata_air$TN ## W = 0.90264, p-value = 0.08858 # NH3 normality check and transformation shapiro.test(metadata_air$NH3) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_air$NH3 ## W = 0.81991, p-value = 0.005069 skewness(metadata_air$NH3) ## [1] -0.8292116 data_NH3_air <- sqrt(max(metadata_air$NH3+1)-metadata_air$NH3) # sqrt transfo rmation shapiro.test(data_NH3_air) # normal ## ## Shapiro-Wilk normality test ## ## data: data_NH3_air ## W = 0.92158, p-value = 0.1789 # new data structure data_air11<-data.frame(metadata_air$Treatment,metadata_air$pH,metadata_air$Tu rbidity,data_turb_air,metadata_air$NH3,data_NH3_air,metadata_air$TN) colnames(data_air11)<-c("Treatment","pH","Turbidity","sqrt_turb","NH3" ,"sqrt _NH3","TN") data_air11 data_air11T <- data_air11[which(data_air11$Treatment=="Tray"),] data_air11T data_air11T11 <- data_air11T[which(data_air11T$pH=="11"),] data_air11T11 data_air11C <- data_air11[which(data_air11$Treatment=="Column"),] data_air11C9 <- data_air11C[which(data_air11C$pH=="9"),] data_air11C9 data_air11C11 <- data_air11C[which(data_air11C$pH=="11"),] data_air11C11 # equal variance check bartlett.test(data_turb_air~Treatment,data_air11) # equal variance ## ## Bartlett test of homogeneity of variances ## 136 ## data: data_turb_air by Treatment ## Bartlett's K-squared = 6.1248, df = 1, p-value = 0.01333 bartlett.test(TN~Treatment,data_air11) # equal variance ## ## Bartlett test of homogeneity of variances ## ## data: TN by Treatment ## Bartlett's K-squared = 3.592, df = 1, p-value = 0.05806 bartlett.test(data_NH3_air~Treatment,data_air11) # not equal ## ## Bartlett test of homogeneity of variances ## ## data: data_NH3_air by Treatment ## Bartlett's K-squared = 17.355, df = 1, p-value = 3.101e-05 bartlett.test(data_turb_air~pH,data_air11) # equal variance ## ## Bartlett test of homogeneity of variances ## ## data: data_turb_air by pH ## Bartlett's K-squared = 0.21957, df = 1, p-value = 0.6394 bartlett.test(TN~pH,data_air11) # equal variance ## ## Bartlett test of homogeneity of variances ## ## data: TN by pH ## Bartlett's K-squared = 0.65096, df = 1, p-value = 0.4198 bartlett.test(data_NH3_air~pH,data_air11) # equal ## ## Bartlett test of homogeneity of variances ## ## data: data_NH3_air by pH ## Bartlett's K-squared = 0.23945, df = 1, p-value = 0.6246 ## 5. Multiple Welch's and unpaired student t-tests ----- # Tray v column @ pH 9 t.test(data_air11T9$sqrt_turb,data_air11C9$sqrt_turb,var.equal = TRUE) #signi ficant (tray has lower mean) ## ## Two Sample t-test ## ## data: data_air11T9$sqrt_turb and data_air11C9$sqrt_turb 137 ## t = -9.8431, df = 6, p-value = 6.338e-05 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -5.518615 -3.321137 ## sample estimates: ## mean of x mean of y ## 4.492765 8.912641 t.test(data_air11T9$sqrt_NH3,data_air11C9$sqrt_NH3,var.equal = FALSE) # not s ignificant ## ## Welch Two Sample t-test ## ## data: data_air11T9$sqrt_NH3 and data_air11C9$sqrt_NH3 ## t = -4.0952, df = 4.8398, p-value = 0.01006 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -7.395877 -1.656600 ## sample estimates: ## mean of x mean of y ## 3.430820 7.957058 t.test(data_air11T9$TN,data_air11C9$TN,var.equal = TRUE) # significant ## ## Two Sample t-test ## ## data: data_air11T9$TN and data_air11C9$TN ## t = 6.5067, df = 6, p-value = 0.0006278 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## 54.96896 121.23104 ## sample estimates: ## mean of x mean of y ## 466.4 378.3 # Tray v column @ pH 11 t.test(data_air11T11$sqrt_turb,data_air11C11$sqrt_turb,var.equal = TRUE) #sig nificant (tray has lower mean) ## ## Two Sample t-test ## ## data: data_air11T11$sqrt_turb and data_air11C11$sqrt_turb ## t = -4.8691, df = 6, p-value = 0.002797 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -7.347399 -2.432612 ## sample estimates: 138 ## mean of x mean of y ## 3.622046 8.512052 t.test(data_air11T11$sqrt_NH3,data_air11C11$sqrt_NH3,var.equal = FALSE) # hig hly significant ## ## Welch Two Sample t-test ## ## data: data_air11T11$sqrt_NH3 and data_air11C11$sqrt_NH3 ## t = 22.744, df = 5.9544, p-value = 5.14e-07 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## 5.669078 7.038775 ## sample estimates: ## mean of x mean of y ## 14.979075 8.625148 t.test(data_air11T11$TN,data_air11C11$TN,var.equal = TRUE) # significant ## ## Two Sample t-test ## ## data: data_air11T11$TN and data_air11C11$TN ## t = -4.1902, df = 6, p-value = 0.005748 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -176.96835 -46.48165 ## sample estimates: ## mean of x mean of y ## 120.425 232.150 #pH 9 v pH 11 for tray t.test(data_air11T9$sqrt_turb,data_air11T11$sqrt_turb,var.equal = TRUE) #sign ificant ## ## Two Sample t-test ## ## data: data_air11T9$sqrt_turb and data_air11T11$sqrt_turb ## t = 5.6662, df = 6, p-value = 0.0013 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## 0.4947037 1.2467338 ## sample estimates: ## mean of x mean of y ## 4.492765 3.622046 t.test(data_air11T9$sqrt_NH3,data_air11T11$sqrt_NH3,var.equal = FALSE) # high ly significant 139 ## ## Welch Two Sample t-test ## ## data: data_air11T9$sqrt_NH3 and data_air11T11$sqrt_NH3 ## t = -11.834, df = 3.2793, p-value = 0.0008407 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -14.509433 -8.587078 ## sample estimates: ## mean of x mean of y ## 3.43082 14.97908 t.test(data_air11T9$TN,data_air11T11$TN,var.equal = TRUE) # highly significan t ## ## Two Sample t-test ## ## data: data_air11T9$TN and data_air11T11$TN ## t = 25.26, df = 6, p-value = 2.536e-07 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## 312.4601 379.4899 ## sample estimates: ## mean of x mean of y ## 466.400 120.425 # pH 9 v pH 11 for column t.test(data_air11C11$sqrt_turb,data_air11C9$sqrt_turb,var.equal = TRUE) # not significant ## ## Two Sample t-test ## ## data: data_air11C11$sqrt_turb and data_air11C9$sqrt_turb ## t = -0.36775, df = 6, p-value = 0.7257 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -3.06604 2.26486 ## sample estimates: ## mean of x mean of y ## 8.512052 8.912641 t.test(data_air11C11$sqrt_NH3,data_air11C9$sqrt_NH3,var.equal = FALSE) # not significant ## ## Welch Two Sample t-test ## ## data: data_air11C11$sqrt_NH3 and data_air11C9$sqrt_NH3 ## t = 1.1336, df = 3.6765, p-value = 0.3254 140 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -1.026629 2.362810 ## sample estimates: ## mean of x mean of y ## 8.625148 7.957058 t.test(data_air11C11$TN,data_air11C9$TN,var.equal = TRUE) # significant ## ## Two Sample t-test ## ## data: data_air11C11$TN and data_air11C9$TN ## t = -5.4978, df = 6, p-value = 0.001518 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -211.19702 -81.10298 ## sample estimates: ## mean of x mean of y ## 232.15 378.30 ## 6. Plots -------- # TN plot box_air_TN <- ggplot(datasummaryTN, aes(x=Treatment, y=mean, fill = pH )) + g eom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Treatment")+ ylab("TN (mg/L)") + labs(fill ="pH") + ylim(0, 500) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 15, family="A"), legend.title= element_text(size = 15, family="A")) #box_air_TN #NH3 box_air_NH3 <- ggplot(datasummaryNH3, aes(x=Treatment, y=mean, fill = pH )) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Treatment")+ ylab("NH3 (mg/L)") + labs(fill ="pH") + ylim(0, 500) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), 141 axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 15, family="A"), legend.title= element_text(size = 15, family="A")) #box_air_NH3 #Turbidity box_air_Turbidity <- ggplot(datasummaryTurbidity, aes(x=Treatment, y=mean, fi ll = pH )) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Treatment")+ ylab("Turbidity (NTU)") + labs(fill ="pH") + ylim(0, 112) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 15, family="A"), legend.title= element_text(size = 15, family="A")) #box_air_Turbidity ## End of code ----- ## Gus Aburto, February 23, 1223 ## Statistical analysis comparing different amounts of calcium hydroxide for the tray aeration setup ## 1. loading libraries------------ library (MASS) library(ggplot2) ## Warning: package 'ggplot2' was built under R version 4.1.3 library(grid) library(gridExtra) ## Warning: package 'gridExtra' was built under R version 4.1.3 library(ggpubr) ## Warning: package 'ggpubr' was built under R version 4.1.3 library(plyr) ## Warning: package 'plyr' was built under R version 4.1.3 142 ## ## Attaching package: 'plyr' ## The following object is masked from 'package:ggpubr': ## ## mutate library(inferr) ## Warning: package 'inferr' was built under R version 4.1.3 library(extrafont) ## Warning: package 'extrafont' was built under R version 4.1.3 ## Registering fonts with R library(car) ## Warning: package 'car' was built under R version 4.1.3 ## Loading required package: carData ## Warning: package 'carData' was built under R version 4.1.3 library(dplyr) ## Warning: package 'dplyr' was built under R version 4.1.3 ## ## Attaching package: 'dplyr' ## The following object is masked from 'package:car': ## ## recode ## The following objects are masked from 'package:plyr': ## ## arrange, count, desc, failwith, id, mutate, rename, summarise, ## summarize ## The following object is masked from 'package:gridExtra': ## ## combine ## The following object is masked from 'package:MASS': ## ## select ## The following objects are masked from 'package:stats': ## ## filter, lag 143 ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(conover.test) windowsFonts(A = windowsFont("Times New Roman")) ## 2. Loading data------- con3 <- file.choose(new = FALSE) #The file should be in the AerationAndOzoneM etaData folder (meta_data_aeration_calcium) metadata_tray <- read.table(con3, header = T, row.names = NULL) metadata_tray$Ca_dose <- factor(metadata_tray$Ca_dose) ## 3. Data summary---------- data_tray1 <- metadata_tray[which(metadata_tray$Ca_dose=="1.8"),] data_tray2 <- metadata_tray[which(metadata_tray$Ca_dose=="0.9"),] # COD datasummary_tray_COD<-metadata_tray %>% group_by(Ca_dose) %>% dplyr::summarize(mean=mean(COD), sd = sd(COD),) datasummary_tray_COD ## # A tibble: 2 x 3 ## Ca_dose mean sd ## ## 1 0.9 545. 15.4 ## 2 1.8 553. 44.8 # pH datasummary_tray_pH<-metadata_tray %>% group_by(Ca_dose) %>% summarize(mean=mean(pH, na.rm=TRUE), sd = sd(pH,na.rm=TRUE),) datasummary_tray_pH ## # A tibble: 2 x 3 ## Ca_dose mean sd ## ## 1 0.9 10.8 0.0471 ## 2 1.8 11.0 0.0147 # TP datasummary_tray_TP<-metadata_tray %>% group_by(Ca_dose) %>% summarize(mean=mean(TP), 144 sd = sd(TP),) datasummary_tray_TP ## # A tibble: 2 x 3 ## Ca_dose mean sd ## ## 1 0.9 0.752 0.150 ## 2 1.8 0.481 0.0432 # Turbidity datasummary_tray_Turbidity<-metadata_tray %>% group_by(Ca_dose) %>% summarize(mean=mean(Turbidity), sd = sd(Turbidity),) datasummary_tray_Turbidity ## # A tibble: 2 x 3 ## Ca_dose mean sd ## ## 1 0.9 26.7 6.60 ## 2 1.8 14.2 2.54 # TN datasummary_tray_TN<-metadata_tray %>% group_by(Ca_dose) %>% summarize(mean=mean(TN), sd = sd(TN),) datasummary_tray_TN ## # A tibble: 2 x 3 ## Ca_dose mean sd ## ## 1 0.9 198. 62.7 ## 2 1.8 167. 56.4 # NH3 datasummary_tray_NH3<-metadata_tray %>% group_by(Ca_dose) %>% summarize(mean=mean(NH3), sd = sd(NH3),) datasummary_tray_NH3 ## # A tibble: 2 x 3 ## Ca_dose mean sd ## ## 1 0.9 208. 42.8 ## 2 1.8 86.5 44.6 ## 4. Checking for normality and equal variance -------- shapiro.test(metadata_tray$COD) # not normal 145 ## ## Shapiro-Wilk normality test ## ## data: metadata_tray$COD ## W = 0.77955, p-value = 0.000139 shapiro.test(metadata_tray$pH) # normal ## ## Shapiro-Wilk normality test ## ## data: metadata_tray$pH ## W = 0.86073, p-value = 0.04992 shapiro.test(metadata_tray$TN) # normal ## ## Shapiro-Wilk normality test ## ## data: metadata_tray$TN ## W = 0.88883, p-value = 0.01257 shapiro.test(metadata_tray$Turbidity) # normal ## ## Shapiro-Wilk normality test ## ## data: metadata_tray$Turbidity ## W = 0.89313, p-value = 0.01544 shapiro.test(metadata_tray$NH3) # normal ## ## Shapiro-Wilk normality test ## ## data: metadata_tray$NH3 ## W = 0.91632, p-value = 0.04846 shapiro.test(metadata_tray$TP) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_tray$TP ## W = 0.8652, p-value = 0.004243 # bartlett.test(metadata_tray$pH,metadata_tray$Ca_dose) # equal ## ## Bartlett test of homogeneity of variances ## 146 ## data: metadata_tray$pH and metadata_tray$Ca_dose ## Bartlett's K-squared = 5.1165, df = 1, p-value = 0.0237 bartlett.test(metadata_tray$Turbidity,metadata_tray$Ca_dose) # not equal ## ## Bartlett test of homogeneity of variances ## ## data: metadata_tray$Turbidity and metadata_tray$Ca_dose ## Bartlett's K-squared = 8.4342, df = 1, p-value = 0.003682 bartlett.test(metadata_tray$TN,metadata_tray$Ca_dose) # not equal ## ## Bartlett test of homogeneity of variances ## ## data: metadata_tray$TN and metadata_tray$Ca_dose ## Bartlett's K-squared = 0.11841, df = 1, p-value = 0.7308 bartlett.test(metadata_tray$NH3,metadata_tray$Ca_dose) # equal ## ## Bartlett test of homogeneity of variances ## ## data: metadata_tray$NH3 and metadata_tray$Ca_dose ## Bartlett's K-squared = 0.01698, df = 1, p-value = 0.8963 ## 5. t-test and nonparametric tests Mann-Whitney tests----------- #Chose the Mann-Whitney test which is the nonparametric equivalent to the t-t est. t.test(data_tray1$pH,data_tray2$pH,var.equal=TRUE) # significant ## ## Two Sample t-test ## ## data: data_tray1$pH and data_tray2$pH ## t = 9.4347, df = 10, p-value = 2.702e-06 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## 0.1451288 0.2348712 ## sample estimates: ## mean of x mean of y ## 11.02833 10.83833 wilcox.test(data_tray1$COD,data_tray2$COD,exact=FALSE) # not sig ## ## Wilcoxon rank sum test with continuity correction ## ## data: data_tray1$COD and data_tray2$COD ## W = 68, p-value = 0.8397 ## alternative hypothesis: true location shift is not equal to 0 147 t.test(data_tray1$TN,data_tray2$TN,var.equal=FALSE) # not sig ## ## Welch Two Sample t-test ## ## data: data_tray1$TN and data_tray2$TN ## t = -1.267, df = 21.757, p-value = 0.2186 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -81.38107 19.68107 ## sample estimates: ## mean of x mean of y ## 166.725 197.575 wilcox.test(data_tray1$TP,data_tray2$TP,exact = FALSE) # significant ## ## Wilcoxon rank sum test with continuity correction ## ## data: data_tray1$TP and data_tray2$TP ## W = 0, p-value = 3.56e-05 ## alternative hypothesis: true location shift is not equal to 0 t.test(data_tray1$Turbidity,data_tray2$Turbidity,var.equal = FALSE) # signifi cant ## ## Welch Two Sample t-test ## ## data: data_tray1$Turbidity and data_tray2$Turbidity ## t = -6.1541, df = 14.181, p-value = 2.364e-05 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -16.941078 -8.192256 ## sample estimates: ## mean of x mean of y ## 14.15000 26.71667 t.test(data_tray1$NH3,data_tray2$NH3,var.equal = TRUE) #significant ## ## Two Sample t-test ## ## data: data_tray1$NH3 and data_tray2$NH3 ## t = -6.8069, df = 22, p-value = 7.719e-07 ## alternative hypothesis: true difference in means is not equal to 0 ## 95 percent confidence interval: ## -158.51116 -84.47884 ## sample estimates: ## mean of x mean of y ## 86.475 207.970 148 ## 6. Bar chart plots--------- # pH box_tray_pH <- ggplot(datasummary_tray_pH, aes(x=Ca_dose, y=mean, fill = Ca_d ose )) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Ca(OH)2 dose (g/L)")+ ylab("pH") + labs(fill ="Ca_dose") + ylim(0, 12) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 15, family="A"), legend.title= element_text(size = 15, family="A")) #box_tray_pH + theme(legend.position = "none") # TN box_tray_TN <- ggplot(datasummary_tray_TN, aes(x=Ca_dose, y=mean, fill = Ca_d ose )) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Ca(OH)2 dose (g/L)")+ ylab("TN (mg/L)") + labs(fill ="Ca_dose") + ylim(0, 300) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 15, family="A"), legend.title= element_text(size = 15, family="A")) #box_tray_TN + theme(legend.position = "none") # NH3 box_tray_NH3 <- ggplot(datasummary_tray_NH3, aes(x=Ca_dose, y=mean, fill = Ca _dose )) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Ca(OH)2 dose (g/L)")+ ylab("NH3 (mg/L)") + labs(fill ="Ca_dose") + ylim(0, 300) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 15, family="A"), 149 legend.title= element_text(size = 15, family="A")) #box_tray_NH3 + theme(legend.position = "none") # Turbidity box_tray_Turbidity <- ggplot(datasummary_tray_Turbidity, aes(x=Ca_dose, y=mea n, fill = Ca_dose )) + geom_bar(stat="identity", position=position_dodge(0.9) )+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Ca(OH)2 dose (g/L)")+ ylab("Turbidity (NTU)") + labs(fill ="Ca_dose") + ylim(0, 50) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 15, family="A"), legend.title= element_text(size = 15, family="A")) #box_tray_Turbidity + theme(legend.position = "none") # COD box_tray_COD <- ggplot(datasummary_tray_COD, aes(x=Ca_dose, y=mean, fill = Ca _dose )) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Ca(OH)2 dose (g/L)")+ ylab("COD (mg/L)") + labs(fill ="Ca_dose") + ylim(0, 700) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 15, family="A"), legend.title= element_text(size = 15, family="A")) #box_tray_COD + theme(legend.position = "none") # TP box_tray_TP <- ggplot(datasummary_tray_TP, aes(x=Ca_dose, y=mean, fill = Ca_d ose )) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Ca(OH)2 dose (g/L)")+ ylab("TP (mg/L)") + labs(fill ="Ca_dose") + ylim(0, 1.5) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), 150 axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 15, family="A"), legend.title= element_text(size = 15, family="A")) #box_tray_TP + theme(legend.position = "none") ## End of code ## Statistical analysis -- EC runs with pulse-width modulation ## Wei Liao, August 01, 1222 ## Gus Aburto, August 02, 1222 ## Gus Aburto, August 08, 1222 ## Gus Aburto, August 10, 1222 ## Gus Aburto, August 16, 1222 ## Gus Aburto, August 10, 1222 ## Gus Aburto, September 19, 1222 ## Wei Liao, October 10, 1222 ## Gus Aburto, October 31, 1222 ## Gus Aburto, November 1, 1222 # Loading Library and Tables ---------------------------------------------- library (MASS) library(ggplot2) ## Warning: package 'ggplot2' was built under R version 4.1.3 library(grid) library(gridExtra) ## Warning: package 'gridExtra' was built under R version 4.1.3 library(ggpubr) ## Warning: package 'ggpubr' was built under R version 4.1.3 library(plyr) ## Warning: package 'plyr' was built under R version 4.1.3 ## ## Attaching package: 'plyr' ## The following object is masked from 'package:ggpubr': ## ## mutate library(inferr) ## Warning: package 'inferr' was built under R version 4.1.3 library(extrafont) 151 ## Warning: package 'extrafont' was built under R version 4.1.3 ## Registering fonts with R library(car) ## Warning: package 'car' was built under R version 4.1.3 ## Loading required package: carData ## Warning: package 'carData' was built under R version 4.1.3 library(plotly) ## Warning: package 'plotly' was built under R version 4.1.3 ## ## Attaching package: 'plotly' ## The following objects are masked from 'package:plyr': ## ## arrange, mutate, rename, summarise ## The following object is masked from 'package:ggplot2': ## ## last_plot ## The following object is masked from 'package:MASS': ## ## select ## The following object is masked from 'package:stats': ## ## filter ## The following object is masked from 'package:graphics': ## ## layout library(moments) ## Warning: package 'moments' was built under R version 4.1.3 windowsFonts(A = windowsFont("Times New Roman")) ## the .txt file needs to be saved as the type of "Tab delimited". ## choose the Meta_data table should be .txt con <- file.choose(new = FALSE) metadata_cycle <- read.table(con, header = T, row.names = NULL) 152 metadata_cycle$Voltage <- factor(metadata_cycle$Voltage) ##Factor Statement metadata_cycle$Duty_cycle <- factor(metadata_cycle$Duty_cycle) ##Factor State ment metadata_cycle$Frequency <- factor(metadata_cycle$Frequency) ## factor statem ent ## Normality and distribution skewness ----------- # Distributions of variables ggdensity(metadata_cycle, x = "COD", fill = "lightgray", title = "COD") + scale_x_continuous(limits = c(100, 700)) + stat_overlay_normal_density(color = "red", linetype = "dashed") ## Warning: Removed 62 row(s) containing missing values (geom_path). skewness(metadata_cycle$COD) # negative skew ## [1] -0.8863847 ggdensity(metadata_cycle, x = "Turbidity", fill = "lightgray", title = "Turbi dity") + scale_x_continuous(limits = c(0, 300)) + stat_overlay_normal_density(color = "red", linetype = "dashed") ## Warning: Removed 2 rows containing non-finite values (stat_density). ## Warning: Removed 2 rows containing non-finite values ## (stat_overlay_normal_density). ## Warning: Removed 146 row(s) containing missing values (geom_path). ggdensity(metadata_cycle, x = "NH3", fill = "lightgray", title = "NH3") + scale_x_continuous(limits = c(100, 400)) + stat_overlay_normal_density(color = "red", linetype = "dashed") ## Warning: Removed 41 row(s) containing missing values (geom_path). skewness(metadata_cycle$Turbidity) ## [1] 1.897373 153 data_turb <- log10(metadata_cycle$Turbidity) shapiro.test(data_turb) ## ## Shapiro-Wilk normality test ## ## data: data_turb ## W = 0.95053, p-value = 0.05758 shapiro.test(metadata_cycle$COD) # COD data are not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_cycle$COD ## W = 0.87492, p-value = 0.000201 skewness(metadata_cycle$COD) ## [1] -0.8863847 data_COD <- sqrt(max(metadata_cycle$COD+1)-metadata_cycle$COD) shapiro.test(data_COD) ## ## Shapiro-Wilk normality test ## ## data: data_COD ## W = 0.95594, p-value = 0.09167 ggdensity(metadata_cycle, x = "TP", fill = "lightgray", title = "TP") + scale_x_continuous(limits = c(0, 5)) + stat_overlay_normal_density(color = "red", linetype = "dashed") ## Warning: Removed 9 rows containing non-finite values (stat_density). ## Warning: Removed 9 rows containing non-finite values ## (stat_overlay_normal_density). ## Warning: Removed 135 row(s) containing missing values (geom_path). shapiro.test(metadata_cycle$TP) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_cycle$TP ## W = 0.82155, p-value = 8.901e-06 skewness(metadata_cycle$TP) 154 ## [1] 1.189815 data_TP <- log(metadata_cycle$TP) shapiro.test(data_TP) ## ## Shapiro-Wilk normality test ## ## data: data_TP ## W = 0.9343, p-value = 0.01478 shapiro.test(metadata_cycle$NH3) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_cycle$NH3 ## W = 0.90421, p-value = 0.00147 skewness(metadata_cycle$NH3) ## [1] 0.5374867 data_NH3 <- log10(metadata_cycle$NH3) shapiro.test(data_NH3) ## ## Shapiro-Wilk normality test ## ## data: data_NH3 ## W = 0.9229, p-value = 0.005957 shapiro.test(metadata_cycle$TN) #not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_cycle$TN ## W = 0.92405, p-value = 0.00652 skewness(metadata_cycle$TN) ## [1] 0.8160434 data_TN <- log10(metadata_cycle$TN) shapiro.test(data_TN) ## ## Shapiro-Wilk normality test ## ## data: data_TN ## W = 0.94818, p-value = 0.04708 155 shapiro.test(metadata_cycle$Engergy_consumption) ## ## Shapiro-Wilk normality test ## ## data: metadata_cycle$Engergy_consumption ## W = 0.90274, p-value = 0.001323 skewness(metadata_cycle$Engergy_consumption) ## [1] 1.09252 data_edemand <- log10(metadata_cycle$Engergy_consumption) shapiro.test(data_edemand) ## ## Shapiro-Wilk normality test ## ## data: data_edemand ## W = 0.98525, p-value = 0.8379 ## Multiple ANOVA and Tukey multiple comparison tests----------------------- fit1 <- aov(data_edemand~Voltage*Duty_cycle*Frequency, data = metadata_cycle) #for current output. Use of "*" operator signifies a potential synergistic ef fect b summary(fit1) #Provide P-value ## Df Sum Sq Mean Sq F value Pr(>F) ## Voltage 1 1.3968 1.3968 72.160 8.14e-10 *** ## Duty_cycle 2 0.8881 0.4441 22.941 5.69e-07 *** ## Frequency 1 0.1301 0.1301 6.721 0.01409 * ## Voltage:Duty_cycle 2 0.2311 0.1156 5.970 0.00612 ** ## Voltage:Frequency 1 0.2392 0.2392 12.360 0.00130 ** ## Duty_cycle:Frequency 2 0.0010 0.0005 0.025 0.97529 ## Voltage:Duty_cycle:Frequency 1 0.0676 0.0676 3.492 0.07056 . ## Residuals 33 0.6388 0.0194 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 plot(fit1,which =3) # not equal variance shapiro.test(fit1$residuals) # equal variance ## ## Shapiro-Wilk normality test ## ## data: fit1$residuals ## W = 0.88465, p-value = 0.0003796 bartlett.test(data_edemand~Voltage,data=metadata_cycle) 156 ## ## Bartlett test of homogeneity of variances ## ## data: data_edemand by Voltage ## Bartlett's K-squared = 0.1181, df = 1, p-value = 0.7311 bartlett.test(data_edemand~Duty_cycle,data=metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_edemand by Duty_cycle ## Bartlett's K-squared = 6.284, df = 2, p-value = 0.0432 bartlett.test(data_edemand~Frequency,data=metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_edemand by Frequency ## Bartlett's K-squared = 4.1756, df = 1, p-value = 0.04101 Tukey1 <- TukeyHSD(fit1, conf.level=0.99) #Tukey multiple comparison Tukey1 #Output Tukey results ## Tukey multiple comparisons of means ## 99% family-wise confidence level ## ## Fit: aov(formula = data_edemand ~ Voltage * Duty_cycle * Frequency, data = metadata_cycle) ## ## $Voltage ## diff lwr upr p adj ## 10-6 0.3578207 0.2426871 0.4729543 0 ## ## $Duty_cycle ## diff lwr upr p adj ## 80-50 0.26182213 0.0956680 0.4279763 0.0000664 ## 100-50 0.34773056 0.1815764 0.5138847 0.0000006 ## 100-80 0.08590843 -0.0679204 0.2397373 0.2034576 ## ## $Frequency ## diff lwr upr p adj ## 200-100 -0.1071392 -0.2222728 0.007994441 0.0158444 ## ## $`Voltage:Duty_cycle` ## diff lwr upr p adj ## 10:50-6:50 0.23092427 -0.08204494 0.54389348 0.1000207 ## 6:80-6:50 0.06582531 -0.24714390 0.37879452 0.9702637 ## 10:80-6:50 0.64644440 0.33347519 0.95941362 0.0000001 ## 6:100-6:50 0.27681945 -0.03614976 0.58978866 0.0292588 157 ## 10:100-6:50 0.60726713 0.29429792 0.92023634 0.0000005 ## 6:80-10:50 -0.16509896 -0.42063725 0.09043933 0.1950357 ## 10:80-10:50 0.41552013 0.15998184 0.67105842 0.0000146 ## 6:100-10:50 0.04589518 -0.20964311 0.30143347 0.9851173 ## 10:100-10:50 0.37634286 0.12080457 0.63188115 0.0000757 ## 10:80-6:80 0.58061909 0.32508080 0.83615738 0.0000000 ## 6:100-6:80 0.21099414 -0.04454415 0.46653243 0.0489038 ## 10:100-6:80 0.54144182 0.28590353 0.79698011 0.0000001 ## 6:100-10:80 -0.36962495 -0.62516324 -0.11408666 0.0001003 ## 10:100-10:80 -0.03917727 -0.29471556 0.21636102 0.9927487 ## 10:100-6:100 0.33044768 0.07490939 0.58598597 0.0005108 ## ## $`Voltage:Frequency` ## diff lwr upr p adj ## 10:100-6:100 0.49802633 0.306813256 0.68923941 0.0000000 ## 6:200-6:100 0.05350797 -0.160274752 0.26729069 0.8337540 ## 10:200-6:100 0.26042143 0.069208356 0.45163451 0.0003483 ## 6:200-10:100 -0.44451836 -0.658301086 -0.23073564 0.0000003 ## 10:200-10:100 -0.23760490 -0.428817978 -0.04639182 0.0010933 ## 10:200-6:200 0.20691347 -0.006869256 0.42069619 0.0131901 ## ## $`Duty_cycle:Frequency` ## diff lwr upr p adj ## 80:100-50:100 0.28469171 0.029153416 0.54023000 0.0032468 ## 100:100-50:100 0.36751586 0.111977568 0.62305415 0.0001095 ## 50:200-50:100 -0.09651728 -0.409486493 0.21645193 0.8641092 ## 80:200-50:100 0.17460769 -0.080930597 0.43014599 0.1503971 ## 100:200-50:100 0.26360041 0.008062119 0.51913870 0.0073670 ## 100:100-80:100 0.08282415 -0.172714140 0.33836244 0.8381052 ## 50:200-80:100 -0.38120899 -0.694178200 -0.06823978 0.0011201 ## 80:200-80:100 -0.11008401 -0.365622304 0.14545428 0.6153112 ## 100:200-80:100 -0.02109130 -0.276629588 0.23444699 0.9996225 ## 50:200-100:100 -0.46403314 -0.777002351 -0.15106393 0.0000680 ## 80:200-100:100 -0.19290816 -0.448446455 0.06263013 0.0875121 ## 100:200-100:100 -0.10391545 -0.359453739 0.15162284 0.6704248 ## 80:200-50:200 0.27112498 -0.041844236 0.58409419 0.0343900 ## 100:200-50:200 0.36011769 0.047148480 0.67308690 0.0022410 ## 100:200-80:200 0.08899272 -0.166545575 0.34453101 0.7938887 ## ## $`Voltage:Duty_cycle:Frequency` ## diff lwr upr p adj ## 10:50:100-6:50:100 0.30538115 -0.102962221 0.71372452 0.1241414 ## 6:80:100-6:50:100 -0.06367028 -0.472013653 0.34467308 0.9999408 ## 10:80:100-6:50:100 0.77633352 0.367990150 1.18467689 0.0000003 ## 6:100:100-6:50:100 0.23615949 -0.172183875 0.64450286 0.4330706 ## 10:100:100-6:50:100 0.64215204 0.233808675 1.05049541 0.0000121 ## 6:50:200-6:50:100 NA NA NA NA ## 10:50:200-6:50:100 0.07298231 -0.335361055 0.48132568 0.9997768 ## 6:80:200-6:50:100 0.12575001 -0.282593359 0.53409338 0.9764027 ## 10:80:200-6:50:100 0.47481275 0.066469382 0.88315612 0.0015773 158 ## 6:100:200-6:50:100 0.24790851 -0.160434859 0.65625188 0.3629554 ## 10:100:200-6:50:100 0.53063968 0.122296314 0.93898305 0.0003148 ## 6:80:100-10:50:100 -0.36905143 -0.777394800 0.03929194 0.0279079 ## 10:80:100-10:50:100 0.47095237 0.062609003 0.87929574 0.0017606 ## 6:100:100-10:50:100 -0.06922165 -0.477565022 0.33912171 0.9998658 ## 10:100:100-10:50:100 0.33677090 -0.071572472 0.74511426 0.0613961 ## 6:50:200-10:50:100 NA NA NA NA ## 10:50:200-10:50:100 -0.23239883 -0.640742202 0.17594453 0.4566619 ## 6:80:200-10:50:100 -0.17963114 -0.587974506 0.22871223 0.7927462 ## 10:80:200-10:50:100 0.16943160 -0.238911765 0.57777497 0.8453574 ## 6:100:200-10:50:100 -0.05747264 -0.465816005 0.35087073 0.9999787 ## 10:100:200-10:50:100 0.22525853 -0.183084833 0.63360190 0.5026220 ## 10:80:100-6:80:100 0.84000380 0.431660435 1.24834717 0.0000000 ## 6:100:100-6:80:100 0.29982978 -0.108513590 0.70817315 0.1395324 ## 10:100:100-6:80:100 0.70582233 0.297478960 1.11416570 0.0000019 ## 6:50:200-6:80:100 NA NA NA NA ## 10:50:200-6:80:100 0.13665260 -0.271690770 0.54499597 0.9576633 ## 6:80:200-6:80:100 0.18942029 -0.218923074 0.59776366 0.7358986 ## 10:80:200-6:80:100 0.53848304 0.130139667 0.94682640 0.0002505 ## 6:100:200-6:80:100 0.31157879 -0.096764574 0.71992216 0.1086419 ## 10:100:200-6:80:100 0.59430997 0.185966598 1.00265333 0.0000489 ## 6:100:100-10:80:100 -0.54017403 -0.948517393 -0.13183066 0.0002384 ## 10:100:100-10:80:100 -0.13418148 -0.542524843 0.27416189 0.9626228 ## 6:50:200-10:80:100 NA NA NA NA ## 10:50:200-10:80:100 -0.70335121 -1.111694574 -0.29500784 0.0000021 ## 6:80:200-10:80:100 -0.65058351 -1.058926878 -0.24224014 0.0000094 ## 10:80:200-10:80:100 -0.30152077 -0.709864136 0.10682260 0.1346879 ## 6:100:200-10:80:100 -0.52842501 -0.936768377 -0.12008164 0.0003358 ## 10:100:200-10:80:100 -0.24569384 -0.654037205 0.16264953 0.3757071 ## 10:100:100-6:100:100 0.40599255 -0.002350818 0.81433592 0.0106511 ## 6:50:200-6:100:100 NA NA NA NA ## 10:50:200-6:100:100 -0.16317718 -0.571520548 0.24516619 0.8736905 ## 6:80:200-6:100:100 -0.11040948 -0.518752852 0.29793388 0.9912760 ## 10:80:200-6:100:100 0.23865326 -0.169690111 0.64699663 0.4177070 ## 6:100:200-6:100:100 0.01174902 -0.396594352 0.42009238 1.0000000 ## 10:100:200-6:100:100 0.29448019 -0.113863180 0.70282356 0.1557915 ## 6:50:200-10:100:100 NA NA NA NA ## 10:50:200-10:100:100 -0.56916973 -0.977513099 -0.16082636 0.0001021 ## 6:80:200-10:100:100 -0.51640203 -0.924745403 -0.10805867 0.0004763 ## 10:80:200-10:100:100 -0.16733929 -0.575682661 0.24100408 0.8551859 ## 6:100:200-10:100:100 -0.39424353 -0.802586902 0.01409983 0.0145556 ## 10:100:200-10:100:100 -0.11151236 -0.519855730 0.29683101 0.9905569 ## 10:50:200-6:50:200 NA NA NA NA ## 6:80:200-6:50:200 NA NA NA NA ## 10:80:200-6:50:200 NA NA NA NA ## 6:100:200-6:50:200 NA NA NA NA ## 10:100:200-6:50:200 NA NA NA NA ## 6:80:200-10:50:200 0.05276770 -0.355575672 0.46111106 0.9999910 ## 10:80:200-10:50:200 0.40183044 -0.006512931 0.81017381 0.0119040 ## 6:100:200-10:50:200 0.17492620 -0.233417172 0.58326956 0.8179460 159 ## 10:100:200-10:50:200 0.45765737 0.049314001 0.86600074 0.0025655 ## 10:80:200-6:80:200 0.34906274 -0.059280627 0.75740611 0.0457850 ## 6:100:200-6:80:200 0.12215850 -0.286184868 0.53050187 0.9809393 ## 10:100:200-6:80:200 0.40488967 -0.003453695 0.81323304 0.0109703 ## 6:100:200-10:80:200 -0.22690424 -0.635247609 0.18143913 0.4919135 ## 10:100:200-10:80:200 0.05582693 -0.352516437 0.46417030 0.9999841 ## 10:100:200-6:100:200 0.28273117 -0.125612196 0.69107454 0.1967349 fit3 <- aov(data_turb~Voltage*Duty_cycle*Frequency, data = metadata_cycle) #f or turbidity summary(fit3) #Provide P-value ## Df Sum Sq Mean Sq F value Pr(>F) ## Voltage 1 0.8070 0.8070 66.292 2.13e-09 *** ## Duty_cycle 2 2.4160 1.2080 99.229 1.10e-14 *** ## Frequency 1 0.0675 0.0675 5.543 0.02466 * ## Voltage:Duty_cycle 2 0.1753 0.0877 7.202 0.00254 ** ## Voltage:Frequency 1 0.0004 0.0004 0.034 0.85483 ## Duty_cycle:Frequency 2 0.3081 0.1540 12.654 8.34e-05 *** ## Voltage:Duty_cycle:Frequency 1 0.0357 0.0357 2.936 0.09601 . ## Residuals 33 0.4017 0.0122 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 shapiro.test(fit3$residuals) ## ## Shapiro-Wilk normality test ## ## data: fit3$residuals ## W = 0.96305, p-value = 0.169 plot(fit3,which=3) bartlett.test(data_turb~Voltage,metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_turb by Voltage ## Bartlett's K-squared = 1.6161, df = 1, p-value = 0.2036 bartlett.test(data_turb~Duty_cycle,metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_turb by Duty_cycle ## Bartlett's K-squared = 5.5114, df = 2, p-value = 0.06356 160 bartlett.test(data_turb~Frequency,metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_turb by Frequency ## Bartlett's K-squared = 4.1555, df = 1, p-value = 0.0415 Tukey3 <- TukeyHSD(fit3, conf.level=0.95,na.rm=TRUE) #Tukey multiple comparis on Tukey3 #Output Tukey results ## Tukey multiple comparisons of means ## 95% family-wise confidence level ## ## Fit: aov(formula = data_turb ~ Voltage * Duty_cycle * Frequency, data = me tadata_cycle) ## ## $Voltage ## diff lwr upr p adj ## 10-6 -0.2719895 -0.3399543 -0.2040247 0 ## ## $Duty_cycle ## diff lwr upr p adj ## 80-50 -0.3128800 -0.4162712 -0.2094888 0e+00 ## 100-50 -0.5879444 -0.6913357 -0.4845532 0e+00 ## 100-80 -0.2750644 -0.3707861 -0.1793427 1e-07 ## ## $Frequency ## diff lwr upr p adj ## 200-100 -0.07716172 -0.1451265 -0.009196954 0.0272948 ## ## $`Voltage:Duty_cycle` ## diff lwr upr p adj ## 10:50-6:50 -0.41268886 -0.61697888 -0.208398827 0.0000099 ## 6:80-6:50 -0.32029008 -0.52458011 -0.116000049 0.0005255 ## 10:80-6:50 -0.76505855 -0.96934858 -0.560768519 0.0000000 ## 6:100-6:50 -0.73314014 -0.93743017 -0.528850115 0.0000000 ## 10:100-6:50 -0.90233735 -1.10662738 -0.698047323 0.0000000 ## 6:80-10:50 0.09239878 -0.07440333 0.259200887 0.5572056 ## 10:80-10:50 -0.35236969 -0.51917180 -0.185567583 0.0000044 ## 6:100-10:50 -0.32045129 -0.48725340 -0.153649179 0.0000237 ## 10:100-10:50 -0.48964850 -0.65645061 -0.322846386 0.0000000 ## 10:80-6:80 -0.44476847 -0.61157058 -0.277966360 0.0000000 ## 6:100-6:80 -0.41285007 -0.57965218 -0.246047957 0.0000002 ## 10:100-6:80 -0.58204727 -0.74884938 -0.415245164 0.0000000 ## 6:100-10:80 0.03191840 -0.13488371 0.198720513 0.9917921 ## 10:100-10:80 -0.13727880 -0.30408091 0.029523306 0.1568827 ## 10:100-6:100 -0.16919721 -0.33599932 -0.002395098 0.0451992 ## 161 ## $`Voltage:Frequency` ## diff lwr upr p adj ## 10:100-6:100 -0.25671523 -0.37855817 -0.13487229 0.0000135 ## 6:200-6:100 -0.06859094 -0.20481549 0.06763361 0.5313826 ## 10:200-6:100 -0.34213651 -0.46397945 -0.22029358 0.0000001 ## 6:200-10:100 0.18812429 0.05189974 0.32434884 0.0037671 ## 10:200-10:100 -0.08542129 -0.20726423 0.03642165 0.2491345 ## 10:200-6:200 -0.27354558 -0.40977012 -0.13732103 0.0000296 ## ## $`Duty_cycle:Frequency` ## diff lwr upr p adj ## 80:100-50:100 -0.21886640 -0.38566851 -0.05206429 0.0045694 ## 100:100-50:100 -0.68966683 -0.85646894 -0.52286472 0.0000000 ## 50:200-50:100 -0.12316598 -0.32745601 0.08112404 0.4656738 ## 80:200-50:100 -0.48900424 -0.65580635 -0.32220213 0.0000000 ## 100:200-50:100 -0.56833268 -0.73513479 -0.40153057 0.0000000 ## 100:100-80:100 -0.47080043 -0.63760254 -0.30399832 0.0000000 ## 50:200-80:100 0.09570042 -0.10858961 0.29999044 0.7170862 ## 80:200-80:100 -0.27013784 -0.43693995 -0.10333573 0.0003354 ## 100:200-80:100 -0.34946628 -0.51626839 -0.18266417 0.0000051 ## 50:200-100:100 0.56650085 0.36221082 0.77079088 0.0000000 ## 80:200-100:100 0.20066259 0.03386049 0.36746470 0.0109891 ## 100:200-100:100 0.12133416 -0.04546795 0.28813627 0.2651727 ## 80:200-50:200 -0.36583825 -0.57012828 -0.16154823 0.0000747 ## 100:200-50:200 -0.44516669 -0.64945672 -0.24087666 0.0000025 ## 100:200-80:200 -0.07932844 -0.24613055 0.08747367 0.7042807 ## ## $`Voltage:Duty_cycle:Frequency` ## diff lwr upr p adj ## 10:50:100-6:50:100 -0.39379416 -0.66772567 -0.11986265 0.0008458 ## 6:80:100-6:50:100 -0.25003662 -0.52396813 0.02389489 0.1001800 ## 10:80:100-6:50:100 -0.61714210 -0.89107361 -0.34321058 0.0000002 ## 6:100:100-6:50:100 -0.79178109 -1.06571261 -0.51784958 0.0000000 ## 10:100:100-6:50:100 -1.01699848 -1.29093000 -0.74306697 0.0000000 ## 6:50:200-6:50:100 NA NA NA NA ## 10:50:200-6:50:100 -0.49170957 -0.76564108 -0.21777805 0.0000230 ## 6:80:200-6:50:100 -0.44064855 -0.71458006 -0.16671704 0.0001518 ## 10:80:200-6:50:100 -0.94303801 -1.21696952 -0.66910649 0.0000000 ## 6:100:200-6:50:100 -0.72460421 -0.99853572 -0.45067269 0.0000000 ## 10:100:200-6:50:100 -0.81773923 -1.09167074 -0.54380771 0.0000000 ## 6:80:100-10:50:100 0.14375754 -0.13017397 0.41768905 0.7836212 ## 10:80:100-10:50:100 -0.22334794 -0.49727945 0.05058358 0.2009590 ## 6:100:100-10:50:100 -0.39798693 -0.67191845 -0.12405542 0.0007262 ## 10:100:100-10:50:100 -0.62320433 -0.89713584 -0.34927281 0.0000002 ## 6:50:200-10:50:100 NA NA NA NA ## 10:50:200-10:50:100 -0.09791541 -0.37184692 0.17601611 0.9793724 ## 6:80:200-10:50:100 -0.04685439 -0.32078590 0.22707712 0.9999719 ## 10:80:200-10:50:100 -0.54924385 -0.82317536 -0.27531233 0.0000028 ## 6:100:200-10:50:100 -0.33081005 -0.60474156 -0.05687853 0.0078862 ## 10:100:200-10:50:100 -0.42394507 -0.69787658 -0.15001355 0.0002808 162 ## 10:80:100-6:80:100 -0.36710548 -0.64103699 -0.09317396 0.0022124 ## 6:100:100-6:80:100 -0.54174448 -0.81567599 -0.26781296 0.0000037 ## 10:100:100-6:80:100 -0.76696187 -1.04089338 -0.49303035 0.0000000 ## 6:50:200-6:80:100 NA NA NA NA ## 10:50:200-6:80:100 -0.24167295 -0.51560446 0.03225857 0.1258551 ## 6:80:200-6:80:100 -0.19061193 -0.46454344 0.08331958 0.4073871 ## 10:80:200-6:80:100 -0.69300139 -0.96693290 -0.41906987 0.0000000 ## 6:100:200-6:80:100 -0.47456759 -0.74849910 -0.20063607 0.0000434 ## 10:100:200-6:80:100 -0.56770261 -0.84163412 -0.29377109 0.0000014 ## 6:100:100-10:80:100 -0.17463900 -0.44857051 0.09929252 0.5357964 ## 10:100:100-10:80:100 -0.39985639 -0.67378790 -0.12592487 0.0006783 ## 6:50:200-10:80:100 NA NA NA NA ## 10:50:200-10:80:100 0.12543253 -0.14849898 0.39936404 0.8940759 ## 6:80:200-10:80:100 0.17649355 -0.09743796 0.45042506 0.5203770 ## 10:80:200-10:80:100 -0.32589591 -0.59982742 -0.05196440 0.0093258 ## 6:100:200-10:80:100 -0.10746211 -0.38139362 0.16646940 0.9600242 ## 10:100:200-10:80:100 -0.20059713 -0.47452864 0.07333439 0.3348652 ## 10:100:100-6:100:100 -0.22521739 -0.49914890 0.04871412 0.1920048 ## 6:50:200-6:100:100 NA NA NA NA ## 10:50:200-6:100:100 0.30007153 0.02614001 0.57400304 0.0220049 ## 6:80:200-6:100:100 0.35113255 0.07720103 0.62506406 0.0038953 ## 10:80:200-6:100:100 -0.15125691 -0.42518842 0.12267460 0.7279270 ## 6:100:200-6:100:100 0.06717689 -0.20675463 0.34110840 0.9991031 ## 10:100:200-6:100:100 -0.02595813 -0.29988964 0.24797338 0.9999999 ## 6:50:200-10:100:100 NA NA NA NA ## 10:50:200-10:100:100 0.52528892 0.25135741 0.79922043 0.0000067 ## 6:80:200-10:100:100 0.57634994 0.30241842 0.85028145 0.0000011 ## 10:80:200-10:100:100 0.07396048 -0.19997103 0.34789199 0.9978823 ## 6:100:200-10:100:100 0.29239428 0.01846277 0.56632579 0.0281620 ## 10:100:200-10:100:100 0.19925926 -0.07467225 0.47319077 0.3441388 ## 10:50:200-6:50:200 NA NA NA NA ## 6:80:200-6:50:200 NA NA NA NA ## 10:80:200-6:50:200 NA NA NA NA ## 6:100:200-6:50:200 NA NA NA NA ## 10:100:200-6:50:200 NA NA NA NA ## 6:80:200-10:50:200 0.05106102 -0.22287050 0.32499253 0.9999339 ## 10:80:200-10:50:200 -0.45132844 -0.72525995 -0.17739693 0.0001023 ## 6:100:200-10:50:200 -0.23289464 -0.50682615 0.04103687 0.1583899 ## 10:100:200-10:50:200 -0.32602966 -0.59996117 -0.05209815 0.0092835 ## 10:80:200-6:80:200 -0.50238946 -0.77632097 -0.22845794 0.0000155 ## 6:100:200-6:80:200 -0.28395566 -0.55788717 -0.01002414 0.0367418 ## 10:100:200-6:80:200 -0.37709068 -0.65102219 -0.10315916 0.0015472 ## 6:100:200-10:80:200 0.21843380 -0.05549771 0.49236531 0.2259733 ## 10:100:200-10:80:200 0.12529878 -0.14863273 0.39923029 0.8947248 ## 10:100:200-6:100:200 -0.09313502 -0.36706653 0.18079649 0.9858516 fit4 <- aov(data_COD~Voltage*Duty_cycle*Frequency, data = metadata_cycle) #fo r COD summary(fit4) #Provide P-value 163 ## Df Sum Sq Mean Sq F value Pr(>F) ## Voltage 1 309.14 309.14 213.944 5.58e-16 *** ## Duty_cycle 2 27.44 13.72 9.496 0.000553 *** ## Frequency 1 56.46 56.46 39.075 4.62e-07 *** ## Voltage:Duty_cycle 2 83.48 41.74 28.886 5.61e-08 *** ## Voltage:Frequency 1 9.23 9.23 6.386 0.016476 * ## Duty_cycle:Frequency 2 233.48 116.74 80.792 1.93e-13 *** ## Voltage:Duty_cycle:Frequency 1 83.48 83.48 57.772 9.55e-09 *** ## Residuals 33 47.68 1.44 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 shapiro.test(fit4$residuals) ## ## Shapiro-Wilk normality test ## ## data: fit4$residuals ## W = 0.98527, p-value = 0.8387 plot(fit4,which=3) bartlett.test(data_COD~Voltage,metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_COD by Voltage ## Bartlett's K-squared = 0.6887, df = 1, p-value = 0.4066 bartlett.test(data_COD~Duty_cycle,metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_COD by Duty_cycle ## Bartlett's K-squared = 3.7678, df = 2, p-value = 0.152 bartlett.test(data_COD~Frequency,metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_COD by Frequency ## Bartlett's K-squared = 3.2151, df = 1, p-value = 0.07296 Tukey4 <- TukeyHSD(fit4, conf.level=0.95) #Tukey multiple comparison Tukey4 #Output Tukey results 164 ## Tukey multiple comparisons of means ## 95% family-wise confidence level ## ## Fit: aov(formula = data_COD ~ Voltage * Duty_cycle * Frequency, data = met adata_cycle) ## ## $Voltage ## diff lwr upr p adj ## 10-6 5.323354 4.582903 6.063805 0 ## ## $Duty_cycle ## diff lwr upr p adj ## 80-50 -1.9787999 -3.1052093 -0.85239053 0.0003970 ## 100-50 -1.2223180 -2.3487274 -0.09590863 0.0310943 ## 100-80 0.7564819 -0.2863706 1.79933435 0.1919298 ## ## $Frequency ## diff lwr upr p adj ## 200-100 -2.231941 -2.972392 -1.49149 7e-07 ## ## $`Voltage:Duty_cycle` ## diff lwr upr p adj ## 10:50-6:50 0.3978574 -1.8278071 2.623522 0.9940050 ## 6:80-6:50 -5.7842704 -8.0099349 -3.558606 0.0000001 ## 10:80-6:50 0.5826959 -1.6429686 2.808360 0.9670184 ## 6:100-6:50 -5.3349974 -7.5606619 -3.109333 0.0000004 ## 10:100-6:50 1.6463867 -0.5792778 3.872051 0.2488817 ## 6:80-10:50 -6.1821278 -7.9993752 -4.364880 0.0000000 ## 10:80-10:50 0.1848384 -1.6324090 2.002086 0.9995954 ## 6:100-10:50 -5.7328548 -7.5501023 -3.915607 0.0000000 ## 10:100-10:50 1.2485292 -0.5687182 3.065777 0.3233936 ## 10:80-6:80 6.3669663 4.5497188 8.184214 0.0000000 ## 6:100-6:80 0.4492730 -1.3679744 2.266520 0.9742108 ## 10:100-6:80 7.4306571 5.6134096 9.247904 0.0000000 ## 6:100-10:80 -5.9176933 -7.7349407 -4.100446 0.0000000 ## 10:100-10:80 1.0636908 -0.7535566 2.880938 0.4980685 ## 10:100-6:100 6.9813841 5.1641367 8.798632 0.0000000 ## ## $`Voltage:Frequency` ## diff lwr upr p adj ## 10:100-6:100 4.828889 3.501455 6.1563225 0.0000000 ## 6:200-6:100 -3.154378 -4.638494 -1.6702619 0.0000117 ## 10:200-6:100 3.294316 1.966883 4.6217504 0.0000007 ## 6:200-10:100 -7.983267 -9.467383 -6.4991505 0.0000000 ## 10:200-10:100 -1.534572 -2.862006 -0.2071382 0.0183385 ## 10:200-6:200 6.448695 4.964578 7.9328107 0.0000000 ## ## $`Duty_cycle:Frequency` ## diff lwr upr p adj ## 80:100-50:100 -1.6125843 -3.429832 0.20466313 0.1059525 165 ## 100:100-50:100 -5.0148768 -6.832124 -3.19762940 0.0000000 ## 50:200-50:100 -6.5062754 -8.731940 -4.28061098 0.0000000 ## 80:200-50:100 -6.6825325 -8.499780 -4.86528507 0.0000000 ## 100:200-50:100 -1.7672762 -3.584524 0.04997124 0.0604755 ## 100:100-80:100 -3.4022925 -5.219540 -1.58504509 0.0000364 ## 50:200-80:100 -4.8936911 -7.119356 -2.66802667 0.0000021 ## 80:200-80:100 -5.0699482 -6.887196 -3.25270077 0.0000000 ## 100:200-80:100 -0.1546919 -1.971939 1.66255554 0.9998309 ## 50:200-100:100 -1.4913986 -3.717063 0.73426585 0.3499536 ## 80:200-100:100 -1.6676557 -3.484903 0.14959175 0.0872248 ## 100:200-100:100 3.2476006 1.430353 5.06484806 0.0000772 ## 80:200-50:200 -0.1762571 -2.401922 2.04940741 0.9998815 ## 100:200-50:200 4.7389993 2.513335 6.96466372 0.0000038 ## 100:200-80:200 4.9152563 3.098009 6.73250373 0.0000000 ## ## $`Voltage:Duty_cycle:Frequency` ## diff lwr upr p adj ## 10:50:100-6:50:100 2.79719210 -0.18719064 5.7815749 0.0829197 ## 6:80:100-6:50:100 -4.61081631 -7.59519905 -1.6264336 0.0002884 ## 10:80:100-6:50:100 2.88819021 -0.09619253 5.8725730 0.0650855 ## 6:100:100-6:50:100 -5.09000442 -8.07438717 -2.1056217 0.0000569 ## 10:100:100-6:50:100 -3.43720671 -6.42158946 -0.4528240 0.0132419 ## 6:50:200-6:50:100 NA NA NA NA ## 10:50:200-6:50:100 -3.74065209 -6.72503484 -0.7562693 0.0051143 ## 6:80:200-6:50:100 -8.40703686 -11.39141960 -5.4226541 0.0000000 ## 10:80:200-6:50:100 -2.59238590 -5.57676865 0.3919968 0.1389151 ## 6:100:200-6:50:100 -7.02930277 -10.01368552 -4.0449200 0.0000001 ## 10:100:200-6:50:100 5.86039263 2.87600988 8.8447754 0.0000042 ## 6:80:100-10:50:100 -7.40800841 -10.39239116 -4.4236257 0.0000000 ## 10:80:100-10:50:100 0.09099811 -2.89338464 3.0753809 1.0000000 ## 6:100:100-10:50:100 -7.88719652 -10.87157927 -4.9028138 0.0000000 ## 10:100:100-10:50:100 -6.23439882 -9.21878156 -3.2500161 0.0000012 ## 6:50:200-10:50:100 NA NA NA NA ## 10:50:200-10:50:100 -6.53784420 -9.52222695 -3.5534615 0.0000005 ## 6:80:200-10:50:100 -11.20422896 -14.18861171 -8.2198462 0.0000000 ## 10:80:200-10:50:100 -5.38957800 -8.37396075 -2.4051953 0.0000206 ## 6:100:200-10:50:100 -9.82649487 -12.81087762 -6.8421121 0.0000000 ## 10:100:200-10:50:100 3.06320052 0.07881778 6.0475833 0.0400666 ## 10:80:100-6:80:100 7.49900652 4.51462378 10.4833893 0.0000000 ## 6:100:100-6:80:100 -0.47918811 -3.46357086 2.5051946 0.9999851 ## 10:100:100-6:80:100 1.17360959 -1.81077315 4.1579923 0.9593564 ## 6:50:200-6:80:100 NA NA NA NA ## 10:50:200-6:80:100 0.87016421 -2.11421853 3.8545470 0.9959005 ## 6:80:200-6:80:100 -3.79622055 -6.78060330 -0.8118378 0.0042798 ## 10:80:200-6:80:100 2.01843041 -0.96595234 5.0028132 0.4489929 ## 6:100:200-6:80:100 -2.41848646 -5.40286921 0.5658963 0.2076621 ## 10:100:200-6:80:100 10.47120894 7.48682619 13.4555917 0.0000000 ## 6:100:100-10:80:100 -7.97819463 -10.96257738 -4.9938119 0.0000000 ## 10:100:100-10:80:100 -6.32539693 -9.30977967 -3.3410142 0.0000009 ## 6:50:200-10:80:100 NA NA NA NA 166 ## 10:50:200-10:80:100 -6.62884231 -9.61322506 -3.6444596 0.0000003 ## 6:80:200-10:80:100 -11.29522707 -14.27960982 -8.3108443 0.0000000 ## 10:80:200-10:80:100 -5.48057611 -8.46495886 -2.4961934 0.0000152 ## 6:100:200-10:80:100 -9.91749299 -12.90187573 -6.9331102 0.0000000 ## 10:100:200-10:80:100 2.97220241 -0.01218033 5.9565852 0.0517190 ## 10:100:100-6:100:100 1.65279771 -1.33158504 4.6371805 0.7244346 ## 6:50:200-6:100:100 NA NA NA NA ## 10:50:200-6:100:100 1.34935233 -1.63503042 4.3337351 0.9015767 ## 6:80:200-6:100:100 -3.31703244 -6.30141518 -0.3326497 0.0190714 ## 10:80:200-6:100:100 2.49761852 -0.48676423 5.4820013 0.1737142 ## 6:100:200-6:100:100 -1.93929835 -4.92368110 1.0450844 0.5078765 ## 10:100:200-6:100:100 10.95039705 7.96601430 13.9347798 0.0000000 ## 6:50:200-10:100:100 NA NA NA NA ## 10:50:200-10:100:100 -0.30344538 -3.28782813 2.6809374 0.9999999 ## 6:80:200-10:100:100 -4.96983014 -7.95421289 -1.9854474 0.0000856 ## 10:80:200-10:100:100 0.84482081 -2.13956193 3.8292036 0.9968105 ## 6:100:200-10:100:100 -3.59209606 -6.57647880 -0.6077133 0.0081880 ## 10:100:200-10:100:100 9.29759934 6.31321660 12.2819821 0.0000000 ## 10:50:200-6:50:200 NA NA NA NA ## 6:80:200-6:50:200 NA NA NA NA ## 10:80:200-6:50:200 NA NA NA NA ## 6:100:200-6:50:200 NA NA NA NA ## 10:100:200-6:50:200 NA NA NA NA ## 6:80:200-10:50:200 -4.66638476 -7.65076751 -1.6820020 0.0002390 ## 10:80:200-10:50:200 1.14826620 -1.83611655 4.1326489 0.9650226 ## 6:100:200-10:50:200 -3.28865068 -6.27303342 -0.3042679 0.0207634 ## 10:100:200-10:50:200 9.60104472 6.61666198 12.5854275 0.0000000 ## 10:80:200-6:80:200 5.81465096 2.83026821 8.7990337 0.0000049 ## 6:100:200-6:80:200 1.37773409 -1.60664866 4.3621168 0.8890112 ## 10:100:200-6:80:200 14.26742949 11.28304674 17.2518122 0.0000000 ## 6:100:200-10:80:200 -4.43691687 -7.42129962 -1.4525341 0.0005177 ## 10:100:200-10:80:200 8.45277853 5.46839578 11.4371613 0.0000000 ## 10:100:200-6:100:200 12.88969540 9.90531265 15.8740781 0.0000000 fit5 <- aov(data_TP~Voltage*Duty_cycle*Frequency, data = metadata_cycle) #for total phosphorous shapiro.test(fit5$residuals) ## ## Shapiro-Wilk normality test ## ## data: fit5$residuals ## W = 0.75303, p-value = 3.202e-07 plot(fit5,which=3) summary(fit5) #Provide P-value 167 ## Df Sum Sq Mean Sq F value Pr(>F) ## Voltage 1 13.541 13.541 33.685 1.72e-06 *** ## Duty_cycle 2 6.222 3.111 7.738 0.00175 ** ## Frequency 1 0.361 0.361 0.899 0.34993 ## Voltage:Duty_cycle 2 2.366 1.183 2.942 0.06671 . ## Voltage:Frequency 1 3.506 3.506 8.722 0.00575 ** ## Duty_cycle:Frequency 2 0.582 0.291 0.723 0.49268 ## Voltage:Duty_cycle:Frequency 1 0.168 0.168 0.418 0.52236 ## Residuals 33 13.266 0.402 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 bartlett.test(data_TP~Voltage,metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_TP by Voltage ## Bartlett's K-squared = 0.42883, df = 1, p-value = 0.5126 bartlett.test(data_TP~Duty_cycle,metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_TP by Duty_cycle ## Bartlett's K-squared = 11.541, df = 2, p-value = 0.003118 bartlett.test(data_TP~Frequency,metadata_cycle) ## ## Bartlett test of homogeneity of variances ## ## data: data_TP by Frequency ## Bartlett's K-squared = 7.5675, df = 1, p-value = 0.005943 Tukey5 <- TukeyHSD(fit5, conf.level=0.95) #Tukey multiple comparison Tukey5 #Output Tukey results ## Tukey multiple comparisons of means ## 95% family-wise confidence level ## ## Fit: aov(formula = data_TP ~ Voltage * Duty_cycle * Frequency, data = meta data_cycle) ## ## $Voltage ## diff lwr upr p adj ## 10-6 -1.114134 -1.504689 -0.7235796 1.7e-06 ## ## $Duty_cycle ## diff lwr upr p adj ## 80-50 -0.2628137 -0.8569438 0.33131652 0.5296504 168 ## 100-50 -0.8971539 -1.4912841 -0.30302375 0.0021668 ## 100-80 -0.6343403 -1.1843979 -0.08428261 0.0209193 ## ## $Frequency ## diff lwr upr p adj ## 200-100 0.178572 -0.2119825 0.5691266 0.3590049 ## ## $`Voltage:Duty_cycle` ## diff lwr upr p adj ## 10:50-6:50 -1.48290001 -2.6568377 -0.3089623 0.0068027 ## 6:80-6:50 -0.26414956 -1.4380872 0.9097881 0.9829358 ## 10:80-6:50 -1.86729971 -3.0412374 -0.6933620 0.0004312 ## 6:100-6:50 -1.40497618 -2.5789139 -0.2310385 0.0115370 ## 10:100-6:50 -1.99515363 -3.1690913 -0.8212159 0.0001666 ## 6:80-10:50 1.21875045 0.2602343 2.1772666 0.0063612 ## 10:80-10:50 -0.38439971 -1.3429158 0.5741164 0.8276377 ## 6:100-10:50 0.07792382 -0.8805923 1.0364399 0.9998651 ## 10:100-10:50 -0.51225362 -1.4707697 0.4462625 0.5943453 ## 10:80-6:80 -1.60315016 -2.5616663 -0.6446341 0.0002111 ## 6:100-6:80 -1.14082663 -2.0993427 -0.1823105 0.0121501 ## 10:100-6:80 -1.73100407 -2.6895202 -0.7724880 0.0000654 ## 6:100-10:80 0.46232353 -0.4961926 1.4208396 0.6920204 ## 10:100-10:80 -0.12785391 -1.0863700 0.8306622 0.9984967 ## 10:100-6:100 -0.59017744 -1.5486935 0.3683387 0.4424883 ## ## $`Voltage:Frequency` ## diff lwr upr p adj ## 10:100-6:100 -1.6208179 -2.3209794 -0.9206564 0.0000026 ## 6:200-6:100 -0.4304319 -1.2132363 0.3523725 0.4563292 ## 10:200-6:100 -0.9517960 -1.6519575 -0.2516344 0.0044097 ## 6:200-10:100 1.1903860 0.4075816 1.9731904 0.0013305 ## 10:200-10:100 0.6690219 -0.0311396 1.3691834 0.0653545 ## 10:200-6:200 -0.5213641 -1.3041684 0.2614403 0.2907150 ## ## $`Duty_cycle:Frequency` ## diff lwr upr p adj ## 80:100-50:100 -0.13245532 -1.09097142 0.82606078 0.9982193 ## 100:100-50:100 -0.79505735 -1.75357346 0.16345875 0.1510225 ## 50:200-50:100 0.46278076 -0.71115692 1.63671844 0.8374978 ## 80:200-50:100 -0.08465149 -1.04316759 0.87386461 0.9997974 ## 100:200-50:100 -0.69072999 -1.64924609 0.26778611 0.2744522 ## 100:100-80:100 -0.66260204 -1.62111814 0.29591406 0.3169481 ## 50:200-80:100 0.59523608 -0.57870160 1.76917376 0.6461922 ## 80:200-80:100 0.04780383 -0.91071227 1.00631993 0.9999880 ## 100:200-80:100 -0.55827468 -1.51679078 0.40024143 0.5034646 ## 50:200-100:100 1.25783811 0.08390044 2.43177579 0.0299440 ## 80:200-100:100 0.71040587 -0.24811024 1.66892197 0.2470434 ## 100:200-100:100 0.10432736 -0.85418874 1.06284346 0.9994372 ## 80:200-50:200 -0.54743225 -1.72136993 0.62650543 0.7208835 ## 100:200-50:200 -1.15351075 -2.32744843 0.02042693 0.0564226 169 ## 100:200-80:200 -0.60607850 -1.56459460 0.35243760 0.4131843 ## ## $`Voltage:Duty_cycle:Frequency` ## diff lwr upr p adj ## 10:50:100-6:50:100 -1.986076813 -3.56020418 -0.41194944 0.0047250 ## 6:80:100-6:50:100 -0.013971332 -1.58809870 1.56015604 1.0000000 ## 10:80:100-6:50:100 -1.990267564 -3.56439493 -0.41614019 0.0046061 ## 6:100:100-6:50:100 -1.038112718 -2.61224009 0.53601465 0.4861497 ## 10:100:100-6:50:100 -2.291330253 -3.86545762 -0.71720288 0.0007065 ## 6:50:200-6:50:100 NA NA NA NA ## 10:50:200-6:50:100 -0.840576172 -2.41470354 0.73355120 0.7654547 ## 6:80:200-6:50:100 -0.398371925 -1.97249929 1.17575544 0.9988075 ## 10:80:200-6:50:100 -1.674758350 -3.24888572 -0.10063098 0.0290268 ## 6:100:200-6:50:100 -1.655883795 -3.23001116 -0.08175643 0.0322064 ## 10:100:200-6:50:100 -1.629403485 -3.20353086 -0.05527612 0.0372083 ## 6:80:100-10:50:100 1.972105481 0.39797811 3.54623285 0.0051429 ## 10:80:100-10:50:100 -0.004190751 -1.57831812 1.56993662 1.0000000 ## 6:100:100-10:50:100 0.947964095 -0.62616327 2.52209146 0.6167926 ## 10:100:100-10:50:100 -0.305253440 -1.87938081 1.26887393 0.9999026 ## 6:50:200-10:50:100 NA NA NA NA ## 10:50:200-10:50:100 1.145500641 -0.42862673 2.71962801 0.3435654 ## 6:80:200-10:50:100 1.587704888 0.01357752 3.16183226 0.0465350 ## 10:80:200-10:50:100 0.311318463 -1.26280891 1.88544583 0.9998820 ## 6:100:200-10:50:100 0.330193018 -1.24393435 1.90432039 0.9997918 ## 10:100:200-10:50:100 0.356673327 -1.21745404 1.93080070 0.9995678 ## 10:80:100-6:80:100 -1.976296232 -3.55042360 -0.40216886 0.0050139 ## 6:100:100-6:80:100 -1.024141386 -2.59826876 0.54998598 0.5060846 ## 10:100:100-6:80:100 -2.277358921 -3.85148629 -0.70323155 0.0007719 ## 6:50:200-6:80:100 NA NA NA NA ## 10:50:200-6:80:100 -0.826604840 -2.40073221 0.74752253 0.7829886 ## 6:80:200-6:80:100 -0.384400593 -1.95852796 1.18972678 0.9991369 ## 10:80:200-6:80:100 -1.660787018 -3.23491439 -0.08665965 0.0313509 ## 6:100:200-6:80:100 -1.641912463 -3.21603983 -0.06778509 0.0347629 ## 10:100:200-6:80:100 -1.615432153 -3.18955952 -0.04130478 0.0401244 ## 6:100:100-10:80:100 0.952154846 -0.62197252 2.52628222 0.6106973 ## 10:100:100-10:80:100 -0.301062689 -1.87519006 1.27306468 0.9999149 ## 6:50:200-10:80:100 NA NA NA NA ## 10:50:200-10:80:100 1.149691392 -0.42443598 2.72381876 0.3384971 ## 6:80:200-10:80:100 1.591895639 0.01776827 3.16602301 0.0455102 ## 10:80:200-10:80:100 0.315509214 -1.25861816 1.88963658 0.9998656 ## 6:100:200-10:80:100 0.334383769 -1.23974360 1.90851114 0.9997651 ## 10:100:200-10:80:100 0.360864078 -1.21326329 1.93499145 0.9995180 ## 10:100:100-6:100:100 -1.253217535 -2.82734490 0.32090983 0.2278234 ## 6:50:200-6:100:100 NA NA NA NA ## 10:50:200-6:100:100 0.197536546 -1.37659082 1.77166392 0.9999988 ## 6:80:200-6:100:100 0.639740793 -0.93438658 2.21386816 0.9493267 ## 10:80:200-6:100:100 -0.636645632 -2.21077300 0.93748174 0.9509251 ## 6:100:200-6:100:100 -0.617771077 -2.19189845 0.95635629 0.9599146 ## 10:100:200-6:100:100 -0.591290767 -2.16541814 0.98283660 0.9704485 ## 6:50:200-10:100:100 NA NA NA NA 170 ## 10:50:200-10:100:100 1.450754081 -0.12337329 3.02488145 0.0936199 ## 6:80:200-10:100:100 1.892958328 0.31883096 3.46708570 0.0082717 ## 10:80:200-10:100:100 0.616571903 -0.95755547 2.19069927 0.9604428 ## 6:100:200-10:100:100 0.635446458 -0.93868091 2.20957383 0.9515348 ## 10:100:200-10:100:100 0.661926768 -0.91220060 2.23605414 0.9368037 ## 10:50:200-6:50:200 NA NA NA NA ## 6:80:200-6:50:200 NA NA NA NA ## 10:80:200-6:50:200 NA NA NA NA ## 6:100:200-6:50:200 NA NA NA NA ## 10:100:200-6:50:200 NA NA NA NA ## 6:80:200-10:50:200 0.442204247 -1.13192312 2.01633162 0.9970132 ## 10:80:200-10:50:200 -0.834182178 -2.40830955 0.73994519 0.7735488 ## 6:100:200-10:50:200 -0.815307623 -2.38943499 0.75881975 0.7967404 ## 10:100:200-10:50:200 -0.788827313 -2.36295468 0.78530006 0.8273416 ## 10:80:200-6:80:200 -1.276386425 -2.85051379 0.29774094 0.2070167 ## 6:100:200-6:80:200 -1.257511870 -2.83163924 0.31661550 0.2238570 ## 10:100:200-6:80:200 -1.231031560 -2.80515893 0.34309581 0.2491151 ## 6:100:200-10:80:200 0.018874555 -1.55525281 1.59300192 1.0000000 ## 10:100:200-10:80:200 0.045354865 -1.52877251 1.61948223 1.0000000 ## 10:100:200-6:100:200 0.026480309 -1.54764706 1.60060768 1.0000000 fit7 <- aov(data_TN~Voltage*Duty_cycle*Frequency, data = metadata_cycle) #for total nitrogen summary(fit7) #Provide P-value ## Df Sum Sq Mean Sq F value Pr(>F) ## Voltage 1 0.00202 0.00202 1.797 0.189260 ## Duty_cycle 2 0.02061 0.01030 9.148 0.000691 *** ## Frequency 1 0.00730 0.00730 6.484 0.015734 * ## Voltage:Duty_cycle 2 0.01924 0.00962 8.540 0.001026 ** ## Voltage:Frequency 1 0.03777 0.03777 33.533 1.79e-06 *** ## Duty_cycle:Frequency 2 0.02765 0.01382 12.274 0.000103 *** ## Voltage:Duty_cycle:Frequency 1 0.00220 0.00220 1.950 0.171898 ## Residuals 33 0.03717 0.00113 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 shapiro.test(fit7$residuals) ## ## Shapiro-Wilk normality test ## ## data: fit7$residuals ## W = 0.94144, p-value = 0.02665 plot(fit7,which=3) bartlett.test(data_TN~Voltage,metadata_cycle) # equal 171 ## ## Bartlett test of homogeneity of variances ## ## data: data_TN by Voltage ## Bartlett's K-squared = 0.18036, df = 1, p-value = 0.6711 bartlett.test(data_TN~Duty_cycle,metadata_cycle) # equal ## ## Bartlett test of homogeneity of variances ## ## data: data_TN by Duty_cycle ## Bartlett's K-squared = 1.4633, df = 2, p-value = 0.4811 bartlett.test(data_TN~Frequency,metadata_cycle)# equal ## ## Bartlett test of homogeneity of variances ## ## data: data_TN by Frequency ## Bartlett's K-squared = 1.997, df = 1, p-value = 0.1576 Tukey7 <- TukeyHSD(fit7, conf.level=0.95) #Tukey multiple comparison Tukey7 #Output Tukey results ## Tukey multiple comparisons of means ## 95% family-wise confidence level ## ## Fit: aov(formula = data_TN ~ Voltage * Duty_cycle * Frequency, data = meta data_cycle) ## ## $Voltage ## diff lwr upr p adj ## 10-6 -0.01362027 -0.03429317 0.007052625 0.1892602 ## ## $Duty_cycle ## diff lwr upr p adj ## 80-50 -0.02799996 -0.05944855 0.003448634 0.0887590 ## 100-50 -0.05424829 -0.08569688 -0.022799692 0.0004959 ## 100-80 -0.02624833 -0.05536407 0.002867415 0.0838920 ## ## $Frequency ## diff lwr upr p adj ## 200-100 0.02538464 0.004711743 0.04605754 0.0176408 ## ## $`Voltage:Duty_cycle` ## diff lwr upr p adj ## 10:50-6:50 -0.05263798 -0.11477704 0.0095010783 0.1359122 ## 6:80-6:50 -0.03507416 -0.09721322 0.0270649019 0.5372902 ## 10:80-6:50 -0.08656965 -0.14870871 -0.0244305884 0.0023335 ## 6:100-6:50 -0.10472649 -0.16686555 -0.0425874328 0.0001887 172 ## 10:100-6:50 -0.06941396 -0.13155302 -0.0072749055 0.0213205 ## 6:80-10:50 0.01756382 -0.03317251 0.0683001524 0.8983981 ## 10:80-10:50 -0.03393167 -0.08466800 0.0168046621 0.3520503 ## 6:100-10:50 -0.05208851 -0.10282484 -0.0013521823 0.0414222 ## 10:100-10:50 -0.01677598 -0.06751231 0.0339603450 0.9147084 ## 10:80-6:80 -0.05149549 -0.10223182 -0.0007591615 0.0450067 ## 6:100-6:80 -0.06965233 -0.12038866 -0.0189160059 0.0027659 ## 10:100-6:80 -0.03433981 -0.08507614 0.0163965214 0.3392551 ## 6:100-10:80 -0.01815684 -0.06889317 0.0325794844 0.8850098 ## 10:100-10:80 0.01715568 -0.03358065 0.0678920117 0.9070591 ## 10:100-6:100 0.03531253 -0.01542380 0.0860488561 0.3098528 ## ## $`Voltage:Frequency` ## diff lwr upr p adj ## 10:100-6:100 -0.067096146 -0.104157209 -0.030035083 0.0001412 ## 6:200-6:100 -0.037998663 -0.079434191 0.003436865 0.0817902 ## 10:200-6:100 0.009456673 -0.027604389 0.046517736 0.9000996 ## 6:200-10:100 0.029097483 -0.012338045 0.070533011 0.2478334 ## 10:200-10:100 0.076552819 0.039491757 0.113613882 0.0000187 ## 10:200-6:200 0.047455336 0.006019809 0.088890864 0.0197083 ## ## $`Duty_cycle:Frequency` ## diff lwr upr p adj ## 80:100-50:100 -0.0053258992 -0.056062228 0.045410430 0.9995282 ## 100:100-50:100 -0.0903482904 -0.141084619 -0.039611962 0.0000816 ## 50:200-50:100 0.0202548342 -0.041884224 0.082393893 0.9193018 ## 80:200-50:100 -0.0371707983 -0.087907127 0.013565530 0.2581910 ## 100:200-50:100 -0.0046450588 -0.055381388 0.046091270 0.9997582 ## 100:100-80:100 -0.0850223912 -0.135758720 -0.034286062 0.0002052 ## 50:200-80:100 0.0255807333 -0.036558325 0.087719792 0.8117248 ## 80:200-80:100 -0.0318448992 -0.082581228 0.018891430 0.4213206 ## 100:200-80:100 0.0006808404 -0.050055488 0.051417169 1.0000000 ## 50:200-100:100 0.1106031246 0.048464066 0.172742183 0.0000822 ## 80:200-100:100 0.0531774921 0.002441163 0.103913821 0.0355033 ## 100:200-100:100 0.0857032316 0.034966903 0.136439560 0.0001825 ## 80:200-50:200 -0.0574256325 -0.119564691 0.004713426 0.0836164 ## 100:200-50:200 -0.0248998930 -0.087038951 0.037239165 0.8281120 ## 100:200-80:200 0.0325257395 -0.018210589 0.083262068 0.3980563 ## ## $`Voltage:Duty_cycle:Frequency` ## diff lwr upr p adj ## 10:50:100-6:50:100 -0.082140565 -0.165462529 0.001181399 0.0562016 ## 6:80:100-6:50:100 0.016489941 -0.066832023 0.099811905 0.9998812 ## 10:80:100-6:50:100 -0.085011878 -0.168333841 -0.001689914 0.0421971 ## 6:100:100-6:50:100 -0.095366605 -0.178688569 -0.012044641 0.0141392 ## 10:100:100-6:50:100 -0.143200114 -0.226522078 -0.059878150 0.0000499 ## 6:50:200-6:50:100 NA NA NA NA ## 10:50:200-6:50:100 -0.003355157 -0.086677121 0.079966807 1.0000000 ## 6:80:200-6:50:100 -0.070154723 -0.153476686 0.013167241 0.1677339 ## 10:80:200-6:50:100 -0.078237297 -0.161559261 0.005084667 0.0818243 173 ## 6:100:200-6:50:100 -0.097602846 -0.180924809 -0.014280882 0.0110516 ## 10:100:200-6:50:100 0.014262305 -0.069059659 0.097584269 0.9999717 ## 6:80:100-10:50:100 0.098630506 0.015308543 0.181952470 0.0098584 ## 10:80:100-10:50:100 -0.002871313 -0.086193276 0.080450651 1.0000000 ## 6:100:100-10:50:100 -0.013226040 -0.096548004 0.070095924 0.9999868 ## 10:100:100-10:50:100 -0.061059549 -0.144381513 0.022262415 0.3338766 ## 6:50:200-10:50:100 NA NA NA NA ## 10:50:200-10:50:100 0.078785408 -0.004536556 0.162107372 0.0777008 ## 6:80:200-10:50:100 0.011985843 -0.071336121 0.095307806 0.9999952 ## 10:80:200-10:50:100 0.003903268 -0.079418696 0.087225232 1.0000000 ## 6:100:200-10:50:100 -0.015462281 -0.098784244 0.067859683 0.9999367 ## 10:100:200-10:50:100 0.096402870 0.013080907 0.179724834 0.0126186 ## 10:80:100-6:80:100 -0.101501819 -0.184823783 -0.018179855 0.0071416 ## 6:100:100-6:80:100 -0.111856546 -0.195178510 -0.028534583 0.0021627 ## 10:100:100-6:80:100 -0.159690055 -0.243012019 -0.076368091 0.0000068 ## 6:50:200-6:80:100 NA NA NA NA ## 10:50:200-6:80:100 -0.019845098 -0.103167062 0.063476865 0.9993135 ## 6:80:200-6:80:100 -0.086644664 -0.169966627 -0.003322700 0.0357245 ## 10:80:200-6:80:100 -0.094727238 -0.178049202 -0.011405274 0.0151622 ## 6:100:200-6:80:100 -0.114092787 -0.197414750 -0.030770823 0.0016622 ## 10:100:200-6:80:100 -0.002227636 -0.085549600 0.081094328 1.0000000 ## 6:100:100-10:80:100 -0.010354727 -0.093676691 0.072967236 0.9999989 ## 10:100:100-10:80:100 -0.058188236 -0.141510200 0.025133728 0.4021495 ## 6:50:200-10:80:100 NA NA NA NA ## 10:50:200-10:80:100 0.081656721 -0.001665243 0.164978684 0.0589338 ## 6:80:200-10:80:100 0.014857155 -0.068464808 0.098179119 0.9999574 ## 10:80:200-10:80:100 0.006774581 -0.076547383 0.090096545 1.0000000 ## 6:100:200-10:80:100 -0.012590968 -0.095912932 0.070730996 0.9999920 ## 10:100:200-10:80:100 0.099274183 0.015952219 0.182596147 0.0091747 ## 10:100:100-6:100:100 -0.047833509 -0.131155472 0.035488455 0.6803429 ## 6:50:200-6:100:100 NA NA NA NA ## 10:50:200-6:100:100 0.092011448 0.008689484 0.175333412 0.0203355 ## 6:80:200-6:100:100 0.025211883 -0.058110081 0.108533846 0.9944144 ## 10:80:200-6:100:100 0.017129308 -0.066192655 0.100451272 0.9998284 ## 6:100:200-6:100:100 -0.002236240 -0.085558204 0.081085723 1.0000000 ## 10:100:200-6:100:100 0.109628910 0.026306947 0.192950874 0.0028065 ## 6:50:200-10:100:100 NA NA NA NA ## 10:50:200-10:100:100 0.139844957 0.056522993 0.223166920 0.0000749 ## 6:80:200-10:100:100 0.073045391 -0.010276572 0.156367355 0.1310856 ## 10:80:200-10:100:100 0.064962817 -0.018359147 0.148284781 0.2528437 ## 6:100:200-10:100:100 0.045597268 -0.037724695 0.128919232 0.7383008 ## 10:100:200-10:100:100 0.157462419 0.074140455 0.240784383 0.0000089 ## 10:50:200-6:50:200 NA NA NA NA ## 6:80:200-6:50:200 NA NA NA NA ## 10:80:200-6:50:200 NA NA NA NA ## 6:100:200-6:50:200 NA NA NA NA ## 10:100:200-6:50:200 NA NA NA NA ## 6:80:200-10:50:200 -0.066799565 -0.150121529 0.016522398 0.2197793 ## 10:80:200-10:50:200 -0.074882140 -0.158204103 0.008439824 0.1113984 ## 6:100:200-10:50:200 -0.094247688 -0.177569652 -0.010925725 0.0159749 174 ## 10:100:200-10:50:200 0.017617462 -0.065704501 0.100939426 0.9997753 ## 10:80:200-6:80:200 -0.008082574 -0.091404538 0.075239389 0.9999999 ## 6:100:200-6:80:200 -0.027448123 -0.110770087 0.055873841 0.9889258 ## 10:100:200-6:80:200 0.084417028 0.001095064 0.167738991 0.0448082 ## 6:100:200-10:80:200 -0.019365549 -0.102687512 0.063956415 0.9994523 ## 10:100:200-10:80:200 0.092499602 0.009177638 0.175821566 0.0192978 ## 10:100:200-6:100:200 0.111865151 0.028543187 0.195187114 0.0021605 # PLOT BAR CHARTS ------------------------------------------- ## Frequency = 100 ## Data summary and plots # COD summary COD_100<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummarysCOD_100<-COD_100 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(COD), sd = sd(COD)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummarysCOD_100 ## # A tibble: 6 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 50 389. 33.7 ## 2 6 80 481. 11.9 ## 3 6 100 488. 11.9 ## 4 10 50 314. 17.3 ## 5 10 80 312 4.69 ## 6 10 100 460. 34.0 # COD removal summary COD_100R<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummarysCOD_100R<-COD_100R %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(COD_rem), sd = sd(COD_rem)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummarysCOD_100R ## # A tibble: 6 x 4 ## # Groups: Voltage [2] 175 ## Voltage Duty_cycle mean sd ## ## 1 6 50 76.2 14.5 ## 2 6 80 86.0 2.59 ## 3 6 100 84.0 1.72 ## 4 10 50 81.6 0.841 ## 5 10 80 83.8 1.94 ## 6 10 100 84.6 0.450 # COD plot box_COD_100 <- ggplot(datasummarysCOD_100, aes(x=Duty_cycle, y=mean, fill=Vol tage)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Duty cycle (%)")+ ylab("COD (mg/L)") + labs(fill="Voltage")+ ylim(0,800) + labs(title = "", subtitle="a") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo ttom", legend.text = element_text(size = 10, family="A"), legend.title= element_text(size = 10, family="A")) #box_COD_100 # COD removal plot box_COD_100R <- ggplot(datasummarysCOD_100R, aes(x=Duty_cycle, y=mean, fill=V oltage)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Duty cycle (%)")+ ylab("COD removal (%)") + labs(fill="Voltage")+ ylim(0,100) + labs(title = "", subtitle="a") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo ttom", legend.text = element_text(size = 10, family="A"), legend.title= element_text(size = 10, family="A")) #box_COD_100R # energy consumption summary energy_100<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummarysenergy_100<-energy_100 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(Engergy_consumption), sd = sd(Engergy_consumption)) 176 ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummarysenergy_100 ## # A tibble: 6 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 50 1.18 0.769 ## 2 6 80 0.832 0.177 ## 3 6 100 1.64 0.153 ## 4 10 50 1.93 0.305 ## 5 10 80 5.70 0.840 ## 6 10 100 4.16 0.254 # turbidity summary turb_100<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummaryturb_100<-turb_100 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(Turbidity), sd = sd(Turbidity)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryturb_100 ## # A tibble: 6 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 50 284. 80.7 ## 2 6 80 155 4.69 ## 3 6 100 46.1 13.9 ## 4 10 50 115. 34.1 ## 5 10 80 67.4 12.2 ## 6 10 100 26.6 2.99 # Turbidity plot box_turb_100 <- ggplot(datasummaryturb_100, aes(x=Duty_cycle, y=mean, fill=Vo ltage)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab(" Duty cycle (%)")+ ylab("Turbidity (NTU)") + labs(fill="Voltage")+ ylim(0,400) + labs(title = "", subtitle="a") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo 177 ttom", legend.text = element_text(size = 10, family="A"), legend.title= element_text(size = 10, family="A")) #box_turb_100 # TP summary TP_100<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummaryTP_100<-TP_100 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(TP), sd = sd(TP)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryTP_100 ## # A tibble: 6 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 50 6.20 2.30 ## 2 6 80 5.77 0.0602 ## 3 6 100 2.08 0.150 ## 4 10 50 1.78 1.66 ## 5 10 80 0.802 0.0818 ## 6 10 100 0.608 0.160 # TP plot box_TP_100 <- ggplot(datasummaryTP_100, aes(x=Duty_cycle, y=mean, fill=Voltag e)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Duty cycle (%)")+ ylab("TP (mg/L)") + labs(fill="Voltage")+ ylim(0,10) + labs(title = "", subtitle="a") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo ttom", legend.text = element_text(size = 10, family="A"), legend.title= element_text(size = 10, family="A")) #box_TP_100 # energy demand plot box_energy_100 <- ggplot(datasummarysenergy_100, aes(x=Duty_cycle, y=mean, fi ll=Voltage)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Duty cycle (%)")+ ylab("Energy consumption (Wh/g/L of COD removed)") 178 + labs(fill="Voltage")+ ylim(0,8) + labs(title = "", subtitle="a") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo ttom", legend.text = element_text(size = 10, family="A"), legend.title= element_text(size = 10, family="A")) #box_energy_100 current_100<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummarycurrent_100<-current_100 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(Current), sd = sd(Current)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummarycurrent_100 ## # A tibble: 6 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 50 1.4 0.0577 ## 2 6 80 1.55 0.0577 ## 3 6 100 2.1 0.115 ## 4 10 50 1.6 0.115 ## 5 10 80 3.45 0.0577 ## 6 10 100 3.15 0.0577 # TN summary TN_100<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummaryTN_100<-TN_100 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(TN), sd = sd(TN)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryTN_100 ## # A tibble: 6 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 50 348. 71.2 179 ## 2 6 80 356. 15.6 ## 3 6 100 275. 11.1 ## 4 10 50 284. 18.0 ## 5 10 80 282. 14.8 ## 6 10 100 246 6.06 #TN removal summary TN_100R<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummaryTN_100R<-TN_100R %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(TN_rem), sd = sd(TN_rem)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryTN_100R ## # A tibble: 6 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 50 14.0 11.8 ## 2 6 80 23.0 3.47 ## 3 6 100 28.4 9.22 ## 4 10 50 24.2 5.95 ## 5 10 80 26.4 4.61 ## 6 10 100 24.0 2.67 # NH3 summary NH3_100<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummaryNH3_100<-NH3_100 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(NH3), sd = sd(NH3)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryNH3_100 ## # A tibble: 6 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 50 187. 6.55 ## 2 6 80 258. 27.6 ## 3 6 100 269 4.08 ## 4 10 50 204. 4.5 ## 5 10 80 191. 13.3 ## 6 10 100 252. 1.73 180 # NH3 summary NH3_100R<- metadata_cycle[which(metadata_cycle$Frequency=="100"),] datasummaryNH3R_100<-NH3_100R %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(NH3_rem), sd = sd(NH3_rem)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryNH3R_100 ## # A tibble: 6 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 50 15.5 18.0 ## 2 6 80 9.71 11.6 ## 3 6 100 2.37 2.54 ## 4 10 50 29.0 6.11 ## 5 10 80 22.1 2.76 ## 6 10 100 4.76 5.09 ## Frequency = 200 ## Data summary and plots # COD summary COD_200<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] datasummarysCOD_200<-COD_200 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(COD), sd = sd(COD)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummarysCOD_200 ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 520. 19.7 ## 2 6 100 512 8.29 ## 3 10 50 468. 4.99 ## 4 10 80 447 7.57 ## 5 10 100 213. 25.3 # COD removal summary COD_200R<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] datasummarysCOD_200R<-COD_200R %>% group_by(Voltage,Duty_cycle) %>% 181 dplyr::summarize(mean=mean(COD_rem), sd = sd(COD_rem)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummarysCOD_200R ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 79.7 6.05 ## 2 6 100 83.9 0.639 ## 3 10 50 86.1 1.42 ## 4 10 80 85.9 0.400 ## 5 10 100 93.8 1.16 # COD plot box_COD_200 <- ggplot(datasummarysCOD_200, aes(x=Duty_cycle, y=mean, fill=Vol tage)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Duty cycle (%)")+ ylab("COD (mg/L)") + labs(fill="Voltage")+ ylim(0,800) + labs(title = "", subtitle="b") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo ttom", legend.text = element_text(size = 10, family="A"), legend.title= element_text(size = 10, family="A")) #box_COD_200 #grid.arrange(box_COD_100 ,box_COD_200 ,nrow=1) # COD removal plot box_COD_200R <- ggplot(datasummarysCOD_200R, aes(x=Duty_cycle, y=mean, fill=V oltage)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Duty cycle (%)")+ ylab("COD removal (%)") + labs(fill="Voltage")+ ylim(0,100) + labs(title = "", subtitle="b") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo ttom", legend.text = element_text(size = 10, family="A"), 182 legend.title= element_text(size = 10, family="A")) #box_COD_200R #grid.arrange(box_COD_100R ,box_COD_200R ,nrow=1) # energy demand summary energy_200<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] datasummarysenergy_200<-energy_200 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(Engergy_consumption), sd = sd(Engergy_consumption)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummarysenergy_200 ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 1.42 0.764 ## 2 6 100 1.69 0.243 ## 3 10 50 1.12 0.0690 ## 4 10 80 2.84 0.309 ## 5 10 100 3.22 0.134 # turbidity summary turb_200<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] datasummaryturb_200<-turb_200 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(Turbidity), sd = sd(Turbidity)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryturb_200 ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 108. 47.8 ## 2 6 100 53.8 16.1 ## 3 10 50 89.6 13.3 ## 4 10 80 31.4 0.759 ## 5 10 100 42.8 10.2 # Turbidity summary box_turb_200 <- ggplot(datasummaryturb_200, aes(x=Duty_cycle, y=mean, fill=Vo ltage)) + geom_bar(stat="identity", position=position_dodge(0.9))+ 183 geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab(" Duty cycle (%)")+ ylab("Turbidity (NTU)") + labs(fill="Voltage")+ ylim(0,400) + labs(title = "", subtitle="b") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo ttom", legend.text = element_text(size = 10, family="A"), legend.title= element_text(size = 10, family="A")) #box_turb_200 #grid.arrange(box_turb_100 ,box_turb_200 ,nrow=1) # TP summary TP_200<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] datasummaryTP_200<-TP_200 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(TP), sd = sd(TP)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryTP_200 ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 4.54 2.63 ## 2 6 100 1.14 0.265 ## 3 10 50 2.61 0.768 ## 4 10 80 1.12 0.294 ## 5 10 100 1.16 0.161 # TP plot box_TP_200 <- ggplot(datasummaryTP_200, aes(x=Duty_cycle, y=mean, fill=Voltag e)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Duty cycle (%)")+ ylab("TP (mg/L)") + labs(fill="Voltage")+ ylim(0,10) + labs(title = "", subtitle="b") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo ttom", 184 legend.text = element_text(size = 10, family="A"), legend.title= element_text(size = 10, family="A")) #box_TP_200 grid.arrange(box_TP_100 ,box_TP_200 ,nrow=1) # energy demand plot box_energy_200 <- ggplot(datasummarysenergy_200, aes(x=Duty_cycle, y=mean, fi ll=Voltage)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Duty cycle (%)")+ ylab("Energy consumption (Wh/g/L of COD removed)") + labs(fill="Voltage")+ ylim(0,8) + labs(title = "", subtitle="b") + theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "bo ttom", legend.text = element_text(size = 10, family="A"), legend.title= element_text(size = 10, family="A")) #box_energy_200 #grid.arrange(box_energy_100 ,box_energy_200 ,nrow=1) current_200<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] datasummarycurrent_200<-current_200 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(Current), sd = sd(Current)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummarycurrent_200 ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 1.7 0.289 ## 2 6 100 2.25 0.231 ## 3 10 50 1.98 0.318 ## 4 10 80 2.9 0.404 ## 5 10 100 3.15 0.173 # TN summary TN_200<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] 185 datasummaryTN_200<-TN_200 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(TN), sd = sd(TN)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryTN_200 ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 292. 19.7 ## 2 6 100 273. 7.59 ## 3 10 50 340. 18.3 ## 4 10 80 286. 9.64 ## 5 10 100 354. 17.7 #TN removal summary TN_200R<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] datasummaryTN_200R<-TN_200R %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(TN_rem), sd = sd(TN_rem)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryTN_200R ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 25.3 4.71 ## 2 6 100 26.8 3.66 ## 3 10 50 18.8 5.00 ## 4 10 80 28.7 3.32 ## 5 10 100 27.9 3.50 # NH3 summary NH3_200<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] datasummaryNH3_200<-NH3_200 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(NH3), sd = sd(NH3)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. 186 datasummaryNH3_200 ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 275 7.62 ## 2 6 100 266. 5.07 ## 3 10 50 258. 2.38 ## 4 10 80 244 1.41 ## 5 10 100 356. 3.70 # NH3 removal summary NH3_200<- metadata_cycle[which(metadata_cycle$Frequency=="200"),] datasummaryNH3R_200<-NH3_200 %>% group_by(Voltage,Duty_cycle) %>% dplyr::summarize(mean=mean(NH3_rem), sd = sd(NH3_rem)) ## `summarise()` has grouped output by 'Voltage'. You can override using the ## `.groups` argument. datasummaryNH3R_200 ## # A tibble: 5 x 4 ## # Groups: Voltage [2] ## Voltage Duty_cycle mean sd ## ## 1 6 80 1.70 2.26 ## 2 6 100 3.54 2.56 ## 3 10 50 2.17 1.89 ## 4 10 80 9.96 3.40 ## 5 10 100 9.64 7.54 ## End of code --------------- Chapter 3 code ## EC sludge separator statistical analysis ## Gus Aburto, February 6, 1223 ## Gus Aburto, February 7, 1223 ## Gus Aburto February 25 1223 ## Gus Aburto February 26 1223 # Loading Library and Tables ---------------------------------------------- #install.packages("dplyr") library (MASS) library(ggplot2) ## Warning: package 'ggplot2' was built under R version 4.1.3 187 library(grid) library(gridExtra) ## Warning: package 'gridExtra' was built under R version 4.1.3 library(ggpubr) ## Warning: package 'ggpubr' was built under R version 4.1.3 library(plyr) ## Warning: package 'plyr' was built under R version 4.1.3 ## ## Attaching package: 'plyr' ## The following object is masked from 'package:ggpubr': ## ## mutate library(inferr) ## Warning: package 'inferr' was built under R version 4.1.3 library(extrafont) ## Warning: package 'extrafont' was built under R version 4.1.3 ## Registering fonts with R library(car) ## Warning: package 'car' was built under R version 4.1.3 ## Loading required package: carData ## Warning: package 'carData' was built under R version 4.1.3 library(dplyr) ## Warning: package 'dplyr' was built under R version 4.1.3 ## ## Attaching package: 'dplyr' ## The following object is masked from 'package:car': ## ## recode ## The following objects are masked from 'package:plyr': ## ## arrange, count, desc, failwith, id, mutate, rename, summarise, ## summarize 188 ## The following object is masked from 'package:gridExtra': ## ## combine ## The following object is masked from 'package:MASS': ## ## select ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(conover.test) windowsFonts(A = windowsFont("Times New Roman")) ## the .txt file needs to be saved as the type of "Tab delimited". ## This script is for the statistical analysis of EC sludge separators. It us es one-way ANOVA and Tukey's HSD tests to detect differences between the perf ormance of the separators. ## choose the Meta_data table should be .txt con <- file.choose(new = FALSE) #The file should be in the Pilot_EC_data_anal ysis folder and is named sludge_separation_meta_data.txt metadata_sep <- read.table(con, header = T, row.names = NULL) metadata_sep$s_version <- factor(metadata_sep$s_version) ##Factor Statement sep_version <- metadata_sep$s_version sep_version ## [1] 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 ## Levels: 1 2 3 # data summary of variables grouped by the sludge separator version because t he function above was not working properly. # for COD meta_datasummary<-metadata_sep %>% group_by(s_version) %>% dplyr::summarize(mean=mean(COD), sd = sd(COD)) meta_datasummary 189 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 215 17.2 ## 2 2 193. 50.2 ## 3 3 220. 179. # data summary for TP meta_datasummary2<-metadata_sep %>% group_by(s_version) %>% summarize(mean=mean(TP), sd = sd(TP)) meta_datasummary2 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 1.01 0.746 ## 2 2 1.14 0.334 ## 3 3 1.40 1.21 # data summary for voltage meta_datasummary3<-metadata_sep %>% group_by(s_version) %>% summarize(mean=mean(voltage), sd = sd(voltage)) meta_datasummary3 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 79.9 0.0632 ## 2 2 80.0 0.0568 ## 3 3 80 0 # data summary for TN meta_datasummary4<-metadata_sep %>% group_by(s_version) %>% summarize(mean=mean(TN), sd = sd(TN)) meta_datasummary4 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 17.6 3.50 ## 2 2 25.9 2.75 ## 3 3 14.7 2.38 # data summary for TN removal meta_datasummary5<-metadata_sep %>% 190 group_by(s_version) %>% summarize(mean=mean(TN_rem), sd = sd(TN_rem)) meta_datasummary5 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 51.7 9.60 ## 2 2 23.8 8.65 ## 3 3 35.7 17.4 # data summary for current meta_datasummary6<-metadata_sep %>% group_by(s_version) %>% summarize(mean=mean(current), sd = sd(current)) meta_datasummary6 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 10.1 0.902 ## 2 2 7.93 1.01 ## 3 3 9.25 0.388 # data summary for TS removal meta_datasummary7 <- metadata_sep %>% group_by(s_version) %>% summarize(mean=mean(TS_rem), sd = sd(TS_rem)) meta_datasummary7 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 78.9 6.95 ## 2 2 81.6 5.85 ## 3 3 78.8 7.00 # data summary for COD removal meta_datasummary8 <- metadata_sep %>% group_by(s_version) %>% summarize(mean=mean(COD_rem), sd = sd(COD_rem)) meta_datasummary8 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 87.8 0.978 191 ## 2 2 90.1 1.04 ## 3 3 87.0 8.46 # data summary for TP removal meta_datasummary9 <- metadata_sep %>% group_by(s_version) %>% summarize(mean=mean(TP_rem), sd = sd(TP_rem)) meta_datasummary9 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 93.0 5.21 ## 2 2 95.9 1.49 ## 3 3 94.7 5.68 # data summary for TS meta_datasummary10 <- metadata_sep %>% group_by(s_version) %>% summarize(mean=mean(TS), sd = sd(TS)) meta_datasummary10 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 0.518 0.171 ## 2 2 0.502 0.184 ## 3 3 0.334 0.162 # data summary for Turbidity meta_datasummary11 <- metadata_sep %>% group_by(s_version)%>% summarize(mean=mean(Turbidity,na.rm=TRUE), sd = sd(Turbidity,na.rm=TRUE)) meta_datasummary11 ## # A tibble: 3 x 3 ## s_version mean sd ## ## 1 1 255. 103. ## 2 2 41.8 2.26 ## 3 3 36.8 1.84 ## Checking for normality # voltage, current, TP, COD TP removal, TN, TN removal data are not normal shapiro.test(metadata_sep$voltage) # not normal ## ## Shapiro-Wilk normality test ## 192 ## data: metadata_sep$voltage ## W = 0.67129, p-value = 6.121e-07 shapiro.test(metadata_sep$current) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$current ## W = 0.86774, p-value = 0.001493 shapiro.test(metadata_sep$COD) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$COD ## W = 0.88822, p-value = 0.00438 shapiro.test(metadata_sep$COD_rem) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$COD_rem ## W = 0.72933, p-value = 4.294e-06 shapiro.test(metadata_sep$TP) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$TP ## W = 0.72998, p-value = 4.394e-06 shapiro.test(metadata_sep$TP_rem) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$TP_rem ## W = 0.67222, p-value = 6.304e-07 shapiro.test(metadata_sep$TN) # normal ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$TN ## W = 0.93806, p-value = 0.08067 shapiro.test(metadata_sep$TN_rem) # normal 193 ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$TN_rem ## W = 0.94575, p-value = 0.1299 shapiro.test(metadata_sep$TS) # normal ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$TS ## W = 0.97011, p-value = 0.5421 shapiro.test(metadata_sep$TS_rem) # normal ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$TS_rem ## W = 0.94914, p-value = 0.1604 shapiro.test(metadata_sep$Turbidity) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadata_sep$Turbidity ## W = 0.57958, p-value = 4.274e-06 # equal variance check on TN and TS data bartlett.test(TN~s_version, metadata_sep) # equal ## ## Bartlett test of homogeneity of variances ## ## data: TN by s_version ## Bartlett's K-squared = 1.3405, df = 2, p-value = 0.5116 bartlett.test(TS~s_version, metadata_sep)# equal ## ## Bartlett test of homogeneity of variances ## ## data: TS by s_version ## Bartlett's K-squared = 0.1344, df = 2, p-value = 0.935 ## Multiple ANOVA, Tukey, Kruskal-Wallis, and Conover tests.-------------- # COD k1 <-kruskal.test(COD~s_version,metadata_sep) # no statistically significant differences in COD values between removal k1 194 ## ## Kruskal-Wallis rank sum test ## ## data: COD by s_version ## Kruskal-Wallis chi-squared = 1.0323, df = 2, p-value = 0.5968 # COD removal k2 <-kruskal.test(COD_rem~s_version,metadata_sep) # no statistical significan ce found k2 ## ## Kruskal-Wallis rank sum test ## ## data: COD_rem by s_version ## Kruskal-Wallis chi-squared = 6, df = 2, p-value = 0.04979 # TP k2<- kruskal.test(TP~s_version, metadata_sep) # not significant k2 ## ## Kruskal-Wallis rank sum test ## ## data: TP by s_version ## Kruskal-Wallis chi-squared = 3.7193, df = 2, p-value = 0.1557 # voltage k3 <- kruskal.test(voltage~s_version, metadata_sep) # there is a significant difference found k3 ## ## Kruskal-Wallis rank sum test ## ## data: voltage by s_version ## Kruskal-Wallis chi-squared = 16.278, df = 2, p-value = 0.000292 conover.test(metadata_sep$voltage,metadata_sep$s_version,alpha=0.01) # separa tor one and two had significantly different voltages ## Kruskal-Wallis rank sum test ## ## data: x and group ## Kruskal-Wallis chi-squared = 16.2779, df = 2, p-value = 0 ## ## ## Comparison of x by group ## (No adjustment) ## Col Mean-| ## Row Mean | 1 2 ## ---------+---------------------- 195 ## 2 | -3.895963 ## | 0.0003* ## | ## 3 | -5.759250 -1.863287 ## | 0.0000* 0.0367 ## ## alpha = 0.01 ## Reject Ho if p <= alpha/2 # TP removal k2<- kruskal.test(TP_rem~s_version, metadata_sep) # not significant k2 ## ## Kruskal-Wallis rank sum test ## ## data: TP_rem by s_version ## Kruskal-Wallis chi-squared = 6.9073, df = 2, p-value = 0.03163 # TS fit6 <- aov(TS~s_version, metadata_sep) # Not significantly different summary(fit6) ## Df Sum Sq Mean Sq F value Pr(>F) ## s_version 2 0.2078 0.10389 3.488 0.0449 * ## Residuals 27 0.8042 0.02978 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 fit7 <- aov(TS_rem~s_version, metadata_sep) # not significantly different summary(fit7) ## Df Sum Sq Mean Sq F value Pr(>F) ## s_version 2 51.6 25.79 0.588 0.562 ## Residuals 27 1184.1 43.86 fit8 <- aov(TN~s_version, metadata_sep) # significant summary(fit8) ## Df Sum Sq Mean Sq F value Pr(>F) ## s_version 2 666.8 333.4 39.25 1.02e-08 *** ## Residuals 27 229.4 8.5 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Tukey7 <- TukeyHSD(fit8, conf.level=0.95) # 2 and 1 are different and 3 and 2 are different Tukey7 ## Tukey multiple comparisons of means ## 95% family-wise confidence level ## 196 ## Fit: aov(formula = TN ~ s_version, data = metadata_sep) ## ## $s_version ## diff lwr upr p adj ## 2-1 8.245 5.013149 11.476851 0.0000026 ## 3-1 -2.880 -6.111851 0.351851 0.0876243 ## 3-2 -11.125 -14.356851 -7.893149 0.0000000 fit9 <- aov(TN_rem~s_version, metadata_sep) summary(fit9) ## Df Sum Sq Mean Sq F value Pr(>F) ## s_version 2 3929 1964.6 12.56 0.000139 *** ## Residuals 27 4223 156.4 ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Tukey9 <- TukeyHSD(fit9, conf.level=0.95) # 2 is lower than 1, (only differe nce ). means that initial blackwater concentration had an impact Tukey9 ## Tukey multiple comparisons of means ## 95% family-wise confidence level ## ## Fit: aov(formula = TN_rem ~ s_version, data = metadata_sep) ## ## $s_version ## diff lwr upr p adj ## 2-1 -27.926 -41.793284 -14.058716 0.0000896 ## 3-1 -16.082 -29.949284 -2.214716 0.0205747 ## 3-2 11.844 -2.023284 25.711284 0.1050485 # turbidity k11 <-kruskal.test(Turbidity~s_version,metadata_sep) # significant k11 ## ## Kruskal-Wallis rank sum test ## ## data: Turbidity by s_version ## Kruskal-Wallis chi-squared = 14.737, df = 2, p-value = 0.0006309 conover.test(metadata_sep$Turbidity,sep_version,alpha=0.01) ## Kruskal-Wallis rank sum test ## ## data: x and sep_version ## Kruskal-Wallis chi-squared = 14.7368, df = 2, p-value = 0 ## ## ## Comparison of x by sep_version ## (No adjustment) 197 ## Col Mean-| ## Row Mean | 1 2 ## ---------+---------------------- ## 2 | 3.735436 ## | 0.0010* ## | ## 3 | 9.449990 6.250581 ## | 0.0000* 0.0000* ## ## alpha = 0.01 ## Reject Ho if p <= alpha/2 ## plotting the data with bar plots using the data summaries from above------ -- CODPlot <- ggplot(meta_datasummary,aes(x=s_version,y=mean,fill=s_version)) + geom_bar(aes(x=s_version, y=mean), stat='identity') + geom_errorbar(aes(x=s_version, ymin=mean-sd, ymax=mean+sd), width=0.3)+ lab s(subtitle="a")+ xlab("Sludge separator version")+ ylab("COD (mg/L)")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #CODPlot TPPlot <- ggplot(meta_datasummary2,aes(x=s_version,y=mean,fill=s_version)) + geom_bar(aes(x=s_version, y=mean), stat='identity') + geom_errorbar(aes(x=s_version, ymin=mean-sd, ymax=mean+sd), width=0.3)+ lab s(fill ="separator version", subtitle="a")+ xlab("Sludge separator version")+ ylab("TP (mg/L)")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position="none ", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #TPPlot TNPlot <- ggplot(meta_datasummary4,aes(x=s_version,y=mean,fill=s_version)) + geom_bar(aes(x=s_version, y=mean), stat='identity') + geom_errorbar(aes(x=s_version, ymin=mean-sd, ymax=mean+sd), width=0.3)+ lab 198 s(fill ="separator version",subtitle="a")+ xlab("Sludge separator version")+ ylab("TN (mg/L)")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #TNPlot TNRPlot <- ggplot(meta_datasummary5,aes(x=s_version,y=mean,fill=s_version)) + geom_bar(aes(x=s_version, y=mean), stat='identity') + geom_errorbar(aes(x=s_version, ymin=mean-sd, ymax=mean+sd), width=0.3)+ lab s(subtitle="b")+ xlab("Sludge separator version")+ ylab("TN removal (%)")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #TNRPlot TSPlot <- ggplot(meta_datasummary10,aes(x=s_version,y=mean,fill=s_version)) + geom_bar(aes(x=s_version, y=mean), stat='identity') + geom_errorbar(aes(x=s_version, ymin=mean-sd, ymax=mean+sd), width=0.3)+ lab s(subtitle="a")+ xlab("Sludge separator version")+ ylab("TS (g/L)")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #TSPlot TSRPlot <- ggplot(meta_datasummary7,aes(x=s_version,y=mean,fill=s_version)) + geom_bar(aes(x=s_version, y=mean), stat='identity') + geom_errorbar(aes(x=s_version, ymin=mean-sd, ymax=mean+sd), width=0.3)+ lab s(subtitle="b")+ 199 ylim(0,110)+xlab("Sludge separator version")+ ylab("TS removal (%)")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #TSRPlot TurbPlot <- ggplot(meta_datasummary11,aes(x=s_version,y=mean,fill=s_version)) + geom_bar(aes(x=s_version, y=mean), stat='identity') + geom_errorbar(aes(x=s_version, ymin=mean-sd, ymax=mean+sd), width=0.3)+ xlab("Sludge separator version")+ ylab("Turbidity (NTU)")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #TurbPlot CODRPlot <- ggplot(meta_datasummary8,aes(x=s_version,y=mean,fill=s_version)) + geom_bar(aes(x=s_version, y=mean), stat='identity') + geom_errorbar(aes(x=s_version, ymin=mean-sd, ymax=mean+sd), width=0.3)+ lab s(subtitle = "b")+ xlab("Sludge separator version")+ ylab("COD removal (%)")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #CODRPlot TPRPlot <- ggplot(meta_datasummary9,aes(x=s_version,y=mean,fill=s_version)) + geom_bar(aes(x=s_version, y=mean), stat='identity') + geom_errorbar(aes(x=s_version, ymin=mean-sd, ymax=mean+sd), width=0.3)+ lab s(subtitle="b")+ 200 xlab("Sludge separator version")+ ylab("TP removal (%)")+ ylim(0, 110) + labs(subtitle="b")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #TPRPlot #grid.arrange(CODPlot,CODRPlot,ncol=2) #grid.arrange(TPPlot,TPRPlot,ncol=2) #grid.arrange(TNPlot,TNRPlot,ncol=2) #grid.arrange(TSPlot,TSRPlot,ncol=2) ## End of code. ## statistical analysis examining effects of flow rate and electrode distance on EC treatment ## loading libraries------------- library (MASS) library(ggplot2) ## Warning: package 'ggplot2' was built under R version 4.1.3 library(grid) library(gridExtra) ## Warning: package 'gridExtra' was built under R version 4.1.3 library(ggpubr) ## Warning: package 'ggpubr' was built under R version 4.1.3 library(plyr) ## Warning: package 'plyr' was built under R version 4.1.3 ## ## Attaching package: 'plyr' ## The following object is masked from 'package:ggpubr': ## ## mutate library(inferr) ## Warning: package 'inferr' was built under R version 4.1.3 201 library(extrafont) ## Warning: package 'extrafont' was built under R version 4.1.3 ## Registering fonts with R library(car) ## Warning: package 'car' was built under R version 4.1.3 ## Loading required package: carData ## Warning: package 'carData' was built under R version 4.1.3 library(dplyr) ## Warning: package 'dplyr' was built under R version 4.1.3 ## ## Attaching package: 'dplyr' ## The following object is masked from 'package:car': ## ## recode ## The following objects are masked from 'package:plyr': ## ## arrange, count, desc, failwith, id, mutate, rename, summarise, ## summarize ## The following object is masked from 'package:gridExtra': ## ## combine ## The following object is masked from 'package:MASS': ## ## select ## The following objects are masked from 'package:stats': ## ## filter, lag ## The following objects are masked from 'package:base': ## ## intersect, setdiff, setequal, union library(moments) ## Warning: package 'moments' was built under R version 4.1.3 windowsFonts(A = windowsFont("Times New Roman")) ## the .txt file needs to be saved as the type of "Tab delimited". ## This script is for the statistical analysis of the flow rate and gap size 202 data with sludge separator 4. ## Loading data---------- con1 <- file.choose(new = FALSE) #The file should be in the Pilot_EC_data_ana lysis metadatas4 <- read.table(con1, header = T, row.names = NULL) #head(metadatas4) ## factor statements metadatas4$flow_rate1 <- factor(metadatas4$flow_rate1) metadatas4$gap_size <- factor(metadatas4$gap_size) ## Data summary------------- data1s4<-metadatas4[which(metadatas4$gap_size=="5.08"),] #data1s4 data2s4 <- metadatas4[which(metadatas4$gap_size=="2.54"),] #data2s4 # COD summary datasummarysCOD<-metadatas4 %>% group_by(gap_size,flow_rate1) %>% summarize(mean=mean(COD), sd = sd(COD)) ## `summarise()` has grouped output by 'gap_size'. You can override using the ## `.groups` argument. datasummarysCOD ## # A tibble: 6 x 4 ## # Groups: gap_size [2] ## gap_size flow_rate1 mean sd ## ## 1 2.54 1.1 90.4 0.424 ## 2 2.54 1.5 210 2.83 ## 3 2.54 1.9 223 71.8 ## 4 5.08 1.1 201. 153. ## 5 5.08 1.5 302. 175. ## 6 5.08 1.9 365 248. # voltage summary datasummarysVoltage<-metadatas4 %>% group_by(gap_size) %>% summarize(mean=mean(Voltage), sd = sd(Voltage)) datasummarysVoltage 203 ## # A tibble: 2 x 3 ## gap_size mean sd ## ## 1 2.54 59.8 0.246 ## 2 5.08 79.7 0.695 # current summary datasummarysCurrent<-metadatas4 %>% group_by(gap_size) %>% summarize(mean=mean(Current), sd = sd(Current)) datasummarysCurrent ## # A tibble: 2 x 3 ## gap_size mean sd ## ## 1 2.54 11.3 0.812 ## 2 5.08 9.32 1.41 # energy consumption summary datasummarysPower<-metadatas4 %>% group_by(gap_size) %>% summarize(mean=mean(n_power), sd=sd(n_power)) datasummarysPower ## # A tibble: 2 x 3 ## gap_size mean sd ## ## 1 2.54 1.17 0.109 ## 2 5.08 1.31 0.168 # TN summary datasummarysTN<-metadatas4 %>% group_by(gap_size,flow_rate1) %>% summarize(mean=mean(TN), sd = sd(TN)) ## `summarise()` has grouped output by 'gap_size'. You can override using the ## `.groups` argument. datasummarysTN ## # A tibble: 6 x 4 ## # Groups: gap_size [2] ## gap_size flow_rate1 mean sd ## ## 1 2.54 1.1 15.8 0.778 ## 2 2.54 1.5 21.5 0.566 ## 3 2.54 1.9 44.6 23.3 ## 4 5.08 1.1 10.2 5.55 204 ## 5 5.08 1.5 14.3 1.48 ## 6 5.08 1.9 22.7 8.26 # TP summary datasummarysTP<-metadatas4 %>% group_by(gap_size,flow_rate1) %>% summarize(mean=mean(TP,na.rm=TRUE), sd = sd(TP,na.rm=TRUE)) ## `summarise()` has grouped output by 'gap_size'. You can override using the ## `.groups` argument. datasummarysTP ## # A tibble: 6 x 4 ## # Groups: gap_size [2] ## gap_size flow_rate1 mean sd ## ## 1 2.54 1.1 0.68 0.0424 ## 2 2.54 1.5 1.33 0.0212 ## 3 2.54 1.9 1.80 0.0768 ## 4 5.08 1.1 1.56 1.32 ## 5 5.08 1.5 3.51 1.95 ## 6 5.08 1.9 2.95 2.25 # Turbidity summary datasummarysTurb<-metadatas4 %>% group_by(gap_size,flow_rate1) %>% summarize(mean=mean(Turbidity), sd = sd(Turbidity)) ## `summarise()` has grouped output by 'gap_size'. You can override using the ## `.groups` argument. datasummarysTurb ## # A tibble: 6 x 4 ## # Groups: gap_size [2] ## gap_size flow_rate1 mean sd ## ## 1 2.54 1.1 40.6 5.55 ## 2 2.54 1.5 44.0 0.269 ## 3 2.54 1.9 57.8 11.8 ## 4 5.08 1.1 109. 87.4 ## 5 5.08 1.5 136. 64.9 ## 6 5.08 1.9 139. 108. # COD removal summary datasummarysCODR<-metadatas4 %>% group_by(gap_size,flow_rate1) %>% summarize(mean=mean(COD_Rem), sd = sd(COD_Rem)) 205 ## `summarise()` has grouped output by 'gap_size'. You can override using the ## `.groups` argument. datasummarysCODR ## # A tibble: 6 x 4 ## # Groups: gap_size [2] ## gap_size flow_rate1 mean sd ## ## 1 2.54 1.1 94.4 0.0283 ## 2 2.54 1.5 91.1 0.120 ## 3 2.54 1.9 89.9 2.69 ## 4 5.08 1.1 87.8 7.36 ## 5 5.08 1.5 87.1 4.78 ## 6 5.08 1.9 80.7 2.35 # TN removal summary datasummarysTNR<-metadatas4 %>% group_by(gap_size,flow_rate1) %>% summarize(mean=mean(TN_Rem), sd = sd(TN_Rem)) ## `summarise()` has grouped output by 'gap_size'. You can override using the ## `.groups` argument. datasummarysTNR ## # A tibble: 6 x 4 ## # Groups: gap_size [2] ## gap_size flow_rate1 mean sd ## ## 1 2.54 1.1 70.1 1.46 ## 2 2.54 1.5 67.7 0.849 ## 3 2.54 1.9 32.9 13.0 ## 4 5.08 1.1 54.9 23.2 ## 5 5.08 1.5 44.1 12.1 ## 6 5.08 1.9 32.1 30.0 # TP removal summary datasummarysTPR<-metadatas4 %>% group_by(gap_size,flow_rate1) %>% summarize(mean=mean(TP_Rem,na.rm=TRUE), sd = sd(TP_Rem,na.rm=TRUE)) ## `summarise()` has grouped output by 'gap_size'. You can override using the ## `.groups` argument. datasummarysTPR ## # A tibble: 6 x 4 ## # Groups: gap_size [2] ## gap_size flow_rate1 mean sd 206 ## ## 1 2.54 1.1 96.9 0.191 ## 2 2.54 1.5 95.2 0.0778 ## 3 2.54 1.9 91.7 0.354 ## 4 5.08 1.1 93.6 6.05 ## 5 5.08 1.5 86.0 8.38 ## 6 5.08 1.9 90.1 6.31 # TS removal summary datasummarysTSR<-metadatas4 %>% group_by(gap_size,flow_rate1) %>% summarize(mean=mean(TS_Rem), sd = sd(TS_Rem)) ## `summarise()` has grouped output by 'gap_size'. You can override using the ## `.groups` argument. datasummarysTSR ## # A tibble: 6 x 4 ## # Groups: gap_size [2] ## gap_size flow_rate1 mean sd ## ## 1 2.54 1.1 56.8 7.74 ## 2 2.54 1.5 58.2 5.81 ## 3 2.54 1.9 80.4 4.87 ## 4 5.08 1.1 83.5 7.25 ## 5 5.08 1.5 74.5 2.98 ## 6 5.08 1.9 56.5 19.1 # Turbidity removal summary datasummarysTurbR<-metadatas4 %>% group_by(gap_size,flow_rate1) %>% summarize(mean=mean(Turb_Rem), sd = sd(Turb_Rem)) ## `summarise()` has grouped output by 'gap_size'. You can override using the ## `.groups` argument. datasummarysTurbR ## # A tibble: 6 x 4 ## # Groups: gap_size [2] ## gap_size flow_rate1 mean sd ## ## 1 2.54 1.1 98.1 0.262 ## 2 2.54 1.5 97.9 0.0141 ## 3 2.54 1.9 97.3 0.551 ## 4 5.08 1.1 94.9 4.08 ## 5 5.08 1.5 93.7 3.03 ## 6 5.08 1.9 93.5 5.03 207 ## normality and equal variance check ----------- data_gs1 <- metadatas4[which(metadatas4$gap_size=="5.08"),] data_gs2 <- metadatas4[which(metadatas4$gap_size=="2.54"),] shapiro.test(metadatas4$COD) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadatas4$COD ## W = 0.86628, p-value = 0.0002292 skewness(metadatas4$COD) ## [1] 0.848135 shapiro.test(metadatas4$Voltage) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadatas4$Voltage ## W = 0.60809, p-value = 4.04e-09 shapiro.test(metadatas4$Current) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadatas4$Current ## W = 0.83419, p-value = 3.803e-05 shapiro.test(metadatas4$Power) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadatas4$Power ## W = 0.70609, p-value = 1.227e-07 shapiro.test(metadatas4$n_power) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadatas4$n_power ## W = 0.87262, p-value = 0.0003349 shapiro.test(metadatas4$TN) # not normal ## ## Shapiro-Wilk normality test ## 208 ## data: metadatas4$TN ## W = 0.74222, p-value = 5.168e-07 shapiro.test(metadatas4$TS)# not normal ## ## Shapiro-Wilk normality test ## ## data: metadatas4$TS ## W = 0.92182, p-value = 0.008791 shapiro.test(metadatas4$TP) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadatas4$TP ## W = 0.82288, p-value = 4.798e-05 shapiro.test(metadatas4$Turbidity) # not normal ## ## Shapiro-Wilk normality test ## ## data: metadatas4$Turbidity ## W = 0.76756, p-value = 1.525e-06 # likely need to use non parametric tests ## multiple Mann-Whitnney tests------------- # 1 inch vs 2 inch data wilcox.test(data1s4$COD,data2s4$COD,exact=FALSE) # no difference ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s4$COD and data2s4$COD ## W = 177.5, p-value = 0.7905 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s4$TP,data2s4$TP,exact=FALSE) # no difference ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s4$TP and data2s4$TP ## W = 127, p-value = 0.5811 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s4$Turbidity,data2s4$Turbidity,exact=FALSE) # no difference 209 ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s4$Turbidity and data2s4$Turbidity ## W = 196, p-value = 0.417 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s4$TN,data2s4$TN,exact=FALSE) # very significant ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s4$TN and data2s4$TN ## W = 40, p-value = 0.0001677 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s4$n_power,data2s4$n_power,exact=FALSE)# significant ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s4$n_power and data2s4$n_power ## W = 271, p-value = 0.002484 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s4$Current,data2s4$Current,exact=FALSE) # very significant ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s4$Current and data2s4$Current ## W = 48, p-value = 0.0003711 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s4$Voltage,data2s4$Voltage,exact=FALSE) # very significant ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s4$Voltage and data2s4$Voltage ## W = 336, p-value = 1.938e-08 ## alternative hypothesis: true location shift is not equal to 0 # TN gap and flow rate comparisons # 1 inch gap data data1s45 <- data1s4[which(data1s4$flow_rate1=="1.9"),] data1s44 <- data1s4[which(data1s4$flow_rate1=="1.5"),] data1s43 <- data1s4[which(data1s4$flow_rate1=="1.1"),] # 2 inch gap data data2s45 <- data2s4[which(data2s4$flow_rate1=="1.9"),] data2s44 <- data2s4[which(data2s4$flow_rate1=="1.5"),] data2s43 <- data2s4[which(data2s4$flow_rate1=="1.1"),] 210 # between gap size at the same flow rate wilcox.test(data1s45$TN, data2s45$TN,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s45$TN and data2s45$TN ## W = 16, p-value = 0.1036 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s44$TN, data2s44$TN,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s44$TN and data2s44$TN ## W = 0, p-value = 0.06675 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s43$TN, data2s43$TN,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s43$TN and data2s43$TN ## W = 5, p-value = 0.1771 ## alternative hypothesis: true location shift is not equal to 0 # Means that gap size did not really have an impact on the final TN concentra tion # between flow rates now for 1 inch wilcox.test(data1s45$TN, data1s44$TN,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s45$TN and data1s44$TN ## W = 39.5, p-value = 0.05255 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s44$TN, data1s43$TN,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s44$TN and data1s43$TN ## W = 56, p-value = 0.2655 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s43$TN, data1s45$TN,exact=FALSE)# significant difference 211 ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s43$TN and data1s45$TN ## W = 16, p-value = 0.007018 ## alternative hypothesis: true location shift is not equal to 0 # between flow rates now for 2 inches wilcox.test(data2s45$TN, data2s44$TN,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s45$TN and data2s44$TN ## W = 13, p-value = 0.24 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data2s44$TN, data2s43$TN,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s44$TN and data2s43$TN ## W = 4, p-value = 0.2453 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data2s43$TN, data2s45$TN,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s43$TN and data2s45$TN ## W = 0, p-value = 0.05019 ## alternative hypothesis: true location shift is not equal to 0 # Overall, changing the flow rate and gap size has little impact on the TN re moval, likely because EC is simply not suitable for reducing TN. # between gap size for each flow rate wilcox.test(data1s45$COD, data2s45$COD,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s45$COD and data2s45$COD ## W = 37.5, p-value = 0.5992 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s44$COD, data2s44$COD,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction 212 ## ## data: data1s44$COD and data2s44$COD ## W = 8, p-value = 0.6171 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s43$COD, data2s43$COD,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s43$COD and data2s43$COD ## W = 22, p-value = 0.2334 ## alternative hypothesis: true location shift is not equal to 0 # Means that gap size did not really have an impact on the final COD concentr ation # between flow rates now for 2 inch wilcox.test(data1s45$COD, data1s44$COD,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s45$COD and data1s44$COD ## W = 32, p-value = 0.3329 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s44$COD, data1s43$COD,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s44$COD and data1s43$COD ## W = 48.5, p-value = 0.6204 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s43$COD, data1s45$COD,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s43$COD and data1s45$COD ## W = 24, p-value = 0.03151 ## alternative hypothesis: true location shift is not equal to 0 # between flow rates now for 1 inches wilcox.test(data2s45$COD, data2s44$COD,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s45$COD and data2s44$COD 213 ## W = 10, p-value = 0.6953 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data2s44$COD, data2s43$COD,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s44$COD and data2s43$COD ## W = 4, p-value = 0.2453 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data2s43$COD, data2s45$COD,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s43$COD and data2s45$COD ## W = 0, p-value = 0.05019 ## alternative hypothesis: true location shift is not equal to 0 # no differences at all. In terms of COD reduction, the EC performance consis tent across these three flow rates and gap distance. # TP comparisons # between gap size for each flow rate wilcox.test(data1s45$TP, data2s45$TP,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s45$TP and data2s45$TP ## W = 16, p-value = 1 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s44$TP, data2s44$TP,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s44$TP and data2s44$TP ## W = 8, p-value = 0.6171 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s43$TP, data2s43$TP,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s43$TP and data2s43$TP ## W = 20, p-value = 0.3825 ## alternative hypothesis: true location shift is not equal to 0 214 # Means that gap size did not really have an impact on the final TP concentra tion # between flow rates now for 2 inch for each flow rate wilcox.test(data1s45$TP, data1s44$TP,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s45$TP and data1s44$TP ## W = 24, p-value = 1 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s44$TP, data1s43$TP,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s44$TP and data1s43$TP ## W = 73, p-value = 0.01188 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s43$TP, data1s45$TP,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s43$TP and data1s45$TP ## W = 24, p-value = 0.03156 ## alternative hypothesis: true location shift is not equal to 0 # between flow rates now for 1 inch wilcox.test(data2s45$TP, data2s44$TP,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s45$TP and data2s44$TP ## W = 8, p-value = 0.1002 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data2s44$TP, data2s43$TP,exact=FALSE) # not different ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s44$TP and data2s43$TP ## W = 4, p-value = 0.2453 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data2s43$TP, data2s45$TP,exact=FALSE) # not different 215 ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s43$TP and data2s45$TP ## W = 0, p-value = 0.1002 ## alternative hypothesis: true location shift is not equal to 0 # between gap size at the same flow rate 2 inches wilcox.test(data1s45$Turbidity, data2s45$Turbidity,exact=FALSE) # not differe nt ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s45$Turbidity and data2s45$Turbidity ## W = 32, p-value = 1 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s44$Turbidity, data2s44$Turbidity,exact=FALSE) # not differe nt ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s44$Turbidity and data2s44$Turbidity ## W = 12, p-value = 0.06675 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s43$Turbidity, data2s43$Turbidity,exact=FALSE) # not differe nt ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s43$Turbidity and data2s43$Turbidity ## W = 17, p-value = 0.6914 ## alternative hypothesis: true location shift is not equal to 0 # Means that gap size did not really have an impact on the final Turbidity co ncentration # between flow rates now for 2 inch for each flow rate wilcox.test(data1s45$Turbidity, data1s44$Turbidity,exact=FALSE) # not differe nt ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s45$Turbidity and data1s44$Turbidity ## W = 24, p-value = 1 ## alternative hypothesis: true location shift is not equal to 0 216 wilcox.test(data1s44$Turbidity, data1s43$Turbidity,exact=FALSE) # not differe nt ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s44$Turbidity and data1s43$Turbidity ## W = 53, p-value = 0.3865 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data1s43$Turbidity, data1s45$Turbidity,exact=FALSE) # not differe nt ## ## Wilcoxon rank sum test with continuity correction ## ## data: data1s43$Turbidity and data1s45$Turbidity ## W = 33, p-value = 0.1246 ## alternative hypothesis: true location shift is not equal to 0 # between flow rates now for 1 inch wilcox.test(data2s45$Turbidity, data2s44$Turbidity,exact=FALSE) # not differe nt ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s45$Turbidity and data2s44$Turbidity ## W = 16, p-value = 0.05019 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data2s44$Turbidity, data2s43$Turbidity,exact=FALSE) # not differe nt ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s44$Turbidity and data2s43$Turbidity ## W = 2, p-value = 1 ## alternative hypothesis: true location shift is not equal to 0 wilcox.test(data2s43$Turbidity, data2s45$Turbidity,exact=FALSE) # not differe nt ## ## Wilcoxon rank sum test with continuity correction ## ## data: data2s43$Turbidity and data2s45$Turbidity ## W = 0, p-value = 0.05019 ## alternative hypothesis: true location shift is not equal to 0 217 ## plots--------- # COD box_COD <- ggplot(datasummarysCOD, aes(x=flow_rate1, y=mean, fill=gap_size)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Flow rate (L/min)")+ ylab("COD (mg/L)") + labs(fill="Gap size (cm)")+ ylim(0, 650) + labs(title = "", subtitle="a")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #box_COD # Voltage box_voltage <- ggplot(datasummarysVoltage, aes(x=gap_size, y=mean, fill=gap_s ize)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Gap size (L/min)")+ ylab("Voltage (V)") + labs(fill="Gap size (in)")+ ylim(0, 100) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #box_voltage # Current box_current <- ggplot(datasummarysCurrent, aes(x=gap_size, y=mean, fill=gap_s ize)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Gap size (L/min)")+ ylab("Current (A)") + labs(fill="Gap size (in)")+ ylim(0, 12) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "no ne", legend.text = element_text(size = 13, family="A"), 218 legend.title= element_text(size = 13, family="A")) #box_current #TP plot box_TP <- ggplot(datasummarysTP, aes(x=flow_rate1, y=mean, fill=gap_size)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Flow rate (L/min)")+ ylab("TP (mg/L)") + labs(fill="Gap size (in)")+ ylim(0, 6) + labs(title = "", subtitle="a")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #box_TP # TN plot box_TN <- ggplot(datasummarysTN, aes(x=flow_rate1, y=mean, fill=gap_size)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Flow rate (L/min)")+ ylab("TN (mg/L)") + labs(fill="Gap size (in)")+ ylim(0, 70) + labs(title = "", subtitle="a")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #box_TN box_Turb<- ggplot(datasummarysTurb, aes(x=flow_rate1, y=mean, fill=gap_size)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Flow rate (L/min)")+ ylab("Turbidity (NTU)") + labs(fill="Gap size (i n)")+ ylim(0, 250) + labs(title = "", subtitle="")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri 219 ght", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #box_Turb # COD removal plot box_CODR <- ggplot(datasummarysCODR, aes(x=flow_rate1, y=mean, fill=gap_size) ) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Flow rate (L/min)")+ ylab("COD removal (%)") + labs(fill="Gap size (i n)")+ ylim(0, 100) + labs(title = "", subtitle="b")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #box_CODR # TP removal plot box_TPR <- ggplot(datasummarysTPR, aes(x=flow_rate1, y=mean, fill=gap_size)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Flow rate (L/min)")+ ylab("TP removal (%)") + labs(fill="Gap size (in )")+ ylim(0, 100) + labs(title = "", subtitle="b")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #box_TPR box_TNR <- ggplot(datasummarysTNR, aes(x=flow_rate1, y=mean, fill=gap_size)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Flow rate (L/min)")+ ylab("TN removal (%)") + labs(fill="Gap size (in )")+ ylim(0, 100) + labs(title = "", subtitle="b")+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), 220 axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #box_TNR # TS removal plot box_TSR <- ggplot(datasummarysTSR, aes(x=flow_rate1, y=mean, fill=gap_size)) + geom_bar(stat="identity", position=position_dodge(0.9))+ geom_errorbar(aes(ymin=mean-sd, ymax=mean+sd), width=0.2, position=position _dodge(0.9))+ xlab("Flow rate (GPM)")+ ylab("TS removal (%)") + labs(fill="Gap size (in)" )+ ylim(0, 100) + labs(title = "", subtitle=NULL)+ theme(title=element_text(size=12, family="A"), axis.text.x = element_text(size=12, family="A"), axis.text.y=element_text(size=12, family="A"), axis.title.y = element_text(size = 12, family="A"), axis.title.x=element_text(size=12, family="A"), legend.position = "ri ght", legend.text = element_text(size = 13, family="A"), legend.title= element_text(size = 13, family="A")) #box_TSR #grid.arrange(box_COD, box_CODR, nrow=2) #grid.arrange(box_TP, box_TPR, nrow=2) #grid.arrange(box_TN,box_TNR) ## End of code 221