WEEK 2 FOLLOW-UP · ABOUT 20 MINUTES

From Excel to a VLE model comparison

Import a real CSV file from the supplied workbook, check one observation, compare two activity models, and reopen your saved work. Use the same synthetic dataset throughout.

The workbook has two tabs: Demo contains calculations and explanations; VLE_data contains the 19 observations to import. The separate CSV supplies that same observation table if you need a ready-to-use file.

0–3 MINUTES · PREPARE THE INPUT FILE

1. Inspect the workbook and save one worksheet as CSV

  1. Open lab08-demo.xlsx. Select VLE_data. Inspect A1:D20: four headers in row 1 and 19 data rows below them. Each row is one constructed equilibrium observation.
  2. The headers must be exactly T,P,x1,y1. For this dataset, T is in K, P is in kPa, and x1 and y1 are mole fractions, not percentages. Keep units and explanatory text outside this table.
  3. Keep VLE_data active. In desktop Excel, use File → Save As and select CSV UTF-8 (Comma delimited) (.csv) where available. Save a separate file, for example my-lab08-data.csv. If Excel asks which sheet to keep, export the active worksheet only. Preserve the original XLSX so its Demo formulas remain available.
  4. Check that the CSV starts with the four headers and contains all 19 observations. Do not export the Demo tab. Keep dot decimals and numerical precision; do not replace numbers with rounded text.

Excel wording varies by version. Select the CSV format first, then check that the filename ends in .csv. If you use the provided lab08-demo-K-kPa.csv instead, you can complete the Lab steps, but you have not yet practiced exporting from Excel.

T,P,x1,y1
…
350,158.707198211,0.5,0.704857144627
…

The ellipses above are explanatory placeholders, not data to paste. Use the complete CSV. In the workbook, this observation is row 11.

3–6 MINUTES · INITIALIZE PROPERTIES, THEN IMPORT YOUR FILE

2. Load the CSV into Lab 08

  1. In Lab 08, select Load synthetic example. This fills the matching component names, source description, measured units and both Antoine definitions, as well as a table.
  2. Now use Load CSV or tab-separated text to select the CSV you actually saved in step 1. Check the selected filename and the contents of Or paste the table, including headers. Do not click Load synthetic example again after importing your file.
  3. Check Experimental path: Isothermal, Measured T column unit: K, and Measured P column unit: kPa. Both Antoine equations use log₁₀(Psat) = A − B/(T + C), with equation temperature in K, Psat in kPa, and valid limits 300–390 K.
  4. Select Validate & inspect data →. Expect 19 observations and 19 interior points used. Keep Unmeasured endpoint intervals → No extrapolation · no full-area verdict.
  5. Select Export complete study JSON. Keep a clearly named baseline file, for example week02-baseline.json.
The two actions have different jobs. Load synthetic example initializes the matching property setup for this particular teaching dataset. Selecting your CSV is the file-import step. For another dataset, supply its own sources, units and property constants. CSV alone does not restore those settings.

First-row check: 350 K = 76.85 °C; P ≈ 95.123102 kPa, x₁ = 0.05, y₁ ≈ 0.397542. Changing the measured T selector to °C would reinterpret 350 as 623.15 K; it would not convert the input table.

6–9 MINUTES · CHECK ONE OBSERVATION

3. Compare the Demo calculation with the Lab

Open Imported observations. Locate x₁ = 0.5, input row 11. In Excel, use the Demo tab to inspect the formulas linked to this row of VLE_data: B5:B9 contains the observation, B12:B13 calculates the two saturation pressures, B14:B15 calculates γ, and B16:B17 calculates ln γ. The Antoine input block is B24:C30.

QuantityExpected valueMeaning
T; P350 K; 158.707198211 kPaTemperature and total mixture pressure
x₁; y₁0.5; 0.704857144627Component 1 mole fractions in liquid and vapor
P₁sat; P₂sat150 kPa; 60 kPaCalculated pure-component saturation pressures at 350 K
ln γ₁; ln γ₂≈ 0.399813; ≈ 0.445568Natural logarithms displayed in the Lab table
γ₁ = [0.704857144627 × 158.707198211] / [0.5 × 150] ≈ 1.491545
γ₂ = [(1 − 0.704857144627) × 158.707198211] / [(1 − 0.5) × 60] ≈ 1.561377

Both results are dimensionless. Compare your γ values with EXP(table ln γ), allowing for displayed rounding. For component 2, use x₂ = 1 − x₁ and y₂ = 1 − y₁.

These calculations use yᵢP ≈ xᵢγᵢPᵢsat, assuming ideal vapor and negligible Poynting correction. Agreement checks the calculation with these inputs; it does not independently validate the property source.

9–15 MINUTES · FIT, INSPECT AND SAVE EACH MODEL

4. Compare Margules and NRTL

  1. Choose Model → Margules · 1 parameter, then select Fit selected model. Wait for convergence. Choose View → Pressure and vapor residuals.
  2. Record both reported errors, a residual pattern and any parameter-bound warning. Select Export complete study JSON and Export fitted residuals CSV. Rename both downloads to identify Margules before switching models.
  3. Choose Model → NRTL · fixed α and set Fixed NRTL α = 0.3. Leave Fit τᵢⱼ = cᵢⱼ + dᵢⱼ(350/T − 1) unchecked. Keep the observations and property settings unchanged.
  4. Select Fit selected model again. Inspect the same residual view and export the NRTL JSON and residuals CSV under separate names.
Full 19-point baselineMean absolute pressure error (%)Mean absolute vapor error (percentage points)
Margules, 1 parameter≈ 1.14098≈ 0.675676
NRTL, fixed α = 0.3≈ 1.14 × 10⁻⁶≈ 3.83 × 10⁻⁷

Small final-digit differences are normal. For spreadsheet inspection, the exported y_error column is the raw mole-fraction difference ycalc − yobserved. Multiply it by 100 for percentage points. The pressure_error_percent column is already a percentage. A reported mean absolute error averages absolute residuals.

15–18 MINUTES · RESTORE A FILE AND RECALCULATE

5. Reopen one saved study

  1. Expand Study workspace · reopen and compare cases near the top of Lab 08. Set Label for the next captured case to a useful label, such as “Restored Margules”.
  2. Use Load studies or a comparison JSON to select the Margules study JSON downloaded earlier. Select its Restore [case label] button.
  3. Check the restored data, units, constants and model controls. Select Validate & inspect data →, followed by Fit selected model. Inspect the fresh errors and compare them with the saved result.
Loading is not recalculation. The workspace initially displays recorded results. Restore loads the controls; validation and fitting calculate a fresh result. The observation CSV is input data, the residuals CSV is an output table, and complete study JSON preserves the setup and recorded results.

18–20 MINUTES · STATE WHAT YOU HAVE SHOWN

6. Explain the evidence

Finding: NRTL reproduces these synthetic training observations more closely than one-parameter Margules. Report both metrics with their units.

Limitation: NRTL generated these observations, so close recovery is expected. A low training error does not establish thermodynamic consistency, real-fluid property accuracy or prediction on new observations.

For its isothermal diagnostics, Lab 08 neglects excess-volume pressure effects. An isobaric differential verdict also requires independent excess-enthalpy data. The quick guide explains these distinctions and further troubleshooting.

Completed demonstration files

The workflow was checked in desktop Excel and Lab 08: export the active worksheet, import all 19 points, compare both models, then load the saved JSON files and validate/refit each model. The Excel-exported CSV preserves every numeric value in the supplied data.

CSV exported from Excel · Validated baseline JSON

Example modelReopen the setupInspect residuals
Margules, 1 parameterStudy JSONResiduals CSV
NRTL, α = 0.3Study JSONResiduals CSV

These are synthetic worked examples, not student submissions. Practice exporting your own files first. Import one study at a time after entering a descriptive case label. Refit after restoring.

See the restored NRTL resultLab 08 restored NRTL fit with tau12 0.8, tau21 1.2, alpha 0.3 and near-zero reproduction errors

Completion checklist

This is a practice checklist, not a new attendance task. Keep your files and corrections with the original worksheet. If your result differs, retain the study JSON and the exact warning so the same setup can be inspected.