# Supplementary Material: Explaining Giant Apparent $\mathrm{p}K_{\mathrm{A}}$
Shifts in Weak Polyelectrolyte Brushes

David Beyer  Institute for Computational Physics, University of Stuttgart,
D-70569 Stuttgart, Germany  Peter Košovan<EMAIL_ADDRESS>Department of Physical and Macromolecular Chemistry, Charles University,
Prague, Czechia  Christian Holm<EMAIL_ADDRESS>Institute for
Computational Physics, University of Stuttgart, D-70569 Stuttgart, Germany

##  I Ideal Donnan Theory

Within the ideal Donnan theory, we assume that the system can be considered as
composed of two compartments (phases): a polymer brush and an aqueous solution
containing small ions (H+, $\ce{OH-}$, $\ce{Na+}$, $\ce{Cl-}$), termed the
bulk. Additionally, we assume that both the brush and the solution are
electroneutral, which implies that the brush confines all of its counterions.
Because both compartments can exchange small ions, an electrochemical
equilibrium is established between the two phases:

$\displaystyle\mu_{i}^{\mathrm{brush}}+z_{i}e\psi^{\mathrm{Don}}=\mu_{i}^{\mathrm{bulk}}.$
(S1)

Within the ideal theory, all interactions are neglected. In this case, the
Donnan potential $\psi^{\mathrm{Don}}$ can be obtained as a Lagrange
multiplier, originating from the electroneutrality constraint [1]. For an
ideal system, the Donnan equilibrium can be expressed as a relation between
the partition coefficient of cations, $\xi_{+}\equiv
c_{+}^{\text{brush}}/c_{+}^{\text{bulk}}$, and the Donnan potential:

$\displaystyle\xi_{+}=\exp\left(-\beta
e\psi^{\mathrm{Don}}\right)=\frac{\alpha
c_{\mathrm{mon}}}{2I}+\sqrt{\left(\frac{\alpha
c_{\mathrm{mon}}}{2I}\right)^{2}+1}.$ (S2)

Here, $\alpha c_{\mathrm{mon}}$ is the concentration of ionized acid monomers
inside the brush and $I$ the ionic strength in the bulk. Notably, the ionic
strength includes all small ionic species $\ce{Na+}$, $\ce{Cl-}$, $\ce{H+}$
and $\ce{OH-}$. Therefore, the ionic strength is generally different from the
concentration of added salt, especially at low salt concentrations and high or
low pH values. The theory thus predicts a difference in the pH-value between
the the brush and the bulk solution:

$\displaystyle\begin{split}\Delta^{\mathrm{Don}}&=\log_{10}\left(\exp\left(-\beta
e\psi^{\mathrm{Don}}\right)\right)\\\
&\stackrel{{\scriptstyle\mathrm{ideal}}}{{=}}\log_{10}\left(\frac{\alpha
c_{\mathrm{mon}}}{2I}+\sqrt{\left(\frac{\alpha
c_{\mathrm{mon}}}{2I}\right)^{2}+1}\right).\end{split}$ (S3)

For a weak polyelectrolyte brush, the degree of ionization, $\alpha$, is not
fixed but determined by the pH and Donnan potential inside the brush, related
by the Henderson-Hasselbalch equation

$\displaystyle\alpha=\frac{1}{1+10^{\text{p}K_{\text{A}}-\text{pH}-\Delta^{\mathrm{Don}}}}.$
(S4)

Equation S4 and Equation S3 form a nonlinear system of equations which does
not have an analytical solution.

The plot of the degree of ionization of the brush as a function of the pH is
shifted by $\Delta^{\mathrm{Don}}$, as compared to the same curve in the bulk.
This shift can be quantified using the effective p$K_{\mathrm{A}}$, defined as
the pH at which the brush is 50% ionized,

$\displaystyle\mathrm{p}K_{\mathrm{A}}^{\mathrm{eff}}\equiv\mathrm{pH}\left(\alpha=\frac{1}{2}\right)\stackrel{{\scriptstyle\mathrm{ideal}}}{{=}}\mathrm{p}K_{\mathrm{A}}+\Delta^{\mathrm{Don}}.$
(S5)

For a densely grafted brush at $\alpha=0.5$ we have $\alpha
c_{\mathrm{mon}}\gg I$ and thus

$\displaystyle\Delta^{\mathrm{Don}}$
$\displaystyle\approx\log_{10}\left(\frac{c_{\mathrm{mon}}}{2I}\right).$ (S6)

Because for $\alpha=0.5$ the ionic strength inside the brush is dominated by
the counterions confined to the brush, $c_{\mathrm{mon}}$ does not change
significantly with $I$ and consequently
$\mathrm{p}K_{\mathrm{A}}^{\mathrm{eff}}$ decreases approximately linearly
with $\log_{10}\left(I/1\,\mathrm{M}\right)$. In a real interacting system,
the $\mathrm{p}K_{\mathrm{A}}^{\mathrm{eff}}$ depends not only on the Donnan
shift, as suggested by Equation S5, but also on additional contributions due
to interactions [1]. In highly charged systems, these additional contributions
are dominated by electrostatic interactions, which are neglected in the ideal
theory.

If we assume that the $\mathrm{p}K_{\mathrm{A}}$ shift is dominated by the
Donnan term, the we can express the monomer concentration from Equation S6:

$\displaystyle c_{\mathrm{mon}}=2I\cdot 10^{\Delta^{\mathrm{Don}}}.$ (S7)

In addition, if the degree of polymerization, $N$ is known, then this equation
can be used to estimate the grafting density of the brush:

$\displaystyle\Gamma=\frac{2Ih_{\mathrm{brush}}N_{\mathrm{A}}}{N}\cdot
10^{\Delta^{\mathrm{Don}}}.$ (S8)

In this formula, $h_{\mathrm{brush}}$ is the height of the brush and
$N_{\mathrm{A}}$ is the Avogadro constant.

##  II Simulation Model and Methods

###  II.1 Simulation Model

With our coarse-grained simulation model, we want to represent a grafted weak
polyelectrolyte brush. To model the polymer chains which make up the brush, we
make use of the generic Kremer-Grest polymer model with an implicit solvent
[2]. In this model, all particles (monomers and small ions alike) interact via
a Weeks-Chandler-Andersen (WCA) potential [3]:

$\displaystyle
V_{\text{WCA}}(r)=\begin{cases}4\epsilon\left(\left(\frac{\sigma}{r}\right)^{12}-\left(\frac{\sigma}{r}\right)^{6}\right)+\epsilon&\mbox{if
}r\leq 2^{\frac{1}{6}}\sigma\\\ 0&\mbox{if
}r>2^{\frac{1}{6}}\sigma.\end{cases}$ (S9)

Here, we set the bead diameter to $\sigma=0.355\,\text{nm}$ and the energy
scale to $\epsilon=k_{\text{B}}T$ with $T=300\,\text{K}$. Chemical bonds
between adjacent monomers are modelled by the FENE potential [4]:

$\displaystyle V_{\text{FENE}}(r)=\begin{cases}-\frac{k\Delta
r_{\text{max}}^{2}}{2}\ln\left(1-\left(\frac{r-r_{0}}{\Delta
r_{\text{max}}}\right)^{2}\right)&\mbox{if }r\leq\Delta r_{\text{max}}\\\
\infty&\mbox{if }r>\Delta r_{\text{max}}.\end{cases}$ (S10)

In this study we set $\Delta r_{\text{max}}=1.5\sigma$ and
$k=30k_{\text{B}}T/\sigma^{2}$. Furthermore, charged particles interact via
the Coulomb potential,

$\displaystyle
V^{ij}_{\text{Coulomb}}(r)=\frac{\lambda_{\text{B}}k_{\text{B}}Tz_{i}z_{j}}{r},$
(S11)

where we set the Bjerrum length $\lambda_{\text{B}}=e^{2}/4\pi\epsilon
k_{\text{B}}T$ to a value of $\lambda_{\text{B}}=2\sigma=7.1\,\text{\r{A}}$
which corresponds to water at room temperature.

In our simulations, the polyelectrolyte brush of grafting density is
represented by an array of $5\times 5=25$ chains with 25 monomers each. All
monomers are weak acids, characterized by $\mathrm{p}K_{\mathrm{A}}=4.0$. This
value is close to acrylic acid, which is a typical weak polyacid used in
experiments. To pin the polymer chains to the wall, we fix the first monomer
of each chain at a height of $z=\sigma$. Laterally, the first monomers are
fixed on a square lattice, resulting in a uniform grafting density. The
simulation box, corresponding to a slab system, consists of a square cuboid
box with lateral dimensions $L_{x}=L_{y}=\sqrt{25/\Gamma}$ and height
$h=50\sigma$. To confine the system in the $z$-direction, we make use of fixed
walls at $z=0$ and $z=h$ which interact via a WCA potential (with the same
parameters as above) with all particles in the simulation. The simulation box
is replicated in all directions using periodic boundary conditions. In the
$z$-direction, an additional gap is left between the periodic images which is
needed to subtract the contributions of the periodic images to the
electrostatic interactions [5], see below for details.

###  II.2 Simulation Method

To sample different conformations of the system, we make use of Langevin
dynamics with $T\approx 300\,\text{K}$, a friction coefficient of $\gamma=1.0$
(in LJ units) and $m=1.0$ (in LJ units). We integrate the equations of motion
using the Velocity-Verlet method [6] with a time step of $\Delta
t=0.01\,\sigma\left(m/k_{\mathrm{B}}T\right)^{1/2}$.

In order to simulate the ionization equilibrium of the acidic monomers as well
as the exchange of small ions with the bulk, we make use of the G-RxMC method
[1], described in more detail below. In this method, the simulation box,
containing the polyelectrolyte brush and some additional portion of the
solution above the brush, is coupled to a reservoir which represents the bulk
solution and is characterized by $c_{\mathrm{salt}}$ and pH. To efficiently
calculate the electrostatic interactions in the slab system, we make use of
the P3M method [7, 8, 9] with the electrostatic layer correction (ELC) [5, 10,
11], which allows us to take into account the interactions with the periodic
images only in the $x$\- and $y$-directions. All simulations are carried out
using the open-source simulation software ESPResSo [12].

###  II.3 Grand-Reaction Monte-Carlo Method

In the following we include a detailed description of the employed Grand-
Reaction Monte-Carlo method (G-RxMC) [1]. The dissociation reaction of acidic
group, occurring in the polyelectrolyte brush, is schematically described by
the equation

$\displaystyle\ce{HA<=>A-+H+}.$ (S12)

To circumvent possible bottlenecks in the sampling, we additionally consider
the following reactions:

As described in Ref. [1], these reactions are obtained by combining the
reaction in Equation S12 with the reactions describing exchange of small ions
with the reservoir. The exchange of small ions with the reservoir is described
by the following virtual chemical reactions: We represent the insertion and
deletion of ion pairs by the following set of virtual chemical reactions:

Here, $\emptyset$ denotes the empty set. To retain the overall
electroneutrality of the system, these virtual reactions always insert or
delete neutral pairs of ions. In each reaction step we choose a random
reaction and its direction (forward or reverse) with equal probability. In the
forward direction, we insert the particles into the simulation box at random
positions. In the reverse direction, we remove randomly chosen particles from
the simulation box or change their identity of particles in accordance with
the stoichiometry of the selected reaction. This proposed new state (n) is
accepted according to the following acceptance criterion:

$\displaystyle
P^{\mathrm{GRxMC}}_{\textrm{n,o}}=\min\left\\{1,\left(\prod_{i}\frac{N_{i}^{0}!\left(Vc^{\ominus}\right)^{\nu_{i}\xi}}{(N_{i}^{0}+\nu_{i}\xi)!}\right)\exp\left(\beta\left[\xi\sum_{i}\nu_{i}(\mu_{i}-\mu^{\ominus}_{i})-\Delta\mathcal{U}_{\textrm{n,o}}\right]\right)\right\\}:$
(S13)

Otherwise the old state (o) is retained. In the above acceptance criterion,
$V$ denotes the box volume, $\beta=1/k_{\mathrm{B}}T$ the inverse thermal
energy, $\mu_{i}$ are the chemical potentials, $\nu_{i}$ the stoichiometric
coefficients, $c^{\ominus}=1\,$M the reference concentration,
$\Delta\mathcal{U}_{\textrm{n,o}}$ the change in energy from the old state (o)
to the new state (n) and $\xi$ the extent of reaction which is $\xi=1$ for the
forward and $\xi=-1$ for the reverse direction of the reaction. The pH and
salt concentration in the reservoir are ultimately determined by the chemical
potentials $\mu_{i}$. We establish the relation between the imposed pH and
$c_{\mathrm{salt}}$ and the required chemical potentials $\mu_{i}$ by
performing auxiliary simulations in the canonical ensemble of a box filled
with ions at different concentrations. From these simulations we measure the
excess chemical potential as a function of the ionic strength using the Widom
particle insertion method [13]. For the imposed values of pH and
$c_{\mathrm{salt}}$ we can then calculate the required chemical potentials
from the following set of self-consistent equations:

$\displaystyle\mathrm{pH}$
$\displaystyle=-\log_{10}\left(\frac{c_{\ce{H+}}}{c^{\ominus}}\sqrt{\gamma}\right)$
(S14) $\displaystyle\gamma$
$\displaystyle=f\left(I\left(c_{\ce{H+}},c_{\ce{OH-}},c_{\mathrm{salt}}\right)\right)$
(S15) $\displaystyle c_{\ce{OH-}}$
$\displaystyle=\frac{K_{\ce{H+},\ce{OH-}}\left(c^{\ominus}\right)^{2}}{c_{\ce{H+}}\gamma}.$
(S16)

Here, $f(I)$ has to be interpolated using the data obtained from the Widom
insertion simulations.

###  II.4 Simulation Protocol

In order to investigate the influence of the pH value and the salt
concentration in the bulk on the behaviour of the brush, we carry out
simulations for $\mathrm{pH}\in[1.0,13.0]$ and
$c_{\mathrm{salt}}\in\left[10^{-6}\,\mathrm{M},0.1\,\mathrm{M}\right]$. To
simulate the system, we make use of the following protocol: in the beginning,
there are no small ions in the system and all chains are electrically neutral
and in a stretched conformation. To arrive at a random configuration, we run
the Langevin thermostat with a random seed for a total of $10^{6}$ integration
steps. Next, we perform $10^{4}$ reaction steps in order to add some charged
particles to the simulation box. This is necessary to tune the P3M solver with
ELC in the next step. After the electrostatics has been added, we minimize the
energy using the method of steepest descent. Then, we run a total of 2500
warmup loops, where in each loop we perform 1000 integration steps and 200
reaction moves, amounting to a total of $5\cdot 10^{5}$ reaction moves. After
this warmup, we retune the electrostatics solver at the new concentration of
ions, which is now close to equilibrium. The production run consists of a
total of $2\cdot 10^{4}$ loops. In each loop, we perform 1000 integration
steps, while we perform 1000 reaction moves every tenth loop. The observables
such as the degree of ionization are sampled every tenth loop.

###  II.5 Influence of the Simulation Box Size

The simulations presented in the main text were performed for a system with a
box height of $h=50\,\sigma=17.75\,\mathrm{nm}$. We verified that this box
size is big enough by performing simulations for a few selected salt
concentrations at larger box sizes of $h=100\,\sigma=35.5\,\mathrm{nm}$ and
$h=1000\,\sigma=355\,\mathrm{nm}$. The agreement between the simulation
results, shown in Figure S1, justifies a-posteriori the chosen box size.
Irrespective of the simulation box size, we always use the composition of the
reservoir as the reference bulk composition. Otherwise, our calculation would
neglect an additional Donnan potential which arises between the simulation box
and the reservoir. This is evidenced by the proton density profiles in Figure
S2 which show that these profiles agree within the brush, irrespective of the
box size. For the smallest boxes, the concentration of H+ at the far end of
the simulation box has not yet converged to its bulk value. For all box sizes
used in the current study, this additional contribution is rather small,
however, it might become more significant if we had used smaller boxes.
However, being aware of this possible artifact allows us to choose an
appropriate box size, which is big enough to be free of artifacts, while
simultaneously being small enough in order to avoid excessive computational
cost.

Figure S1: Degree of ionization of the brush as obtained for different box
sizes and salt concentrations.

Figure S2: Density profiles of H+ ions for a bulk salt concentration of
$c_{\mathrm{salt}}=10^{-6}\,\mathrm{M}$ and $\mathrm{pH}=12$, obtained for
different simulation box sizes. The dashed line indicates the corresponding H+
concentrations in the reservoir. The lower panel shows a zoomed in view of the
tail of the distribution.

##  III Self-consistent field model and method

The numerical model employed here is based on the Scheutjens-Fleer Self-
Consistent Field (SCF) theory [14, 15]. Its implementation has been described
in multiple publications, e.g. in Refs. [16, 17]. The implementation used here
is essentially identical to the one described in full detail in the supporting
information of Ref. [17], except that we assume a flat lattice, composed of
equally spaced layers, instead of concentric spherical shells. Therefore, we
provide here just a brief description, referring to Ref. [17] for the
necessary equations and further technical details.

In the Scheutjens-Fleer SCF method [14, 18], the free energy is expressed as a
functional of (i) the volume fraction profiles of the polymer segments, the
ions, and the solvent, (ii) the complementary segment potential profiles, and
(iii) the Lagrange field (profile) linked to the compressibility condition.
This free energy functional is optimized on a grid of lattice sites, divided
into layers parallel to the surface. The lattice is subdivided into
$z=1,\ldots,M$ layers. Properties within each layer are assumed to be uniform
while density gradients perpendicular to the surface are considered
explicitly. Furthermore, we assume that all polymer segments solvent molecules
and small ions have the same size $z_{0}=0.355\,\mathrm{nm}$, exactly fitting
one lattice site which has the volume of $z_{0}^{3}$. We assume additivity of
volumes and incompressibility which implies that all volume fractions add up
to unity within each lattice layer. To match the simulation model, we use
chains with $N=25$ segments, with the first segment grafted to the surface,
i.e. fixed to the first lattice layer. We assume that the segments are weak
acids with $\mathrm{p}K_{\mathrm{A}}=4.0$. To ensure that our calculations are
not too much affected by the finite size of the lattice, we verified that the
calculations yield nearly identical results for different system sizes (number
of layers): $M\in\\{50,100,1000\\}$.

Within the SCF machinery, we numerically optimise the mean field free energy.
We search for volume fraction profiles of segments, ions, and solvent which
minimises the free energy of the whole system and satisfies the
incompressibility, electroneutrality and connectivity constraints.
Simultaneously, we maximise the free energy functional with respect to the
segment potentials and the Lagrange field. To account for connectivity, we
apply the propagator formalism, as described in detail in supporting
information of Ref. [17]. The electrostatic interactions are included by
solving the one-dimensional Poisson equation for the given density profiles of
all charged species. The resultant electrostatic potential adds to the mean-
field potential and also affects the local chemical potential of charged
segments. The acid-base equilibrium is calculated based on the density
profiles of H+ ions within the Poisson-Boltzmann framework, as described in
Refs. [19, 20]. Excluded volume effects are treated at the Flory-Huggins level
with $\chi=0$ (athermal solvent). The salt concentration and the pH are
defined by the boundary conditions as the concentration of each ionic species,
including the concentration of H+ ions, in the outermost lattice layer. One
small ion, either Na+ or CL-, is treated as a neutralizer, _i.e._ , its
concentration is adjusted to keep the system electrically neutral. The
equations are solved iteratively until self-consistency between the potentials
and density profiles is achieved.

##  IV Influence of the Degree of Polymerization

In addition to the chosen box size (which was addressed above), we also
investigate the influence of the brush height, i.e. the degree of
polymerization $N$ of the chains, on the result. Generally, one would expect
that the influence of the explicit brush-solution interface decreases as $N$
is increased. While such a finite-size scaling study would be prohibitively
expensive on the particle-based level, it can be carried out rather easily on
the SCF level. The in general good agreement between SCF and particle-based
simulations justifies this approach. To probe the influence of the degree of
polymerization, we carried out SCF calculations for brushes with
$N\in\left\\{25,50,100\right\\}$. Figure S3 shows the resulting ionization
curves as a function of the pH. The plot shows that there is a miniscule shift
to the right, i.e. the ionization is slightly more suppressed, as $N$ is
increased. This is expected, because the relative importance of the interface,
where the local pH is higher than inside the brush, diminishes as the chains
become longer. Furthermore, we observe that the shift seems to saturate with
increasing $N$, i.e. the shift when going from 25 to 50 is larger than when
going from 50 to 100. This observation thus justifies the chosen value of
$N=25$ for the particle-based simulations.

(a) $\Gamma=0.79/\mathrm{nm}^{2}$

(b) $\Gamma=0.079/\mathrm{nm}^{2}$

Figure S3:  Plot of the degree of ionization $\alpha$ vs the pH as obtained
using the SCF model for different degrees of polymerization
$N\in\left\\{25,50,100\right\\}$. The results for different $N$ are shown as
dotted, dashed and full lines respectively. The two subfigures show analogous
results for different grafting densities of the brush.

##  V Additional Figures

  * •

Figure S4 shows the $\mathrm{p}K_{\mathrm{A}}$ shift as a function of the salt
concentration rather than the ionic strength (LABEL:fig:effective_pK_brush).
At very low salt concentrations, this representation leads to a nonlinear
behaviour.

  * •

Selected concentration profiles for the protons as obtained from the particle-
based simulations, calculated using a kernel density estimation, are shown in
Figure S5. The profiles, obtained from the simulations with a box size of
$h=1000\,\sigma$, display a gradual decay rather than a sharp transition that
is one of the assumptions of the ideal Donnan theory. Far away from the brush,
the concentration approaches the bulk/reservoir value. For values of $z$
smaller than $\langle R_{\mathrm{e}}\rangle/2$ the profiles are effectively
constant. This distance was used to define the region ”inside of the brush”.

  * •

In Figure S6 we show selected monomer concentration profiles of the brush at
different pH-values and grafting densities. The distribution gets broader as
the pH is increased, because the brush becomes ionized and swells due to the
osmotic pressure of the counterions and the electrostatic repulsion. Another
interesting feature one can observe is the appearance of sharply defined
maxima and minima in the distribution function near the wall as the swelling
increases. These appear because the chains become more stretched and near the
wall, where the chain ends are fixed, this increases the ordering.

  * •

Figure S7 displays the pH-dependent mean end-to-end distance of the brush,
quantifying the swelling behaviour of the brush.

  * •

Figure S8 shows the Donnan and polyelectrolyte effect in the brush with a
grafting density of $\Gamma=0.79/\mathrm{nm}^{2}$ as a function of pH at
different salt concentrations (this is analogous to
LABEL:fig:donnan_and_polyelectrolyte in the main text).

  * •

Figure S9 shows the mean end-to-end distance of the brush as a function of the
degree of ionization of the brush. For the brush at the higher grafting
density, we observe that the swelling curves for the different bulk salt
concentrations collapse onto a universal swelling curve. This behaviour
suggests that the densely grafted brush can be considered to be in the osmotic
brush regime for all considered salt concentrations. In contrast, for the
brush at the lower grafting density, we observe that while the data collapses
onto a universal curve for the lower salt concentrations, the brush swells
less for the highest investigated salt concentration ($0.1\,$M). Furthermore,
for all curves we observe a deswelling at very high pH-values, which is
related to the concomitant increase of the bulk ionic strength. These
observations imply that the brush transitions from the osmotic regime to the
salted regime at a high enough salt concentration.

  * •

Figure S10 shows the degree of ionization $\alpha$ of the brush as a function
of the ionic strength inside the brush (including the charged monomers).

  * •

Figure S11 shows the ionic strength inside the brush (including the charged
monomers) as a function of the local pH inside the brush.

  * •

Figure S12 shows the ionic strength inside the brush as a function of the
ionic strength in the bulk solution at various fixed values of the degree of
ionization $\alpha$.

Figure S4:  The $\mathrm{p}K_{\mathrm{A}}$ shift of brushes with different
grafting densities as a function of salt concentration. Solid symbols
represent data from particle-based simulations, whereas empty symbols
represent SCF results.  Figure S5: Proton density profiles for a bulk salt
concentration of $c_{\mathrm{salt}}=10^{-2}\,\mathrm{M}$ and various pH-
values. The vertical dashed lines indicate the value of $\langle
R_{\mathrm{e}}\rangle/2$ (for $\mathrm{pH}=10$ and $\mathrm{pH}=12$, the
values cannot be distinguished visually). The horizontal dashed lines indicate
the corresponding H+ concentrations in the reservoir.

(a) $\Gamma=0.79/\mathrm{nm}^{2}$

(b) $\Gamma=0.079/\mathrm{nm}^{2}$

Figure S6: Monomer concentration profiles of the brush as a function of the
distance $z$ from the wall for $c_{\mathrm{salt}}=10^{-4}\,\mathrm{M}$ and
different values of the pH in the reservoir. The dashed vertical lines
indicate the mean values of the end-to-end distance $\langle
R_{\mathrm{e}}\rangle$. The two subfigures show analogous results for
different grafting densities of the brush.

(a) $\Gamma=0.79/\mathrm{nm}^{2}$

(b) $\Gamma=0.079/\mathrm{nm}^{2}$

Figure S7:  Plot of the pH-dependent mean end-to-end distance $\langle
R_{\mathrm{e}}\rangle$ of the chains for the brush. The two subfigures show
analogous results for different grafting densities of the brush.

(a)

(b)

Figure S8:  Donnan and polyelectrolyte effect in the brush with a grafting
density of $\Gamma=0.79/\mathrm{nm}^{2}$ as a function of pH at different salt
concentrations. (a): Difference between the local pH inside the brush and pH
in the bulk; (b): Degree of ionization of the brush in comparison with the
ideal Henderson-Hasselbalch equation (HH).

(a) $\Gamma=0.79/\mathrm{nm}^{2}$

(b) $\Gamma=0.079/\mathrm{nm}^{2}$

Figure S9:  Plot of the $\alpha$-dependent mean end-to-end distance $\langle
R_{\mathrm{e}}\rangle$ of the chains for the brush. The two subfigures show
analogous results for different grafting densities of the brush.

(a) $\Gamma=0.79/\mathrm{nm}^{2}$

(b) $\Gamma=0.079/\mathrm{nm}^{2}$

Figure S10:  Plot of the degree of ionization $\alpha$ as a unction of the
ionic strength inside the brush. The two subfigures show analogous results for
different grafting densities of the brush.

(a) $\Gamma=0.79/\mathrm{nm}^{2}$

(b) $\Gamma=0.079/\mathrm{nm}^{2}$

Figure S11:  Plot of the ionic strength inside the brush as a function of the
local pH inside the brush. The two subfigures show analogous results for
different grafting densities of the brush.

(a) $\Gamma=0.79/\mathrm{nm}^{2}$

(b) $\Gamma=0.079/\mathrm{nm}^{2}$

Figure S12:  Plot of the ionic strength inside the brush as a function of the
ionic strength in the bulk solution at various fixed values of the degree of
ionization $\alpha$. The two subfigures show analogous results for different
grafting densities of the brush.

## References

  * Landsgesell  _et al._ [2020] J. Landsgesell, P. Hebbeker, O. Rud, R. Lunkad, P. Košovan, and C. Holm, Grand-reaction method for simulations of ionization equilibria coupled to ion partitioning, Macromolecules 53, 3007 (2020).
  * Grest and Kremer [1986] G. S. Grest and K. Kremer, Molecular dynamics simulation for polymers in the presence of a heat bath, Physical Review A 33, 3628 (1986).
  * Weeks  _et al._ [1971] J. D. Weeks, D. Chandler, and H. C. Andersen, Role of repulsive forces in determining the equilibrium structure of simple liquids, The Journal of Chemical Physics 54, 5237 (1971).
  * Kremer and Grest [1990] K. Kremer and G. S. Grest, Dynamics of entangled linear polymer melts: A molecular-dynamics simulation, The Journal of Chemical Physics 92, 5057 (1990).
  * Arnold  _et al._ [2002] A. Arnold, J. de Joannis, and C. Holm, Electrostatics in periodic slab geometries. I, The Journal of Chemical Physics 117, 2496 (2002).
  * Frenkel and Smit [2002] D. Frenkel and B. Smit,  _Understanding Molecular Simulation: From Algorithms to Applications_, 2nd ed., Computational Science, Vol. 1 (Academic Press, San Diego, 2002).
  * Hockney  _et al._ [1973] R. W. Hockney, S. P. Goel, and J. W. Eastwood, A 10000 particle molecular dynamics model with long range forces, Chemical Physics Letters 21, 589 (1973).
  * Eastwood  _et al._ [1980] J. W. Eastwood, R. W. Hockney, and D. N. Lawrence, P3M3DP – the three-dimensional periodic particle-particle/particle-mesh program, Computer Physics Communications 19, 215 (1980).
  * Hockney and Eastwood [1988] R. W. Hockney and J. W. Eastwood,  _Computer Simulation Using Particles_ (IOP, London, 1988).
  * de Joannis  _et al._ [2002] J. de Joannis, A. Arnold, and C. Holm, Electrostatics in periodic slab geometries. II, The Journal of Chemical Physics 117, 2503 (2002).
  * Tyagi  _et al._ [2008] S. Tyagi, A. Arnold, and C. Holm, Electrostatic layer correction with image charges: A linear scaling method to treat slab 2D + h systems with dielectric interfaces, The Journal of Chemical Physics 129, 204102 (2008).
  * Weik  _et al._ [2019] F. Weik, R. Weeber, K. Szuttor, K. Breitsprecher, J. de Graaf, M. Kuron, J. Landsgesell, H. Menke, D. Sean, and C. Holm, ESPResSo 4.0 – an extensible software package for simulating soft matter systems, European Physical Journal Special Topics 227, 1789 (2019).
  * Widom [1963] B. Widom, Some topics in the theory of fluids, The Journal of Chemical Physics 39, 2802 (1963).
  * Scheutjens and Fleer [1979] J. Scheutjens and G. Fleer, Statistical-theory of the adsorption of interacting chain molecules 1. partition-function, segment density distribution, and adsorption-isotherms, Journal of Physical Chemistry 83, 1619 (1979).
  * Fleer  _et al._ [1993] G. J. Fleer, M. A. Cohen Stuart, T. Cosgrove, and B. Vincent,  _Polymers at interfaces_ (Chapman and Hall, London, 1993).
  * Klein Wolterink  _et al._ [2002] J. Klein Wolterink, J. van Male, M. A. Cohen Stuart, L. K. Koopal, E. B. Zhulina, and O. V. Borisov, Annealed star-branched polyelectrolytes in solution, Macromolecules 35, 9176 (2002).
  * Uhlík  _et al._ [2014] F. Uhlík, P. Košovan, Z. Limpouchová, K. Procházka, O. V. Borisov, and F. A. M. Leermakers, Modeling of ionization and conformations of starlike weak polyelectrolytes, Macromolecules 47, 4004 (2014).
  * Fleer and Leermakers [1997] G. Fleer and F. Leermakers, Statistical thermodynamics of polymer layers, Current Opinion in Colloid & Interface Science 2, 308 (1997).
  * Israëls  _et al._ [1994a] R. Israëls, F. A. M. Leermakers, and G. J. Fleer, On the theory of grafted weak polyacids, Macromolecules 27, 3087 (1994a).
  * Israëls  _et al._ [1994b] R. Israëls, F. A. M. Leermakers, G. J. Fleer, and E. B. Zhulina, Charged polymeric brushes: Structure and scaling relations, Macromolecules 27, 3249 (1994b).