Question: partial derivatives of thermodynamic functions

I am trying to solve a problem of liquid-liquid equilibrium based on the gibbs free energy equation:

DGdef := DG/RT = sum(n[i]*ln(phi[i]), i = 1 .. nc)+sum(sum(X[i, j]*n[i]*phi[j], j = i+1 .. nc), i = 1 .. nc)

DGdef1 := subs(n[i] = phi[i]*V/v[i], DGdef)

DG := eval(rhs(DGdef1), nc = 3)

DG1 := subs([phi[1] = phi1, phi[2] = phi2, phi[3] = phi3, v[1] = v1, v[2] = v2, v[3] = v3], DG)

Based on DG1 I need to derivate this expression with respect to phi1. However, phi1, phi2 and phi3 are interdependent because they are volume fractions. It means that phi1 is a function of phi2 & phi3. The same happens for phi2 and phi3.

If I simply use diff(DG1,phi1), Maple will solve it assuming no dependence among the fractions.

Someone know how to differentiate DG1 considering the interdependence among phi1, phi2 and phi3?

Thank you.

 

 

 

Please Wait...