Kobi Felton
Kobi Felton
/
🗒️
Blog
/
Composition Derivatives of Activity Coefficients
Composition Derivatives of Activity Coefficients

Composition Derivatives of Activity Coefficients

The derivation below is based on this resource from the people who created the CocoSimulator and this older paper from the same authors.

To write the derivative of the activity coefficient w.r.t to mole fraction, we’ll work from the Gibbs excess energy to find an expression for the activity coefficient in terms of derivatives of Gibbs excess energy.

Q=gERT=∑i=1nxiln⁡γiQ = \frac{g^E}{RT} = \sum_{i=1}^n x_i \ln \gamma_iQ=RTgE​=i=1∑n​xi​lnγi​

Therefore, the activity coefficient is:

ln⁡γi=∂(ntQ)∂ni∣T,P,nk≠i\ln \gamma_i = \frac{\partial(n_t Q)}{\partial n_i}|_{T,P,n_{k\neq i}}lnγi​=∂ni​∂(nt​Q)​∣T,P,nk=i​​

where nk≠in_{k \neq i}nk=i​ indicates the unconstrained derivative where all components are fixed except iii

  • Using chain rule to expand:
ln⁡γi=Q+nt∂Q∂ni∣T,P,nk≠i\ln \gamma_i = Q + n_t \frac{\partial Q}{\partial n_i}|_{T,P,n_{k\neq i}}lnγi​=Q+nt​∂ni​∂Q​∣T,P,nk=i​​
  • We can expand the second term again using chain rule
    1. ∂Q∂ni=∑j=1nQj∂xj∂ni∣nk≠i\frac{\partial Q}{\partial n_i} = \sum_{j=1}^n Q_j \frac{\partial x_j}{\partial n_i} |_{n_{k \neq i}}∂ni​∂Q​=j=1∑n​Qj​∂ni​∂xj​​∣nk=i​​Qj=∂Q∂xj∣xk≠jQ_j = \frac{\partial Q}{\partial x_j}|_{x_{k\neq j}}Qj​=∂xj​∂Q​∣xk=j​​
    2. We can easily find QjQ_jQj​, but how do we get the derivative of the mole fraction w.r.t moles?
  • Mole fraction derivative
    • We know from the differential for partial moles:
    • dni=d(ntxi)=ntdxi+xidntdn_i = d(n_tx_i) = n_t dx_i + x_i dn_tdni​=d(nt​xi​)=nt​dxi​+xi​dnt​dni−xi∑jdnj=ntdxidn_i - x_i \sum_j dn_j = n_t dx_idni​−xi​j∑​dnj​=nt​dxi​dxi=∑jδij−xintdnjdx_i = \sum_j \frac{\delta_{ij}-x_i}{n_t} dn_jdxi​=j∑​nt​δij​−xi​​dnj​
    • δij\delta_{ij}δij​ is the kronecker delta, so it is 1 when i=ji=ji=j and 0 everywhere else
    • We also know from the total differential
    • dxi=∑j(∂xi∂nj)dnjdx_i = \sum_j \biggl(\frac{\partial x_i}{\partial n_j} \biggr) dn_jdxi​=j∑​(∂nj​∂xi​​)dnj​
    • By inspection of the last two equations
    • (∂xi∂nj)nk≠j=1nt(δij−xi)\biggl (\frac{\partial x_i}{\partial n_j} \biggr )_{n_{k \neq j}} = \frac{1}{n_t}(\delta_{ij} - x_i)(∂nj​∂xi​​)nk=j​​=nt​1​(δij​−xi​)
  • Putting all the expansions together:
    1. ln⁡γi=Q+nt∂Q∂ni∣T,P,nk≠i\ln \gamma_i = Q + n_t \frac{\partial Q}{\partial n_i}|_{T,P,n_{k\neq i}}lnγi​=Q+nt​∂ni​∂Q​∣T,P,nk=i​​ln⁡γi=Q+nt(∑k=1nQk∂xk∂ni∣nl≠i)\ln \gamma_i = Q + n_t\biggl(\sum_{k=1}^n Q_k \frac{\partial x_k}{\partial n_i} |_{n_{l \neq i}} \biggr)lnγi​=Q+nt​(k=1∑n​Qk​∂ni​∂xk​​∣nl=i​​)ln⁡γi=Q+nt(∑k=1nQk1nt(δik−xk))\ln \gamma_i = Q + n_t\biggl(\sum_{k=1}^n Q_k \frac{1}{n_t}(\delta_{ik} - x_k)\biggr)lnγi​=Q+nt​(k=1∑n​Qk​nt​1​(δik​−xk​))
    2. Cancel out ntn_tnt​ and expand the Kronecker delta out of the sum to get our desired expression for the activity coefficient:
ln⁡γi=Q+Qi+∑k=1nxkQk\ln \gamma_i = Q + Q_i + \sum_{k=1}^n x_kQ_klnγi​=Q+Qi​+k=1∑n​xk​Qk​
  • Now we can easily find the derivative of the activity coefficient w.r.t the mole fraction - this is the version that only constrains one mole fraction but doesn’t enforce them all summing to one:
  • ∂ln⁡γi∂xj∣xl≠i=Qij−∑k=1nxkQkj\frac{\partial \ln \gamma_i}{\partial x_j}|_{x_{l \neq i}} = Q_{ij} - \sum_{k=1}^n x_kQ_{kj}∂xj​∂lnγi​​∣xl=i​​=Qij​−k=1∑n​xk​Qkj​Qij≡∂Qi∂xj∣xk≠iQ_{ij} \equiv \frac{\partial Q_i}{\partial x_j} |_{x_k\neq i}Qij​≡∂xj​∂Qi​​∣xk​=i​
  • To get the constrained version, we can observe that an increase in the mole fraction of one component will result in an equal and opposite decrease in the mole fraction of another (given all other mole fractions are fixed except one). This then implies the following equations, starting from the total derivative of the activity coefficient:
  • d(ln⁡γi(x1,…,xN))=∑k=1N∂ln⁡γi∂xk∣xj≠kdxkd(\ln \gamma_i(x_1, \dots, x_N)) = \sum_{k=1}^N \frac{\partial \ln \gamma_i}{\partial x_k}|_{x_{j \neq k}}dx_kd(lnγi​(x1​,…,xN​))=k=1∑N​∂xk​∂lnγi​​∣xj=k​​dxk​

    Only two mole fractions are actually varying so when we take the partial derivative:

    ∂∂xl(ln⁡γi(x1,…,xN))=∂ln⁡γi∂xl∣xj≠l+∂ln⁡γi∂xm∣xj≠mdxmdxl\frac{\partial}{\partial x_l}(\ln \gamma_i(x_1, \dots, x_N)) = \frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq l}}+ \frac{\partial \ln \gamma_i}{\partial x_m}|_{x_{j \neq m}} \frac{dx_m}{dx_l}∂xl​∂​(lnγi​(x1​,…,xN​))=∂xl​∂lnγi​​∣xj=l​​+∂xm​∂lnγi​​∣xj=m​​dxl​dxm​​

    Note that that lll can be equal to iii.

    We know by the logic above that dxl=−dxmdx_l = -dx_mdxl​=−dxm​, so

    ∂ln⁡γi∂xl∣xj≠i,l=∂ln⁡γi∂xl∣xj≠l−∂ln⁡γi∂xm∣xj≠m\frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= \frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq l}}- \frac{\partial \ln \gamma_i}{\partial x_m}|_{x_{j \neq m}}∂xl​∂lnγi​​∣xj=i,l​​=∂xl​∂lnγi​​∣xj=l​​−∂xm​∂lnγi​​∣xj=m​​∂ln⁡γi∂xl∣xj≠i,l=Qil−∑k=1nxkQkl−(Qim−∑k=1nxkQkm)\frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= Q_{il} - \sum_{k=1}^n x_kQ_{kl} - \biggl(Q_{im} - \sum_{k=1}^n x_kQ_{km} \biggr)∂xl​∂lnγi​​∣xj=i,l​​=Qil​−k=1∑n​xk​Qkl​−(Qim​−k=1∑n​xk​Qkm​)∂ln⁡γi∂xl∣xj≠i,l=Qil−Qim+∑k=1nxk(Qkl−Qkm)\frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= Q_{il} - Q_{im} + \sum_{k=1}^n x_k(Q_{kl} -Q_{km})∂xl​∂lnγi​​∣xj=i,l​​=Qil​−Qim​+k=1∑n​xk​(Qkl​−Qkm​)

So if we put this in terms of the Gibbs excess energy directly:

RT∂ln⁡γi∂xl∣xj≠i,l=∂2gE∂xi∂xl−∂2gE∂xi∂xm+∑k=1nxk(∂2gE∂xk∂xl−∂2gE∂xk∂xm)RT \frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= \frac{\partial^2 g^E}{\partial x_i \partial x_l} - \frac{\partial^2 g^E}{\partial x_i \partial x_m} + \sum_{k=1}^n x_k \biggl(\frac{\partial^2 g^E}{\partial x_k \partial x_l} -\frac{\partial^2 g^E}{\partial x_k \partial x_m}\biggr)RT∂xl​∂lnγi​​∣xj=i,l​​=∂xi​∂xl​∂2gE​−∂xi​∂xm​∂2gE​+k=1∑n​xk​(∂xk​∂xl​∂2gE​−∂xk​∂xm​∂2gE​)∂γi∂xl∣xj≠i,l=1RTγi(∂2gE∂xi∂xl−∂2gE∂xi∂xm+∑k=1nxk(∂2gE∂xk∂xl−∂2gE∂xk∂xm))\frac{\partial \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= \frac{1}{RT} \gamma_i \biggl( \frac{\partial^2 g^E}{\partial x_i \partial x_l} - \frac{\partial^2 g^E}{\partial x_i \partial x_m} + \sum_{k=1}^n x_k \biggl(\frac{\partial^2 g^E}{\partial x_k \partial x_l} -\frac{\partial^2 g^E}{\partial x_k \partial x_m}\biggr) \biggr)∂xl​∂γi​​∣xj=i,l​​=RT1​γi​(∂xi​∂xl​∂2gE​−∂xi​∂xm​∂2gE​+k=1∑n​xk​(∂xk​∂xl​∂2gE​−∂xk​∂xm​∂2gE​))

From what I understand you can arbitrarily choose mmm. This is the component which will be determined by all the others. In the paper, they choose the nnnth component. From the third page in the PDF:

image