Question:
Write a MATLAB function to calculate the equilibrium solubility of component 1 (x1) in a binary system at a given temperature and pressure as the input using the fugacity coefficients calculated from the Soave Equation of State (EOS). Your function must:
1. Be user friendly
2. The input of the fitnction should have critical temperature, critical pressure, acentric factor of each component and a given temperature, pressure and a mixing constant kn. (Should be total of 9 inputs)
3. The output is the equilibrium solubility of component 1 (x1)
4. Use your created function to calculate the equilibrium solubility of CO2 in n-decane (x1) at 300 F and 42 bar that kij = 0.12 (Knapp et al, p 638). Define component 1 is CO2 and component 2 is n-decane.
Attachment:- Soave equation of state.rar