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 mirrors FluidMagic's regression (which fits
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.
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-factor3description: 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.4---56# PVT Regression of a Characterization Factor78Use this skill to **regress a single split / characterization factor against9several measured PVT or separator targets at once**, with per-target weights and10explicit residual reporting. It mirrors FluidMagic's regression (which fits11EOS/characterization parameters to measured PVT experiment values with weights)12and NeqSim's characterization plus PVT-simulation workflow.1314The forward model is **injected** by the caller, so this skill has no dependency15on a particular EOS. In practice it wraps a NeqSim characterization + flash /16PVT-simulation evaluation, or the community17`pseudocomponent-split-characterization` and `reference-fluid-synthetic-generation`18skills.1920## When to Use2122- When one heavy-end factor must reproduce **multiple** measured quantities23 (for example saturation pressure and stock-tank-oil density) simultaneously.24- When targets have **different importance** and need weighting.25- When you must report **per-target residuals** to judge whether the match is26 acceptable.27- When a full EOS regression is not warranted but a calibrated split factor is.2829## Inputs3031- `forward_model(factor) -> {target_name: predicted_value}`: caller-supplied.32- `targets`: a list of `RegressionTarget(name, measured, weight)`.33- `low`, `high`: bounds of the factor search interval.34- `tol`, `max_iter`: search controls.3536## Outputs3738- `RegressionResult`: fitted factor, objective, per-target residuals and39 predictions, iterations, and convergence flag.40- `weighted_ssr(predicted, targets)`: the weighted sum of squared relative41 residuals, usable as a standalone objective.4243## Engineering Method4445Each residual is normalized: `(predicted - measured) / measured`, so quantities46of different magnitude and units contribute comparably. The objective is the47weighted sum of squared relative residuals. The factor is fitted by a robust48golden-section 1-D search over `[low, high]` — no gradients, suitable for the49noisy forward models produced by flash and PVT calculations.5051Typical targets and units:5253| Target | Symbol | Typical unit |54| --- | --- | --- |55| Saturation pressure | `p_sat` | bara |56| Gas-oil ratio | `GOR` | Sm³/Sm³ |57| Stock-tank-oil density | `rho_STO` | kg/m³ |58| Oil formation volume factor | `Bo` | m³/Sm³ |5960## Python Usage Pattern6162```python63from pvt_regression import RegressionTarget, regress_characterization_factor6465def forward(alpha):66 # Replace with a NeqSim characterization + PVT evaluation for this factor.67 fluid = build_fluid_with_split_factor(alpha)68 return {69 "p_sat": saturation_pressure_bara(fluid),70 "rho_STO": stock_tank_oil_density(fluid),71 }7273targets = [74 RegressionTarget("p_sat", measured=248.0, weight=2.0),75 RegressionTarget("rho_STO", measured=832.0, weight=1.0),76]77result = regress_characterization_factor(forward, targets, low=0.6, high=3.0)78print(result.factor, result.residuals)79```8081## Related NeqSim Functionality8283- `neqsim.thermo.characterization.PlusFractionModel` / `PlusCharacterize` — the84 factor (`alpha`/`eta`) regressed here.85- `SystemInterface` + `ThermodynamicOperations` — saturation pressure86 (`bubblePointPressureFlash`), GOR and density via separator/flash calculations.87- For a full EOS parameter regression (kij, Tc, Pc, omega, volume shift), use the88 rigorous NeqSim PVT-simulation and tuning classes rather than this89 single-factor screening.9091Pair this skill with `neqsim-pseudocomponent-split-characterization` (the split)92and `neqsim-reference-fluid-synthetic-generation` (generate the fluids).9394## Validation Checklist9596- Each measured target has a stated value, unit, source, and weight.97- The forward model returns every target name the regression expects.98- The returned `converged` flag is checked and per-target residuals are within a99 documented acceptable-match threshold.100- The fitted factor lies inside (not on) the search bounds; widen bounds if it101 sits at an endpoint.102- Assumptions and limitations are recorded and qualified PVT review is planned.103104## Common Mistakes105106- A forward model that omits a target name (raises a missing-prediction error).107- A measured value of zero (relative residual is undefined; raises).108- Passing `low >= high` (raises).109- Interpreting a single-factor fit as a full EOS regression.110111## Limitations112113- Screening-level and single-factor; it does not tune the full EOS.114- The caller's forward model determines physical accuracy.115- Acceptable-match criteria (residual thresholds) must be set by the engineer.116- Results require qualified PVT review before design or operational use.117118## References119120- Whitson, C.H., Brulé, M.R. (2000). *Phase Behavior*, SPE Monograph 20.121- Pedersen, K.S. et al. (2015). *Phase Behavior of Petroleum Reservoir Fluids*, 2nd ed.122- NeqSim: https://github.com/equinor/neqsim