Machine learning discovered nano-circuitry for nonlinear ion transport in nanoporous materials

Connecting physio-chemical theory with electrical model is essential yet difficult for evaluating the impact of nonlinear ion transport on the performance of ionic circuits and electrochemical energy storage devices 1-6 . Here we demonstrate that machine learning can resolve this difficulty and produce physics-based nano-circuitry. Starting from a physio-chemical perspective, we first reveal an anomalous diffusion-enhanced migration of ions in nanopores, which exhibits a nonlinear electrical response. Using machine learning, we discover its underlying mathematical equation, and produce a dynamically varying ionic resistance for construction of nano-circuitry model. Based on the physio-chemical understanding of nano-circuitry model, we discover in supercapacitors that the nonlinear ion transport can lead to a Faradaic-like current peak in non-Faradaic processes and an asymmetric charging/discharging without ion desolvation, adding new perspectives to physio-chemistry.

Ionic systems manipulate the transport and storage behaviour of ions at material-electrolyte interfaces for electrical energy storage, ionic circuits, and neuron stimulation [7][8][9] . Recent introduction of nanoporous materials in ionic systems has enabled new physio-chemical discoveries of confined ion transport such as superionic effect or nonlinear dynamics, which in principle could advance the performance of the system 5,10,11 . While the physio-chemical mechanism of ion transport and storage can be understood by methods such as molecular dynamics and continuum-level simulation, experimental interpretation and design of highperformance systems are heavily assisted by electrical models 4,[12][13][14][15] . The advantages of electrical models include highly efficient prediction of system performance, straightforward application of practical electrical input, and direct interface between ionic systems and external electronic circuits of various applications 16 . The success of electrical models is based on the assumption that the electrical response of circuit elements can represent the physio-chemical processes of ions 6,9 . However, insufficient validation of this assumption, resulting from the fundamental gap between the pure electrical origin of circuit models and the physio-chemical background of ionic systems, leads to the main difficulty in using electrical models for ionic research [4][5][6] . Furthermore, this assumption becomes even more questionable when ions transport in nanoporous materials 5,13 . In nanoporous materials, the material-electrolyte interface region extends from the exterior surface of the material to the interior, forming a network of interconnected nanopores. Ions must travel through this confining nanoporous network to reach the interface, in which they would intimately interact with each other and the material, exhibiting nanoscopic transport effects that are difficult to describe using conventional electrical models, such as the transmission line model. If the resulting current-voltage relation from the physio-chemical processes of confined ions can be mathematically expressed, new circuit elements can be constructed to account for their new transport phenomena.
Machine learning is a field in computer science studying how to automate complex processes, such as image recognition or autonomous driving, at low cost based on data analysis 17 . In addition to its recent application in physical research to automate the design of materials/devices 18 or the prediction of experiments 19 , it can be used to discover the underlying mathematical expression based on the analysis of simulation results 20,21 . In this work, we use a machine learning algorithm to discover the expression for the nonlinear current-voltage relation of local ion transport, in the context of a nanoporous network, through a two-step strategy (Fig.   1). First, starting from physical chemistry, we study the confined ion transport in adjacent nanopores within nanoporous materials by investigating its components including migration, diffusion, and the effect of finite ion size (steric flux) using primarily a theory of modified Poisson-Nernst-Planck (mPNP) 22 . This is because these components, which are explicitly included in mPNP (see Supplementary Information), provide the necessary transient potential and current profiles for subsequent analysis 5,23,24 . The nanoporous materials are used as electrodes in a typical ionic systemsupercapacitoroperated under the dynamically varying electrical condition of cyclic voltammetry (CV). Second, we use evolutionary algorithm, a machine learning approach, to analyse the obtained current and voltage profiles of confined ions to identify their mathematical relation. Note that the conventional analysis using the electrical theory of Drude model only correlates ion migration with the resistive relation of current and voltage, where diffusion, steric flux, and the time-dependent ion concentration are not accounted for 4 .
We demonstrate that the obtained mathematical expression of local ion transport can be used to construct a physics-based circuit modelthe nano-circuitry modelfor a whole supercapacitor. With this model, we are able to evaluate the impact of nanoscopic ion transport on the macroscopic electrical performance of the supercapacitor; and vice versa, we can analyse the macroscopic performance to provide nanoscopic insights of ions. We discuss whether these results can provide new perspectives to existing knowledge in physical chemistry and whether the methodology of machine-learning-assisted electrical description of physical chemistry can be extended to other fields. Understanding the physio-chemical mechanism of local ion transport inside a nanoporous network under experimentally comparable electrical conditions is the first step towards quantitative description of the associated current-voltage relation. In general cases where nonporous materials are used, this mechanism includes the contributions of migration and diffusion, which are induced by electric field and concentration gradient, respectively 24,25 . In nanoporous network, an additional contribution to ion transportsteric fluxinduced by the steric repulsion of ions with finite size needs to be considered when ion concentration approaches the maximum value permitted inside nanopores 26  We carry out mPNP calculation to study the local interplay of time-dependant migration, diffusion, and steric flux in a supercapacitor under the CV charging/discharging condition (Fig.   2a). Two identical laminar membranes are selected as the electrodes, which comprise a nanometre-resolved internal structure of layered 2D materials ( Fig. 2e and Supplementary Fig.   1). This is because, as demonstrated in our previous studies, the cascading nanoslit network of the membranes provides a structural simplicity and quantifiability for convenient correlation between theory and experiments 9,27 . We explore different slit size (d) in the range from 1.  Fig. 2). This is consistent with the conventional experience 28 : when electric field drives ion migrating towards/away from an electrode, the increased/decreased concentration on its surface always induce a diffusion in the opposite direction (Fig. 2d). In contrast, for nanoslit networks with all values of d studied, our calculation shows the same direction of migration and diffusion from the i th to (i+1) th nanoslit in the network during the entire CV cycle, i.e., diffusion-enhanced migration ( Fig. 2c and Supplementary Fig. 3). The steric flux direction also becomes the same when d<2 nm. Our molecular dynamics simulations quantitatively confirm such diffusion-enhanced migration for a nanoslit network with an equivalent d of 0.59 nm (Supplementary Fig. 4

and Supplementary Information).
Nanoconfinement induces a constructive interplay among all these transport mechanisms, which could be beneficial for charging dynamics in nanoporous electrodes.
We attribute the diffusion-enhanced ion migration across nanoslits in the network to the overlap of EDL under nanoconfinement ( Supplementary Fig. 5a). The electrified surface attracts counter-ions to form EDL that screens the surface electrical potential ϕm of the electrode. For nanoslits with d smaller than twice of the Debye length (thickness of EDL), two EDLs at the two opposite surfaces overlap and form a well-shaped electrical potential profile. Our analysis shows that ion transport across two potential wells in neighbouring nanoslits behaves opposite to the conventional experience in single open-space EDL (Fig. 2g). Given the i th nanoslit having higher net ion charge (the difference between counter-ion and co-ion), the more efficient screening results in a lower electrical potential ϕi in the middle of the i th slit than ϕi+1 in the (i+1) th slit ( Supplementary Fig. 5b). The resultant electric potential gradient produces a migration flux of net ion charge flux from the i th nanoslit to the (i+1) th . Meanwhile, higher net ion charge concentration in i th slit induces a diffusion flux in the same direction, i.e., the observed diffusion-enhanced migration phenomenon. Therefore, this self-consistent behaviour of potential well, i.e., the ability of a well to attract/transport ions is determined by the number of already-attracted ions under the electrode potential ϕm, accounts for the diffusion-enhanced migration phenomenon. A similar analysis can be performed for the case of a lower net ion charge density of i th nanoslit to draw the same conclusion. The conventional perception that  Fig. 6). As suggested in an atomistic study, the failure of using conventional circuit model to describe the complex behaviour of nanoconfined ions could be related to the difficulty in quantifying the in-pore electrical potential 13 . Establishing a physical constitutive relationship for the dynamic dependence between trans-slit voltage and current is an even more challenging task that has not been addressed before. This constitutive relation could translate the physio-chemical knowledge of nanoconfined ion transport to electrical models for efficient and quantitative prediction of dynamic charging behaviour of supercapacitors.

Machine-learning-discovered circuit element for nanoconfined local ion transport
Fig. 3 | Machine-learning-discovered dynamic resistance for local ion transport confined in nanoslit network. a, Flow chart of machine-learning-assisted equation discovery. The mPNP computational data for ion transport in nanoslit network was pre-analysed into the trans-slit voltage-time and current-time relations. They were fed to the evolutionary algorithm (EA) analysis to yield a physical constitutive relationship for a dynamic trans-slit resistance. A negative resistance component (R d ) is discovered, which depends on the net charge Q i (t) stored in the nanoslit. b, Variation of the dynamic trans-slit resistance R c +R d during a CV cycle for a nanoslit network with d=2 nm. The dynamic resistance reaches the maximum (circled in blue) and minimum (circled in orange) at the beginning of charging (blue region) and discharging (yellow region). Inset: R c +R d discovered by EA (red solid line) successfully describes the trans-slit voltage shown in the middle panel of (a). c, The maximum and minimum values of ionic resistance as a function of the slit size (d). The slight change of the maximum resistance and the reduction of minimum resistance with the decreasing d is counterintuitive. d, Both the maximum and minimum ionic resistivity reduce with d, but the difference Δr changes negligibly.
Evolutionary algorithm (EA), among several machine learning techniques for equation discovery including sparse regression 29 and adjoint methods 21 , provides a constraint-free symbolic regression method to identify mathematical expressions from provided numerical data 30 . EA does not require guidance from existing knowledge to search for the global optima in a large solution space. It is therefore particularly suitable for this study since the anomalous diffusion-enhanced migration itself does not offer any mathematical guidance for searching the explicit expression of the nonlinear trans-slit voltage-current relation. Here we use EA to analyse the transient voltage and current profiles obtained by mPNP simulations (Fig. 3a), in order to discover their underlying mathematical expression, i.e., the physical constitutive relation.
The workflow of our machine-learning-discovered physical relation is summarised in Fig. 3a and detailed in the Supplementary Information. First, we pre-process our mPNP simulation data for trans-slit voltage and current in nanoslit networks during a charging process. Then we feed the data to EA (see Supplementary Information). After evolution for thousands of generations, the relation of the voltage (Δϕi) and current (Ii) between the i th and (i+1) th nanoslits in a network is identified as Here  6 and Supplementary Fig. 7). In other words, Rc and γ only depend on slit size d. The parameter γ represents the ratio of resistance reduction under nanoconfinement. Fig. 3b shows the variation of trans-slit ionic resistance Rc+Rd during a typical CV cycle for the nanoslit work with d =2 nm. Slightly after the beginning of charging, Rc+Rd reaches its maximum value close to Rc. Then it keeps reducing during the charging process. Slightly after the beginning of discharging, Rc+Rd reaches its minimum value close to (1-γ)Rc. In the rest of the discharging process, the resistance keeps increasing. Fig. 3c summarises the change in maximum and minimum resistance values versus the slit size d. We observe that the maximum ionic resistance remains almost unchanged when d decreases (blue triangles). This is surprising since small slit size d is expected to reduce the conductive ion numbers and increase the resistance value. Here we note that despite the reduced nanoslit size d, the interface area remains constant. Further analysis suggests that the ionic current across stacked nanoslits indeed mainly occurs at the material surface ( Supplementary Fig. 10a). A previous study observed shortcircuit surface conduction in nanopores with continuous geometry 23 ; our study shows that this surface-conduction insight could be extended to stacked nanoslits due to overlapped EDL.
Furthermore, we discover that the surface-conduction can be time dependent, rather than a stationary effect, as the ionic resistance reduces in the charging process. However, the minimum ionic conductance decreases with d (orange triangles in Fig. 3c), which cannot be attributed to the surface conduction alone. This urges us to analyse further the nanoconfined ion transport.
We then investigate the trans-slit resistivity, as an intrinsic property of ion transport. Both the maximum and minimum of the ionic resistivity decrease with d (Fig. 3d). This is because ion accumulation, which gives more concentrated ions in smaller nanoslits ( Supplementary Fig. 7ac), accounts for the decreased resistivity. The increase in ion concentration in nanoslit is delivered by migration, diffusion, and steric flux all togetherdiffusion enhanced migration ( Supplementary Fig. 8). These electro-adsorbed ions, which are not chemically bonded with the material, can contribute to reducing the trans-slit ion resistivity. The difference between the maximum and minimum (Δr) remains nearly constant for all values of d, implying that this nanoscopic effect is not a special property only occuring in small nanoslits. Nevertheless, when the low magnitude of resistivity for small d is taken into account, both the magnitude and the maximum-minimum difference of conductivity become substantial (Supplementary Fig. 9). It suggests that this nanoscopic effect, although existing in slits with all sizes studied, dominates ion transport in small nanoslits with highly overlapped EDL. Therefore, the nanoconfinement effect must be considered when a corresponding electrical model is constructed. In all cases here, R c =5Ω. e, Revealing nanoscopic insights from CV diagrams: a case study of the current peak shown in the upper right corner as function of R c , which changes from 1 to 10 Ω, rather than a result of redox reaction. In all cases here, γ=0.9.

Building circuit model from machine-learning-discovered elements
In practice, the electrical response of ionic systems is measured at the device level, where circuit models are constructed for the whole system to interpret or predict the results 15 . However, conventional circuit models based on constant ionic resistance are unable to account for nonlinear local ion transport, which has become increasingly important in quantitative studies of charging dynamics in ionic systems using nanoporous materials. This difficulty, along with the notorious reputation of circuit models in insufficient physical validation, substantially hinders further exploration of circuit-based rational design and analysis of ionic systems 4,14,15 .
Therefore, in order to demonstrate how the overall electrical performance of ionic systems can be affected by nonlinear local ion transport in nanoslits, we construct a physics-based circuit model for an example ionic systemsupercapacitor.
Specifically, we allocate nanoscopic ion process at different location to each element of the circuit model through investigation of the spatial distribution of electrical potential and current in nanoslit network (Fig. 4a). Ion transport in the nanoslit network can be modelled using Rc+Rd in equations (1) and (2); and ion storage in different nanoslit can be described by a capacitor Cslit ( Supplementary Fig. 10 and Supplementary Information). Our mPNP results show Cslit is a constant when d>1 nm and remains unchanged during charging/discharging ( Supplementary   Fig. 11a, b). In our circuit model as shown in Fig. 4b, Ropen and Copen represent ion transport and storage in open space of the bulk electrolyte. Due to this physics-based nature, this model can resolve local ion transport and storage at nanoscale in addition to its ability to predict the electrical response of supercapacitors; and hence the name nano-circuitry model (NCM).
For verification, we compare the computed CV diagrams by NCM and mPNP simulations in Fig. 4c for the case of supercapacitor electrode consisting of 6 layers of 2D materials with d=1.5 nm (γ = 0.5). The agreement is very good. We can easily extend our NCM to larger systems including more layers (Supplementary Fig. 12) with computational cost of several minutes, whereas the mPNP simulations could take days and weeks. This is particularly beneficial for (semi-)quantitative engineering design.
We then explore whether the machine-learning-derived NCM for supercapacitors can provide additional physio-chemical insights of ions confined in their nanoporous electrode materials by evaluating the impact of the nonlinear local ion transport on CV diagrams. CV diagram analysis is adopted as a standard technique to characterize the performance of supercapacitors, which contains comprehensive information, e.g., the shape of CV curve provides an indication of the nature of charging dynamics 15 and the enclosed area of CV curve can quantify the energy storage capacity 28 .
The first qualitative insight is the shape variation of the CV curve. We observe that the CV in Fig. 4c captures an asymmetry between charging (blue arrow) and discharging (orange arrow).
For nanoslit networks with d=1.5nm, the asymmetry in CV becomes profound with the increase of layer numbers (i.e., electrode thickness) and charging rate ( Supplementary Fig. 12), where more nanoconfined ions are included. Such asymmetry cannot be revealed using the conventional transmission line model (TLM, Supplementary Fig. 11c and Supplementary Fig.   12) with any parameters used ( Supplementary Fig. 13a), suggesting a mechanistic difference of NCM. This can be attributed to our machine-learning-discovered dynamic resistance Rd. Fig.   4d confirms that increasing value of γ (indicator of nanoconfinement degree) change CV curves from a symmetric ellipse (γ=0) to a trapezoid shape (γ=0.9).
Such trapezoid CV shapes are often observed in experiments 31 , particularly when ions are confined in small nanopores [32][33][34][35] . Previous studies propose that desolvation of ions may lead to this asymmetry 32 . We demonstrate another mechanism of dynamically varying trans-slit resistance under nanoconfinement. As γ increases, our NCM studies reveal that the reduced trans-slit resistance facilitates ion transport ( Supplementary Fig. 13b) and effectively delivers more ions to nanoslits for storage ( Supplementary Fig. 14), re-emphasizing that charging process is a balance between ion storage and transport. Note that the varying resistance could result in a varying charging time constant, which may assist an emerging research direction of material microstructure characterization by time constant distribution investigation 36  The second quantitative insight is the change of enclosed area of CV. The area enclosed by the solid curve in Fig. 4d is clearly larger than that enclosed by the dashed curve, predicting a higher energy storage capacity for large γ (Supplementary Fig. 14). This suggests that not only the power but also the energy density of supercapacitors can be improved by facilitating ion transport, as charging process is a balance between ion storage and transport.
The third qualitative insight is the current peak in CV curve, which is consistently predicted by our NCM (Fig. 4e, Supplementary Fig. 12). Intuitive electrochemical analysis commonly associates current peaks in CV diagram to Faradaic processes or redox reactions 28 . However, no Faradaic processes are involved here. This again could be attributed to the dynamically varying trans-slit resistance, where a substantial decrease in its magnitude leads to a much higher delivering rate of ions, i.e., current, as charging proceeds. Due to the critical role of the magnitude of resistance here, rather than the ratio γ, a higher value of Rc could make the peak more evident. Rc could be increased by lowering ion mobility or electrolyte concentration.
Therefore, a Faradaic-like peak in CV may not necessarily indicate a Faradaic process, providing an additional perspective for future discussion of electrochemical results. Our results offer fresh ideas and insights to understand the macroscopic performance of supercapacitors.
Meanwhile, the highly efficient computational tool of NCM lays a foundation for quantitative engineering design of realistic electrodes on multiple scales.

Conclusion
We demonstrate that machine learning can discover a nano-circuitry elementdynamically varying trans-slit ionic resistanceand its underlying equation to describe a new nonlinear transport of nanoconfined ions, i.e., diffusion-enhanced migration in electrified nanoporous materials. We attribute the physio-chemical origin of this behaviour to the self-consistent, overlapped EDL in nanoporous materials. This dynamic resistance indicates that the recently reported constant surface-conduction mechanism of ions on continuous pore surface can be extended to discontinuous adjacent nanopores and can be time-dependant. We discover that the resultant efficient ion delivery can provide new perspectives to the traditional knowledge of physical chemistry for supercapacitors through a physics-based nano-circuitry model (NCM) constructed using the machine-learning-discovered dynamic resistance. First, the frequently observed asymmetric or trapezoid-shaped CV in experiments can be associated with different nanoconfinement conditions, including the pore-size of nanoporous materials, ionic species and concentration of electrolyte, and voltage window. This asymmetry is attributed to the dynamic resistance, not ion desolvation as reported conventionally. Second, Faradaic-like current peak can be observed in the absence of Faradaic reaction. Third, more ions can be absorbed by engineering ion resistance while the local capacitance of nanoslit is constant, re-emphasizing that the charging process is a balance between ion transport and storage, rather than only dependant on the local capacitance.
These analyses by NCM are completed within minutes using a laptop computer, much faster than weeks of calculation by mPNP. In future, the demonstrated use of machine learning in this work may be used to analyse other nanoscopic ionic behaviour mathematically, such as solvation-involved intercalation or ion-ion correlation in pseudo-capacitors, batteries, or desalination. Circuit models established through this approach can be used for rational design of ionic systems for either performance advancement or novel function invention, which were considered notoriously difficult in the past due to the fundamental gap between the physiochemical knowledge of ionic behaviour and the electrical theory of circuits.