PVT Regression of a Characterization Factor
Use this skill to regress a single split / characterization factor against
several measured PVT or separator targets at once, with per-target weights and
explicit residual reporting. It follows standard PVT regression practice (fitting
EOS/characterization parameters to measured PVT experiment values with weights)
and NeqSim's characterization plus PVT-simulation workflow.
The forward model is injected by the caller, so this skill has no dependency
on a particular EOS. In practice it wraps a NeqSim characterization + flash /
PVT-simulation evaluation, or the community
pseudocomponent-split-characterization and reference-fluid-synthetic-generation
skills.
When to Use
- When one heavy-end factor must reproduce multiple measured quantities
(for example saturation pressure and stock-tank-oil density) simultaneously.
- When targets have different importance and need weighting.
- When you must report per-target residuals to judge whether the match is
acceptable.
- When a full EOS regression is not warranted but a calibrated split factor is.
Inputs
forward_model(factor) -> {target_name: predicted_value}: caller-supplied.
targets: a list of RegressionTarget(name, measured, weight).
low, high: bounds of the factor search interval.
tol, max_iter: search controls.
Outputs
RegressionResult: fitted factor, objective, per-target residuals and
predictions, iterations, and convergence flag.
weighted_ssr(predicted, targets): the weighted sum of squared relative
residuals, usable as a standalone objective.
Engineering Method
Each residual is normalized: (predicted - measured) / measured, so quantities
of different magnitude and units contribute comparably. The objective is the
weighted sum of squared relative residuals. The factor is fitted by a robust
golden-section 1-D search over [low, high] — no gradients, suitable for the
noisy forward models produced by flash and PVT calculations.
Typical targets and units:
| Target |
Symbol |
Typical unit |
| Saturation pressure |
p_sat |
bara |
| Gas-oil ratio |
GOR |
Sm³/Sm³ |
| Stock-tank-oil density |
rho_STO |
kg/m³ |
| Oil formation volume factor |
Bo |
m³/Sm³ |
Python Usage Pattern
from pvt_regression import RegressionTarget, regress_characterization_factor
def forward(alpha):
# Replace with a NeqSim characterization + PVT evaluation for this factor.
fluid = build_fluid_with_split_factor(alpha)
return {
"p_sat": saturation_pressure_bara(fluid),
"rho_STO": stock_tank_oil_density(fluid),
}
targets = [
RegressionTarget("p_sat", measured=248.0, weight=2.0),
RegressionTarget("rho_STO", measured=832.0, weight=1.0),
]
result = regress_characterization_factor(forward, targets, low=0.6, high=3.0)
print(result.factor, result.residuals)
Related NeqSim Functionality
neqsim.thermo.characterization.PlusFractionModel / PlusCharacterize — the
factor (alpha/eta) regressed here.
SystemInterface + ThermodynamicOperations — saturation pressure
(bubblePointPressureFlash), GOR and density via separator/flash calculations.
- For a full EOS parameter regression (kij, Tc, Pc, omega, volume shift), use the
rigorous NeqSim PVT-simulation and tuning classes rather than this
single-factor screening.
Pair this skill with neqsim-pseudocomponent-split-characterization (the split)
and neqsim-reference-fluid-synthetic-generation (generate the fluids).
Validation Checklist
- Each measured target has a stated value, unit, source, and weight.
- The forward model returns every target name the regression expects.
- The returned
converged flag is checked and per-target residuals are within a
documented acceptable-match threshold.
- The fitted factor lies inside (not on) the search bounds; widen bounds if it
sits at an endpoint.
- Assumptions and limitations are recorded and qualified PVT review is planned.
Common Mistakes
- A forward model that omits a target name (raises a missing-prediction error).
- A measured value of zero (relative residual is undefined; raises).
- Passing
low >= high (raises).
- Interpreting a single-factor fit as a full EOS regression.
- Reporting only the fitted factor: also show raw vs tuned vs lab per target, the
per-sample predicted CME/DLE/viscosity error, and a bound flag when the factor
is pinned at an endpoint (see Reporting tuning quality).
- Tuning an oil characterisation (universal P/A) to a gas-cap or gas-condensate
sample: the GOR can be matched while the dew point and stock-tank density stay
wrong. Mark such a fluid NOT TUNED instead of reporting the fit.
- Reusing a cloned NeqSim fluid across trials: clones share kij and volume-shift
state, so rewrite both on every composition change or earlier trials leak in.
Reporting tuning quality
Every use of a tuned fluid in a report needs: a per-fluid table of raw, tuned and
lab GOR, stock-tank density and saturation pressure with the fitted parameters and
bound flags; per-sample prediction error (Psat, GOR, STO, CME above/below Psat,
DLE Rs/Bo, viscosity) with mean and worst case; parity and CME/DLE overlay figures;
untuned or inconsistent samples named (a CME referenced to a pressure that differs
from the reported Psat is a lab inconsistency to flag, not to fit). Worked example:
Grane task 2026-10-06 60_figures_tables.py; reporting rule in
neqsim-professional-reporting Principle 9a.
Also required (Visund task 2026-10-06, 63_tuning_quality.py):
- Compute the untuned "before" with the optimiser start values through the same
quality function as the tuned "after" (gas: alpha 2, S 0.5, k 1; oil: S from the C7+ MW
correlation, k 1) and tabulate before and after per sample.
- Give every experiment row a role:
fit target or check (not fitted). A check metric may
get worse when a target improves (oil Psat -3 points after the GOR and density fit); say so.
- Process-level calibration (for example the produced-gas heavy-end leaning of the wellstream
recombination) is not a PVT parameter: list it in
parameters with fluid
wellstream recombination, its bounds, and the benchmark role per window (calibrated,
hold-out, fitted separately). Never absorb a PVT or allocation mismatch in one factor on the
allocated oil: it closes the calibration window and fails the hold-outs.
Limitations
- Screening-level and single-factor; it does not tune the full EOS.
- The caller's forward model determines physical accuracy.
- Acceptable-match criteria (residual thresholds) must be set by the engineer.
- Results require qualified PVT review before design or operational use.
References
- Whitson, C.H., Brulé, M.R. (2000). Phase Behavior, SPE Monograph 20.
- Pedersen, K.S. et al. (2015). Phase Behavior of Petroleum Reservoir Fluids, 2nd ed.
- NeqSim: https://github.com/equinor/neqsim
1---2name: neqsim-pvt-regression-characterization-factor-23calculation_basis: "screening"4version: "0.1.0"5description: "Public weighted multi-target regression of a split/characterization factor against measured PVT and separator data (saturation pressure, GOR, stock-tank-oil density, formation volume factor). USE WHEN: a task must calibrate one heavy-end characterization factor so a fluid model reproduces several measured PVT/separator quantities at once, with per-target weights and residual reporting, before rigorous NeqSim EOS regression."6last_verified: "2026-07-14"7requires:8 python_packages: []9 java_packages: []10 env: []11 network: []12metadata:13 source: https://skillmd.com/skills/equinor/neqsim-pvt-regression-characterization-factor-214---1516# PVT Regression of a Characterization Factor1718Use this skill to **regress a single split / characterization factor against19several measured PVT or separator targets at once**, with per-target weights and20explicit residual reporting. It follows standard PVT regression practice (fitting21EOS/characterization parameters to measured PVT experiment values with weights)22and NeqSim's characterization plus PVT-simulation workflow.2324The forward model is **injected** by the caller, so this skill has no dependency25on a particular EOS. In practice it wraps a NeqSim characterization + flash /26PVT-simulation evaluation, or the community27`pseudocomponent-split-characterization` and `reference-fluid-synthetic-generation`28skills.2930## When to Use3132- When one heavy-end factor must reproduce **multiple** measured quantities33 (for example saturation pressure and stock-tank-oil density) simultaneously.34- When targets have **different importance** and need weighting.35- When you must report **per-target residuals** to judge whether the match is36 acceptable.37- When a full EOS regression is not warranted but a calibrated split factor is.3839## Inputs4041- `forward_model(factor) -> {target_name: predicted_value}`: caller-supplied.42- `targets`: a list of `RegressionTarget(name, measured, weight)`.43- `low`, `high`: bounds of the factor search interval.44- `tol`, `max_iter`: search controls.4546## Outputs4748- `RegressionResult`: fitted factor, objective, per-target residuals and49 predictions, iterations, and convergence flag.50- `weighted_ssr(predicted, targets)`: the weighted sum of squared relative51 residuals, usable as a standalone objective.5253## Engineering Method5455Each residual is normalized: `(predicted - measured) / measured`, so quantities56of different magnitude and units contribute comparably. The objective is the57weighted sum of squared relative residuals. The factor is fitted by a robust58golden-section 1-D search over `[low, high]` — no gradients, suitable for the59noisy forward models produced by flash and PVT calculations.6061Typical targets and units:6263| Target | Symbol | Typical unit |64| --- | --- | --- |65| Saturation pressure | `p_sat` | bara |66| Gas-oil ratio | `GOR` | Sm³/Sm³ |67| Stock-tank-oil density | `rho_STO` | kg/m³ |68| Oil formation volume factor | `Bo` | m³/Sm³ |6970## Python Usage Pattern7172```python73from pvt_regression import RegressionTarget, regress_characterization_factor7475def forward(alpha):76 # Replace with a NeqSim characterization + PVT evaluation for this factor.77 fluid = build_fluid_with_split_factor(alpha)78 return {79 "p_sat": saturation_pressure_bara(fluid),80 "rho_STO": stock_tank_oil_density(fluid),81 }8283targets = [84 RegressionTarget("p_sat", measured=248.0, weight=2.0),85 RegressionTarget("rho_STO", measured=832.0, weight=1.0),86]87result = regress_characterization_factor(forward, targets, low=0.6, high=3.0)88print(result.factor, result.residuals)89```9091## Related NeqSim Functionality9293- `neqsim.thermo.characterization.PlusFractionModel` / `PlusCharacterize` — the94 factor (`alpha`/`eta`) regressed here.95- `SystemInterface` + `ThermodynamicOperations` — saturation pressure96 (`bubblePointPressureFlash`), GOR and density via separator/flash calculations.97- For a full EOS parameter regression (kij, Tc, Pc, omega, volume shift), use the98 rigorous NeqSim PVT-simulation and tuning classes rather than this99 single-factor screening.100101Pair this skill with `neqsim-pseudocomponent-split-characterization` (the split)102and `neqsim-reference-fluid-synthetic-generation` (generate the fluids).103104## Validation Checklist105106- Each measured target has a stated value, unit, source, and weight.107- The forward model returns every target name the regression expects.108- The returned `converged` flag is checked and per-target residuals are within a109 documented acceptable-match threshold.110- The fitted factor lies inside (not on) the search bounds; widen bounds if it111 sits at an endpoint.112- Assumptions and limitations are recorded and qualified PVT review is planned.113114## Common Mistakes115116- A forward model that omits a target name (raises a missing-prediction error).117- A measured value of zero (relative residual is undefined; raises).118- Passing `low >= high` (raises).119- Interpreting a single-factor fit as a full EOS regression.120- Reporting only the fitted factor: also show raw vs tuned vs lab per target, the121 per-sample *predicted* CME/DLE/viscosity error, and a bound flag when the factor122 is pinned at an endpoint (see Reporting tuning quality).123- Tuning an oil characterisation (universal P/A) to a gas-cap or gas-condensate124 sample: the GOR can be matched while the dew point and stock-tank density stay125 wrong. Mark such a fluid NOT TUNED instead of reporting the fit.126- Reusing a cloned NeqSim fluid across trials: clones share kij and volume-shift127 state, so rewrite both on every composition change or earlier trials leak in.128129## Reporting tuning quality130131Every use of a tuned fluid in a report needs: a per-fluid table of raw, tuned and132lab GOR, stock-tank density and saturation pressure with the fitted parameters and133bound flags; per-sample prediction error (Psat, GOR, STO, CME above/below Psat,134DLE Rs/Bo, viscosity) with mean and worst case; parity and CME/DLE overlay figures;135untuned or inconsistent samples named (a CME referenced to a pressure that differs136from the reported Psat is a lab inconsistency to flag, not to fit). Worked example:137Grane task 2026-10-06 `60_figures_tables.py`; reporting rule in138`neqsim-professional-reporting` Principle 9a.139140Also required (Visund task 2026-10-06, `63_tuning_quality.py`):141142- Compute the **untuned "before"** with the optimiser start values through the same143 quality function as the tuned "after" (gas: alpha 2, S 0.5, k 1; oil: S from the C7+ MW144 correlation, k 1) and tabulate before and after per sample.145- Give every experiment row a role: `fit target` or `check (not fitted)`. A check metric may146 get worse when a target improves (oil Psat -3 points after the GOR and density fit); say so.147- Process-level calibration (for example the produced-gas heavy-end leaning of the wellstream148 recombination) is not a PVT parameter: list it in `parameters` with fluid149 `wellstream recombination`, its bounds, and the benchmark role per window (calibrated,150 hold-out, fitted separately). Never absorb a PVT or allocation mismatch in one factor on the151 allocated oil: it closes the calibration window and fails the hold-outs.152153## Limitations154155- Screening-level and single-factor; it does not tune the full EOS.156- The caller's forward model determines physical accuracy.157- Acceptable-match criteria (residual thresholds) must be set by the engineer.158- Results require qualified PVT review before design or operational use.159160## References161162- Whitson, C.H., Brulé, M.R. (2000). *Phase Behavior*, SPE Monograph 20.163- Pedersen, K.S. et al. (2015). *Phase Behavior of Petroleum Reservoir Fluids*, 2nd ed.164- NeqSim: https://github.com/equinor/neqsim