 bare valency $|Z_n| = 3 \times 2^{n+1}$. The CG segments are connected by bonded and angular potentials both in harmonic form. In the previous work [@xu2017charged] we only studied monovalent ions. Here we extend it to study the competitive uptake of mono- and divalent ions for generations 2 and 4. The bare charge valencies of the G$_2$-dPGS are thus ${Z_\mathrm{d}}= Z_{n=2} = -24$ and ${Z_\mathrm{d}}= Z_{n=4} = -96$. Snapshots are shown in Fig. \[snap\].

The non-bonded interactions between CG beads are described by the Lennard-Jones (LJ) potential together with the Lorentz–Berthelot mixing rules. In particular, the energy parameter $\epsilon_{\rm LJ} = 0.1\,{k_\mathrm{B}T}$ and the diameter $\sigma_{\rm LJ} = 0.4$ nm are set identical for all ions (mono- and divalent) and thus any ion-specific effects are not explicitly included. In our simulations we place the dPGS in the center of a periodically repeated cubic box with a volume of $V$ (side-length of $L = 30$ nm). The solvent is implicitly assumed as a dielectric continuum with a dielectric constant $\epsilon_{\rm w} = 78$. The CG simulations employ the stochastic dynamics (SD) integrator in Gromacs $4.5.5$ as in our previous work. [@xu2017charged]

![image](images/fig2.pdf){width="12.5cm" height="12.5cm"}

![image](images/fig3.pdf){width="13cm" height="13cm"}

All simulations are performed in the canonical ensemble. The divalent cations (DCs), monovalent cations (MCs) and monovalent anions in the system are referred to with subscripts $++,\; +$ and $-$, respectively. The dPGS is accompanied by the corresponding number of monovalent counterions ${N_\mathrm{s}}$ ($24$ for G$_2$-dPGS and $96$ for G$_4$-dPGS) electrically neutralizing the macromolecule and having the same chemical identity as the MCs of the salt. The number of salt ions $i$ ($i = +
bare valency $ |Z_n| = 3 \times 2^{n+1}$. The CG segments are connected by bond and angular potential both in harmonic form. In the previous study [ @xu2017charged ] we only studied monovalent ion. Here we extend it to study the competitive uptake of mono- and bivalent ion for generations 2 and 4. The bare bang valencies of the G$_2$-dPGS are thus $ { Z_\mathrm{d}}= Z_{n=2 } = -24 $ and $ { Z_\mathrm{d}}= Z_{n=4 } = -96$. Snapshots are indicate in Fig.   \[snap\ ]. 

 The non - bonded interactions between CG beads are described by the Lennard - Jones (LJ) potential together with the Lorentz – Berthelot mix rules. In particular, the energy argument $ \epsilon_{\rm LJ } = 0.1\,{k_\mathrm{B}T}$ and the diameter $ \sigma_{\rm LJ } = 0.4 $   nm are set identical for all ions (mono- and divalent) and thus any ion - specific effects are not explicitly include. In our simulations we place the dPGS in the center of a periodically repeated cubic corner with a volume of $ V$ (side - length of $ L = 30 $   nm). The solvent is implicitly assumed as a dielectric continuum with a dielectric changeless $ \epsilon_{\rm w } = 78$. The CG simulations employ the stochastic dynamics (SD) integrator in Gromacs $ 4.5.5 $ as in our previous work.   [ @xu2017charged ] 

! [ image](images / fig2.pdf){width="12.5 cm " height="12.5 cm " } 

! [ image](images / fig3.pdf){width="13 cm " height="13 cm " } 

 All simulations are performed in the canonical corps de ballet. The bivalent cations (DCs), monovalent cations (megahertz) and monovalent anion in the system are referred to with subscripts $ + +, \; + $ and $ -$, respectively. The dPGS is accompanied by the corresponding number of monovalent counterions $ { N_\mathrm{s}}$ ($ 24 $ for G$_2$-dPGS and $ 96 $ for G$_4$-dPGS) electrically neutralizing the macromolecule and having the like chemical identity as the MCs of the salt. The number of salt ions $ i$ ($ i = +
 bage valency $|Z_n| = 3 \times 2^{n+1}$. Uhe CG segments ate connerted by bonded xnd angular potentials both mn hqrmonuc form. In the previour work [@xu2017bharged] ww onot studied monovalekc iona. Herz xe extend it to study the competitive u[txkz of mono- and divalent ions for genewations 2 wnd 4. The bare sharbq vamvngies of the G$_2$-dPGS are thus ${Z_\mathdm{d}}= Z_{n=2} = -24$ and ${Z_\mathrm{c}}= Z_{n=4} = -96$. Snapshots are shown in Vig. \[snap\].

The non-bondfd interactuons vetween CG bdads are dtseribed by tge Lennard-Jones (LJ) potential toeethex with the Ooeenhe–Berthelot mmxing gules. In partlbular, tve enerby parameter $\eisiloi_{\rm OJ} = 0.1\,{k_\mathrm{B}T}$ and the diameter $\sigma_{\rm JJ} = 0.4$ nm ara aet identical for aol iots (mmno- xbd aivzlxnt) and tjus any ion-spscific effexts are not expliciuly pmcluded. In ohr simtlwtions we place the dPGS in the center mf z periodically repeated cubic box with a volome of $V$ (syde-length of $L = 30$ nm). The solvent is implicitly assuked aa a blclecgeif continuum with a dielectric constant $\epsilog_{\dm w} = 78$. The CG simujations empkoj yre stochastic dynamnds (SD) integrator in Hromacs $4.5.5$ as un our prtvioux work. [@xu2017charged]

![image](images/fug2.pdf){width="12.5cm" yeight="12.5cm"}

![image](imaged/fig3.pdf){widtk="13cm" heoght="13ck"}

All simulations are pexformes in the cajonical ehremble. The divaldnt cdtions (DCs), monovalent catijns (MCs) aid mouovalent anipns in the systel are referred to with skbscrnpts $++,\; +$ and $-$, resoectively. The dPGS is accompanixv by the corrgspmndpng numbex of mpnovalent cougterions ${N_\mathtm{s}}$ ($24$ for Y$_2$-dPGS xnd $96$ for G$_4$-sPGS) elxctrically nqutralizing tvg macromolecune and hwvint thw same zfemical identiyy as the MCs of thw salt. The number pf rzlt ions $i$ ($i = +
bare valency $|Z_n| = 3 \times 2^{n+1}$. segments connected by and angular potentials the work [@xu2017charged] we studied monovalent ions. we extend it to study the uptake of mono- and divalent ions for generations 2 and 4. The bare valencies of the G$_2$-dPGS are thus ${Z_\mathrm{d}}= Z_{n=2} = -24$ and ${Z_\mathrm{d}}= Z_{n=4} -96$. are in \[snap\]. The non-bonded interactions between CG beads are described by the Lennard-Jones (LJ) potential together with Lorentz–Berthelot mixing rules. In particular, the energy parameter LJ} = 0.1\,{k_\mathrm{B}T}$ and diameter $\sigma_{\rm LJ} = 0.4$ are identical for ions and and thus any effects are not explicitly included. In our simulations we place the dPGS in the center of a repeated cubic a volume $V$ of = 30$ nm). is implicitly assumed as a dielectric dielectric constant $\epsilon_{\rm w} = 78$. The CG employ the dynamics (SD) integrator in Gromacs $4.5.5$ in our previous work. [@xu2017charged] ![image](images/fig2.pdf){width="12.5cm" height="12.5cm"} ![image](images/fig3.pdf){width="13cm" All simulations are performed in the canonical ensemble. The divalent cations (DCs), monovalent cations (MCs) anions in the system referred to with $++,\; and respectively. dPGS is by the corresponding number of monovalent counterions ${N_\mathrm{s}}$ ($24$ for G$_2$-dPGS $96$ for G$_4$-dPGS) electrically neutralizing the macromolecule and having the identity the MCs of salt. The number of ions ($i = +
 bare valency $|Z_n| = 3 \times 2^{n+1}$. The CG sEgments are ConneCteD by BoNded And aNgular potentiaLS botH in harmonic form. In the prEviouS wORk [@xu2017CHaRged] wE only stUDiED MonOvAlEnt IoNS. HEre we ExtEnd it to Study the coMpeTiTive uptake of MOnO- and divaleNt iOns for generaTioNs 2 and 4. THe BarE ChargE vaLenciEs of thE g$_2$-dPGS aRe thus ${Z_\maThRM{d}}= Z_{n=2} = -24$ anD ${z_\mathrm{D}}= z_{N=4} = -96$. SNapsHots are shown in Fig. \[SNaP\].

the non-bonded inTeractIoNS bETWeeN CG Beads are deScRibed BY the LenNArD-jONes (lj) potential togEther with thE lorEntz–BeRtHelOT mixinG ruleS. IN ParTicular, the eNergY parameteR $\epsilON_{\rm LJ} = 0.1\,{k_\mAThrm{B}T}$ aNd the dIamEteR $\sigMA_{\rM Lj} = 0.4$ nm ArE Set IDeNtiCAl fOr all ionS (mOnO- and dIvalENT) ANd thUs aNy ioN-specIfic effects arE noT expLIciTly inCludeD. In oUr SimulAtions We plaCe The dPGS in the cenTer oF a periodiCalLy RepEaTed cuBIc box wIth A voLume of $V$ (Side-lenGTh oF $L = 30$ NM). tHe Solvent is implicitlY aSSUmEd as a dieLectriC CoNtINuum with A dIelEctrIC ConstAnt $\ePSiLon_{\rm w} = 78$. ThE CG simULaTiOns emplOy The stoChAstIc dYnamiCS (SD) iNtegraTor in GroMacs $4.5.5$ aS In our previous wORk. [@xu2017charged]

![imAGe](IMAgES/fig2.Pdf){Width="12.5cm" heigHt="12.5cm"}

![IMage](ImagES/fIg3.pDF){widtH="13cm" heIgHT="13cM"}

all simulations are peRfOrmed iN the cAnonical ensemBle. The divaLENT cations (dCs), mONoVAlent cations (MCS) and mOnovalent aNIons in thE systEm are refErred to wiTH SubscripTs $++,\; +$ aNd $-$, rEspEctIVElY. The dPGS is accOMPaniEd By the coRreSpondinG nuMbeR of MonOvAlent counTerions ${N_\MaThRm{S}}$ ($24$ fOr G$_2$-DPGS aND $96$ for G$_4$-dPGs) eLecTrIcaLly neUTralizIng thE macRoMoLEcuLe and haVInG THe saMe ChEmicAl iDeNtity As thE mCs Of the saLt. The numbEr oF Salt IoNs $I$ ($i = +
 bare valency $|Z_n| = 3 \ times 2^{n +1}$.  Th e C Gsegm ents  are connected by b onded and angular pote ntial sb othi nharmo nic for m .I n  th epr evi ou s  w ork [ @xu 2017cha rged] we o nly  s tudied monov a le nt ions. H ere  we extend i t t o stud ythe compe tit ive u ptakeo f mono - and div al e nt ion s  for ge n e ra tion s 2 and 4. The ba r ec harge valencie s of t he G$ _ 2 $-d PGS  are thus${ Z_\ma t hrm{d}} =  Z _ { n =2} = -24$ and ${ Z_\mathrm{d } }=Z_{n=4 }= - 9 6$. Sn apsho ts are  shown in F ig.\[snap\]. 

Then on-bond e d inter action s b etw eenC Gbe ads  a r e d e sc rib e d b y the Le nn ar d-Jon es ( L J ) pote nti al t ogeth er with the L ore ntz– B ert helot  mixi ng r ul es. I n part icula r,  the energy par amet er $\epsi lon _{ \rm  L J} =0 .1\,{k _\m ath rm{B}T} $ and t h e d ia m e t er  $\sigma_{\rm LJ}=0 . 4$  nm areset id e nt ic a l for al lion s (m o n o- an d di v al ent) and  thusa ny  i on-spec if ic eff ec tsare  note xpli citlyincluded . Ino ur simulations we place thed PG S in thecen ter of a pe riod i call y re p ea ted cubic  boxwi t ha  volume of $V$ (sid e- length  of $ L = 30$ nm).The solven t i s implic itly as s umed as a diel ectri c continuu m  with adiele ctric co nstant $\ e p silon_{\ rmw}= 7 8$. T he  CG simulatio n s  emp lo y the s toc hasticdyn ami cs(SD )integrato r in Gro ma cs  $ 4. 5.5 $ asi n our pr ev iou swor k. [@ x u2017c harge d]
![ im a ge] (images / fi g 2 .pdf ){ wi dth= "12 .5 cm" h eigh t ="1 2.5cm"} 

![image ](i m ages /f ig 3.pdf){ width="13cm"he ight="13cm "} 

A ll sim u l ations a re performed in the can o nical e nse mble.  The  divalent  ca tions(DC s ), mon ovalen t cat io ns( M Cs) a n d  m ono va lent anion s inthe s ys temare ref erred to with subs c rip ts $++,\; +$and  $-$ , re spe c ti v ely .T hed P GS is accompani ed by theco r re sponding n u mbe rof mono valentcount e rions $ {N_\mathr m{s}}$ ($ 24 $ fo r G$_ 2$-dPGS an d $96$ f or G$_4$- d PGS)e le ctric all y neut ra liz ing t he mac r omo lecul e andha ving t he sa me  chemica l identity as the MCs o f thesalt.  Th e numberofs alt  ions $i$  ($i  = +
 bare_valency $|Z_n|_= 3 \times 2^{n+1}$._The CG_segments_are connected_by_bonded and angular_potentials both in_harmonic form. In the_previous work [@xu2017charged]_we_only studied monovalent ions. Here we extend it to study the competitive uptake of_mono-_and divalent_ions_for_generations 2 and 4. The_bare charge valencies of the_G$_2$-dPGS are_thus ${Z_\mathrm{d}}= Z_{n=2} = -24$ and ${Z_\mathrm{d}}= Z_{n=4}_=_-96$. Snapshots are_shown in Fig. \[snap\].

The non-bonded interactions between CG beads are_described by the Lennard-Jones (LJ) potential_together with the_Lorentz–Berthelot_mixing_rules. In particular, the_energy parameter $\epsilon_{\rm LJ} = 0.1\,{k_\mathrm{B}T}$_and the diameter $\sigma_{\rm LJ} =_0.4$ nm are set identical for all ions_(mono- and divalent) and thus any_ion-specific effects are not explicitly_included. In_our simulations we place the_dPGS in the_center of_a periodically repeated_cubic box with a volume of_$V$ (side-length of_$L = 30$ nm). The solvent is_implicitly_assumed as a_dielectric_continuum_with a_dielectric constant $\epsilon_{\rm_w}_= 78$._The_CG simulations employ the stochastic dynamics_(SD)_integrator in Gromacs $4.5.5$ as in our_previous work. [@xu2017charged]

![image](images/fig2.pdf){width="12.5cm" height="12.5cm"}

![image](images/fig3.pdf){width="13cm" height="13cm"}

All_simulations_are performed in the_canonical ensemble. The divalent cations_(DCs), monovalent cations (MCs) and monovalent_anions in_the system_are referred to with subscripts $++,\; +$ and $-$, respectively. The_dPGS is accompanied by the corresponding_number of monovalent counterions_${N_\mathrm{s}}$ ($24$_for_G$_2$-dPGS and $96$_for_G$_4$-dPGS) electrically_neutralizing the macromolecule and having the same_chemical identity_as the MCs of the salt._The number of salt_ions_$i$ ($i = +