Question: Hello. I have a thermodynamics II final project using the VBA program in excel to identify Dew T and liquid composition. Here is a sample
Hello. I have a thermodynamics II final project using the VBA program in excel to identify Dew T and liquid composition.
Here is a sample vba code that I get from the professor, but I have to modify some of blue parts that I marked on the code using the given equation and data sheets. Furthermore, I don't know how to make the Txy diagram with the vba code in excel..
Q. Could you modify the vba code shown below and make the Txy diagram based on the results followed?
- code provided


- using the NRTL model for gamma

- Here is a data sheet below
- use the antonie constants for antonie equation for Pi (sat)
- use the b12, b21, alpha 12=alpha 21 paramters below for NRTL model

- Guideline to follow

Thank you so much for your time..
Private Sub CommandButton1_Click() Dim i As Integer Dim I As Double, TCal As Double, P As Double, x1 As Double, x2 As Double, y1 As Double, y2 As Double Dim P1sat As Double, P2sat As Double, T1sat As Double, T2sat As Double, alpha As Double Dim gamma1 As Double, gamma2 As Double, A As Double Dim A1 As Double, B1 As Double, C1 As Double, A2 As Double, B2 As Double, C2 As Double P=101.33y1=0.4y2=1y1 A1=16.59158B1=3643.31C1=33.424A2=14.25326B2=2665.54C2=53.424 A2=14.25326B2=2665.54C2=53.424 T1sat=B1/(A1log(P))C1T2sat=B2/(A2log(P))C2T=T1sat*y1+T2sat*y2gamma1=1gamma2=1 For i=1 To 50 A=2.7710.00523T P1sat=Exp(A1B1/(T+C1))P2sat=Exp(A2B2/(T+C2)) x1=y1P/gamma1/P1satx2=1x1 gamma1=Exp(A22)gamma2=Exp(Ax12) P1sat =P(y1/ gamma1 + y 2/ gamma2 * alpha ) TCal =B1/(A1log(P1 sat )) C1 If (Abs(TCal T)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
