Biogas Produced by Anaerobic Digestion Process and Biodiesel from Date Seeds

: Dates are an important food source in many countries that produce different types of dates. Dates have a signiﬁcant amount of waste, either from planting or eating them. A large amount of seeds are produced from eating it. This study is considered to explore the quantity and the quality of biogas produced from the Sagai date seeds through the anaerobic digestion process (AD) before and after oil extraction and exploitation of oil in biodiesel production. In addition, the study aims to tests the resulted digestate from the AD process. This test was performed to ensure that the digestate contains the three basics elements (N, P and K) to be used in agriculture. In its preparation, the date seeds were ground after washing via a grinding machine without exposure to any other treatment process. Design of Experiments (DOE) was applied in determining the effect of temperature, volatile solid and sludge quantity on the resulted biogas. The energy balance at the optimum results was calculated. The highest biogas volumes from the AD of date seed before and after oil extraction were 4140 cc and 3534 cc, respectively, at 37 ◦ C, 4.2 g-VS and 50% sludge quantity. While the highest methane/g-VS were 1143.8 cc/g-VS and 949.6 cc/g-VS, respectively, at 37 ◦ C, 1.1 g-VS and 50% sludge quantity. The oil obtained using the Soxhlet method at 70 ◦ C, 1:4 ratio of date seeds to n-hexane solvent and 5 h reaction time was 16% of the date seed mass (79% biodiesel and 9% glycerine). Therefore, the resultant effect from the main ﬁndings indicated that the study supports the investigation of the possibility of exploiting date seeds in the production of biogas, biodiesel and bio-fertiliser.


Introduction
The palm tree existed more than 5000 years ago. It grows in extreme climatic conditions, which normally not ideal for the growth of many other plants [1,2]. It can grow and survive in arid, semi-arid and hot climate regions [1]. A palm date is scientifically known as "phoenix dactylifera L.". It is an essential food for many countries such as the Middle East, North Africa. It is one of the oldest and main staple food in this region due to its content of several nutrients [2]. Its composition and other contents of vitamins and minerals make it a highly nutritional and health value products. A lot of people in many countries where it is being produced depend on it for their daily diet as a source of food. Even though dates are rich in sugars, the Glycaemic Index of date is low and therefore, their regular consumption do not lead to health worries [3]. Some of the well-known types of dates are Sagai, Ajwa and Sukkary [4]. Dates are processed in mass production to produce many products such as date syrup and date paste [5,6]. The seed is one of the wastes produced from the date, which annually estimated at more than 960,000 tons. It is a solid rectangular body inside the dates, tends to be brown in colour [7,8]. The date seed is used as a source of energy, nutritious drinks and polymer components [9][10][11]. In addition, some studies extract oil from the date seed in order to produce biodiesel [12][13][14][15]. Date Seed Oil is also used in cosmetic industries such as creams, shampoos and soaps [16]. It consists of more than 90% carbohydrate, protein and lipids and this enhances its use as a source of biogas 80 • C for 12 h. The date seeds were then milled to five different sizes (300 nm, 0.1-0.3 mm, 0.3-0.85 mm, 0.85-1.18 mm and >1.18 mm) and compared to the whole date seeds. The study found that the particle size of the date seed has a noticeable effect on the percentage of oil produced. Where the oil percentage produced increased with the decreasing date seed particles size, except for the particles sizes of 300 nm. The oil produced from both date seeds using the Soxhlet method was 10.4% and 10.5% of the date seed mass, while the ratio was 9.0% and 9.7% using the Foch method. The percentage of oil produced was determined by dividing the mass of extracted oil by the mass of dried sample used. They also found that the Soxhlet extraction method was more productive than the Folch method, for all particle sizes and both date seeds types. Table 1 illustrates the biodiesel characteristics of different date seed types. Producing biodiesel from natural oils, also produces glycerol as a by-product of up to 10% [45]. Many previous studies indicated that the percentage of glycerine from the biodiesel transesterification process ranges between 9-9.6% of the total product [46][47][48][49][50]. Glycerol or as typically known as glycerine is formed during the transesterification process with ethanol or methanol [51]. Glycerine is environmentally friendly, harmless to human health, soluble in water and is colourless and odourless [52]. Glycerol does not mix with biodiesel, it polymerises at high temperatures resulting in the emission of a toxic gas [53]. Therefore, it is more expedient to exploit the glycerol produced from the production of biodiesel [54]. Glycerine is available in different forms: Crude, Purified and commercial [55]. The purity of glycerine affects its final use. Crude glycerine is less preferred in use, so it is sold to large refineries to purify it. Purified glycerine is preferred in food, pharmaceutical and cosmetic manufactures, while commercial glycerine is considered optimal in medical usages [29,56].
The aim of this study is to explore the quantity and quality of biogas produced from date seed after grinding pre-treatment without exposing them to any other treatment such as heating or crushing. The effect of oil extraction from the date seed on biogas quality and quantity will also be examined. The ability of biodiesel and glycerine from dates seed oil to enhance the AD process will be investigated as well in this study. Moreover, the effect of oil extraction on the resulting digestate will be clarified as well, to gain more knowledge about its components and suitability for agriculture applications. The effect of some factors affecting AD process, such as temperature, volatile solid concentration and sludge quantity, were attested during this study. The effect of interaction of these factors on the biogas produced were analysed to reach to the optimal composition to maximise the biogas and methane (CH 4 ) percentage and to calculate the energy balance at the optimal settings.

Feedstock and Inoculum
Sagai dates seed was brought from Saudi Arabia. A kilogram of Sagai Date Seed was prepared and washed with water to remove impurities and flush. It was left for three days in the air to dry. The date seed were then ground by using a grinding machine. The grinding process was performed without any additional process to soften the seeds such as heating or hammering to ensure that the seeds are not affected by any external factors as well as to reduce the operational costs. The grinding process resulted in a powdered date with a practical range of 800-355 µm, post sieving. The oil extraction process for the production of biodiesel and glycerine was carried out using the Soxhlet device, according to the AOCS official method Am 2-93 [57]. Each time 20 g of date seed powder was placed in a paper thimble and covered with a piece of cotton to prevent the feedstock from leaking into the extraction device. The n-hexane organic solvent was used for the extraction process at a ratio of 1:4 (seed/n-hexane). The mixture was left to react at 70 • C for 5 h under reflux and continuous stirring. The n-hexane solvent was separated from the oil by a rotary evaporator. To produce biodiesel and glycerine, Amani (2013) [43] method was followed. The date seed oil was heated at 60 • C, then methanol was added to the oil at a ratio of 1:5 (methanol to oil) and approximately 0.4 g of sodium hydroxide. The components were left to react for 2 h under constant stirring and reflux. After producing the biodiesel and glycerine, the alcohol was extracted from the mixture using a rotary evaporator. Biodiesel and glycerine were placed in a separating funnel to separate them from each other due to their differences in densities. The impurities and remaining glycerine were removed from biodiesel using hot water and then dried in a rotary evaporator [43,44].
The inoculum sludge was brought on the same day of performing the experiment in a 20 L container from Green Generation Ltd., Numey, Ireland. The total solid (TS) of the sludge was found equal 6.5% while the volatile solid was equal 4.51%. The pH of the inoculum was measure and found to be equal to 8.1. Sigma Aldrich Ireland provided chemicals used in the study such as (n-hexane and methanol).

Total Solid and Volatile Solid
According to standard methods (NREL/MRI LAP 1994, 2008), the TS and volatile solid were measured and adjusted as designed in the experiment matrix [58]. The volatile solid value of the grounded date seeds was calculated by taking three samples and placing them in the oven at 105 • C. The MS and the TS of all the samples were calculated then they were burned in the oven at 575 • C for 4 h. Thereafter, the volatile solid was determined based on the resulting ash weight. Consequently, based on the previous studies [23,27,28] and the preliminary experiments, found that the optimal value of the volatile solid lies between 1.1 and. 4.2 g-VS.
It was noticed that each gram of extracted oil date seed powder would give 0.867 g-VS. Accordingly, the volatile solid of extracted oil date seed was measured and adjusted [58] as designed in the experiment matrix as follows: 4.85 g of date seed powder to yield 4.2 g-VS. As well, 3.06 g of date seed powder gave 2.65 g-VS, and 1.27 g of the date seed powder provided 1.1 g-VS. Date seed powders were placed in a 500 mL flask and sludge was added to the flask at different quantities (25%, 37.5% and 50%) from the total of 400 mL. Water was added to the mixture in a variable ratio to raise the flask to 400 mL. The moisture content and the TS were calculated as shown in Table 2.

Anaerobic Digestion of Date Seed
For each reactor a specific amount of date seed powder, which would give the required amount of volatile solid was placed in a 500 mL flask. This was carried out according to experiments matrices. Sludge was added to the mixture with different percentages (25%, 37.5% and 50%) from the total sample size of 400 mL. Then, completing the volume to 400 mL by adding water. The flasks were connected to aluminium gasbags to form the reactor. Then the O 2 was withdrawn from the reactor by flushing nitrogen gas into it. A vacuum pump was used to pump out the gases from the reactor. This process was repeated twice to ensure that the reactor is nearly free of O 2 . Reactors were placed in three water baths with three different temperatures. Each sample was replicated three times. The incubation period was set to 21-days. The reactors were shaken on a daily basis. The produced biogas volume was measured using a volumetric cylinder. It uses gas-sampling tubes that were installed in a gas jar with confining liquid. The biogas was measured twice during the experiment period (in day 9 and at the end of the incubation period).
The biogas analyser model biogas5000 Geo-tech was used again to measure percentages of the biogases produced (mainly: CH 4 , CO 2 , O 2 and others gases). The pH of each reactor was measured at the end of the period using Hanna Precision pH meter. In addition, the residue of the process was tested to determine its validity to be used as an organic fertiliser. This test was carried out at Advance Laboratory Testing Ltd., Newbridge, Ireland.

Biogas Measurement
The resulting biogas was measured twice during the experiment on day 9 and day 21. Due to that some bags are almost full on the eighth/ninth day. The volumetric flask was filled with a specific amount of water for comparison. An inverted cylinder of 250 mL was placed in the volumetric flask and the biogas is pumped into it. The water level increased to reach a new level. The difference between the two levels represented the volume of the biogas produced.

Energy Balance
The energy balance based on mechanical processing is calculated using the following formula as shown in Equation [58]: While; B s is the energy content of biogas produced by CP in [kW h/m 3 ], CH 4 % is the average of methane percentage of each sample. The value 9.67 is a reference value and indicates the energy quantity of 1 Nm 3 of biogas [59]. The energy gained from a gram of volatile solid of CP from the biogas produced is calculated by the following formula: Furthermore, E p [Wh/g-VS] is the energy gained from 1 g of volatile solid of CP while B p is the biogas volume produced from 1 g of volatile solid of CP. The formula to calculate the electricity consumed by pre-treatment to treat a gram of volatile solid of CP is: In the same vein: E c is the electricity consumed by pre-treatment to treat a gram of volatile solid of CP in [Wh/g-VS] and E pt is the electricity consumed in the pre-treatment process that measured by a prodigit kilowatt-hour meter. The total amount of volatile solid in the machine indicated as VS m . The net energy produced by a gram of volatile solid of treated CP (Net E p ) in [Wh/g-VS] was calculated by the formula: The energy gain percentage is the difference between the energy gained by the biogas from treated CP (E p-treated ) and the energy produced from the biogas from untreated CP (E p-untreated ). When the energy gain % is negative, it indicates that the mechanical pretreatment of CP caused loss of energy compared to untreated CP. The energy gain % was calculated by the following formula:

General Results
The p-value of all models throughout this study, indicated the models were significant. The impact of each factor, the interaction between factors and the checked probability ("pvalue") of the model are described in the ANOVA tables (5,6,9,10). These tables illustrate significant model terms. The tables also show that models were adequate as all values of R 2 , predicted R 2 and adjusted R 2 were close to 1. For all models the Predicted R 2 was in reasonable agreement with the Adjusted R 2 as the difference between them was less than 0.2. The model graphs aid in illustrating the behaviour of each response as the factors vary. In Figures 1 and 2 (probability graphs) all of the points were close to the distribution line, this indicates that the distribution was normal and that the adaptation of the model was adequate, which shows the normal probability and predicted volatile solid actual residual values. As the majority of the points did not deviate from the line, the agreement between the actual and predicted response was excellent.

Date Seed Results
The Biogas, CH 4 % and CH 4 volume produced from sludge given in Table 3 are expanded in to show the Biogas, CH 4 % and CH 4 produced from sludge and after adding the date seed. The biogas yield increased due to the addition of the date seed to the sludge at all temperatures. The highest biogas was found to have increased by approximately five times at 37 • C, from around 880 cc to 4140 cc as indicated in Figure 3. Figures 4 and 5 show the effect of adding date seed to sludge on the percentage and amount of methane produced. Again the highest rise in methane percentage was found at 37 • C, (from 52.9% to 71.1%). While Figure 5 shows the apparent rise due to the addition of date seeds occurred at all temperatures. The highest increase in the amount of methane was again at 37 • C from 466 cc to 2430 cc.
While the experiment matrix shown in Table 4 presents the conditions of each experiment run and the associated response values. It is clear from run #15 that the highest volume of biogas of 4140 cc was achieved at 37 • C, volatile solid value of 4.2 g-VS and sludge quantity of 50%. While the lowest biogas of 1256 cc was obtained at the same temperature, volatile solid value of 1.1 g-VS and sludge amount of 25% (run #16). In both cases the CH 4 percentage was close to each other at 58.7% and 57.9%, respectively. In contrast, if the amount of CH 4 per volatile solid is to be considered, then its value of 661 cc/g-VS (run #16) would be higher in the second case due to a lower volatile solid of 1.1 g-VS was used. However, the amount of CH 4 per volatile solid in the first case was 579 cc/g-VS (run #15), due to a higher volatile solid of 4.2 g-VS was used.    However, the highest amount of Biogas per g-VS of 1838.9 cc/g-VS was obtained at 37 • C, volatile solid value of 1.1 g-VS and at 50% sludge (run #13). At these conditions the highest CH 4 /g-VS quantity of 1143.8 cc/g-VS was recorded. On the other hand, the lowest value of Biogas/g-VS from of 749.5 cc/g-VS was reported at 34 • C, 2.65 g-VS and 25% of the sludge (run #12). The minimum CH 4 /g-VS of 456.4 cc/g-VS was obtained from run #17 at 40 • C, 2.65 g-VS and 25% sludge.
A methane percentage ranged between 51.9% and 71.1% was achieved which is higher than that recorded by Jaffar [27]. While the CO 2 % was between 13.0% and 26.6% lower than that found in the same study [27]. Table 4 shows the relationship between CH 4 % and CO 2 %. It was found that as the CH 4 % increased the CO 2 % decreased. The highest CH 4 % and lowest CO 2 % was found at the following conditions: 37 • C, 4.2 g-VS and 25% sludge quantity (run #8). In contrast, the lowest CH 4 % of 51.9% was found from run #1 at the following conditions: 40 • C, 2.65 g-VS and 50% of the sludge. The highest CO 2 % was found from run #11 at the following conditions: 37 • C, 2.65 g-VS and 37.5% of the sludge. When comparing the amount of biogas produced in this study with previous studies [24,27], the volume of Biogas/g-VS produced in this study was higher than the amount that recorded by Lattieff [24]. This increase is attributed to the treatment method followed in this study and inoculum used. Furthermore, it was found that the amount of biogas was two times higher than that reported in [27]. This is could be due to the treatment method used on date seed in this study as no boiling or exposing of the date seed to elevated temperatures was conducted (i.e., only grinding). In addition, the difference in the inoculum used may be a reason for the change in the volume of the resulting biogas. However, due to the similarity in the components of most types of dates and their proportions, this study's results are applicable to other types of date seeds, at different times.

Model Estimation
The ANOVA Tables 5 and 6 show that models were significant. The coded Equations (6)-(10) are shown below with each response. The influences of volatile solid (B) and sludge quantity (C) were significant for all responses, while there was no significant influence of temperature (A) on the Biogas/g-VS and CH 4 /g-VS. The interaction of (BC) had a significant influence on the Biogas/g-VS, CH 4 % and CH 4 /g-VS responses. In contrast, the CH 4 % and CO 2 % were significantly affected by the interaction of temperature and volatile solid (AB). There was no significant influence for the interaction between the temperature and the amount of the sludge (AC) on all responses.

Biogas
As its clear from Figure 6, the highest biogas produced was found at volatile solid of 4.2 g-VS. In addition, it is clear that the biogas produced was directly proportional to the volatile solid and sludge quantity. This is in line with what Igoni et al. [60] mentioned that the volume of biogas increased with an increase in the volatile value in the batch reactor. The biogas produced was slightly affected by temperature variation as shown in Figure 6. This differs from what was stated in Lattieff [24], where the volume of biogas produced decreased by 27% when the temperature changed from 37 • C to 55 • C. This difference may be due to that the reaction changed from mesophilic to thermophilic condition and recycled digestate used. Figure 7 illustrates that the highest biogas produced was at volatile solid of 4.2 g-VS and at any temperatures. The coded Equation (6) demonstrates that the most factor affect the biogas volume was the volatile solid followed by sludge quantity and temperature. The effect of these factors on the biogas yield were a positive effect. However, this effect was on the quantity of biogas only. The effect of the factors on the quality of the biogas will be discussed later.

Biogas/g-VS
According to Figure 8 it can be seen that, the highest amount of Biogas per gram volatile solid produced was found at volatile solid of 1.1 g-VS. The reason for that when calculating the amount of Biogas/g-VS the biogas produced (divided by the volatile solid value). The higher the volatile solid value, the less volume of Biogas/g-VS achieved and vice versa. In contrast, direct proportion between the sludge quantity and the volume of Biogas/g-VS produced. The effect of temperature on Biogas/g-VS remained low. Figure 9 shows the interaction effect between volatile solid and sludge quantity on the response. It is evidence from this figure that, by using volatile solid of 1.1 g-VS, the maximum Biogas/g-VS of 1800 cc/g-VS could be achieved if the sludge quantity is kept at 50%. From Figure 9, using a volatile solid of 4.2 g-VS, the amount of Biogas/g-VS decreased to around 900 c/g-VS, observing that there is no significant difference between both sludge quantities. This is due to the increase of feedstock that lead to inhibit the reaction thus the biogas produced decreased [17]. The effect of the volatile solid and the sludge quantity on the response was illustrated in Figure 10. It shows that the maximum Biogas/g-VS yield was when the volatile solid at its minimum values, sludge quantity more than 45% and 37 • C. The effect of volatile solid was highest on Biogas/g-VS followed by sludge quantity and the interaction between them according to the coded Equation (7). The effect of volatile solid and its interaction with the sludge quantity were negative. While increasing the amount of sludge positively affected the Biogas/g-VS. The coded Equation (7) for Biogas/g-VS is: Biogas/g-VS = 987.45 + 29A − 304.56B + 185.14C − 125.95BC + 216.62B 2 (7) Figure 9. Interaction plot clarifies the effect of interaction between volatile solid and sludge quantity on Biogas/g-VS.

CH 4 %
It is evident from Figure 11 that the highest amount of methane percentage was achieved at 25% sludge quantity. The figure shows that the increase of temperature and sludge quantity had a negative effect on the CH 4 %. An increase in temperature lead to instability in the reaction and an increase in the proportion of ammonia, thereby less methane production [24,61]. The quantities of minerals present in the sludge influences on the methane production. Sludge containing large amounts of Ni and Mo helps in improving the digestion process. While, an increase of Al and Zn proportions in the sludge leads to inhibit the digestion process [62]. The negative effect of sludge quantity remained until it reached the centre value and then rose slightly. From Figures 12 and 13 it can be seen that the two interaction effects between volatile solid and both temperature and sludge quantity. The more volatile solid lead to an increase in CH 4 %. The ratio of feedstock to inoculum is an important factor in the AD process [63]. Setting this ratio plays a major role in stabilising the digestion process and the biogas yield. Increasing this ratio gives high methane production in a longer incubation period. On the other hand, the intermediate ratio gives a high yield of methane over a shorter time [63]. It is clear from Figure 12 that the methane percentage decreased as the temperature rose given that no difference in percentage of volatile solid at both settings was observed at 40 • C. Figure 13 illustrates that the CH 4 % reached to its peak at value of 4.2 g-VS and sludge quantity of 25%. This percentage decreased sharply by decreasing the volatile solid value from 4.2 g-VS to 1.1 g-VS. The CH 4 % was similar at a volatile solid of 1.5 g-VS for both sludge quantities ( Figure 13). The coded Equation (8) shows the effect of the interaction between the volatile solid and the sludge quantity were the highest on CH 4 %. These effects are related to the quality of the biogas not the quantity.
The coded Equation (8) for CH 4 % is:    3.2.5. CO 2 % Figure 14 demonstrates that the lowest amount of CO 2 % was achieved at sludge quantity of 25%, proving the inverse relationship between CH 4 % and CO 2 %. From the same figure it can be noticed that the CO 2 % directly proportional with temperature. Furthermore, CO 2 % increased by increasing the volatile solid and sludge quantity until they reach to the centre values. This was followed by a decreased in the CO 2 % by increasing of the volatile solid and sludge quantity. Figure 15 shows the effect of interaction between temperature and volatile solid on the response. It is clear from that the lowest CO 2 % was found when using the volatile solid of 4.2 g-VS at 34 • C. Figure 16 illustrates the wide design space which produced the highest CO 2 % at volatile solid between 1.7-3.6 g-VS, 37.5% sludge and at temperatures between 37-40 • C. The coded Equation (9) shows the effect of the interaction between temperature and volatile solid followed by the sludge quantity were the highest on CO 2 %:

CH 4 /g-VS
The highest methane per gram volatile solid yield was found at the volatile solid of 1.1 g-VS. Figure 17 illustrates the indirect proportion between methane per g-VS and volatile solid. The graph also shows that the CH 4 /g-VS increased slightly by increasing the sludge quantity. Figure 18 shows the effect of the interaction between volatile solid and sludge quantity on CH 4 /g-VS. The highest methane per g-VS was found at a volatile solid of 1.1 g-VS and 50% of sludge quantity. In contrast, lower amounts of methane per g-VS were found at volatile solid of 4.0 g-VS and at both sludge quantity percentages. Even though increasing the volatile solid amount increases the volume of biogas produced and the methane percentage, the highest CH 4 /g-VS was found at lowest volatile solid amount. This is because when calculating the CH 4 /g-VS, it was divided by amount of volatile solid. Therefore, the more volatile solid amount, the less CH 4 /g-VS and vice versa. The coded Equation (10) Table 7 displays the biogas, CH 4 % and methane produced from sludge only. Figure 19 illustrates the influence of adding the extracted oil date seed on the biogas quantity. The volume of biogas reached 3534 cc compared to 804 cc before adding date seeds at 37 • C. The same scenario also occurred at 34 • C and 40 • C however with a slightly less increase, as shown in Figure 19. The extracted oil date seed experiment matrix is shown in Table 8. It illustrates the conditions of experiment runs and the values of the responses. From Table 8 it can be seen the highest biogas yield was 3534 cc (run #10) at 37 • C, of 4.2 g-VS and 50% sludge. In contrast the lowest biogas volume was 971 cc (run #4) achieved at 37 • C, 1.1 g-VS and 25% sludge. The difference in CH 4 % in both cases was quite small at 56.5% and 54.6%, respectively. The CH 4 /g-VS was 482.5 cc/g-VS (run #4) at the lowest biogas yield, which is a little higher than the first case 475.7 cc/g-VS (run #10). That is due to a lower volatile solid of 1.1 g-VS was used in the second case and the higher volatile solid value (4.2 g-VS) was used in the first case.  Figure 19. The considerable increase in biogas yield by adding extracted oil date seed. Furthermore, the highest amount of biogas/g-VS was 1555.1 cc/g-VS and the highest value of CH 4 /g-VS was 949.6 cc/g-VS (run #9) were achieved at 37 • C, 1.1 g-VS and 50% sludge. On the other hand, the lowest value of biogas/g-VS was 641.1 cc/g-VS reported at 34 • C, 2.65 g-VS and 25% of the sludge (run #15). The minimum CH 4 /g-VS was 344.4 cc/g-VS (run #11) was found at 40 • C, 2.65 g-VS and 25% sludge.

Extracted Oil Date Seed Results
Methane percentage ranged between 50.7% and 69.3%, while CO 2 % was between 15.6% and 27.4%. Table 8 illustrates the indirect relationship between CH 4 % and CO 2 %. The highest CH 4 % and lowest CO 2 % values were 37 • C, 4.2 g-VS and 25% sludge (run #5). In contrast, the lowest CH 4 % was found at the following conditions: 40 • C, 2.65 g-VS and 50% of the sludge (run #1). The highest CO 2 % (run #8) was found at 37 • C, 2.65 g-VS and 37.5% of the sludge. Figures 20 and 21 display the effect of added extracted oil date seeds on the quality of the resulting biogas. It is evident from Figure 20 that the CH 4 % reached 69.3% when the date seeds were added compared to approximately 52.3% of sludge only at 37 • C and a little lower values of CH 4 % at 34 • C. In contrast, at 40 • C, the effect of adding date seeds on CH 4 % was insignificant. Figure 21 shows the effect of adding date seeds on the methane yield which increased more than five times at 37 • C from 379 cc to 1997 cc.
Comparing the amount of biogas/g-VS that was resulted from this study with the findings of Shanableh and Radeef (2017) [28], it can be seen that the biogas produced from this study was much higher, almost four times. Furthermore, the methane yield from this study was higher approximately by the same proportion. The reason for this may be due to several factors; including the exposure of the date seeds to drying in the oven at 50 • C for 24 h, crushing the date seeds by a steel hammer and different solvent used in the oil extraction process (mixture of methanol, chloroform and water). In addition, the grinding process using a blender did not grind the core of the date seed so it was excluded [28]. The study found no significant difference between the quantities of biogas before and after oil extraction. The use of small quantities of date seed/sludge mixtures (30 mL) may be the reason for the differences in biogas quantities been somewhat similar, especially during the three-week retention time [28].

Model Estimation
The ANOVA Tables 9 and 10 show that models were significant. The coded Equations (11)-(15) are shown below with each response. The influences of volatile solid (B) and sludge quantity (C) were significant on all responses, while there was no significant influence of temperature (A) on the biogas/g-VS and CH 4 /g-VS. The interaction of (BC) had a significant influence on the biogas/g-VS, CH 4 % and CH 4 /g-VS responses. In contrast, the CO 2 % were significantly affected by the interaction of temperature and volatile solid (AB). There was significant influence for the interaction between the temperature and the amount of the sludge (AC) only on CH 4 %.

Biogas
From Figure 22, it can be seen that the highest biogas achieved was found at 4.2 g-VS of volatile solid. The same figure shows that the biogas yield is directly proportional to the volatile solid and sludge quantity. This corresponds to what was stated in Shanableh and Radeef study [28]. At the incubation period of 3 weeks, when the date seeds/inoculum ratio increased, the biogas produced increased. Moreover, the study found that the inhibition decreased at 20% and 40% ratios due to the oil extraction from date seed. In addition, the figure shows the slight effect of temperature increased on the amount of biogas produced. Figure 23 demonstrates that the highest biogas was found at more than 3.7 g-VS of volatile solid, 50% of the sludge and at all temperatures. The coded Equation (11) shows that the highest effect on the biogas volume was the volatile solid followed by sludge quantity. These factors affected positively on the biogas yield and their effect was on the quantity of biogas only. The effect of the factors on the biogas in quality terms will be discussed later in this section.

Biogas/g-VS
According to Figure 24, it can be seen that the highest biogas per gram volatile solid was achieved at a volatile solid of 1.1 g-VS, because when calculating the biogas/g-VS, the biogas produced was divided by the volatile solid value. The biogas/g-VS is indirectly proportion with the volatile solid value, so the highest volume of biogas was achieved at the lowest volatile solid value. While the sludge quantity and temperature are directly proportion to the volume of biogas/g-VS produced, the interaction effect between volatile solid and sludge quantity on the biogas/g-VS is illustrated in Figure 25. From that figure it can be seen that by using the lowest amount of volatile solid, the maximum biogas/g-VS of 1600 cc/g-VS was achieved when the sludge quantity was 50%. Figure 25 also shows that at a volatile solid of 4.2 g-VS, the amount of biogas/g-VS drop sharply to around 800 c/g-VS. It can be noted that there was no significant difference between biogas/g-VS values at 4.2 g-VS, 37 • C and both sludge quantities due to the inhibition of the reaction resulting from increased the volatile solid [17]. Figure 26 shows the effect of the volatile solid and the sludge quantity on the biogas/g-VS. The highest biogas/g-VS produced was at a volatile solid of 1.1 g-VS and sludge quantity more than 45%. The coded Equation (12) illustrates that the negative effect of volatile solid (B) was highest on biogas/g-VS followed by the positive effect of sludge quantity (C), the positive effect of the square of volatile solid (B2) and the negative interaction (BC) between them (volatile solid and sludge quantity).

CH 4 %
The highest methane percentage was formed at 25% of sludge quantity as shown in Figure 27. The figure also illustrates the negative effect on the CH 4 % when the temperature and the sludge quantity was increased. The amount of ammonia increases with increasing reaction temperature, which also leads to instability of the reaction and thus the production of methane decreases [61]. Likewise, some minerals in the sludge such as Al and Zn inhibit the digestion process. In contrast, the presence of minerals such as Ni and Mo activate the digestion process [62]. The increase in the volatile solid value did not effect on the methane percentage until it reached the centre value, then the methane percentage increased with the increase in the volatile solid value. The negative effect of sludge quantity on the methane percentage remained until it reached centre value and rose slightly. The importance of the date seed/inoculum ratio in controlling the reaction clearly affects the amount of biogas produced. An increase in this ratio leads to higher methane production at a longer incubation time. Setting this ratio at an average value yields high methane production over a shorter incubation time [63]. The interaction effects between all factors are demonstrated in Figures 28-30. From Figure 28, it can be seen that the methane percentage decreased with temperature increase, noticing that no difference in this percentage was found at both volatile solid values at 40 • C. Figure 29 shows the impact of low temperature on the CH 4 % as a methane percentage of 65% was found at 34 • C and 25% of sludge quantity. The CH 4 % readily decreased by increasing the temperature, noticing, when CH 4 % reached its lowest value at the highest temperature of 40 • C and at both sludge quantities values.
It can also be seen from Figure 30 that the highest CH 4 % was formed at a volatile solid value of 4.2 g-VS and sludge quantity of 25%. The CH 4 % clearly declined sharply when the volatile solid value shifted from 4.2 g-VS to 1.1 g-VS. When the volatile solid value was 1.75 g-VS and at both sludge quantities (25% or 50%), the CH 4 % was 56%, as shown in the same Figure. The 3-D surface plot in Figure 31 shows that the highest methane percentage were achieved at a volatile solid values of 3.7-4.2 g-VS, sludge quantities of 25-27% and at 37 • C. The effect of the interaction between the volatile solid and the sludge quantity was followed by the effect of the temperature were the highest on CH 4 %, as clarified in the coded Equation (13). These negatively affected the quality of the biogas, rather than the quantity.

CO 2 %
As evidenced by Figure 32, a sludge quantity of 25% produced the lowest amount of CO 2 % proving the inverse relationship between CH 4 % and CO 2 %. The figure shows a direct relationship between the CO 2 % and temperature. The increase in the volatile solid and sludge quantity led to an increase in the CO 2 % until they both reached their centre values. The CO 2 % decreased after the centre values, as in at increasing values of volatile solid and sludge quantity. The effect of the interaction between temperature and volatile solid on the CO 2 % is demonstrated in Figure 33 which shows, that using a volatile solid of 4.2 g-VS at 34 • C, produced the lowest CO 2 % achieved. Moreover, the contour plot in Figure 34, shows that when a temperature greater than 36 • C was used and volatile solid values between (1.72-3.5) g-VS, the highest CO 2 % can produced. The coded Equation (14) illustrates the highest positive effect of the interaction between temperature and volatile solid followed by the sludge quantity on CO 2 %:

CH 4 /g-VS
It can be seen that from Figure 35 that at the volatile solid of 1.1 g-VS, the highest methane per gram volatile solid volume was obtained. The graph also shows that the CH 4 /g-VS decreased slightly with temperature decrease. The same Figure also shows the indirect proportion between methane per g-VS and volatile solid and the direct relation with that of sludge quantity. The interaction between volatile solid and sludge quantity on CH 4 /g-VS is illustrated in Figure 36. The highest CH 4 /g-VS was gained at a volatile solid of 1.1 g-VS and 50% of sludge quantity. In contrast, the lowest amounts of methane per g-VS were found at a volatile solid of 4.2 g-VS for both sludge quantities. The highest yield of methane per gram volatile solid was obtained at the lowest volatile solid value due to the division by the volatile solid value when calculating the methane per gram volatile solid. Figure 37 shows the highest CH 4 /g-VS can be achieved at 1.

Date Seed vs. Extracted Oil Date Seed
Figures 38-42 illustrate the differences between the responses of date seeds before and after oil extraction. The figures show the impact of oil extraction on all responses, particularly those concerning the resulting biogas quality. Figure 38 displays the difference in biogas before and after oil extraction, where the largest decrease in biogas volume was 22.7% from sample #9, while the smallest decrease was 6.3%. The highest amount of biogas produced from date seeds (sample #12) before oil extraction was 4140 cc, while it decreased to 3534 cc after oil extraction. Furthermore, the variance in biogas/g-VS was similar to the difference in the biogas, as shown in Figure 39.   Figure 40 shows the highest and lowest differences in CH 4 % were 10.98% (sample #6) and 1.12% (sample #13), respectively, while the highest and lowest differences in CO 2 % were 4.14% (sample #15) and −20% (sample #10), respectively, as shown in Figure 41. The highest percentage of methane before and after oil extraction from sample #10 was 71.1% and 69.3%, a decrease of 2.53%. On the other hand, the lowest amount of CO 2 % reached before oil extraction from sample #10 was 13% and after oil extraction, it rose to 15.6%, by an increase of 16.7%. This indicates the effect of oil removal on biogas quality.  The difference in the amount of CH 4 /g-VS can be seen in Figure 42, where it found that extracting the oil from date seed led to a decrease in the amount of CH 4 /g-VS for all sample, with varying percentages ranging from 8.59% to 27%. The highest amount of CH 4 /g-VS before oil extraction was 1143.8 cc and after oil extraction, this amount decreased to 949.6 cc. The decrease in the highest amounts of CH 4 /g-VS from date seed to extracted oil date seed was 16.98%, according to sample #11.  Table 11 shows the test result of the digestates produced from the cassava peel, date seed and extracted oil date seed which confirmed its content of the three main nutrients of conventional fertilisers (N, P and K) and its dry matter (DM). The presence of these elements in the resulting digestate enhances the possibility of its usage in different areas such as agriculture, whether in its liquid form or after it has been dried [64][65][66]. The same table shows different N:P:K ratios obtained from each substance. Extracting the oil from the date seed increased the N content and decreased the P and K contents in the digestate.

Biodiesel
The percentage of oil produced from the date seeds was approximately 16.0 wt.% of the date seed used in the extraction process. The percentage was determined from the mass of extracted oil divided by the mass of the powder date seed used. In other words, each gram of grounded date seed gave approximately 0.202 mL (0.16 g) of oil. This percentage is within the values obtained by Jamil et al. (2016) [44], but it is slightly less than the optimal value obtained, which was 16.5%. This may be due to the use of more reaction time (7 h) [44].
The resulting biodiesel accounted for approximately 79 wt.% of the date seed oil. The separating the biodiesel and glycerine was implemented by placing them in a separating funnel. The properties of the biodiesel produced from the extraction process are given in Table 12 [67][68][69]. The resulting biodiesel was yellowish in colour and had a hazy liquid look. The acid value was measured at 0.01 mg KOH/g, which is in range of the ASTM and EN standard value of maximum 0.5 mg KOH/g. This low acid value indicates that the produced biodiesel is suitable for use in engines. An increase in the acid value of the fuel leads to engine corrosion. Moreover, high acid values impact the low temperature properties of biodiesel due to the high melting points [70]. In addition, the high acid value indicates the inability of biodiesel to store and may cause tank corrosion [15]. The cetane number was calculated at 47.6 as shown in Table 12, which is lies in the range of the ASTM and EN standards. The importance of the cetane number refers to the quality of the fuel in terms of ignition. It depends on the composition of the biodiesel, so it directly affects the engine [71]. The cetane number depends on the chemical compound of the fuel, and it varies from one substance to another. It can affect the engines starting ability, noise level and exhaust emissions [43]. The sulphur content was 0.005% mass, which is a bit higher than the ASTM standard of 0.002% mass, but lower than the EN standard of 0.02% mass. Compared with fossil fuels, one of the most important advantages of biodiesel is its low emissions of sulphur compounds into the atmosphere [72]. The cloud point was measured to be 0 • C which is less than the ASTM standard of −2 to −12 • C, while the pour point of the biodiesel from the study was −2 • C compared to the ASTM standard of −15 to −16 • C. The values of the cloud and pour points as indicated are higher than the standards, which is a disadvantage for the resulting biodiesel. All biodiesels from various sources have high cloud and pour points [43]. The reason for that is because the fatty acids directly affect the cold flow properties of biodiesel. Increasing the carbon atoms in the carbon chain increases the freezing point of the biodiesel, while it decreases with the double bonds [73]. Based on the standard density values of biodiesel for the ASTM and EN standards at 880 kg/m 3 and 860-900 kg/m 3 , respectively, the density of the biodiesel produced from the date seed oil was 890 kg/m 3 , which is within the ranges of the two standards. The density of biodiesel prevents it from breaking up in the engine upon combustion [74]. The mass of injected fuel increases with increasing fuel density.
In addition, the injection timing and the injection spray pattern are directly affected by the density [75]. The penetration of fuel droplets will increase in the combustion chamber with the rise in density. As the density increases, it causes an increase in the fuel droplets diameter [76]. The importance of viscosity lies in its effect on injection in the engine and its spray atomisation after injection. Therefore, the viscosity of biodiesel is high, at 4.11 mm 2 /s. The viscosity value in the ASTM standard is 1.9-6 mm 2 /s and 3.5-5 mm 2 /s in EN standard [77,78]. Moreover, increasing the viscosity value of biodiesel leads to early injection that moves fuel ignition near the top dead centre, which causes an increase in the pressure and temperature in the combustion chamber [75,76].
The temperature at which biodiesel will ignite in contact with air is called the flash point [70]. A low flash point makes the fuel highly volatile, while high flash point leads to carbon deposits in the combustion chambers [71]. The flash point of biodiesel is an important consideration for safety measures in transportation and storage [44]. The flash point is related to the volatility, low volatility with high viscosity leads to misfire, delay in the ignition and poor cold engine starting up [79]. Therefore, the flash point must be at least 130 min according to ASTM D6751 standard or 101 min or more based on EN 14,214 standard [67]. As the flash point in this study was 147 min, it was within range. The biodiesel produced a boiling point of 439 • C which is in the range of the ASTM boiling point between 100-615 • C. The boiling point is related to the volatility of the fatty substances and thus is related to the flash point. Volatility decreases with increasing carbon chain, thus low volatility of flammable materials means higher flash points [80][81][82].

Glycerine
Glycerine was produced as a brownish and gelatinous at room temperature as a by-product from the biodiesel production process. The dark colour of the crude glycerine produced was due to it containing ash, water and other organic matter other than glycerine [83]. The amount of glycerine obtained was estimated at 9 wt.% of the date seed oil. This percentage is in line with the previous studies [46][47][48][49][50]. The physical properties of glycerine are shown in Table 13. The density of glycerine at 15 • C was 1.047 g/mL, with a flash point of 149.5 • C and a glycerine pH of 9.16 which is in the range of the crude glycerol mentioned in the previous studies [56,83]. The glycerine contained 38% water.

Optimisation and Energy Evaluation
Tow optimisation criteria were implemented in this study as shown in Table 14. The first criterion is the quality criterion that to maximise CH 4 with no restrictions on the AD process factors. The second criterion is the cost criterion also to maximise CH 4 with restrictions on the AD process factors to reduce the AD process cost. Table 14 shows the goals and importance set for each criterion. The responses were identified as follows; maximising the biogas/g-VS, CH 4 %, CH 4 /g-VS and minimising the CO 2 % for each criterion. The importance of the CH 4 % response was set to the highest value (5) for its obvious effect on energy balance calculations. The importance of the rest of responses was set to 3. In addition, temperatures were minimised in the second criterion in order to reduce the energy costs used in biogas production process. The volatile solid has been set to maximum in order to take advantage of the largest quantity of date seed. The purpose of that is to contribute to the waste management process, waste disposal without dumping it in the landfill and to reduce the food waste, which is the second highest source of waste [84]. Furthermore, applying the gate fees can be used to enhance the AD process [85]. Gate fees are the costs that the provider pays to AD plants for disposing of waste. These costs are lower than the costs of other options of disposing wastes, which provide a profit for both parties [86]. The energy consumed in the grinding process was quite low and thus neglected. The average electric energy consumed by the water baths at the temperature of 34, 37, 40 • C were 51, 62 and 80 kWh, respectively. Table 15 and Figures 43 and 44 clarified the numerical and graphical optimal results based on the two criteria of date seed. The desired optimal solution by the software only considered in the energy balance calculations. It is clear from Table 15 that the quantity of biogas/g-VS produced by the quality criterion is more than double that of the cost criterion. In contrast, methane in the cost criterion was 73.4%, which is 18% higher than the quality criterion.   As shown in Table 16, the highest energy gain was based on the cost criterion (131.6%) while the energy gain based on the quality criteria was 11.3%. When comparing the two criteria, changing the temperature and sludge quantity goals to "minimise" and the volatile solid to "maximise" resulted in a dramatic rise in energy balance of almost 12 times higher.  Table 17 and Figures 45 and 46 describe the numerical and graphical optimal results based on the two criteria of extracted oil date seed. The optimal solution with the highest desirability that determined by the software was selected in the energy balance calculations. It is clear from Table 17 that the quantity of biogas/g-VS produced by the quality criterion was more than double that of the cost criterion. In contrast, methane in the cost criterion was 71.2%, which was 14.5% higher than the quality criterion. As shown in Table 18, the highest energy gains were based on the cost criterion at 121.5%, while an energy loss resulted based on the quality criteria at −27.1%. When comparing the criteria, changing the temperature to "minimise", sludge quantity goals to "minimise" or "in range" and the volatile solid to "maximise" resulted in a dramatic rise in energy balance.

Conclusions
The exploitation of date seed in producing bioenergy contributes in increasing bioenergy dependence and thus reducing dependence on biofuels and properly managing waste. In addition to the accumulation of waste in general, fossil fuel emissions and food waste pose environmental and health threats. To obtain the highest quantity and quality biogas, it is necessary to set reaction temperature and sludge/substrate ratio at their optimal values. The energy balance results support AD plants in applying gate fees for accepting the wastes and increasing the contribution of the AD of cassava peels and date seeds with respect to waste management. The results of the digestate tests confirmed the content of the three basic nutrients of fertiliser. The presence of these elements is important if one was to use them in the agricultural field, as the quality of the organic fertilisers are evaluated based on the presence of these elements.
Date seeds increased the biogas yield by an order of five times. The methane percentage increased by 25.6%, reaching 71.1%, compared to 52.9% before adding the date seeds. Not exposing the date seed to the treatment processes before the grinding process increased the biogas yield. The highest energy gain obtained from date seed was at the optimal result of 3325.5 cc of Biogas, 830.5 cc/g-VS of cc/g-VS, 73.4% of CH 4 %, 13% CO 2 % and 598.8 cc/g-VS of CH 4 /g-VS at 36.2 • C, 4.2 g-VS and 101.6 mL of sludge. The highest energy gain from extracted oil date seed was 131.6% for the cost criterion, while the gain from the quality criterion was 11.3%. The addition of extracted oil date seeds to the sludge increased the yield of biogas and methane values. The amount of biogas increased dramatically from 800 cc before adding the date seeds to 3534 cc. The CH 4 % increased by approximately 26.5% when the extracted oil date seeds were added. The highest biogas volume at the optimum results of the second Criterion was 2818.7 cc, the Biogas/g-VS was 686.9, CH 4 % was 71.2%, CO 2 % was 17.5% CH 4 /g-VS was 473.7 cc/g-VS at 34 • C, 4.2 g-VS and approximately 128 mL of sludge. The energy gain at these values was 121.5%.
Comparing the results of the AD process of date seeds before and after oil extraction led to the following conclusions: The volume of biogas decreased by varying ratios. The difference was 14.4% at the highest biogas values of 4140 cc before extracting oil and 3543 after the extraction process. The highest difference was 22.7%, while the lowest difference was 6.3%. The largest difference in CH 4 % was 10.98%, while the lowest difference was 1.12%. The difference between the highest values was around 2.53%. In contrast, the percentage of CO 2 emissions resulting from the AD of extracted oil date seeds increased to 15.6% compared to 13% before oil extraction. The difference in the amount of CH 4 /g-VS produced, ranged from 27% to 8.59%. At the highest CH 4 /g-VS values, the difference was about 17%, as it decreased from 1143.8 cc/g-VS to 949.6 cc/g-VS due to the oil extraction process.
Extracting the dates seed oil using the Soxhlet method at the following conditions: 70 • C, 1:4 ratio of date seeds to the solvent and 5 h of reaction time, resulted in approximately identical quantities to the optimal results of previous studies. The percentage of oil extracted from date seeds was approximately 16% of the mass of date seeds, as each gram of ground date seeds yielded approximately 0.220 mL of oil. The percentage of biodiesel produced was 79% of the oil produced, while the glycerine generated, was up about 9% of the oil volume. The test results of the biodiesel and glycerine samples were largely identical to the standards.   The energy content of 1 Nm 3 (Normal cubic meter) of biogas Ep The energy gained from a gram of volatile solid of CP from the biogas produced in [Wh/g-VS] Bp The biogas volume produced from each gram of volatile solid of CP. Ec The energy consumed by the water bath to digest the gram volatile solid of CP in [Wh/g-VS]. Ept The electric energy consumed in the digestion process, which was measured by a prodigit kilowatt-hour meter. VSm The total amount of volatile solid in the water bath Net Ep The net energy produced by a gram of volatile solid of treated CP in [Wh/g-VS]