⬅ Back to Menu

Homework 4: Nonlinear Least Squares Fitting

1. Van der Waals Equation of State

The relationship between pressure ($P$), volume ($V$), and temperature ($T$) is modeled as:

$$ \left(P + \frac{a}{V^2}\right)(V - b) = RT \implies P(V) = \frac{RT}{V-b} - \frac{a}{V^2} $$

Using the Levenberg-Marquardt algorithm, we find the parameters $a$ and $b$ that minimize the sum of squared residuals between the measured data and the model.

2. V vs. P Visualization

Fitted Parameter a (L² bar / mol²)
--
Fitted Parameter b (L / mol)
--