Microwave- and Ultrasound-Assisted Extraction of Cannabinoids and Terpenes from Cannabis Using Response Surface Methodology

Limited studies have explored different extraction techniques that improve cannabis extraction with scale-up potential. Ultrasound-assisted and microwave-assisted extraction were evaluated to maximize the yield and concentration of cannabinoids and terpenes. A central composite rotatable design was used to optimize independent factors (sample-to-solvent ratio, extraction time, extraction temperature, and duty cycle). The optimal conditions for ultrasound- and microwave-assisted extraction were the sample-to-solvent ratios of 1:15 and 1:14.4, respectively, for 30 min at 60 °C. Ultrasound-assisted extraction yielded 14.4% and 14.2% more oil and terpenes, respectively, compared with microwave-assisted extracts. Ultrasound-assisted extraction increased cannabinoid concentration from 13.2–39.2%. Considering reference ground samples, tetrahydrocannabinolic acid increased from 17.9 (g 100 g dry matter−1) to 28.5 and 20 with extraction efficiencies of 159.2% and 111.4% for ultrasound-assisted and microwave-assisted extraction, respectively. Principal component analyses indicate that the first two principal components accounted for 96.6% of the total variance (PC1 = 93.2% and PC2 = 3.4%) for ultrasound-assisted extraction and 92.4% of the total variance (PC1 = 85.4% and PC2 = 7%) for microwave-assisted extraction. Sample-to-solvent ratios significantly (p < 0.05) influenced the secondary metabolite profiles and yields for ultrasound-assisted extracts, but not microwave-assisted extracts.


Introduction
The extraction of secondary compounds from cannabis presents several challenges. Cannabinoids and terpenoids decompose with light and heat, making them unstable during sample preparation, extraction, and testing methods [1][2][3]. Additionally, differences in the quality and quantity of the extracted crude oil can be attributed to factors such as cannabis plant type (drug or fibre), pollination, sex, age, plant parts, method of plant cultivation (indoor or outdoor), harvest conditions, drying, and storage [4][5][6]. Extraction techniques for cannabis biomass have evolved quickly, resulting in diverse methodologies that have not been properly validated [7]. Frequently used techniques in industries for quality assurance and control include cold ethanol extraction, supercritical CO 2 extraction, conventional Soxhlet extraction, ultrasound-assisted extraction, and microwave-assisted extraction [8,9]. Most researchers report that microwave-assisted extraction and ultrasound-assisted extraction are comparably efficient when compared with traditional solvent methods [10][11][12][13].
Microwaves are non-ionizing irradiation that excites molecules in the essential oil, thereby increasing the rate of extraction [14,15]. Microwaves may be used in conjunction with solvent extraction, Soxhlet extraction, and distillation [11,[16][17][18]. Importantly, microwave-assisted extraction is a safe and environmentally friendly method, as it reduces solvent use and energy consumption, along with various environmental hazards such as chemical wastes. Research studies have concluded that the concentration of secondary metabolites in extracts can be increased using a microwave-assisted extraction system [19][20][21].
Compared with some other novel extraction techniques, the ultrasonic device is less expensive and is very easy to use [22]. Ultrasound-assisted extraction is a rapid, simple, and eco-friendly method for extracting bioactive metabolites from plants, with reduced initial production costs due to the low energy and process time required [23]. Ultrasound-assisted extraction uses acoustic cavitation to produce cavitation bubbles which implode and exert mechanical forces which improve the extraction process by increasing solvent penetration into the plant matrix [24]. Extraction rates are increased by the macroturbulence and highvelocity inter-particle collisions that are caused by the implosion of the gas bubbles [25,26]. Ethanol was used as the extraction solvent, as it is commonly used in the cannabis industry and considered a "green" solvent. Ultrasound and microwaves are considered improved extraction techniques compared with conventional systems, with several advantages, such as shortened extraction time, decreased solvent volumes, and increased extract yield [19,[27][28][29]. However, both techniques have not been fully explored for cannabis extraction.
The aim of this study was to determine and compare the optimal extraction conditions for cannabis using ultrasound-assisted extraction (UAE) and microwave-assisted extraction (MAE). Microwave-and ultrasound-assisted extraction were used for the study, as both systems are perceived as 'green' technologies and efficient solutions that industry stakeholders may find advantageous. However, there is inadequate relevant data on optimum extraction conditions and the effect of microwaves and ultrasound on cannabinoid and terpene yield. The effects of several independent variables, including samples-to-solvent ratio (s:s), extraction temperatures, extraction times, and duty cycles, on crude oil yield and concentration of cannabinoids and terpenes were examined. Response surface methodology (RSM) was used to optimize conditions as the established models evaluated and compared the effects of the dependent variables using quantitative results.

Preliminary Ultrasound-Assisted Extraction and Microwave-Assisted Extraction Data
Microwave-and ultrasound-assisted extraction methods were studied and compared. The selection of independent variables and their ranges for the extraction systems were based on preliminary experiments and a literature review of the probable effects of microwaves and ultrasound on the yield of cannabis oil, cannabinoids, and terpenes. The influence of the independent variables on the extraction of cannabis oil and the secondary metabolite profile by UAE and MAE was studied using the central composite rotatability design (CCRD). The central composite rotatable design was used because it consisted of five levels for each independent variable and was able to test fourth-order quadratic models. Major cannabinoid concentrations of the ground cannabis biomass are listed in Table 1. Cannabinoid and terpene concentrations were measured using the liquid chromatographytandem mass spectrometer (LC-MS/MS) and gas chromatography-tandem mass spectrometer (GC-MS/MS), respectively. The total chromatographic run time was 18 min for the cannabinoids and 25 min for the terpenes (Figure 1). Cryo-ground biomass used for the study contained 17.9 g 100 g dry matter −1 (THCA), 0.17 g 100 g dry matter −1 (THC), 0.04 g 100 g dry matter −1 (CBDA), and 1.01 g 100 g dry matter −1 (THCVA).
The results of 31 and 20 experimental runs for UAE and MAE, respectively, carried out under the CCRD matrix for cannabis oil yields, cannabinoid concentration, and terpene concentration are presented in Tables 2 and 3. Extraction conditions with 0 yield indicate that no extraction procedure was performed either due to a high concentration of sample or 0 extraction time. The reproducibility of the extraction data was verified through results obtained by the replication of the central points. No significant differences were observed in the responses of the central points for both extraction methods.  The results of 31 and 20 experimental runs for UAE and MAE, respectively, carried out under the CCRD matrix for cannabis oil yields, cannabinoid concentration, and terpene concentration are presented in Tables 2 and 3. Extraction conditions with 0 yield  X 1 (Sample (g) solvent (g) −1 ), X 2 (Extraction time (min)), X 3 (Duty cycle (%)), and X 4 (Extraction temperature ( • C)) are the independent variables.
Seven major cannabinoids, namely tetrahydrocannabinol (THC), tetrahydrocannabinolic acid (THCA), tetrahydrocannabivarin (THCVA), cannabigerol (CBG), cannabigerolic acid (CBGA), and cannabichromene acid (CBCA), were observed in all extracted samples (Tables 2 and 3). Cannabidiol (CBD) and total CBD were not presented, as the concentration of CBD was below the limit of detection of the instrument and methodology. The findings demonstrate that the extracted cannabis oil yield ranged from 21.8 to 30.6 g 100 g dry matter −1 and 16.6 to 24.6 g 100 g dry matter −1 for UAE and MAE, respectively. Preliminary experiments showed that UAE extracted 16.6% more oil compared with MAE for samples extracted at 60 • C with a s: s of 1 g of cannabis biomass-to-15 mL of ethanol for 30 min. This significant effect (p < 0.05) in cannabis oil can be attributed to the structural damages and the improved solvent penetration into the plant matrix caused by the acoustic vibrations in UAE. Similar observations were made for the THCA (10.5%) and total terpenes (10.7%).

Effect of Ultrasound-Assisted and Microwave-Assisted Extraction Parameters on Cannabis Oil Yield
Optimizing the extraction yield is critical to the development of medicinal cannabis products, as increasing extract yield can reduce the overall production cost. The effects of four and three independent variables for UAE and MAE on the cannabis extraction yield were evaluated according to the significant coefficient (p < 0.05) of the full quadratic polynomial equation. The cannabis extraction yield for UAE was significantly (p < 0.05) influenced by sample (g) solvent (g) −1 and extraction temperature with first-order linear and second-order quadratic effects (extraction time 2 ). A linear effect of sample (g) to solvent (g) −1 and a quadratic effect (s: s 2 ) was observed for the extraction yield with MAE. According to these data, extending the UAE time from 10 min to 30 min resulted in a higher extraction yield (3.3%). Table 3. Crude cannabis oil yield and concentration of cannabinoids and total terpenes obtained from cryo-ground cannabis subjected to microwave-assisted extraction.  24.56 X 1 (Sample (g) solvent (g) −1 ), X 2 (Extraction time (min)), and X 4 (Extraction temperature ( • C)) are the independent variables.

Independent
Positive coefficient values (Tables 4 and 5) for sample (g) to solvent (g) −1 for UAE and MAE showed that increasing the s: s significantly (p < 0.05) increases the extraction yield. A similar observation was made for the UAE extraction time. Thus, at a constant temperature of 40 • C, increasing the sample (g) solvent (g) −1 from 1:5 to 1:15 increases the yield by 15.6% and 33.8% for UAE and MAE, respectively, when samples were extracted for 30 min. Various extraction studies report that increasing sample (g) solvent (g) −1 can facilitate the mass transfer of compounds from the plant matrix into the solvent [30][31][32]. Sulaiman et al. (2017) showed that increasing the ratio of lindau (Clinacanthus nutans) leaves to ethanol from 70/30 (% v/v) to 90/10 (% v/v) increased the extraction yield by 20.8%.
The relationships between the independent parameters and extraction yield are illustrated in three-dimensional (3D) response surface plots ( Figure 2). The extraction temperature insignificantly (p < 0.05) influenced the extraction yield for both UAE and MAE. An increase in the extraction temperature would confer either a negative or positive effect on extraction yield. This is evident with the slow linear increase in the extract yield from 28 to 28.6 g 100 g dry matter −1 for UAE and a slight decrease from 24.7 to 24.4 g 100 g dry matter −1 for MAE as the temperature rose from 40 to 60 • C using a sample (g)-to-solvent (g) ratio of 1:15. Increasing extraction temperature reduces solvent density, promoting an increase in the mass transfer rate and solute solubility, which improves the extraction yield. Irakli et al., (2018) showed that total phenolic compounds increased as the ultrasound extraction temperature increased from 25 to 60 • C for olives (Olea europaea). However, excessive extraction temperature degrades certain phytochemical compounds such as antioxidants (tannins, oxalate, etc.) and should be avoided [33,34]. Table 4. Matrix of the central composite rotatable statistical design (CCRD) and observed responses (Y j ) for ultrasound-assisted extraction using model A (Y j = β 0 + β 1 X 1 + β 2 X 2 + β 3 X 3 + β 4 X 4 + β 11 X 1 X 1 + β 22 X 2 X 2 + β 33 X 3 X 3 + β 44 X 4 X 4 + β 12 X 1 X 2 + β 13 X 1 X 3 + β 14 X 1 X 4 + β 23 X 2 X 3 + β 24 X 2 X 4 + β 34 X 3 X 4 ).

Effect of Ultrasound-Assisted and Microwave-Assisted Extraction Parameters on Cannabinoids
Cannabinoids are mainly responsible for the therapeutic effects of cannabis [35]. Sample (g)-to-solvent (g) ratio had a linear significant (p < 0.05) effect on the major cannabinoids analyzed for both extraction systems, except for THC content after MAE (Tables  4 and 5). This is supported by the low correlation (0.41) between MAE extraction yield and THC concentration and the parabolic shape of the curve ( Figure 2). The THC content in MAE extracts was influenced by extraction temperature. For UAE, the quadratic effect of extraction time affected all cannabinoids; however, the quadratic effect of sample (g)to-solvent (g) ratio only influenced THCA and CBG content. A positive coefficient value for sample (g)-to-solvent (g) ratio showed that increasing the sample (g)-to-solvent (g) ratio significantly (p < 0.05) increased cannabinoid concentration in extracts. Increasing the ratio from 1:5 to 1:15 increased the total THC in extracts by 37.7% and 19.3% for UAE and MAE, respectively, when samples were extracted for 10 min at 40 °C. This is likely due to cavitation bubbles with UAE and volumetric heating properties with MAE.
Ultrasound-assisted extraction involves mechanical oscillating sound waves ranging from 20 kHz to 2 MHz that produce acoustic cavitation [12]. Acoustic cavitation is affected by s: s and physical properties of the solvent, such as viscosity, saturation vapor pressure, and surface tension [26,36]. Decreasing the sample (g)-to-solvent (g) ratio and viscosity of the solvent intensifies molecular interactions and thus hinders cavitation. The mechanical effect caused by the cavitation increases the permeability of the plant's cell walls and improves the yield of cannabinoids [12,37,38]. Zakaria et al., 2021 showed that increasing the ratio of havil (Mitragyna speciosa) leaves to methanol by 66% increased the extraction yield and total phenolic content by 36.1% and 6.7%, respectively.

Effect of Ultrasound-Assisted and Microwave-Assisted Extraction Parameters on Cannabinoids
Cannabinoids are mainly responsible for the therapeutic effects of cannabis [35]. Sample (g)-to-solvent (g) ratio had a linear significant (p < 0.05) effect on the major cannabinoids analyzed for both extraction systems, except for THC content after MAE (Tables 4 and 5). This is supported by the low correlation (0.41) between MAE extraction yield and THC concentration and the parabolic shape of the curve ( Figure 2). The THC content in MAE extracts was influenced by extraction temperature. For UAE, the quadratic effect of extraction time affected all cannabinoids; however, the quadratic effect of sample (g)-to-solvent (g) ratio only influenced THCA and CBG content. A positive coefficient value for sample (g)to-solvent (g) ratio showed that increasing the sample (g)-to-solvent (g) ratio significantly (p < 0.05) increased cannabinoid concentration in extracts. Increasing the ratio from 1:5 to 1:15 increased the total THC in extracts by 37.7% and 19.3% for UAE and MAE, respectively, when samples were extracted for 10 min at 40 • C. This is likely due to cavitation bubbles with UAE and volumetric heating properties with MAE.
Ultrasound-assisted extraction involves mechanical oscillating sound waves ranging from 20 kHz to 2 MHz that produce acoustic cavitation [12]. Acoustic cavitation is affected by s: s and physical properties of the solvent, such as viscosity, saturation vapor pressure, and surface tension [26,36]. Decreasing the sample (g)-to-solvent (g) ratio and viscosity of the solvent intensifies molecular interactions and thus hinders cavitation. The mechanical effect caused by the cavitation increases the permeability of the plant's cell walls and improves the yield of cannabinoids [12,37,38]. Zakaria et al., 2021 showed that increasing the ratio of havil (Mitragyna speciosa) leaves to methanol by 66% increased the extraction yield and total phenolic content by 36.1% and 6.7%, respectively.
Microwave-assisted extraction uses microwaves to create heat and mass gradients [14,20]. Microwaves increase the kinetic energy of the solvent and improve the rate of penetration of the solvent into the solid matrix. Cannabinoids dissolve in the solvent and the solution diffuses to the surface of the solid. By natural or forced convection, the solution is transferred from the surface of the solid to the bulk medium. Increasing the sample-to-solvent ratio increases the amount of solvent diffusing into the solid matrix and hence, improves the concentration of secondary metabolites in the extracts [20,21].

Effect of Ultrasound-Assisted and Microwave-Assisted Extraction Parameters on the Total Terpenes
Terpenes are mainly responsible for the aroma of cannabis plants [39]. The greater terpene content of 23.8 to 25.8% observed with UAE extracts compared with MAE extracts can be attributed to the simultaneous action of the sonication that promoted the hydration and fragmentation reaction while expediting the rate of mass transfer of solutes to the extraction solvent and avoiding substantial solvent degradation. The sample-to-solvent ratio had a linear effect on total terpene content for both UAE and MAE. However, a quadratic effect (sample-to-solvent 2 ) was only observed for MAE (Tables 4 and 5). The main terpenes identified in the cannabis-extracted oil in this investigation were pinene, myrcene, eucalyptol, limonene, linalool, caryophyllene, and humulene. The observed terpenes are reported to have peppery, citrus, and hoppy mixed aroma [40,41]. As indicated in Figure 2, the duty cycle did not have a significant (p < 0.05) effect on terpene content. Increasing the duty cycle from 40 to 80% at a constant sample (g)-to-solvent (g) ratio of 1:5 and extraction temperature of 40 • C, caused a non-significant (p > 0.05) increase from 0.98 to 0.99 g 100 g dry matter −1 . Extraction time and extraction temperature had similar minimal effects on the terpenes extracted. Terpenes have a low molecular mass and boiling point compared with other plant secondary metabolites [42]. They undergo thermal degradation with prolonged extraction time and increased temperature. Response surface plots ( Figure 2) show that increasing the sample-to-solvent ratio from 1/5 to 1/15 caused a significant increase in terpenes by 11.2% and 23.8% for MAE and UAE, respectively, at a constant temperature (60 • C) and time (10 min).

Model Fitting for Ultrasound-Assisted and Microwave-Assisted Extraction Systems
Responses consisting of THC, THCA, total THC, CBG, CBGA, total CBGA, THCVA, CBCA, total terpene content, and extraction yield for cannabis extracts for UAE and MAE were optimized using CCRD. Four and three second-order polynomial regression models were used to fit the experimental data for UAE and MAE, respectively. The models were included in the study to help explain the correlations between the independent variables and dependent variables and assist scale-up purposes. Regression coefficients for the intercept, linear, quadratic and interaction terms of the models were statistically analyzed and are presented in Tables 4, 5 and S1-S5 (Supplementary Materials). Based on ANOVA (Table 6) and the lack-of-fit data (0.05 to 0.98), models B and F are the best models for explaining the experimental data acquired for UAE and MAE, respectively. F ratios ranging from 1.5 to 5.8 and 3 to 30.5 for UAE and MAE, respectively, imply the significance of all the models. Notably, model E was not significant (p < 0.05) and does not explain the THCA and extract yield data. This is evident by the strong correlation (0.97) between THCA and the extraction yield.
Revising model E to include only the sample-to-solvent (g) ratio and extraction temperature ( • C) as independent parameters, was the ideal model for THCA and the yield. R 2 values above 0.5 demonstrated a significant correlation between the CCRD design and the developed models. Apart from R 2 values, the lack-of-fit analysis determines the validity of the models in which a p-value > 0.05 indicates that the model fits accurately with the experimental data. Since the lack-of-fit was only significant (p < 0.05) for the MAE extraction yield, this means that the quadratic polynomial model F does not accurately predict extract yield for cannabis oil using MAE. Further studies exploring other factors, such as microwave power, could be conducted and included in the model to expand our understanding of this method. The low coefficient of determination (R 2 ) values for both models B and F showed that the models can be improved by considering the effects of other independent variables, such as ultrasound and microwave power densities on the extraction of cannabis oil, cannabinoids, and terpenes. Effects are statistically significant if p value * < 0.05. p-values for ANOVA and lack-of-fit for the revised model B, which has only sample (g) solvent (g) −1 and extraction temperature ( • C) as independent parameters. Degree of freedom (df), Sum of squares (SS), and Mean square (MS).

Optimal Experimental Conditions for Ultrasound-Assisted and Microwave-Assisted Extraction Systems for Cannabis
Ultrasound-and microwave-assisted extraction for cannabis were successfully optimized with a response surface methodology when evaluating the effects of the independent parameters of this study. All independent parameters were kept within the range for both extraction systems. Optimization was based on the maximum desirability function for the maximum yield of cannabinoids, total terpenes, and extracted cannabis oil. The desirability function consolidates all the responses into one response with a numerical value varying from 0 (one or more product characteristics are unacceptable) to 1 (all product characteristics are on target). The optimal independent experimental conditions for UAE and MAE at various conditions and the predicted responses at 95% confidence interval are presented in Table 7. UAE and MAE extractions of cannabis using a sample-to-solvent of 1:15 and 1:14.4, respectively, for 30 min at 60 • C were presented as the optimal conditions for maximum responses. Statistical analyses of the predicted responses showed significant (p < 0.05) differences between the extraction yields and secondary metabolite profiles for UAE and MAE. Under the optimal conditions, UAE extracts resulted in 14.4% more oil from cannabis biomass compared with MAE ( Table 7). The concentration of total terpenes extracted was reduced by 14.7% when MAE was used. Compared with the reference ground sample (Table 1), the THCA concentration increased from 17.9 (g 100 g dry matter −1 ) to 28.5% and 20% with extraction efficiencies of 159.2% and 111.4% for ultrasound-assisted and microwave-assisted extraction, respectively. Extraction efficiency greater than 100% can be explained by the biosynthesis or conversion of other cannabinoids to THCA during the extraction process or variance due to the analytical method used.

Verification of Models for Ultrasound-Assisted and Microwave-Assisted Extraction Systems for Cannabis
Generated models for UAE and MAE for cannabis were verified by performing cannabis extraction using the optimal conditions ( Table 7). The corresponding experimental values for the cannabinoid content, total terpenes, and extraction yields were determined and compared with the predicted results. The results showed a strong correlation ranging from 0.81 to 0.89 between the predicted and experimental values, which indicates the suitability of the models in predicting cannabinoid and terpenes profiles and extract yield for cannabis produced by the optimum UAE and MAE conditions.

Principal Component Analysis for Ultrasound-Assisted and Microwave-Assisted Extraction Systems for Cannabis
An exploratory principal component analysis (PCA) was performed to help identify correlation and dependencies between the independent variables and understand their effects on the responses. The scree plots, loading plots, score plots, and scatterplots for the different extraction systems are presented in Figures 3 and 4. Scree plots are line plots of eigenvalues of principal components and are used to determine the number of principal components that are responsible for variations in the data during PCA [43]. Scree plots indicate that the first two principal components (PC) account for 96.55% of the total variance (PC1 = 93.2% and PC2 = 3.35%) for UAE and 92.44% of the total variance (PC1 = 85.4% and PC2 = 7.04%) for MAE. The loading plots provide information on how the various responses contribute to the variations accounted for by the principal components. Axes on the loading plot (1 to −1) describe how strongly the response influences the principal component. A positive value on the loading plot indicates a positive correlation between the response and the PC. Total THC, THCA, total terpenes, and the extraction yield directly influenced the variation observed by PC2 for UAE ( Figure 3B) and inversely affected the variation accounted by PC2 for MAE. All dependent variables/responses identified in the extracts are important contributors to PC1 for both UAE and MAE, except the THC concentration under MAE. According to the loading plots, parameters positioned close to each other indicate a high positive correlation. Figures 3 and 4 showed a strong correlation between all the dependent variables for both extraction systems except the THC concentration under MAE. The score and the scatter plots did not show any variation in the sample-to-solvent ratio for MAE. For UAE, however, there was a significant (p < 0.05) variation caused by the sample-to-solvent ratios.

Sample Preparation
Harvested inflorescence from three cannabis accessions, Qrazy Train, Qrazy Apple, and Qrazy Angel, that were cultivated indoors under the same growing conditions were obtained from EXKA Inc. (Mirabel, QC, Canada). Inflorescences were pre-frozen at −20 °C for 24 h before transferring to a laboratory-scale vacuum freeze-dryer (Martin Christ Gefriertrocknungsanlagen GmbH Gamma 1-16 LSCplus, Osterode, Lower Saxony, Germany) with a condenser temperature of −55 °C. Freeze-drying was carried out at 10 °C for 24 h at 0.85 mbar. The initial moisture content of the inflorescence ranged from 78.52 to 80.48% (wb). Using a previously described method for hops [44], the freeze-dried inflorescences of the different accessions were mixed and cryo-ground to uniform particle size (0.25-0.5 mm) using liquid nitrogen and a mortar and pestle. Ground samples were kept in clean plastic bags, homogenized by hand mixing and shaking, and stored at either −20 °C or −40 °C before extraction and analysis.

Sample Preparation
Harvested inflorescence from three cannabis accessions, Qrazy Train, Qrazy Apple, and Qrazy Angel, that were cultivated indoors under the same growing conditions were obtained from EXKA Inc. (Mirabel, QC, Canada). Inflorescences were pre-frozen at −20 • C for 24 h before transferring to a laboratory-scale vacuum freeze-dryer (Martin Christ Gefriertrocknungsanlagen GmbH Gamma 1-16 LSCplus, Osterode, Lower Saxony, Germany) with a condenser temperature of −55 • C. Freeze-drying was carried out at 10 • C for 24 h at 0.85 mbar. The initial moisture content of the inflorescence ranged from 78.52 to 80.48% (wb). Using a previously described method for hops [44], the freeze-dried inflorescences of the different accessions were mixed and cryo-ground to uniform particle size (0.25-0.5 mm) using liquid nitrogen and a mortar and pestle. Ground samples were kept in clean plastic bags, homogenized by hand mixing and shaking, and stored at either −20 • C or −40 • C before extraction and analysis.

Extraction Procedures
Ultrasound-assisted (UAE) and microwave-assisted (MAE) extractions were carried out with different sample (g)-to-solvent (g) ratios, extraction temperatures, and extraction times. The influence of the duty cycle of the ultrasound was used as an independent variable for the ultrasound-assisted extraction of cannabis oil. Sample (g)-to-solvent (g) ratios used for this study were calculated by varying the mass of cannabis biomass into 40 mL ethanol with Equation (1).
Mass of cannabis biomass = 40 mL × density of ethanol 0.789 g mL mass of ethanol (g)

Ultrasound-Assisted Extraction
A Branson Sonifier 450 ultrasound system (Marshall Scientific, Hampton, VI, USA) with a fixed working frequency of 20 kHz and an electric power output of 450 W was used for the UAE of crude cannabis oil ( Figure 5A). The ultrasound system consisted of an ultrasound generator, a transducer, and an ultrasound probe. Cannabis biomass mixed with ethanol was placed in a 50-mL beaker positioned in a water bath with a heating coil system to maintain the extraction temperature. The ultrasonic emitter was immersed 1 cm into the solution, as previously described, [45] and turned on. Acoustic cavitation (creation, growth, and implosion of gas bubbles under the ultrasonic treatment) was observed, and the duty cycle was set at the desired level, ranging from 20 to 100%. The duty cycle is the percentage of the total ultrasound extraction time during which the ultrasound signal and power are "on".

Microwave-Assisted Extraction
Microwave-assisted extraction of crude cannabis oil was performed in a multi-mode (closed) mini-wave microwave unit (SCP Science, Baie-D'Urfe, QC, Canada). The system consists of a touchscreen controller that is USB-connected with the microwave module (digestion chamber) ( Figure 5B). The magnetron is located at the base of the module to ensure even distribution of the microwave energy across the digestion chamber. The module has six equidistant and radially constructed 75-mL vessels in a non-rotating digestion rack. Quartz vessels were used for the microwave extraction process. The average realtime operating temperature was monitored using six infrared sensors located on the side walls of the oven. Irradiation frequency and power were 2.45 GHz and 1000 W, respectively. The duration of irradiation included ramp time (time to reach the target process temperature, set at 5 min for all experiments) and hold time (elapsed time while irradiating the sample at a set temperature). The unit had a forced air ventilation system for cooling.

Calculation of Extraction Yield and Efficiency
After extraction processes, each extract containing the solvent and cannabis biomass mixture was subjected to vacuum filtration using Whatman 4 filter paper (Sigma Aldrich, St. Louis, MO, USA). The mass of the crude cannabis oil was derived using a vacuum rotary evaporator, operating at 35 rpm and 50 °C, to evaporate ethanol present in the extract. The extraction yield of the crude cannabis oil was calculated using Equation (2). However, the extraction efficiency was calculated based on the concentration of the major cannabinoid (THCA) using Equation (3).

Cannabinoid Analyses by LC-MS/MS
Cannabinoid analysis method developed and described previously by the National Research Council of Canada was modified and used for this study [46,47]. Extracted crude cannabis oil samples were centrifuged at 5000 rpm for 5 min. An aliquot of the supernatant was diluted in methanol based on the initial sample biomass (Table 8) used for the extraction (this sample is referred to as the diluted cannabis extract). Samples, standards, and quality control (QC) samples (100 μL) were transferred to high-pressure liquid chromatography (HPLC) vials containing glass inserts. The internal standard (50 μL, 500 ng mL −1

Microwave-Assisted Extraction
Microwave-assisted extraction of crude cannabis oil was performed in a multi-mode (closed) mini-wave microwave unit (SCP Science, Baie-D'Urfe, QC, Canada). The system consists of a touchscreen controller that is USB-connected with the microwave module (digestion chamber) ( Figure 5B). The magnetron is located at the base of the module to ensure even distribution of the microwave energy across the digestion chamber. The module has six equidistant and radially constructed 75-mL vessels in a non-rotating digestion rack. Quartz vessels were used for the microwave extraction process. The average real-time operating temperature was monitored using six infrared sensors located on the side walls of the oven. Irradiation frequency and power were 2.45 GHz and 1000 W, respectively. The duration of irradiation included ramp time (time to reach the target process temperature, set at 5 min for all experiments) and hold time (elapsed time while irradiating the sample at a set temperature). The unit had a forced air ventilation system for cooling.

Calculation of Extraction Yield and Efficiency
After extraction processes, each extract containing the solvent and cannabis biomass mixture was subjected to vacuum filtration using Whatman 4 filter paper (Sigma Aldrich, St. Louis, MO, USA). The mass of the crude cannabis oil was derived using a vacuum rotary evaporator, operating at 35 rpm and 50 • C, to evaporate ethanol present in the extract. The extraction yield of the crude cannabis oil was calculated using Equation (2). However, the extraction efficiency was calculated based on the concentration of the major cannabinoid (THCA) using Equation (3).
Yield g 100 g dry matter −1 = mass of crude cannabis oil (g) mass of dried sample (100 g) Efficiency (%) = Concentration of THCA in extract g 100 g dry matter Initial concentration of THCA in cryo − ground sample g 100 g dry matter × 100% (3)

Cannabinoid Analyses by LC-MS/MS
Cannabinoid analysis method developed and described previously by the National Research Council of Canada was modified and used for this study [46,47]. Extracted crude cannabis oil samples were centrifuged at 5000 rpm for 5 min. An aliquot of the supernatant was diluted in methanol based on the initial sample biomass (Table 8) used for the extraction (this sample is referred to as the diluted cannabis extract). Samples, standards, and quality control (QC) samples (100 µL) were transferred to high-pressure liquid chromatography (HPLC) vials containing glass inserts. The internal standard (50 µL, 500 ng mL −1 in methanol) was added prior to injection onto the liquid chromatography tandem mass spectrometer (LC-MS/MS) system. The LC-MS/MS system consisted of an HPLC (Ultimate3000; Thermo Fisher Scientific, Waltham, MA, USA) coupled to a triple quadrupole mass spectrometer (TSQ Quantiva; Thermo Fisher Scientific, Waltham, MA, USA). Chromatographic separation was carried out on a C18 bonded phase column (Accucore C18, 150 mm × 2.1 mm i.d. with 2.6 µm particle size; Thermo Fisher Scientific, Waltham, MA, USA) maintained at 40 • C, and the mobile phases consisted of water/formic acid and acetonitrile/formic acid both mixed in a 1000:1 volume ratio. The MS/MS detection of cannabinoids was performed via electrospray ionization in positive ion mode using quasi-molecular ion-to-product ion transitions. External calibration standard solutions containing 20 cannabinoids were prepared in methanol at concentrations of 10, 20, 100, 1000, 6000, 9000 and 10,000 ng mL −1 ) with quality control samples prepared at 30, 1500 and 8000 ng mL −1 . Linear regression, weighted 1/x 2 , was used for calibration, with the peak area ratio of cannabinoid and internal standard as the response variable.

Terpene Analysis
For terpene analysis, extracted crude cannabis oil samples were centrifuged at 5000 rpm for 5 min. An aliquot of the supernatant was diluted in hexane based on the initial sample biomass (Table 8) used for the extraction (referred to as the diluted cannabis extract). Samples, standards, and QC samples (150 µL) were transferred to HPLC vials containing glass inserts and the internal standard (50 µL, 1 µg mL −1 of linalool-d 3 in hexane) was added before injection onto the gas chromatography-tandem mass spectrometer (GC-MS/MS) system (Trace 1310 GC coupled to a TSQ 9000 Triple Quadrupole MS/MS; Thermo Fisher Scientific, Waltham, MA, USA).
Chromatographic separation of the analytes was obtained using the TraceGOLD TG-5SilMS column (30 m × 0.25 mm i.d. with 0.25 µm film thickness; Thermo Fisher Scientific, Waltham, MA, USA) and helium as the carrier gas. The SSL inlet temperature was held at 250 • C with a deactivated splitless quartz wool single taper liner (78.5 mm × 4 mm i.d. × 6.3 mm o.d.; Thermo Fisher Scientific, Waltham, MA, USA). A constant inlet flow of 1.5 mL min −1 with a split flow of 15 mL min −1 and a split ratio of 10 was used. Selected reaction monitoring (SRM) scan type with electron impact ionization mode was used for the tandem mass spectrometer, while the ion source temperature and MS transfer line temperature were held at 300 • C and 250 • C, respectively. The temperature program for the GC oven can be found in Table 9.
Calibration curves (0.005-2.5 µg mL −1 ) were generated using weighted linear regression (1/x) of the peak area ratios (analyte/internal standard) versus the concentration of the calibration standards. The concentration of individual terpenes in extracts was determined using the appropriate calibration curve for the metabolite using the resulting peak area ratios. Table 9. Gas chromatography oven temperature program.

Experimental Design
A five-level-by-four-variables and five-level-by-three-variables central composite rotatable statistical design (CCRD) with uniform precision was used for ultrasound-assisted extraction and microwave-assisted extraction, respectively. CCRD was used to assess and compare the effects of the different extraction conditions on the total yield of cannabis crude oil, cannabinoids, and terpenes. It comprised 16 combinations of factorial values, 8 combinations of axial values, and 7 combinations of central values for ultrasound-assisted extraction (Table 10). For MAE, combinations for the factorial, axial, and central values were 8, 6, and 6, respectively (Table 10); this was due to the reduced number of variables for this extraction method. Axial points were fixed at a distance (α = 2 k/4 , where k represents the number of variables) from the center to ensure rotatability. Axial combinations allow for the inclusion of quadratic terms in the response surface model. Replication of a central point ensures a greater uniformity in the precision of response estimation over the experimental design. Table 10. Uncoded and coded levels of the independent variables for ultrasound-and microwaveassisted extraction of cannabis.

Independent variables Symbol
Coded levels

Statistical Analysis
The analysis of the independent variables' effect was assessed using JMP software (JMP 4.3 SAS Institute Inc.). The least-square multiple regression method was used to evaluate the relationship between the independent and dependent variables. Four and three multiple regression equations were used to fit the second-order polynomial model based on the experimental data for ultrasound-assisted extraction and microwave-assisted extraction, respectively (Table 11). Models A and E represent the full regression model for UAE and MAE, respectively. It includes all the independent terms, their interactions, and quadratic terms. The reduced regression models for UAE (models B, C, and D) and MAE (models F and G) were evaluated by controlling one independent parameter. The analysis of variance (ANOVA) was used to investigate the statistical significance of the regression coefficients by conducting the Fisher's F-test at a 95% confidence level. The statistical significance of the model was improved through a "backward elimination" process, deleting non-significant dependent terms (p > 0.05). A response surface plot was obtained using the fitted model. Optimal conditions for MAE and UAE for the dependent variables were determined based on modelling and desirability function and principal component analysis (PCA) using JMP software (JMP 4.3 SAS Institute Inc., Cary, NC, USA). Table 11. Multiple regression equation for ultrasound-assisted extraction and microwave-assisted extraction.

Model Multiple Regression Equation Equation
No.

Model Verification
To verify the model, three experiments were conducted using optimal extraction conditions with the highest desirability. The experimental and predicted values were compared with determine the validity of the model.

Conclusions
The depenalization of the cannabis industry in Canada has intensified cannabis production and driven sales of cannabis and cannabis products for medical and recreational adult use. Although some commercial entities have developed efficient extraction systems to improve the safety and potency of cannabis, most of these novel systems have not been optimized for maximum extraction yield and concentration of secondary metabolites. This study optimized for maximum extraction efficiency, using CCRD as a function of several independent variables, namely samples-to-solvent ratio, extraction temperatures, extraction times, and duty cycles. Cannabis samples were extracted using ultrasoundassisted and microwave-assisted extraction. UAE and MAE extraction of cannabis using a sample-to-solvent ratio of 1:15 and 1:14.4, respectively, for 30 min at 60 • C were presented as the optimal conditions for maximum responses with maximum desirability of 0.83% and 0.75% for UAE and MAE, respectively. UAE increased the crude oil yield, cannabinoid concentration, and total terpene extracted by 14.39%, 13.21-39.24%, and 14.67% respectively, compared with MAE. Developed predictive models for all responses yielded predictable and reproducible results, and the verification of the models showed a close agreement between the experimental values and the predicted values, with a strong correlation ranging from 0.81 to 0.89. Scree plots under PCA indicated that the first two principal components account for 96.55% of the total variance (PC1 = 93.2% and PC2 = 3.35%) for UAE and 92.44% of the total variance (PC1 = 85.4% and PC2 = 7.04%) for MAE. The data showed a significant (p < 0.05) variation caused by the sample-to-solvent ratios for only the UAE. Further research studies on ethanol recovery using centrifugation, mechanical press system, and vacuum filtration must be conducted to help reduce the operational cost for cannabis industries.