Skip to content

Repeated calls to equilibrate() with 'auto' charge balancing cause pH to drift (phreeqc2026 engine) #332

@mdaeron

Description

@mdaeron

This may be a new bug or a resurgence of #141, but I'm getting drifting pH when repeatedly equilibrating the same solution. I'm on a Mac M1 with pyEQL version a169325 (installed directly from github though uv:

from pyEQL import Solution
from pylab import *

initial_conditions = {
	'CO2(aq)': 1.8e-2,
	'H+': 1e-7,
}

S = Solution(
	initial_conditions,
	engine = 'phreeqc2026',
)

x = list(range(200))
y = []
for k in range(200):
	S.equilibrate()
	y.append(S.pH)

figure(figsize = (4,2.5))
subplots_adjust(bottom = 0.2)
plot(x,y)
xlabel('S.equilibrate() iterations')
ylabel('pH')
savefig('pH_drift.png')

yields:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions