Skip to content

Peng-Robinson EOS does not appear to load BIPs from Parameters into EquationOfState (or missing docs on correct BinaryRecord format for PR) #333

Closed

Description

@ImagineBaggins

Hello again,

Perhaps, I'm misunderstanding what the correct JSON format is for loading Peng-Robinson BIPs now, but prior to v0.9, the correct format was this:

[
    {
        "id1": {
           ...
        },
        "id2": {
           ...
        },
        "model_record": 0.0289
    }
]

Seeing as the model_record field was dissolved in v0.9, I assumed that the correct format is now the following, though the only information regarding cubic EOS BIPs specifically that I can find is #91:

[
    {
        "id1": {
            ...
        },
        "id2": {
           ...
        },
        "k_ij": 0.0289
    }
]

In any case, whatever field is included is successfully loaded into the Parameters object by Parameters.from_json, as confirmed by printing the Parameters object. The same is true for using Parameters.new_binary.

However, neither model_record nor k_ij is successfully loaded into the EquationOfState by peng_robinson = EquationOfState.peng_robinson(params_pr). Printing this object's parameters attribute produces the following:

print(peng_robinson.parameters)

> {'tc': array([190.56, 126.2 ]), 'pc': array([4599000., 3398000.]), 'acentric_factor': array([0.011, 0.037])}

with no mention of k_ij, which does appear here as a matrix when using another EOS such as PC-SAFT:

print(pcsaft.parameters)

> {'m': array([1.    , 1.1879]), 'sigma': array([3.7039, 3.3353]), 'epsilon_k': array([150.03,  90.99]), 'q': array([0.    , 1.1151]), 'k_ij': array([[0.     , 0.03227],
       [0.03227, 0.     ]])}

Further evidence that the BIP is not being loaded is given by VLE calculations; results do not change before or after attempting to provide a BIP.

So, it seems to me that either I am misunderstanding/unaware of the correct way to load Peng-Robinson BIPs now in v>=0.9, or some part of the implementation has broken. I tried to examine the parameter loading source code, but unfortunately I couldn't find the information I'm looking for.

Any advice is appreciated, as always.

Activity

  1. g-bauer commented on Jan 22, 2026

    @g-bauer
    Contributor

    Hey!

    Thanks (as always) for the issue. The intended use is as you wrote above (using "k_ij").

    You found a bug we introduced when moving from model-specific parameters on the Python side to a generic Python parameter container that parses parameters the model (EoS or functional) is instantiated. The fix is simple but we have to think about making this issue transparent in the future (warnings or error messages).

  2. added theissue type on Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pythonPython related feature or issue

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions