Introduction

The importance of supercritical fluids (SCFs) as solvents in various processes has been recognized for decades1,2. Significant applications of SCFs encompass particle sizing, extraction, reactions, and separations3. SCFs serve as solvents in all of these applications3,4,5,6. However, it is essential to note that while theoretically, all substances can attain a supercritical state, some necessitate exceedingly high pressures and temperatures to achieve this state, rendering it impractical and resource-intensive7,8,9,10. Carbon dioxide is a well-known substance that readily reaches its supercritical state with minimal effort11,12,13. Consequently, CO2 as an SCF is extensively documented in the literature14,15,16.

The sizing of drug particles, whether at the micro or nano level, primarily depends on their solubility17,18,19,20. The desired drug particle size can be achieved by rapidly expanding supercritical solutions (RESS) or anti-solvent processes21,22,23. The size of a drug particle can play a crucial role in treating various illnesses, as it significantly influences bioavailability24,25,26,27,28. Therefore, determining solubility is a fundamental step in micronization/nanonization. While recent literature reports the solubility of codeine phosphate in conventional solvents, information regarding its solubility in SCFs is notably absent29,30,31. Hence, this study focuses on measuring the solubility of codeine phosphate in supercritical carbon dioxide (SC-CO2) under various conditions. A modeling task is also undertaken to facilitate the application of the acquired data.

Several methodologies are available in the literature for modeling solubility data; however, only three are considered user-friendly32,33,34. The first method involves the use of the Equation of State (EoS), which requires critical properties of both the solute (the drug) and the solvent (SC-CO2). The second method relies on semi-empirical models, often referred to as density-based models, which necessitate data on the density of the solvent, as well as temperature and pressure data. The final method is the solid–liquid equilibrium model, also known as the expanded liquid model (ELM), which requires information about the solute's enthalpy of melting and the solute's melting temperature35,36,37,38.To obtain the required properties such as critical temperature, critical pressure, acentric factor, molar volume, and sublimation pressures, standard group contribution techniques are employed39,40,41.However, there are instances where the application of group contribution methods becomes challenging due to the absence of functional group contributions, such as phosphate and sulfates. Applying EoS modeling and the solid–liquid equilibrium model can prove challenging42,43,44,45.Codeine phosphate, an analgesic drug, exemplifies such a compound where critical properties (\(T_{c}\) and \(P_{c}\)), molar volume(\(v_{2}\))and sublimation pressures are unavailable, and existing group contribution techniques cannot be applied due to the presence of phosphate in its structure. However, experimental data for the melting temperature (155 °C) and the heat of fusion (18.86 cal/g or 78.91 J/g or 31,358.83 J/mol) of codeine phosphate are readily accessible46,47,48. The magnitude of codeine phosphate's solubility in SC-CO2 determines the technique employed for drug micronization/nanonization using SC-CO2.

The present work unfolds in two distinct phases. In the first phase, the solubilities of codeine phosphate in SC-CO2 are measured under various conditions. The second phase evaluates the collected data using EoS, density, and ELM models.

Experiment section

Materials

Codeine phosphate was provided by Parsian Pharmaceutical Co. (Tehran, Iran) with a CAS number of 52-28-8 and a mass purity exceeding 99%. CO2 (carbon dioxide) with a CAS number of 124-38-9 and a mass purity exceeding 99.9% was supplied by Fadak Company, Kashan, Iran. Table 1 provides information about the chemicals used in this study.

Table 1 Molecular structure and physiochemical properties of used materials.

Equipment details

Static equipment was employed for solubility measurements, as depicted in Fig. 1. Comprehensive equipment details can be found in our previous studies49,50,51. This section offers a concise explanation of the experimental setup and methodology. Thermodynamically, the measurement method falls under the category of isobaric-isothermal methods52. Throughout the experiments, temperatures and pressures were rigorously controlled at the desired experimental conditions with a precision of ± 0.1 K for temperature and ± 0.1 MPa for pressure, respectively. Solubility measurements were conducted in triplicate for each data point. In each measurement, a known quantity of codeine phosphate drug (1 g) was utilized, and after reaching equilibrium, the saturated sample was collected through a 2-position 6-way port valve into a vial preloaded with demineralized water (DM water). After discharging 600 µL of saturated SC-CO2 the port valve was rinsed with 1 ml of DM water, resulting in a total saturation solution volume of 5 ml.

Figure 1
figure 1

Experimental setup for solubility measurement, E1- CO2 cylinder; E2- Filter; E3- Refrigerator unit; E4- Air compressor; E5- High pressure pump; E6- Equilibrium cell; E7- Magnetic stirrer; E8- Needle valve; E9- Back-pressure valve; E10- Six-port, two position valve; E11- Oven; E12- Syringe; E13- Collection vial; and E14- Control panel.

The drug solubility values were measured by absorbance assays at \({\lambda }_{\mathrm{max}}\) (281 nm) on a UNICO-4802 UV–Vis spectrophotometer with 1-cm pass length quartz cells and the solubility was calculated from the concentration of solute by using the calibration curve (with regression coefficient 0.999) and the UV-absorbance, Fig. 2.

Figure 2
figure 2

The calibration curve of drug in DM water.

For solubility calculations, the following equations were employed:

$$y_{2} = \frac{{n_{drug} }}{{n_{drug} + n_{{CO_{2} }} }}$$
(1)

where \({n}_{\text{drug}}\) and \({n}_{{\text{CO}}_{2}}\) represent the moles of codeine phosphate and CO2, respectively.

Moreover, these quantities are defined as follows:

$${n}_{\text{drug}}=\frac{{C}_{s}\cdot {V}_{s}}{{M}_{s}}$$
(2)
$${n}_{{\text{CO}}_{2}}=\frac{{V}_{1}\cdot \rho }{{M}_{{\text{CO}}_{2}}}$$
(3)

In the above relations, \({C}_{\text{s}}\) is defined as the drug concentration in saturated sample vial in g/L. Also, the volume of the sampling loop and vial collection are expressed as V1(L) = 600 \(\times\) 10–6 m3 and Vs(L) = 5 \(\times\) 10–3 m3, respectively. The \(M_{s}\) and \(M_{{CO_{2} }}\) are the molecular weights of the codeine phosphate drug (component 2) and CO2, respectively.

Solubility can be also expressed as:

$$S = \frac{{C_{S} V_{s} }}{{V_{1} }}$$
(4)

where, one can find the relation between S and \(y_{2}\) as follows:

$$S = \frac{{\rho M_{s} }}{{M_{{CO_{2} }} }}\frac{{y_{2} }}{{1 - y_{2} }}$$
(5)

Codeine phosphate’s solubility was determined using a UV–visible spectrophotometer (Model UNICO-4802, double beam, with multipurpose software, USA), with DM water as the solvent.

Modeling

The solubility data obtained in this study were correlated with one equation of state (EoS), five density-based models, and three ELM models. we considered the Peng-Robinson (PR) EoS. In the case of density-based modeling, several well-known models, namely Chrastil, Mendez-Santiago, Teja (MT), Bartle et al., Sodeifian et al., and Reddy-Garlapati were employed. Three forms of ELMs with different parameters were used for data fitting. Detailed information about all the models considered in this work is discussed in the following sections.

EoS modeling

This model is an extension to the model framework suggested by Schmitt53 and Reid and Estévez et al.54. PR EoS was used for the modeling. Solubility of codeine phosphate (solute, component 2) in SC-CO2 (solvent, component 1) is expressed as55

$${\text{y}}_{{2}} = \frac{{P_{2}^{S} \hat{\phi }_{2}^{S} }}{{P\hat{\phi }_{2}^{{SC - CO_{2} }} }}\exp \left[ {\frac{{\left( {P - P_{2i}^{S} } \right)v_{S} }}{RT}} \right] \,$$
(6)

where \(P_{2}^{s}\), \(\hat{\phi }_{2}^{{SC - CO_{2} }}\), \(\hat{\phi }_{2}^{S}\) \(P\), \(v_{2}\), \(T\) and R, are sublimation pressure, solid solute fugacity coefficient, saturation fugacity coefficient, system pressure, drug molar volume, system temperature and universal gas constant, respectively. The required equation for the solid solute fugacity coefficient in the SC-CO2 (\(\hat{\phi }_{2}^{{SC - CO_{2} }}\)) is calculated using PR EoS. It is obtained from the following thermodynamic equation.

$$\ln \left( {\hat{\varphi }_{2}^{{SC - CO_{2} }} } \right) = \frac{1}{RT}\int\limits_{v}^{\infty } {\left[ {\left( {\frac{\partial P}{{\partial N_{i} }}} \right)_{{T,V,N_{1} }} - \frac{RT}{v}} \right]} dv - \ln Z$$
(7)

Equation (8) represents the fugacity coefficients expression for PR EoS.

$$\ln \left( {\hat{\varphi }_{2}^{{SC - CO_{2} }} } \right) = {{b_{2} } \mathord{\left/ {\vphantom {{b_{2} } b}} \right. \kern-0pt} b}\left( {Z - 1} \right) - \ln \left( {P\left( {V - b} \right)/RT} \right) - {a \mathord{\left/ {\vphantom {a {(2\sqrt 2 }}} \right. \kern-0pt} {(2\sqrt 2 }}RTb)\left\{ {[2(a_{12} y_{1} + a_{2} y_{2} )/a] - {{b_{2} } \mathord{\left/ {\vphantom {{b_{2} } b}} \right. \kern-0pt} b}} \right\}\ln \left[ {\frac{V + 2.414b}{{V - 0.414b}}} \right]$$
(8)

For modeling tasks, critical temperature, critical pressure, centric factor, molar volume, and sublimation pressures of the codeine phosphate are required. Unfortunately, they are unavailable for this typical drug. Therefore, to overcome this drawback, the following assumptions are applied.

Assumption 1

Solute in the solvent is very dilute. Thus, the required \(\hat{\phi }_{2}^{{SC - CO_{2} }}\) is obtained by applying William J. Schmitt and Robert C. Reid assumptions to Eq. (8) (i.e., for dilute system \(z \to z_{1}\), \(a \to a_{1}\) and \(b \to b_{1}\)). Thus, \(\hat{\phi }_{2}^{{SC - CO_{2} }}\) PR EoS (Eq. 8) is reduced to Eq. (9). In which solute parameters are adjustable (i.e., \(a_{2}\) and \(b_{2}\))53.

$$\ln \left( {\hat{\varphi }_{2}^{{SC - CO_{2} }} } \right) \approx {{b_{2} } \mathord{\left/ {\vphantom {{b_{2} } b}} \right. \kern-0pt} b}_{1} \left( {Z_{1} - 1} \right) - \ln \left( {P\left( {V_{1} - b_{1} } \right)/RT} \right) - {{a_{1} } \mathord{\left/ {\vphantom {{a_{1} } {(2\sqrt 2 }}} \right. \kern-0pt} {(2\sqrt 2 }}RTb_{1} )\left\{ {[2(a_{2} )/a_{1} ] - {{b_{2} } \mathord{\left/ {\vphantom {{b_{2} } {b_{1} }}} \right. \kern-0pt} {b_{1} }}} \right\}\ln \left[ {\frac{{V_{1} + 2.414b_{1} }}{{V_{1} - 0.414b_{1} }}} \right]$$
(9)

Assumption 2

The molar volume of solute (\(v_{2}\)) is a function of SC-CO2 (solvent) density (\(\rho_{1}\))56 and in this work the following expression is used

$$v_{2} = K_{1} + K_{2} \rho_{1} + K_{3} \rho_{1}^{2}$$
(10)

where \(K_{1} ,\,\)\(K_{2} ,\,\)\(K_{3}\) have units are m3/mol, m6/mol kg, m9/mol kg2, respectively.

Assumption 3

The sublimation pressure of the solute is expressed as a function of temperature, and it is expressed as Eq. (11)55

$$R\ln \left( {P_{A}^{sub} } \right) = \beta + \frac{\gamma }{T} + \Delta_{sub} \delta \ln \left( {\frac{T}{298.15}} \right)$$
(11)

where \(\beta\), \(\gamma\) and \(\Delta_{sub} \delta\) are sublimation pressure expression coefficients. They are substituting Eqs. (9)–(11), in Eq. (6), results in the solubility model based on PR EoS in terms of pressure, temperature, density, and some adjustable parameters. The adjustable parameters are \(a_{2}\), \(b_{2}\), \(\beta\), \(\gamma\),\(\Delta_{sub} \delta\),\(K_{1}\),\(K_{2}\) and \(K_{3}\). These parameters are treated as temperature-independent in the temperature range considered in the present work. The adjustable parameters are obtained by regression with experimental data.

For the data regression, the objective function, Eq. (12), is used57

$$OF = \sum\limits_{i = 1}^{N} {\frac{{\left| {y_{2i}^{\exp } - y_{2i}^{calc} } \right|}}{{y_{2i}^{\exp } }}}$$
(12)

where \(y_{2i}^{\exp }\) is the experimental mole fraction of solute, and \(y_{2i}^{calc}\) is the model predicted mole fraction of solute.

Density-based modeling

Chrastil model58,59,60

Solute concentration and solvent density are related as follows:

$$c_{m} = \left( {\rho_{m1} } \right)^{\kappa } \exp \left( {A_{1} + {\raise0.7ex\hbox{${B_{1} }$} \!\mathord{\left/ {\vphantom {{B_{1} } {{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}$}}} \right)$$
(13)

where \(c_{m}\) is the mass concentration of solute,\(\rho_{m1}\) is the mass concentration of solvent, and \(\kappa\),\(A_{1}\) and \(B_{1}\) are model constants.

Equation (1) can be rearranged to mole fraction as follows:

$$\frac{{c_{m} }}{{\rho_{m1} }}\frac{{M_{ScF} }}{{M{}_{Solute}}} = \frac{{M_{ScF} }}{{M{}_{Solute}}}\left( {\rho_{1} } \right)^{\kappa - 1} \exp \left( {A_{1} + {\raise0.7ex\hbox{${B_{1} }$} \!\mathord{\left/ {\vphantom {{B_{1} } {{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}$}}} \right)$$
(14)

where \(M_{ScF}\), \(M{}_{Solute}\) and \(c_{m} /M_{solute}\) are molar mass of SCF, molar mass of solute, and molar concentration of solute (\(c\)), respectively. Also,\(\rho_{m1} /M_{ScF}\) and \(\kappa\) are molar concentration of solvent(\(\rho_{1}\)), and association number, respectively. Furthermore, \(A_{1}\) and \(B_{1}\) are model constants.

$$mole\;ratio = \frac{c}{{\rho_{1} }} = \frac{{M_{ScF} }}{{M{}_{Solute}}}\left( {\rho_{1} } \right)^{\kappa - 1} \exp \left( {A_{1} + {\raise0.7ex\hbox{${B_{1} }$} \!\mathord{\left/ {\vphantom {{B_{1} } {{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}$}}} \right)$$
(15)

Mole fraction (\(y_{2}\)) and mole ratios are related as follows:

$$\frac{c}{{\rho_{1} }} = \frac{{y_{2} }}{{1 - y_{2} }}$$
(16)
$$y_{2} = {{mole\;ratio} \mathord{\left/ {\vphantom {{mole\;ratio} {\left[ {1 + mole\;ratio} \right]}}} \right. \kern-0pt} {\left[ {1 + mole\;ratio} \right]}}$$
(17)
$$y_{2} = {{\frac{{M_{ScF} }}{{M{}_{Solute}}}\left( {\rho_{1} } \right)^{\kappa - 1} \exp \left( {A_{1} + {\raise0.7ex\hbox{${B_{1} }$} \!\mathord{\left/ {\vphantom {{B_{1} } {{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}$}}} \right)} \mathord{\left/ {\vphantom {{\frac{{M_{ScF} }}{{M{}_{Solute}}}\left( {\rho_{1} } \right)^{\kappa - 1} \exp \left( {A_{1} + {\raise0.7ex\hbox{${B_{1} }$} \!\mathord{\left/ {\vphantom {{B_{1} } {{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}$}}} \right)} {\left[ {1 + \frac{{M_{ScF} }}{{M{}_{Solute}}}\left( {\rho_{1} } \right)^{\kappa - 1} \exp \left( {A_{1} + {\raise0.7ex\hbox{${B_{1} }$} \!\mathord{\left/ {\vphantom {{B_{1} } {{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}$}}} \right)} \right]}}} \right. \kern-0pt} {\left[ {1 + \frac{{M_{ScF} }}{{M{}_{Solute}}}\left( {\rho_{1} } \right)^{\kappa - 1} \exp \left( {A_{1} + {\raise0.7ex\hbox{${B_{1} }$} \!\mathord{\left/ {\vphantom {{B_{1} } {{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}}}\right.\kern-0pt} \!\lower0.7ex\hbox{${{T \mathord{\left/ {\vphantom {T K}} \right. \kern-0pt} K}}$}}} \right)} \right]}}$$
(18)

where \(\kappa\),\(A_{1}\) and \(B_{1}\) are the model constants and their units are dimensionless, dimensionless and K, respectively.

Méndez-Santiago and Teja (MT) model61

This model can generally be used for checking thermodynamic consistency. It is stated as Eq. (19) and when \(T\ln \left( {y_{2} P} \right) - C_{2} T\) vs. \(\rho_{1}\) is established, all data points fall around a single straight line

$$T\ln \left( {y_{2} P} \right) = A_{2} + B_{2} \cdot \rho_{1} + C_{2} T$$
(19)

where \(A_{2}\), \(B_{2}\) and \(C_{2}\) are the model constants and their units are K, K m3/kg and dimensionless, respectively

Bartle et al. model62

According to the model, the solubility is expressed as Eq. (20)

$$\ln \left( {\frac{{y_{2} \cdot P}}{{P_{ref} }}} \right) = A_{3} + \frac{{B_{3} }}{T} + C_{3} \left( {\rho_{1} - \rho_{ref} } \right)$$
(20)

where the pressure (\(P_{ref}\)) and density for reference states (\(\rho_{ref}\)) are considered 0.1 MPa, and 700 kg m−3. Also, \(A_{3}\), \(B_{3}\) and \(C_{3}\) are the model constants and their units are dimensionless, K and m3/kg, respectively. From the constant \(B_{3}\), sublimation enthalpy can be obtained (i.e.,\(\Delta_{sub} H = - B_{3} R\) J/mol).

Sodeifian et al. model63

According to this model, the solubility is represented by Eq. (21)

$$y_{2} = A_{4} + B_{4} \frac{{P^{2} }}{T} + C_{4} \ln \left( {\rho_{1} T} \right) + D_{4} \rho_{1} \ln \left( {\rho_{1} } \right) + E_{4} P\ln \left( T \right) + F_{4} \frac{{\ln \left( {\rho_{1} } \right)}}{T}$$
(21)

where \(A_{4}\), \(B_{4}\), \(C_{4}\), \(D_{4}\), \(E_{4}\) and \(F_{4}\) are the model constants and their units are dimensionless, K/MPa2, dimensionless, m3/Kg, 1/MPa and K, respectively.

Reddy-Garlapati model64

According to the model, the solubility is expressed as Eq. (22)

$$y_{2} = \left( {A_{5} + B_{5} P_{r} + C_{5} P_{r}^{2} } \right)T_{r} + (D_{5} + E_{5} P_{r} + F_{5} P_{r}^{2} )$$
(22)

where \(A_{5}\) \(B_{5}\), \(C_{5}\), \(D_{5}\), \(E_{5}\) and \(F_{5}\) are the model constants and all are dimensionless quantities;\(P_{r}\) is reduced pressure and \(T_{r}\) is reduced temperature.

Expanded Liquid Models (ELMs)

This section deals with models under the solid–liquid equilibrium model (also known as ELMs). It relies on the solution theory, where SC-CO2 was considered an expanded liquid with infinite dissolved codeine phosphate. The essential solubility expression is given by65,66,67,68

$$y_{2} = \frac{1}{{\gamma_{2}^{\infty } }}\frac{{f_{2}^{S} }}{{f_{2}^{L} }}$$
(23)

where \(\gamma_{2}^{\infty }\) is the activity coefficient of solute at infinite dilution,\(f_{2}^{S}\), \(f_{2}^{L}\) are fugacity of codeine phosphate compound in the solid phase and expanded liquid phase, respectively. The basic equation for the fugacity ratio is represented by

$$\ln \left( {\frac{{f_{2}^{S} }}{{f_{L}^{L} }}} \right) = \frac{{\Delta H_{2}^{m} }}{RT}\left( {\frac{T}{{T_{m} }} - 1} \right) - \int\limits_{{T_{m} }}^{T} {\frac{1}{{RT^{2} }}} \left[ {\int\limits_{{T_{m} }}^{T} {\left[ {\Delta C_{p} } \right]dT} } \right]dT$$
(24)

where \(\Delta C_{p}\) implies the difference between the heat capacity of solid and expanded liquid states. When Eqs. (23 and 24) are combined, the solubility expression for ELM is obtained as Eq. (25)

$$y_{2} = \frac{1}{{\gamma_{2}^{\infty } }}\exp \left[ {\frac{{\Delta H_{2}^{m} }}{RT}\left( {\frac{T}{{T_{m} }} - 1} \right) - \int\limits_{{T_{m} }}^{T} {\frac{1}{{RT^{2} }}} \left[ {\int\limits_{{T_{m} }}^{T} {\left[ {\Delta C_{p} } \right]dT} } \right]dT} \right]$$
(25)

The solubility expression may be estimated with and without \(\Delta C_{p}\) term. In the following section, three cases are presented. For all three cases, a unique expression for \(\gamma_{2}^{\infty }\) used23,69 was \(\exp \left( {l_{1} + l_{2} (p/(RT)} \right) + l_{3} (p/(RT))^{2} )\).

Case 1. \(\Delta C_{p} = 0\).

The solubility expression for this case is written as

$$y_{2} = \exp \left[ {\frac{{\Delta H_{2}^{m} }}{{RT}}\left( {\frac{T}{{T_{m} }} - 1} \right)} \right]/\exp \left( {l_{1} + l_{2} \left( {\frac{p}{{RT}}} \right) + l_{3} \left( {\frac{p}{{RT}}} \right)^{2} } \right)$$
(26)

Thus Eq. (26) has three maximum parameters (l1, l2 and l3).

Case 2. \(\Delta C_{p} = {\text{contant}}\). Consider the constant \(\Delta C_{p}\) is D23.

The solubility expression for this case iswritten as

$$y_{2} = \exp [\frac{{\Delta H_{2}^{m} }}{{RT}}\left( {\frac{T}{{T_{m} }} - 1} \right) - {\raise0.7ex\hbox{$D$} \!\mathord{\left/ {\vphantom {D R}}\right.\kern-\nulldelimiterspace} \!\lower0.7ex\hbox{$R$}}\left[ {\ln \left( {\frac{T}{{T_{m} }}} \right) - T_{m} \left( {\frac{1}{{T_{m} }} - \frac{1}{T}} \right)} \right]/\exp \left( {l_{1} + l_{2} \left( {\frac{p}{{RT}}} \right) + l_{3} \left( {\frac{p}{{RT}}} \right)^{2} } \right)$$
(27)

Thus Eq. (27) has four maximum of parameters (\(D\), l1, l2 and l3) and respective units are J/mole K, dimensionless, J/mole MPa and J2/mole2 MPa2, respectively.

Case 3. \(\Delta C_{p} = f(T)\).

Generally,\(C_{p}\) it is a third-order polynomial equation in temperature equation; however, a recent study on solubility modeling shows that a good fit is achieved with the second-order polynomial. Thus, it is assumed that the \(\Delta C_{p}\) quadratic function in temperature as Eq. (28)70

$$\Delta C_{p} = \beta_{1} + \beta_{2} T + \beta_{3} T^{2}$$
(28)

Integral evaluation of Eq. (25) by substituting Eq. (28) results in Eq. (29)

$$\begin{aligned} \ln \left( {\frac{{f_{2}^{S} }}{{f_{L}^{L} }}} \right) &= \frac{{\Delta H_{2}^{m} }}{{RT}}\left( {\frac{T}{{T_{m} }} - 1} \right) - \frac{{\beta _{1} }}{R}\left[ {\ln \left( {\frac{T}{{T_{m} }}} \right) - T_{m} \left( {\frac{1}{{T_{m} }} - \frac{1}{T}} \right)} \right] - \frac{{\beta _{2} }}{{2R}}\left[ {\left( {T - T_{m} } \right) - T_{m}^{2} \left( {\frac{1}{{T_{m} }} - \frac{1}{T}} \right)} \right] \hfill \\ &\quad - \frac{{\beta _{3} }}{{3R}}\left[ {\left( {\frac{{T^{2} }}{2} - \frac{{T_{m}^{2} }}{2}} \right) - T_{m}^{3} \left( {\frac{1}{{T_{m} }} - \frac{1}{T}} \right)} \right] \hfill \\ \end{aligned}$$
(29)

Thus, the solubility expression for this case is written as

$$\begin{gathered} y_{2} = \exp [\frac{{\Delta H_{2}^{m} }}{RT}\left( {\frac{T}{{T_{m} }} - 1} \right) - \frac{{\beta_{1} }}{R}\left[ {\ln \left( {\frac{T}{{T_{m} }}} \right) - T_{m} \left( {\frac{1}{{T_{m} }} - \frac{1}{T}} \right)} \right] - \frac{{\beta_{2} }}{2R}\left[ {\left( {T - T_{m} } \right) - T_{m}^{2} \left( {\frac{1}{{T_{m} }} - \frac{1}{T}} \right)} \right] \hfill \\ \;\;\;\;\;\;\;\;\;\;\;\; - \frac{{\beta_{3} }}{3R}\left[ {\left( {\frac{{T^{2} }}{2} - \frac{{T_{m}^{2} }}{2}} \right) - T_{m}^{3} \left( {\frac{1}{{T_{m} }} - \frac{1}{T}} \right)} \right]]/\exp \left( {l_{1} + l_{2} \left( \frac{p}{RT} \right) + l_{3} \left( \frac{p}{RT} \right)^{2} } \right)] \hfill \\ \end{gathered}$$
(30)

In Eq. (30), six parameters are there and they are \(\beta_{1}\),\(\beta_{2}\),\(\beta_{3}\), l1, l2 and l3 and their units are J/K kg, J/K2kg, J/K3kg, dimensionless, J/mole MPa and J2/mole2 MPa2, respectively. These parameters are optimally fitted to experimental solubility data by minimizing the error with the help of the objective function defined in Eq. (12). It is also important to note that all three expressions for solubility are explicit functions of composition.

Results and discussion

The present study reports the measured solubilities of codeine phosphate (C18H21NO3) in supercritical carbon dioxide (SC-CO2) at temperatures of 308, 318, 328, and 338 K, spanning a pressure range of 12–27 MPa. Three types of models mentioned in the previous section were used in data correlation. The correlation task was carried out in MATLAB 2019® using the inbuilt fminsearch algorithm. The optimization algorithm minimized the error and was used for parameter estimation for all the models mentioned in the previous section. The measured data are shown in Table 2. The solvent density was obtained from the NIST database71. Considering the order of magnitude of codeine phosphate solubility in SC-CO2, supercritical anti-solvent methods can be regarded an appropriate choice for producing fine particles of this drug.

Table 2 Solubility of crystalline codeine phosphatein SC-CO2 at various temperatures and pressures.

The solubility of codeine phosphate in SC-CO2 vs. pressure is depicted in Fig. 3. From the solubility plot, it is evident that a cross-over pressure is not observed for codeine phosphate. Since conducting experimental investigations at each required condition (pressure and temperature) is tedious, modeling becomes necessary. Therefore, modeling was performed in all three modes. Numerous equations of state (EoS) are available in the literature for modeling solubility data. However, the PR EoS was selected in this work due to its success in modeling the solubilities of solid substances in supercritical fluids (SCFs)53,54,55,70. When correlating the data, the PR EoS model parameters were treated as temperature-independent over 308–338 K. The objective function indicated in Eq. (12) was utilized for data correlation, and all the adjustable parameters were obtained through regression with experimental data. Table 3 presents the correlation constants of the PR EoS model. Sublimation enthalpies at 308, 318, 328, and 338 K were calculated from the vapor pressure expression constants using the following relation:

$$\Delta_{sub} H = \left( { - \gamma + \Delta_{sub} \delta \;T} \right)R\;{\text{J}}/{\text{mol}}$$
(31)
Figure 3
figure 3

Codeine phosphate solubility in SC-CO2, \(y_{2}\) versus P (MPa).

Table 3 Correlation constant of EoS model.

The estimated sublimation enthalpies are presented in Table 3. The correlating ability of the equation of state (EoS) method is depicted in Fig. 3.

When considering density-based models for data correlation, the Chrastil model (Eq. 18), treated constants as independent variables, and their values were determined through regression with experimental data. The obtained constants are reported in Table 4. The correlating ability of the Chrastil model is illustrated in Fig. 4. Reasonable fit is observed when the data is represented as y2 versus \(\rho_{1}\), this confirms the applicability of the Chrastil model to the solubility data72,73. From the parameters of the Chrastil model, the total enthalpy for codeine phosphate was derived, and its value is reported in Table 5.

Table 4 Correlation constant of density-based models.
Figure 4
figure 4

Codeine phosphate solubility in SC-CO2, \(y_{2}\) versus P (MPa). Symbols are experimental points; lines are PREoS model fit.

Table 5 Thermodynamic parameters of codeine phosphate-SC-CO2 system.

The results for data fitting of the MT model (Eq. 19) are presented in Fig. 6, and the corresponding parameters are reported in Table 4. The correlating ability of the MT model is evident in Fig. 5, where linear plots are observed when the data is plotted as \({T \mathord{\left/ {\vphantom {T {K\ln \left( {y_{2} \cdot P} \right)}}} \right. \kern-0pt} {K\ln \left( {y_{2} \cdot P} \right)}} - C_{2} T\) versus \(\rho_{1}\) (Fig. 6), this further confirms the suitability of the MT model for the solubility data72,73. Similarly, the model proposed by Bartle et al. (Eq. 20) was correlated with solubility data, and the obtained results are reported in Table 4. Linear plots are also observed when the data is represented as \(\ln \left( {{{y_{2} P} \mathord{\left/ {\vphantom {{y_{2} P} {P_{ref} }}} \right. \kern-0pt} {P_{ref} }}} \right)\) versus \(\left( {\rho_{1} - \rho_{ref} } \right)\) (Fig. 7),confirming the applicability of the Bartle et al. model to the solubility data72,73.From the parameters of the Bartle et al. model, the vaporization enthalpy was determined, and its value is reported in Table 5.

Figure 5
figure 5

Codeine Phosphate Solubility, y2 versus \(\rho_{1}\). Symbols are experimental points, and lines are Chrastil model fit.

Figure 6
figure 6

\(T\ln (y_{2} P) - C_{2} T\) vs. \(\rho_{1}\)(kg m−3). Symbols are experimental points, and lines are MT model fit.

Figure 7
figure 7

\(\ln (y_{2} P/P_{ref} )\) versus \((\rho_{1} - \rho_{ref} )\) kg m−3. Symbols are experimental points, and lines are Bartle et al., model fit.

The solvation enthalpy was computed using the values of total and vaporization enthalpies, and the computed solvation enthalpy values are reported in Table 5. Notably, there is good agreement between the calculated average sublimation enthalpies from the PR EoS model (59.78 kJ/mol, as derived from Tables 3 and 5) and the calculated sublimation enthalpies from the Bartle et al. model (60.91 kJ/mol, as derived from Table 5). This suggests that using the PR EoS method in this study can yield meaningful correlation constants. However, the PR EoS accuracy decreases as the temperature increases from 308 to 338 K, possibly due to the temperature dependency of adjustable parameters. Figure 8 depicts the data fitting achieved using the Sodeifian and Reddy–Garlapati models.

Figure 8
figure 8

Codeine phosphate solubility in SC-CO2, \(y_{2}\) versus \(\rho_{1}\)(kg m−3). Symbols are experimental points, lines are Sodeifian and Reddy-Garlapati model’s fit.

Three forms of expanded liquid models, precisely Eqs. (26), and (30), underwent evaluation with experimental data using the objective function mentioned in Eq. (12). Among these models, Eq. (30), which possesses the highest number of parameters, strongly agrees with the experimental data. Table 6 presents all the parameters associated with the expanded liquid models, and Fig. 9 shows the data correlation capabilities of these models.

Table 6 Correlation constant of ELM models.
Figure 9
figure 9

Codeine phosphate solubilities in SC-CO2, \(y_{2}\) versus \(\rho_{1}\)(kg m−3). Symbols are experimental points; lines are ELMs model’s fit.

The quality of data fit is contingent upon the number of parameters employed in the model. The Akaike Information Criterion (AIC) and the corrected AIC (AICc) are utilized to discern the optimal model. AICcis computed based on AIC74,75,76,77, mathematical criteria commonly employed for assessing the compatibility of a solubility model with the corresponding solubility data. In statistics, these criteria compare solubility models and determine whichbest fits the data. AIC is appropriate when the data set comprises more than 40 data points, whereas AICc is preferred when the data set contains fewer than 40 data points75,76. The following is relation between AIC and AICc. Additionally, the adjustable or mode parameters may be determined by different algorithms or methods such as nonlinear regression models78,79.

$$AIC_{c} = AIC + \frac{{2Q\left( {Q + 1} \right)}}{N - Q - 1}$$
(32)

In Eq. (32), N represents the number of experimental data points, Q denotes the adjustable constants of the model, and AIC is defined as the sum of \(N\;\ln \left( {{{SSE} \mathord{\left/ {\vphantom {{SSE} N}} \right. \kern-0pt} N}} \right)\)&\(2Q\), where SSE stands for the sum of squared error. Table 7 displays all the computed values, revealing that Eq. (30) exhibits the lowest AICc value, establishing it as the most suitable model for the given data.

Table 7 Statistical values (AIC and AICc) of all models.

The best model has the lowest AICc value. The six-parameter ELM model is identified as the optimal choice, while based on AICc, the Chrastil model exhibits a weaker correlation than the other models considered in this study.

Conclusion

This research presents, for the first time, solubility data of codeine phosphate in SC-CO2 measured at various conditions ranging between 308 and 338 K and 12–27 MPa. The measured data was found to vary within the range of (1.297–6.502) × 10–5 in mole fraction. The obtained solubility data were modeled using the PREoS model, with solute properties as one of the adjustable constants. Among the density models, the Chrastil, MT, and Bartle et al. models effectively captured the data. From the model constants, the enthalpies of the SC-CO2-codeine phosphate mixture were determined. Three expanded liquid models (ELMs) were applied to the solubility data. The model results indicate that all the expanded liquid models (ELMs) reasonably fit the data compared to the PR EOS and density models. Finally, AICc analysis indicates that the six-parameter ELM model is the most suitable model for data correlation. Considering the order of magnitude of solubility of codeine phosphate in SC-CO2, supercritical anti-solvent methods can be considered an appropriate choice for producing fine particles of this drug.