원시데이터 수집 시스템
선정목록으로

Physics informed neural network for charged particles surrounded by conductive boundaries

간접 관련 수소연료전지 · (7) MEA(막전극접합체) (5) 연료전지용 수분제어장치(가습기)(6) PEM(고분자전해질막)

기본 정보

저자
  1. Fatemeh Hafezianzade — Department of Physics, Institute for Advanced Studies in Basic Sciences, Zanjan, 45137-66731, Iran
  2. Morad Biagooi — Intelligent Data Aim Ltd (IDA Ltd), Science and Technology Park of Institute for Advanced Studies in Basic Sciences, Zanjan, 45137-65697, Iran
  3. SeyedEhsan Nedaaee Oskoee — Research Center for Basic Sciences and Modern Technologies (RBST), Institute for Advanced Studies in Basic Sciences (IASBS), Zanjan, 45137-66731, Iran
DOI
10.1038/s41598-023-40477-y
저널
Scientific Reports
발행년도
2023
발행기관
Nature Portfolio
피인용수
2
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1038/s41598-023-40477-y
토픽
Fuel Cells and Related Materials
OpenAlex ID
W4386218575

평가 내용

관련도
간접 관련
사업분야
수소연료전지 · (7) MEA(막전극접합체)
부 분야
(5) 연료전지용 수분제어장치(가습기), (6) PEM(고분자전해질막)
R&D 측면
분석·모델링
확신도
0.70
근거 용어
Physics informed neural network, Poisson equation, charged particles, conductive porous media, molecular dynamics
판단 근거
이 논문은 전하를 띤 입자가 전도성 다공성 매질 내에서 어떻게 거동하는지 예측하기 위해 물리 정보 신경망(PINN)을 사용하는 연구입니다. 이는 코오롱인더스트리의 수소연료전지(PEMFC) 핵심 소재인 이온전도성 고분자막 및 다공성 구조 내 이온/물질 이동 시뮬레이션 방법론에 간접적으로 응용될 수 있습니다.
R&D 활용 포인트
PEMFC의 전해질막(PEM) 및 가습기용 중공사막 내에서의 이온 전도 및 물질 전달 현상을 수치 해석적으로 모델링하고 최적화하는 데 활용 가능합니다.
평가 입력
본문 38,471자 중 30,032자 발췌

초록

Molecular dynamics of charged particles in porous conductive media have received considerable attention in recent years due to their application in cutting-edge technologies such as batteries and supercapacitors. Due to the presence of long-range electrical interactions, induced charges present at the boundary, and the influence of boundary conditions, the simulation of these systems is more challenging than the simulation of typical molecular dynamic systems. Simulating these kinds of systems typically involves using a numerical solver to solve the Poisson equation, which is a very time-consuming procedure. Recently, Physics-Informed Neural Networks (PINNs) have been introduced as an alternative to numerical solutions of PDEs. In this paper, we present a new PINN-based model for predicting the potential of point-charged particles surrounded by conductive walls. As a result of the proposed PINN model, the mean square error is less than [Formula: see text] and [Formula: see text] score is more than [Formula: see text] for the corresponding example simulation. Results have been compared with typical neural networks and random forest as standard machine learning algorithms. The [Formula: see text] score of the random forest model was [Formula: see text], and a standard neural network could not be trained well.

본문 38,471자

본문 펼치기
## OPEN # Physics informed neural network for charged particles surrounded by conductive boundaries Fatemeh Hafezianzade <sup>1</sup> , Morad Biagooi <sup>2</sup> & SeyedEhsan Nedaaee Oskoee <sup>1,3</sup> <sup>*</sup> Molecular dynamics of charged particles in porous conductive media have received considerable attention in recent years due to their application in cutting-edge technologies such as batteries and supercapacitors. Due to the presence of long-range electrical interactions, induced charges present at the boundary, and the influence of boundary conditions, the simulation of these systems is more challenging than the simulation of typical molecular dynamic systems. Simulating these kinds of systems typically involves using a numerical solver to solve the Poisson equation, which is a very timeconsuming procedure. Recently, Physics-Informed Neural Networks (PINNs) have been introduced as an alternative to numerical solutions of PDEs. In this paper, we present a new PINN-based model for predicting the potential of point-charged particles surrounded by conductive walls. As a result of the proposed PINN model, the mean square error is less than 7% and _R_ score is more than 90% for the corresponding example simulation. Results have been compared with typical neural networks and random forest as standard machine learning algorithms. The _R_ <sup>2</sup> score of the random forest model was 70%, and a standard neural network could not be trained well. Computational Electromagnetic Simulation plays a significant role in many areas of science and engineering, such as soft matter, electrical engineering, biomedical engineering and chemistry. In addition, it has numerous applications in industry. For example, it is one of the main tools in investigating and designing the process of supercapacitors, which are porous energy storage devices with many applications in industry, especially when high power consumption or transfer is ­needed <sup>1</sup> . Here, studying the physical mechanisms arising from charge storage in supercapacitors is essential for further technological ­development <sup>2, 3</sup> . Solving Maxwell’s equation, especially the Poisson equation in this study, is an essential part of computational electromagnetic ­algorithms <sup>4</sup> . Solving the Poisson equation can help scientists to calculate the potential of electrical sources in any system. However, many difficulties arise in practice due to the long-range nature of electrical interactions. In particular, estimating the potential of point-charged components in an environment with conductive walls is challenging because of the induced charges presented on the boundaries. Generally, there are two approaches to solving the Poisson equation: analytical ­solution <sup>4</sup> and numerical methods. There are limited techniques for solving analytically, like image charges methods applicable for cases with regular geometries; however, there is no guarantee to achieve practical results. If, for example, a particle is placed in a cubic conductive container, the image charges method will produce an infinite series. On the other hand, numerical methods lead to approximate solutions based on discretizing space and/or time domains. One of the typical numerical methods is the Finite Element Method (FEM) <sup>5</sup>, which discretizes the continuous partial differential equations (PDEs) and forms a linear set of algebraic ­equations <sup>6</sup> . Nevertheless, even FEM fails in calculating the potential in a charged particle’s position since the electrical potential is singular at the place of charges. There are a number of methods and algorithms that have been developed to address this problem, including Induced Charge MMM2D (ICMMM2D) <sup>7</sup> for 2D, ­ELCIC <sup>8</sup> for 2D + h, Induced Charge Computation ( ICC∗ ) <sup>9–11</sup> for 3D periodicity, and a method introduced by Reed et al. <sup>12</sup> have been developed. In addition, recently, there has been another algorithm named PLT. It was first demonstrated for a partially periodic system constrained between two metallic plates ­in <sup>13</sup>, and then it was applied to ­CAVIAR <sup>14</sup>, a molecular dynamics simulation package for charged particles surrounded by non-trivial conductive boundaries. Numerical solving of these problems with the CAVIAR package is accurate; moreover, it took less time than ICC∗ <sup>14</sup> but is still time and memory-consuming. 1Department of Physics, Institute for Advanced Studies in Basic Sciences, Zanjan 45137‑66731, Iran. 2Intelligent Data Aim Ltd (IDA Ltd), Science and Technology Park of Institute for Advanced Studies in Basic Sciences, Zanjan 45137‑65697, Iran. <sup>3</sup> Research Center for Basic Sciences and Modern Technologies (RBST), Institute for Advanced Studies in Basic Sciences (IASBS), Zanjan 45137‑66731, Iran. <sup>*</sup> email: nedaaee@iasbs.ac.ir Recently another data-driven approach to solving the PDEs based on deep machine learning is also of great current interest. For instance, Shan et al. <sup>15</sup> present a CNN to predict the electric potential with different excitations and permittivity distribution in 2D and 3D models. It is fast and efficient compared with ­FEM <sup>5</sup> . However, a couple of problems prevent it from utilizing as a Poisson solver in the MD simulation process; first, it could not work in the case of discrete density functions such as those of point charges, and second, it is a physics-free approach which makes it hard to consider boundary conditions. To overcome the first problem, one can use the PLT algorithm. Additionally, Raissi et al. introduced the physics-informed neural network (PINN) that the loss function defined ­by <sup>16</sup> is an excellent alternative to the conventional deep learning method because of the governing equations, boundary conditions and initial conditions used in its definition. In this paper, we applied a new PINN-based model to predict the potential of point-charged particles surrounded by conductive walls. We then compared the results with typical neural networks and random forests as a standard machine learning algorithm. For instance, we tried to implement these models for a charged particle in a spherical container. The reason for utilizing this simple example was that there is an exact solution to this problem through the analytical method, the image charges method. As a starting point, we used the PLT algorithm to transfer the Poisson equation into the Laplace equation with modified boundary conditions. Then we trained the model to solve the Laplacian equation with new boundary conditions. The input data is included the position in which we want to evaluate the potential on it and the modified boundary conditions; the output data is the corresponding electrical potential of that position. Results In this paper, we predict the smooth potential of a point-charged particle in a spherical conductive container. First, we set the train and test set with 5000 and 1000 samples; then we train our models to predict smooth potential. We can calculate total potential by summating smooth and singular potential (more detailed in the “Methods” section). However, in this work, to compare our results with ­CAVIAR <sup>14</sup>, we investigate the smooth potential. Random forest. We optimize over the only hyperparameter, the number of trees in the forest that influences the fitting of the random forest model. In Fig. 1, we plot _MSE_ (the left panel) and R <sup>2</sup> score (the right one) as a function of the number of trees for the test set to determine the optimal hyperparameter, which we find 100 trees since progress after 100 trees is negligible. Afterward, we trained the RF model using 100 trees. _RF prediction._ Figure 2 is illustrated the RF model with 100 trees. It shows that prediction is acceptable when the numeric value of potential is less than 0.3 ( φTrue < 0.3 ) while it could not predict precisely in the case of φTrue >= 0.3 . The graphs of Fig. 2 compare the true potential φTrue and RF model predicted potential φRF for the train data set(left picture) and test data set(right image). The RF method is relatively fast; however, it works when the predicted potential is smooth and relatively small; it is not suitable in the case of point-charged particles (where a gradient of potential as well as its numeric value is high at the position of the charge). Furthermore, it fails to predict the potential near the boundaries since the gradient of the potential is considerable. PINN based model and NN. By setting both �2 and �3 in the Eq. (9) to zero in the PINN-based model, one can get exactly the NN model. Therefore we investigate models together and report their results simultaneously in the following section. Unlike the RF model, we define several hyperparameters for analyzing the performance of PINN and NN: a number of neurons, a number of layers, �2, and �3 . To tune all hyperparameters, we train the model up to 100,000 epochs, using the L-BFGS-B ­optimizer <sup>25</sup>, until the model’s tolerance reaches the level of machine epsilon. We use a tanh activation function for all layers except the last one. Supplementary Table 1 Figure 1. _MSE_ (left), and R <sup>2</sup> score (right) for 1000 different sample of Test set. (a) (b) Figure 2. Potential estimation of RF model: ( a ) show the train data set with 5000 samples with scatter of σ = 0.02, ( b ) show the test data set with 1000 samples with scatter of σ = 0.07 . The dashed red line shows where the predicted potential equals the true potential. The pink-shaded region marks 1σ scatter of potential errors. is reported the _MSE_ between the predicted and the same potential for a different value of hyperparameters; �2 = [0, 0.1, 0.2, 0.3], �3 = [0, 0.1, 0.2, 0.3, 0.4], number of hidden layers= [1, 3, 5, 7] and number of neurons per hidden layer= [10, 30, 50] for 1000 samples of the test set. We chose �4 = 0.0001 to prevent over-fitting. _PINN and NN prediction._ The model with seven layers and 50 neurons per layer resulted better when �2 and �3 are 0.3, 0.3, or 0.2, 0.4, respectively (more detailed in the Supplementary Table 2). When �2 and �3 are zero, a standard neural network, the model has not worked well; it is observed from Supplementary Table 2 and Fig. 3. Both plots in Fig. 3 compare the true and predicted potentials for the best-tuned NN and the best-tuned PINN model with 7 layers and 50 neurons per layer, �2 = 0.3 and �3 = 0.3 - on the train set. As can be seen, the NN model is not trained well, while the PINN-based model could predict the potential precisely with a scatter of 0.01. Although the PINN-based model predicts the train set well, aiming to clarify that over-fitting has not been accrued, we also evaluate the model on the test set, Fig. 4. (a) (b) Figure 3. Potential estimation of best-tuned ( a ) NN with scatter of σ = 0.07 and ( b ) PINN model on the 5000 samples of the train set with scatter of σ = 0.01 . The dashed red line shows where the predicted potential equals the true potential. The pink-shaded region marks 1σ scatter of potential errors. Figure 4. Potential estimation of best-tuned PINN model on the 1000 samples of the test set with scatter of σ = 0.02, MSE = 0.069 and R <sup>2</sup> score = 0.851 . The dashed red line shows where the predicted potential equals the true potential. The pink-shaded region marks 1σ scatter of potential errors. Comparison. We evaluate RF, NN, and PINN to estimate the potential of point-charged particles surrounded by conductive walls. According to Fig. 3, NN was not trained well, while RF and PINN-based models could predict potential precisely. However, RF did not work well to estimate φTrue - 0.3 . Apart from this, the best model could estimate not only the potential of the train and the test sets but also the potential of pointcharged particles that are not in the train or test set. So we evaluate the best tuned-PINN model and RF on the extrapolation samples; the results are reported in Supplementary Table 3. As can be seen in Fig. 5 PINN-based model could predict the potential of newly charged particles better than the RF model, where PINN could predict φTrue - 0.3 by far better than RF. Generalization (multi charged particles). For generalization, we test the PINN-based model with �2 = 0.3 and �3 = 0.3 for the case of more than one charged particle surrounded with conductive boundaries. Since the Laplace equation is a linear function, we predict the potential of each charged particle and then (a) (b) Figure 5. Potential estimation of best-tuned ( a ) RF with scatter of σ = 0.07, and ( b ) PINN-based model with scatter of σ = 0.02 on the 1000 samples of the Extrapolation set. The dashed red line shows where the predicted potential equals the true potential. The pink-shaded region marks 1σ scatter of potential errors. calculate the total potential with a superposition of the corresponding predicted potential. After that, we report the _MSE_ between the predicted smooth potential and the exact smooth solution, which is calculated by the image charges method. Figure 6 shows the relation between _MSE_ and _N_, the number of charged particles. As expected, the _MSE_ is independent of the number of charged particles. Therefore, it leads to the fact that we can also use this method for problems with any desired particles. In an accurate MD simulation, the number of particles is significantly higher than shown in Fig. 6. Since there is no notable trend between the _MSE_ and the number of particles _N_, one can conclude that PINN’s prediction is valid for any number of particles. It is also applicable to complex cases such as charged macromolecules and polymers. Recent simulations have shown that the superposition principle works well for complex systems using the PLT ­algorithm <sup>26</sup> . Therefore, PINN-based methods are well suited for these complex components. Conclusion In this study, we have trained a machine to predict the smooth potential of charged components surrounded by conductive boundaries. In this scene, the total potential could be easily calculated by the summation of predicted smooth potential with singular potential due to the PLT algorithm. The reference set consists of analytic solutions, the solution of the image charge method, which is split into a train set with 5000 samples and a test set with 1000 samples. To check the accuracy of our model, we set another data set called the extrapolation set consisting of 1000 samples with different boundary conditions that were not in the train or even the test set. Our main conclusion can be summarized as follows: - We find that the PINN-based model trained better than RF and NN models. RF could not predict high potential; on the other hand, the NN could not be trained well at all. - our PINN-based model could predict the potential of the test set with MSE = 0.069, R <sup>2</sup> score = 0.902, and scatter σ = 0.02 . It also could predict the potential of the extrapolation set with MSE = 0.089, R <sup>2</sup> score = 0.851, and scatter σ = 0.02. - Since the Laplace equation is a linear equation, the trained model could predict the potential of more than one charged particle by summating every particle’s predicted potential. Besides, we show that the _MSE_ of more than one particle is independent of a number of particles. We used an analytical approach, the image charge method, to solve the Laplace equation in order to construct the test and training sets. Analytical methods work well for simple geometries, like conductive spherical shells in our case. In contrast, most simulations contain complex geometries that require numerical methods, such as the Finite Element method, in order to solve the Laplace equation. These methods are usually time-consuming, reducing simulation efficiency and becoming an obstacle for simulating large systems with numerous particles. A trained PINN model, on the other hand, is much more efficient; it is as simple as multiplying network inputs with weight tensors and transforming the resulting numbers to predict the numerical value of the electrical potential at any given point inside the simulation box. In contrast to other numerical methods, PINN provides a powerful tool for predicting the electrical potential in any desired point and computing the electrical forces much more quickly. As a result, we are able to consider a more complex system with more particles. Consequently, we can sample more data for averaging, resulting in less finite size error. This compensates for the lack of high-precision results compared with other numerical results. Figure 6. _MSE_ between true and predicted potential as a function of charged particles number; in 100 different problems. Methods This article aims to build a machine-learning model (ML-Model) to predict the potential of point-charged particles surrounded by conductive walls. The potential of charged particles is calculated by solving the Poisson equation, which can be written ­as <sup>4</sup> : N �i=1 ∇ <sup>2</sup> φ = −ρ/ǫ0 = − - qiδ(x − xqi )/ǫ0, (1) qiδ(x − xqi )/ǫ0, where φ is the potential and ρ is a charge distribution. The first and straightforward ML-Model that jumps to mind is a model that includes xq and _x_ as an input and φ(xq, x) as an output. Here xq is the position of a pointcharged particle, _x_ is the position in which we want to calculate the potential on it, and φ(xq, x) is the corresponding potential. So the number of input features depends on the number of charged particles; for instance, in 3 dimensions, if there are N charged particles, the input features have to be 3 + 3 × N . Therefore, this kind of model could only predict the potential of fix number of charged particles. One of the applications of this method is simulating charged particles transport in conductive porous media. The number of pores is more than unity in many simulation setups. Therefore, one common scenario is training a separate PINN for each system pore. In this case, even though the total number of particles is fixed during the simulation, the number of charged particles in each pore varies, which has to be considered. We use the PLT algorithm to transform the Poisson equation into the Laplace equation with new boundary conditions to overcome this problem. This algorithm will be discussed in more detail in the following subsection. So we can train a model which includes _x_ and modified boundary conditions as input features and φ(φb, x) as an output. We define the boundary conditions only on Nb fixed points on the boundary φ1, φ2, . . ., φNb . In this output. We define the boundary conditions only on Nb fixed points on the boundary φ1, φ2, . . ., φNb . In this case, with the PLT algorithm, we can build a model with a fixed number of input features that can predict any � charged particles’ potential. For further explanation, Fig. 7 shows the flowchart of this study. �φ1, φ2, . . ., φNb Creating reference data set with PLT algorithm Spliting reference set into the train and test set Train Set Test Set Training the models: RF ANN PINN Testing and hyperparameter tuning all models Chosing the best model Figure 7. Methodology flow chart, The blue part: Preparing the data, in which the reference data set is created based on the PLT algorithm. The red part: Training models process, first the reference set is split to train and test set, then RF, ANN, and PINN model were applied on the train set, after tuning the hyperparameters the best model were chose. Poisson to Laplace transformation (PLT). According to the PLT algorithm, the electrical potential is divided into two parts: singular potential (φsi) and smooth potential (φsm) ; φ(x�) = φsi(x�) + φsm(x�) . It is important to note that the smooth part here is the solution of the Laplace equation with modified boundary conditions, ∇ <sup>2</sup> φsm(x�) = 0, (2) while φsi obeys the famous Coulomb’s law N �i=1 <u>qi</u> 4πǫ0��x −�xi� <sup>.</sup> φsi(x�) = - 4πǫ0��x −�xi� <sup>.</sup> (3) It can be seen that the modified boundary condition for φsm is represented by φsm�x�bc = φ�x�bc - φsi�x�bc, (4) where φ∥x⃗ bc corresponds to the initial electrical potential on the boundaries. Figure 8 shows a schematic of the PLT algorithm. Finally, with the PLT algorithm, we could transfer the Poisson to the Laplace equation with new modified boundary conditions, then train an ML-Model with these modified boundary conditions as an input parameter and the smooth potential as an output. Afterward, we can reach the total potential with the summation of singular and predicted smooth potential. The advantage of utilizing the PLT algorithm is that it leads to having a fixed number of input data since the number of input data would be independent of the number of point-charged particles. Data engineering. For training a highly accurate model, having a nice train set is crucial. In this work, the �x, y, z, ϕ�bc = reference set is Ŵ = �x <sup>i</sup>, y <sup>i</sup>, z <sup>i</sup>, ϕ <sup>�i</sup> <sup>�i</sup> i= bc <sup>, φi�N</sup> i=1 <sup>, where the input is concluded</sup> <sup>N</sup> φreference set is is the target. _x_ Ŵ, _y_ =, _z_ - is the coordinate of a point in the container on which we want to calculate their potential, x <sup>i</sup>, y <sup>i</sup>, z <sup>i</sup>, ϕ <sup>�</sup> bc <sup>i</sup> <sup>, φi�</sup> i <sup>N</sup> =1 <sup>, where the input is concluded</sup> �x, y, z, ϕ�bc = �φ1, φ2, . . ., φNb �� and φ is the numeric value of the potential at this point, and φ1, φ2, . . ., φNb is the boundary condition on Nb �φ1, φ2, . . ., φNb φ is the numeric value of the potential at this point, and φ1, φ2, . . ., φNb is the boundary condition on Nb points on the boundary. First, in the container, Np positions are chosen to predict the potential in their situations. � In fact, for each boundary condition, φ1, φ2, . . ., φNb, there are Np points that we want to calculate the poten In fact, for each boundary condition, φ1, φ2, . . ., φNb, there are Np points that we want to calculate the poten tial at their positions. Then, the reference set could be created for � - Nq different boundary conditions. So the reference set consists of N = Nq × Np samples which could split to train and test set. In this case, our container is a sphere; we also set Np = 78, Nb = 26, and Nq = 100 . So, our reference consists of 100 different boundary conditions and for each boundary condition {φ1, φ2, . . ., φ26} there are 78 points in the sphere on which we want to calculate the potential on it. We use the solution of the image charges method (Eq. 5) to calculate targets of the reference set: �φ1, φ2, . . ., φNb �φ1, φ2, . . ., φNb - ��x −�q xq� <sup>+</sup> ��x −�q <sup>′</sup> r 1 <u>q</u> <u>q</u> <sup>′</sup> <u>x�q</u> φ(x�) =, q <sup>′</sup> = − <sup><u>rq</u></sup> x�q′ = <sup><u>a2</u></sup> (5) 4πǫ0 - ��x −�xq� <sup>+</sup> ��x −�xq′ - - a <sup>,</sup> r ��xq� <sup>,</sup> ��x −�xq′ �, q <sup>′</sup> = − <sup><u>rq</u></sup> a <sup><u>rq</u></sup> x�q′ = <sup><u>a2</u></sup> a <sup>,</sup> r <u>x�q</u> ��xq� <sup>,</sup> where _a_ is the conductive spherical shell radius and _r_ is the distance of a point charge _q_ from its center. The numeric value of potential is minimal ( ∼ 10 <sup>−9</sup> ), which conducts to significant rounding error during computation; therefore, the potential of an electron in a 1 m distance of it, 1.44 × 10 <sup>−9</sup> [V ], is used as a unit to make Eq. (5) dimensionless. We randomly chose 5000 and 1000 samples from the reference set to create a train and test set. The train and test set have no samples in common. In addition, the best model could adequately predict the potential of test samples and samples with different boundary conditions from the train and test set. So to evaluate the model better, we prepare an extrapolation set that includes 1000 samples with 55 modified boundary conditions due to different configurations of charged particles. ML algorithms. In this work, three different supervised learning methods have been used, and their regression accuracy, based on the metrics presented in the “Evaluating metrics” subsection, has been evaluated. Mainly, we stick to Physics-Informed Neural Networks ­(PINN <sup>16</sup> ), but to compare our results with other ML algorithms, (a) (b) (c) Figure 8. Schematic of the PLT method: ( a ) the main system which had point charges inside of it, ( b ) the new system without any point charges and the boundaries were modified, ( c ) Nb points on the boundary are shown to be used as our model input. we use Random Forest ­(RF <sup>17</sup> ) and Artificial Neural Networks (ANN). All the models are briefly introduced, the hyperparameters are fine-tuned, and their performance is reported. Scikit-learn <sup>18</sup>, ­Tensorflow <sup>19</sup>, ­Keras <sup>20</sup>, and ­NumPy <sup>21</sup> are all the Python libraries that have been used in this project. _Random forest (RF)._ RF is one of the most popular machine learning algorithms in regression problems for many reasons, but this model has been chosen in this project since (a) It is speedy to learn. (b) It is robust against over-fitting. Over-fitting is detected when the performance of train samples is perfect while the performance of test samples is poor. RF is an ensemble model in which an average of many uncorrelated trees determines the predicted potential for the target data set. Although each tree is a weak learner, they make a strong learner when many trees are grouped. The RF randomizes the trees by choosing a subset of training data and features for each tree. Here we use scikit-learn <sup>18</sup> RF implementation. _ANN._ Typical neural network architecture consists of the input layer, multiple hidden layers, and the output layer with several neurons in each layer. Totally: - Input layer: The neurons in the input layer are the input features. - Hidden layers: The value of every neuron in the hidden layers is a linear combination of the neurons in the previous layer followed by the implementation of an activation function (Eq. 6); in most cases, the activation function is non-linear. an = σl(an−1 w n + b n). (6) n is the layer number, w and b are the model parameters, weights and bias respectively, and σl is the activation function based ­on <sup>22</sup> . - Output layer: The neurons in the output layer are the model targets and they are calculated with Eq. (6) with linear activation function. - Loss function: There is a function in all neural networks that must be minimized over the model parameters during the training stage via back-propagation, typically the loss function is the mean square error between the true and the predicted values. �w w <sup>2</sup>, Loss(w) =MSEd + � w <sup>2</sup>, (7) w MSEd = <sup>1</sup> - [U( X i, w ) − Ti] <sup>2</sup> . (8) N N �i=1 i=1 [U( X i, w ) − Ti] <sup>2</sup> . U and T are the predicted output and true target values, respectively, X is the input data, and w is the parameter of neural networks, weights, and biases. The first sentence in Eq. (7) is a mean square error, and The second sentence exists to prevent over-fitting, namely _L_ 2 ­regularization <sup>23</sup>, that is used in order to reduce the effects of the large weights. _PINN._ PINN <sup>16</sup> enforces the Laplace equation, a physical law of the electromagnetic system, as a constraint on the neural network. This study proposes a PINN-based approach to solve the Laplace equation with changeable boundary conditions. Figure 9 shows a schematic of the neural network layout for this approach. PINN-based models are neural networks with modified _loss_ functions: �w w <sup>2</sup>, Loss = �1MSEd + �2MSEf + �3MSEb + �4 w <sup>2</sup>, (9) w The first and the last term of Eq. (9) are the same as typical neural networks in Eq. (7). The second term corresponds to the governing physical equation, i.e., the is Laplace, and the third term corresponds to the boundary conditions; 2 MSEd = <sup>1</sup> x d <sup>i</sup> <sup>,</sup> <sup>ϕ�</sup> d <sup>i</sup> <sup>; w</sup> - φd <sup>i</sup>, (10) - - d - φd <sup>i</sup> 2 , ��� Nd Nd �i=1 i=1 ���u� x d <sup>i</sup> d <sup>i</sup> <sup>,</sup> <sup>ϕ�</sup> d <sup>i</sup> <sup>�</sup> d <sup>i</sup> <sup>; w</sup> 2 MSEf = <sup>1</sup> x f <sup>i</sup> <sup>, u</sup> f <sup>i</sup> <sup>; w</sup>, (11) - 2 , ���� Nf Nf �i=1 ���f - x f <sup>i</sup> <sup>,</sup> f <sup>i</sup> <sup>, u</sup> f <sup>i</sup> f <sup>i</sup> <sup>; w</sup> and Figure 9. Physics-informed neural network scheme for solving Laplace equation with variable boundaries. 2 MSEb = <sup>1</sup> - - x b <sup>i</sup> <sup>,</sup> <sup>ϕ�</sup> b <sup>i</sup> <sup>, u</sup> b <sup>i</sup> <sup>; w</sup> . (12) b <sup>i</sup> <sup>; w</sup> 2 . ���� Nb Nb �i=1 i=1 x b <sup>i</sup> <sup>,</sup> <sup>ϕ�</sup> b <sup>i</sup> b <sup>i</sup> <sup>, u</sup> b <sup>i</sup> ���B� x b <sup>i</sup> Here we define f ( x, u; w) f ( x, u; w) = 0, x ∈ Ŵf = ∇ <sup>2</sup> u <sup><u>∂</u></sup> ∂ <sup>2</sup> x <sup><u>u2</u></sup> <sup>+</sup> <sup><u>∂</u></sup> ∂ <sup>2</sup> y <sup><u>u2</u></sup> ∂z <sup>2</sup> = <sup><u>∂</u></sup> ∂ <sup>2</sup> x <sup><u>u2</u></sup> <sup><u>∂</u></sup> ∂ <sup>2</sup> y <sup><u>u2</u></sup> <sup>+</sup> <sup><u>∂</u></sup> ∂ <sup>2</sup> z <sup><u>u2</u></sup> <u>∂u</u> ∂w <u>∂</u> ∂w - + <sup><u>∂</u></sup> ∂ <sup><u>w</u></sup> z - + <sup><u>∂</u></sup> ∂ <sup><u>w</u></sup> z <u>∂</u> ∂w <u>∂u</u> ∂w (13) (14) = <sup><u>∂w</u></sup> ∂x ∂∂w - <u>∂∂wx</u> - + <sup><u>∂</u></sup> ∂ <sup><u>w</u></sup> y , - <u>∂∂wy</u> <u>∂u</u> ∂w - <u>∂∂wz</u> with Dirichlet boundary conditions B( x, ϕ�, u; w) = 0, x ∈ Ŵb u� x <sup>j</sup>, ϕ�; w . - ϕb <sup>j</sup> = 26 �j=1 u �1, �2, �3 in Eq. (9) correspond to the weight coefficients for the data contributions, Laplace equation, and boundary losses. We use the weight coefficient by motivating from the study of Kag et al. <sup>24</sup> . The last sentence is the _L_ 2 ­regularization <sup>23</sup> . Notice that the model with �2 = �3 = 0.0 is exactly a typical neural network described in the previous subsection. Evaluating metrics. The performance evaluation of different algorithms for potential estimation depends on different metrics, �φ <sup>i</sup> = φTrue <sup>i</sup> <sup>−</sup> <sup>φ</sup> Pred <sup>i</sup> <sup>,</sup> (15) ~~�~~ <u>�</u> n - <sup>1</sup> n−1 �i=0 σ = ~~�~~ (�φ <sup>i</sup> ) <sup>2</sup>, (16) <u>�</u> - (�φ <sup>i</sup> ) <sup>2</sup>, <u>i=1</u> <u>�n</u> <u>�φ</u> <sup>i</sup> <u>�φ</u> <sup>i</sup> φTrue <sup>i</sup> <sup>−¯φTrue</sup> <u>True</u> <sup>i</sup> <sup>−</sup> <sup>φi</sup> <u>�2</u> <u>�2</u> <u>�2</u> <sup>,</sup> <u>i=1</u> φTrue <sup>i</sup> <sup>−</sup> <sup>φi</sup> <u>Pred</u> R <sup>2</sup> = 1 − <u>�n</u> <u>�</u> <u>�2</u> (17) <u>Pred</u> i=1 <u>�n</u> MSE = �(�φ) <sup>2</sup> �. (18) Where φTrue is the true potential, φPred is the predicted potential, and φ <sup>¯</sup> True is the mean true potential of a given test sample. In this study we used scatter σ, R <sup>2</sup> score and _MSE_ as our evaluating metrics. Data availability A complete description of how the datasets for the current study were generated can be found in the section of “Data Engineering”. In addition, the datasets used and/or analyzed during the current study are available from the corresponding author upon reasonable request. Received: 13 April 2023; Accepted: 10 August 2023 References 1. Miller, J. R. & Simon, P. Electrochemical capacitors for energy management. _Science_ 321 (5889), 651–652 (2008). 2. Salanne, M. _et al._ Efficient storage mechanisms for building better supercapacitors. _Nat. Energy_ 1 (6), 1–10 (2016). 3. Simon, P. & Gogotsi, Y. Materials for electrochemical capacitors. _Nat. Mater._ 7 [(11), 845–854. https://​doi.​org/​10.​1038/​nmat2​297](https://doi.org/10.1038/nmat2297) (2008). 4. Jackson, J. D. _Classical Electrodynamics_ (Wiley, 1975). 5. Jin, J. M. _The Finite Element Method in Electromagnetics_ 3rd edn. (Wiley, 2015). 6. Golub, G. H. & Van Loan, C. F. _Matrix Computations_ (JHU Press, 2013). 7. Tyagi, S., Arnold, A. & Holm, C. Icmmm2d: An accurate method to include planar dielectric interfaces via image charge summa tion. _J. Chem. Phys._ 127 [, 154723. https://​doi.​org/​10.​1063/1.​27904​28 (2007).](https://doi.org/10.1063/1.2790428) 8. Tyagi, S., Arnold, A. & Holm, C. Electrostatic layer correction with image charges: a linear scaling method to treat slab 2d+h systems with dielectric interfaces. _J. Chem. Phys._ 129 [, 204102. https://​doi.​org/​10.​1063/1.​30210​64 (2008).](https://doi.org/10.1063/1.3021064) 9. Tyagi, S. _et al._ An iterative, fast, linear-scaling method for computing induced charges on arbitrary dielectric boundaries. _J. Chem._ _Phys._ 132 [, 154112. https://​doi.​org/​10.​1063/1.​33760​11 (2010).](https://doi.org/10.1063/1.3376011) 10. Kesselheim, S., Sega, M. & Holm, C. The icc* algorithm: A fast way to include dielectric boundary effects into molecular dynamics [simulations. arXiv:​1003.​1271 (2010).](http://arxiv.org/abs/1003.1271) 11. Arnold, A. _et al._ Espresso 3.1: Molecular dynamics software for coarse-grained models, in _Meshfree Methods for Partial Differential_ _Equations VI_ [1–23. (Springer, 2013). https://​doi.​org/​10.​1007/​978-3-​642-​32979-1_1](https://doi.org/10.1007/978-3-642-32979-1_1) 12. Reed, S. K., Lanning, O. J. & Madden, P. A. Electrochemical interface between an ionic liquid and a model metallic electrode. _J._ _Chem. Phys._ 126 [, 084704. https://​doi.​org/​10.​1063/1.​24640​84 (2007).](https://doi.org/10.1063/1.2464084) 13. Rostami, S., Ghasemi, S. A. & Nedaaee Oskoee, E. A highly accurate and efficient algorithm for electrostatic interactions of charged particles confined by parallel metallic plates. _J. Chem. Phys._ 145 (12), 124118 (2016). 14. Biagooi, M., Samanipour, M., Ghasemi, S. A. & Oskoee, S. N. Caviar: A simulation package for charged particles in environments surrounded by conductive boundaries. _AIP Adv._ 10, [035310. https://​doi.​org/​10.​1063/1.​51400​52 (2020).](https://doi.org/10.1063/1.5140052) 15. Shan, T. _et al._ Study on a fast solver for Poisson’s equation based on deep learning technique. _IEEE Trans. Antennas Propag._ 68 (9), [6725–6733. https://​doi.​org/​10.​1109/​TAP.​2020.​29851​72 (2020).](https://doi.org/10.1109/TAP.2020.2985172) 16. Raissi, M., Perdikaris, P. & Karniadakis, G. E. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. _J. Comput. Phys._ 378 [, 686–707. https://​doi.​org/​10.​1016/j.​](https://doi.org/10.1016/j.jcp.2018.10.045) [jcp.​2018.​10.​045 (2019).](https://doi.org/10.1016/j.jcp.2018.10.045) 17. Breiman, L. Random forests. _Mach. Learn._ 45 [. https://​doi.​org/​10.​1023/A:​10109​33404​324 (2001).](https://doi.org/10.1023/A:1010933404324) 18. Pedregosa, F. _et al._ Scikit-learn: Machine learning in python. _J. Mach. Learn. Res._ 12, 2825–2830 (2011). 19. Abadi, M. Tensorflow: Learning functions at scale. _ACM SIGPLAN Not._ 51 [. https://​doi.​org/​10.​1145/​30226​70.​29767​46 (2016).](https://doi.org/10.1145/3022670.2976746) 20. Chollet, F. _Keras: The Python Deep Learning Library_ (Keras.Io, 2015). 21. Walt, S. V. D., Colbert, S. C. & Varoquaux, G. The numpy array: A structure for efficient numerical computation. _Comput. Sci. Eng._ 13 [, 22–30. https://​doi.​org/​10.​1109/​MCSE.​2011.​37 (2011).](https://doi.org/10.1109/MCSE.2011.37) 22. Goodfellow, I., Bengio, Y. & Courville, A. _Deep Learning_ [(MIT Press, 2016). http://​www.​deepl​earni​ngbook.​org](http://www.deeplearningbook.org) 23. Krogh, A. & Hertz, J. A. A simple weight decay can improve generalization. _Adv. Neural Inf. Process. Syst._ 4, 950–957 (1992). 24. Kag, V., Seshasayanan, K. & Gopinath, V. Physics and data informed neural networks for two-dimensional turbulence. _Phys. Fluids_ 34 (5), 055130 (2022). 25. Liu, D. C. & Nocedal, J. On the limited memory BFGS method for large scale optimization. _Math. Program._ 45 (1), 503–528 (1989). 26. Eyvazi, N., Biagooi, M. & Nedaaee Oskoee, E. Molecular dynamics investigation of charging process in polyelectrolyte-based supercapacitors. _Sci. Rep._ 12 (1), 1098 (2022). Author contributions F.H. designed the machine learning model, analyzed the results, and drafted the manuscript. M.B. collected and analyzed the initial data points. S.E.N.O. reanalyzed the results and revised the manuscript. F.H. and S.E.N.O. defined the problem and all of the authors reviewed the final manuscript. Competing interests The authors declare no competing interests. Additional information Supplementary Information [The online version contains supplementary material available at https://​doi.​org/​](https://doi.org/10.1038/s41598-023-40477-y) [10.​1038/​s41598-​023-​40477-y.](https://doi.org/10.1038/s41598-023-40477-y) Correspondence and requests for materials should be addressed to S.N.O. Reprints and permissions information is available at www.nature.com/reprints. Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from [the copyright holder. To view a copy of this licence, visit http://​creat​iveco​mmons.​org/​licen​ses/​by/4.​0/.](http://creativecommons.org/licenses/by/4.0/) © The Author(s) 2023

섹션 본문 56문단 · 23,700자

(제목 없음)

1In this paper, we developed a new PINN-based model to predict the potential of point-charged particles surrounded by conductive walls.As a result of the proposed physics-informed neural network model, the mean square error and R 2 score are less than 7% and more than 90% for the corresponding example simulation, respectively.Results have been compared with typical neural networks and random forest as a standard machine learning algorithm.The R 2 score of the random forest model was 70%, and a standard neural network could not be trained well.Besides, computing time is significantly reduced compared to the finite element solver.

Introduction

2Computational Electromagnetic Simulation (CES) plays a significant role in many areas of science and engineering, such as soft matter, electrical engineering, biomedical engineering and chemistry.In addition, it has numerous applications in industry.For example, it is one of the main tools in investigating and designing the process of supercapacitors, which are porous energy storage devices with many applications in industry, especially when high power consumption or transfer is neededMiller and Simon [2008].Here, studying the physical mechanisms arising from charge storage in supercapacitors is essential for further technological developmentSalanne et al. [2016], Simon and Gogotsi [2008].Solving Maxwell's equation, especially the Poisson equation in this study, is an essential part of computational electromagnetic algorithmsJackson [1962].Solving the Poisson equation can help scientists to calculate the potential of electrical sources in any system.However, many difficulties arise in practice due to the long-range nature of electrical interactions.In particular, estimating the potential of point-charged components in an environment with conductive walls is challenging because of the induced charges presented on the boundaries.

3Generally, there are two approaches to solving the Poisson equation: analytical solutionJackson [1962] and numerical methods.There are limited techniques for solving analytically, like image charges methods applicable for cases with regular geometries; however, there is no guarantee to achieve practical results.If, for example, a particle is placed in a cubic conductive container, the image charges method will produce an infinite series.On the other hand, numerical methods lead to approximate solutions based on discretizing space and/or time domains.One of the typical numerical methods is the Finite Element Method (FEM)Jin [2014] which discretizes the continuous partial differential equations (PDEs) and forms a linear set of algebraic equationsS.et al. [1991].Nevertheless, even FEM fails in calculating the potential in a charged particle's position since the electrical potential is singular at the place of charges.There are a number of methods and algorithms that have been developed to address this problem, including Induced Charge MMM2D (ICMMM2D) Tyagi et al. [2007] for 2D, ELCICTyagi et al. [2008] for 2D + h, Induced Charge Computation (ICC * ) Tyagi et al. [2010], Kesselheim et al. [2010], Arnold et al. [2013] for 3D periodicity, and a method introduced by Reed et al.Reed et al. [2007] have been developed.In addition, recently, there has been another algorithm named PLT.It was first demonstrated for a partially periodic system constrained between two metallic plates in Rostami et al. [2016], and then it was applied to CAVIAR Biagooi et al. [2020], a molecular dynamics simulation package for charged particles surrounded by non-trivial conductive boundaries.Numerical solving of these problems with the CAVIAR package is accurate; moreover, it took less time than ICC * Biagooi et al. [2020] but is still time and memory-consuming.

4Recently another data-driven approach to solving the PDEs based on deep machine learning is also of great current interest.For instance, Shan et al.Shan et al. [2020] present a CNN to predict the electric potential with different excitations and permittivity distribution in 2D and 3D models.It is fast and efficient compared with FEMJin [2014].However, a couple of problems prevent it from utilizing as a Poisson solver in the MD simulation process; first, it could not work in the case of discrete density functions such as those of point charges, and second, it is a physics-free approach which makes it hard to consider boundary conditions.To overcome the first problem, one can use the PLT algorithm.Additionally, Raissi et al. introduced the physics-informed neural network (PINN) that the loss function defined by Raissi et al. [2019] is an excellent alternative to the conventional deep learning method because of the governing equations, boundary conditions, and initial conditions used in its definition.

5In this paper, we applied a new PINN-based model to predict the potential of point-charged particles surrounded by conductive walls.We then compared the results with typical neural networks and random forests as a standard machine learning algorithm.For instance, we tried to implement these models for a charged particle in a spherical container.The reason for utilizing this simple example was that there is an exact solution to this problem through the analytical method, the image charges method.As a starting point, we used the PLT algorithm to transfer the Poisson equation into the Laplace equation with modified boundary conditions.Then we trained the model to solve the Laplacian equation with new boundary conditions.The input data is included the position in which we want to evaluate the potential on it and the modified boundary conditions; the output data is the corresponding electrical potential of that position.

Methods

6This article aims to build a machine-learning model (ML-Model) to predict the potential of point-charged particles surrounded by conductive walls.The potential of charged particles is calculated by solving the Poisson equation, which can be written as Jackson [1962]:

7where φ is the potential and ρ is a charge distribution.The first and straightforward ML-Model that jumps to mind is a model that includes x q and x as an input, and φ(x q , x) as an output.Here x q is the position of point-charged particle, x is the position in which we want to calculate the potential on it, and φ(x q , x) is the corresponding potential.So the number of input features depends on the number of charged particles; for instance, in 3 dimensions, if there is N charged particles, the input features have to be 3 + 3 × N .Therefore, this kind of model could only predict the potential of fix number of charged particles.In many applications of this method, such as the molecular dynamic simulation, this number is not fixed and could even increase or decrease during the simulation.We use the PLT algorithm to transpose the Poisson equation into the Laplace equation with new boundary conditions to overcome this problem.This algorithm will be discussed in more detail in 2.1.So we can train a model which includes x and modified boundary conditions as input features and φ(φ b , x) as an output.We define the boundary conditions only on N b fixed points on the boundary {φ 1 , φ 2 , . . ., φ N b }.In this case, with the PLT algorithm, we can build a model with a fixed number of input features that can predict any charged particles' potential.

Poisson to Laplace Transformation (PLT)

8According to the PLT algorithm, the electrical potential is divided into two parts: singular potential (φ si ) and smooth potential (φ sm ); φ( x) = φ si ( x) + φ sm ( x).It is important to note that the smooth part here is the solution of the Laplace equation with modified boundary conditions,

9while φ si obeys the famous Columb laws

10It can be seen that the modified boundary condition for φ sm is represented by

11where φ x bc corresponds to the initial electrical potential on the boundaries.Finally, with the PLT algorithm, we could transfer the Poisson to the Laplace equation with new modified boundary conditions, then train an ML-Model with these modified boundary conditions as an input parameter and the smooth potential as an output.Afterward with the summation of singular and predicted smooth potential, we can reach the total potential.Advantage of utilizing PLT algorithm is that it leads to having a fixed number of input data since the number of input data would be independent of the number of point-charged particles.

Data Engineering

12For training a highly accurate model, having a nice train set is crucial.In this work, the reference set is

13, where the input is concluded {x, y, z, ϕ bc = {φ 1 , φ 2 , ..., φ N b }} and φ is the target.

14x, y, z is the coordinate of a point in the container on which we want to calculate their potential, φ is the numeric value of the potential at this point, and {φ 1 , φ 2 , ..., φ N b } is the boundary condition on N b points on the boundary.First, in the container, N p positions are chosen to predict the potential in their situations.

15In fact, for each boundary condition, {φ 1 , φ 2 , ..., φ N b }, there are N p points that we want to calculate the potential at their positions.Then, the reference set could be created for N q different boundary conditions.So the reference set consists of N = N q × N p samples which could split to train and test set.In this case, our container is a sphere, we also set N p = 78, N b = 26, and N q = 100.So, our reference consists of 100 different boundary conditions and for each boundary condition {φ 1 , φ 2 , ..., φ 26 } there are 78 points in the sphere on which we want to calculate the potential on it.We use the solution of the image charges method (Eq.5) to calculate targets of the reference set:

16where a is the conductive spherical shell radius and r is the distance of a point charge q from its center.The numeric value of potential is minimal (∼ 10 −9 ), which conducts to significant rounding error during computation; therefore, the potential of an electron in a 1m distance of it, 1.44 × 10 −9 [V ], is used as a unit to make equation 5 dimensionless.We randomly chose 5000 and 1000 samples from the reference set to create a train and test set.The train and test set have no samples in common.In addition, the best model could adequately predict the potential of test samples and samples with different boundary conditions from the train and test set.So to evaluate the model better, we prepare an extrapolation set that includes 1000 samples with 55 distinct boundary conditions.

ML Algorithms

17In this work, three different supervised learning methods have been used, and their regression accuracy, based on the metrics presented in 2.4, has been evaluated.Mainly, we stick to Physics-Informed Neural Networks (PINN, Raissi et al. [2019]), but to compare our results with other ML algorithms, we use Random Forest (RF, Breiman [2001]) and Artificial Neural Networks (ANN).All the models are briefly introduced, the hyperparameters are fine-tuned, and their performance is reported.Scikit-learn Pedregosa et al. [2011],

18Tensorflow Abadi [2016], Keras Chollet [2015], and NumPy Walt et al. [2011] are all the python libraries that have been used in this project.

Random Forest(RF)

19RF is one of the most popular machine learning algorithms in regression problems for many reasons, but in this project, this model has been chosen since a) It is speedy to learn.b) It is robust against over-fitting.over-fitting is detected when the performance of train samples is perfect while the performance of test samples is poor.RF is an ensemble model in which an average of many uncorrelated trees determines the predicted potential for the target data set.Although each tree is a weak learner, they make a strong learner when many trees are grouped.The RF randomizes the trees by choosing a subset of training data and features for each tree.Here we use scikit-learn Pedregosa et al. [2011] RF implementation.

ANN

20Typical neural network architecture consists of the input layer, multiple hidden layers, and the output layer with several neurons in each layer.Totally:

21• Input layer: The neurons in the input layer are the input features.

22• Hidden layers: The value of every neuron in the hidden layers is a linear combination of the neurons in the previous layer followed by the implementation of an activation function(Eq.6); in most cases, the activation function is non-linear.

23n is the layer number, w and b are the model parameters, weights and bias respectively, and σ l is the activation function based on Goodfellow et al. [2016].

24• Output layer: The neurons in the output layer are the model targets and they are calculated with Eq.6 with linear activation function.

25• Loss function: There is a function in all neural networks that must be minimized over the model parameters during the training stage via back-propagation, typically the loss function is the mean square error between the true and the predicted values.

26U and T are the predicted output and true target values, respectively, X is the input data, and w is the parameter of neural networks, weights, and biases.The first sentence in Eq.7 is a mean square error, and

27The second sentence exists to prevent over-fitting, namely L2 regularizationa.K. Connect et al. [1992], that is used in order to reduce the effects of the large weights.

PINN

28PINNRaissi et al. [2019] enforces the Laplace equation, a physical law of the electromagnetic system, as a constraint on the neural network.This study proposes a PINN-based approach to solve the Laplace equation with changeable boundary conditions.Fig. 3 shows a schematic of the neural network layout for this approach.PINN-based models are neural networks with modified loss functions:

29The first and the last term of Eq.9 are the same as typical neural networks in Eq.7.The second term corresponds to the governing physical equation, i.e., the is Laplace, and the third term corresponds to the boundary conditions;

30and

31Here we define f (x, u; w)

32with Dirichlet boundary conditions

33λ 1 , λ 2 , λ 3 in Eq.9 correspond to the weight coefficients for the data contributions, Laplace equation, and boundary losses.We use the weight coefficient by motivating from the study of Kag et al.Kag et al. [2022].

34The last sentence is the L2 regularizationa.K. Connect et al. [1992].Notice that the model with λ 2 = λ 3 = 0.0 is exactly a typical neural network described in the previous subsection.

Evaluating Metrics

35The performance evaluation of different algorithms for potential estimation depends on different metrics, ∆φ = φ T rue − φ P red , (15)

36Where φ T rue is the true potential, φ P red is the predicted potential, and φT rue is the mean true potential of a given test sample.In this study we used scatter σ, R 2 score and M SE as our evaluating metrics.

Result

37In this paper, we predict the smooth potential of a point-charged particle in a spherical conductive container.First, we set the train and test set with 5000 and 1000 samples (2.2), then we train our models to predict smooth potential.We can calculate total potential by summating smooth and singular potential (more detailed in 2.1).However, in this work, to compare our results with CAVIARBiagooi et al. [2020], we investigate the smooth potential.

hyperparameter for RF

38We optimize over the only hyperparameter, the number of trees in the forest that influences the fitting of the random forest model.In Fig. 4, we plot M SE (the left panel) and R 2 score (the right one) as a function of the number of trees for the test set to determine the optimal hyperparameter, which we find 100 trees since progress after 100 trees are negligible.Afterward, we trained the RF model using 100 trees.The RF method is relatively fast; however, it works when the predicted potential is smooth and relatively small, it is not suitable in the case of point-charged particles (where a gradient of potential as well as its numeric value is high at the position of the charge).Furthermore, it fails to predict the potential near the boundaries since the gradient of the potential is considerable.

PINN based model and NN

39By setting both λ 2 and λ 3 to zero in PINN-based model, one can get exactly NN model.Therefore we investigate both models together and report their reulsts at the same time in the following section.

hyperparameter for PINN and NN

40Unlike the RF model, we define several hyperparameters: a number of neurons, a number of layers, λ 2 , and λ 3 .To tune all hyperparameters, we train the model up to 100000 epochs, using the L-BFGS-B optimizerLiu and Nocedal [1989], until the model's tolerance reaches the level of machine epsilon.For all layers except the last one, we use a tanh activation function.Table 1 is reported the M SE between the predicted and the same potential for a different value of hyperparameters; λ 2 = [0, 0.1, 0.2, 0.3], λ 3 = [0, 0.1, 0.2, 0.3, 0.4], number of hidden layers= [1,3,5,7] and number of neurons per hidden layer= [10,30,50] for 1000 samples of the test set.As shown in Table 1, we observe that a model with one hidden layer could not predict the potential well.Also, a model with ten neurons per layer could not work well.So, Table 2 and Table 3 reported the results for just [3,5,7] layers as well as for [30,50] neurons per layer.We chose λ 4 = 0.0001 to prevent over-fitting.

PINN and NN Prediction

41In Contrast with Table 1, Table 2 is reported not only the M SE but also the R 2 score of the test set.As can be seen in Table 2, the model with seven layers and 50 neurons per layer resulted better when λ 2 and λ 3 are 0.3, 0.3, or 0.2, 0.4, respectively.When λ 2 and λ 3 are zero, a standard neural network, the model has not worked well; it is observed from Tabel 2 and Fig. 4. 1: M SE between the predicted and the exact potential φ(x) for a different value of λ 2 , and λ 3 , and the different number of hidden layers, and neurons per hidden layer in PINN for 1000 different sample of the Test set.Here, λ 4 = 0.0001 is fixed and λ 1 = 1 − (λ 2 + λ 3 + λ 4 ).In this table, the bold number means M SE < 0.1.

Comparison

42We evaluate RF, NN, and PINN to estimate the potential of point-charged particles surrounded by conductive walls.According to Fig. 6, NN was not trained well, while RF and PINN-based models could predict potential precisely.However, RF did not work well to estimate φ T rue > 0.3.Apart from this, the best model could estimate not only the potential of the train and the test sets but also the potential of point-charged particles that are not in the train or test set.So we evaluate the best tuned-PINN model and RF on the extrapolation samples; the results are reported in Table 3.As can be seen in Fig. 8 PINN-based model could predict the potential of newly charged particles better than the RF model, where PINN could predict φ T rue > 0.3 by far better than RF.

Generalization (Multi charged particles)

43For generalization, we test the PINN-based model with λ 2 = 0.3 and λ 3 = 0.3 for the case of more than one charged particle surrounded with conductive boundaries.Since the Laplace equation is a linear function, we predict the potential of each charged particle and then calculate the total potential with a superposition of the corresponding predicted potential.After that, we report the M SE between the predicted smooth potential and the exact smooth solution, which is calculated by the image charges method.Fig. 9 shows the relation between M SE and N , the number of charged particles.As expected, the M SE is independent of the number of charged particles.Therefore, it leads to the fact that we can also use this method for problems with any desired particles.

Conclusion

44In this study, we have trained a machine to predict the smooth potential of charged components surrounded by conductive boundaries.In this scene, the total potential could be easily calculated by the summation of predicted smooth potential with singular potential due to the PLT algorithm.The reference set consists of analytic solutions, the solution of the image charge method, which is split into a train set with 5000 samples and a test set with 1000 samples.To check the accuracy of our model, we set another data set called extrapolation set consisting of 1000 samples with different boundary conditions which were not in the train or even test set.Our main conclusion can be summarized as follows:

45• We find that the PINN-based model trained better than RF and NN models.RF could not predict high potential; on the other hand, the NN could not be trained well at all.

46• our PINN-based model could predict the potential of the test set with M SE = 0.069, R 2 score = 0.902, and scatter σ = 0.02.It also could predict the potential of the extrapolation set with M SE = 0.089, R 2 score = 0.851, and scatter σ = 0.02.• Since the Laplace equation is a linear equation, the trained model could predict the potential of more than one charged particle by summating every particle's predicted potential.Besides, we show that the M SE of more than one particle is independent of a number of particles.

Figure 2 :

47Figure 2: Schematic of the PLT method: a) the main system which had point charges inside of it b) the new system without any point charges and the boundaries were modified c) N b points on the boundary are shown to be used as our model input.

48Figure 3: Physics-informed neural network scheme for solving Laplace equation with variable boundaries

Figure 4 :

49Figure 4: M SE (left), and R 2 score (right) for 1000 different sample of Test set

Figure 5 :

50Figure 5: Potential estimation of RF model: a) show the train data set with 5000 samples with scatter of σ = 0.02, b) show the test data set with 1000 samples with scatter of σ = 0.07.The dashed red line shows where the predicted potential equals the true potential.The pink-shaded region marks 1σ scatter of potential errors.

Figure 6 :

51Figure 6: Potential estimation of best-tuned (a) NN with scatter of σ = 0.07 and (b) PINN model on the 5000 samples of the train set with scatter of σ = 0.01.The dashed red line shows where the predicted potential equals the true potential.The pink-shaded region marks 1σ scatter of potential errors.Both plots in Fig.6compare the true and predicted potentials for the best-tuned NN and the best-tuned PINN model with 7 layers and 50 neurons per layer, λ 2 = 0.3 and λ 3 = 0.3-on the train set.As can be seen, the NN model is not trained well, while the PINN-based model could predict the potential precisely with a scatter of 0.01.Although the PINN-based model predicts the train set well, aiming to clarify that over-fitting has not been accrued, we also evaluate the model on the test set, Fig.7.

Figure 7 :

52Figure 7: Potential estimation of best-tuned PINN model on the 1000 samples of the test set with scatter of σ = 0.02, M SE = 0.069 and R 2 score = 0.851.The dashed red line shows where the predicted potential equals the true potential.The pink-shaded region marks 1σ scatter of potential errors.

Figure 8 :

53Figure 8: Potential estimation of best-tuned (a) RF with scatter of σ = 0.07, and (b) PINN-based model with scatter of σ = 0.02 on the 1000 samples of the Extrapolation set.The dashed red line shows where the predicted potential equals the true potential.The pink-shaded region marks 1σ scatter of potential errors.

Figure 9 :

54Figure 9: M SE between true and predicted potential as a function of charged particles number; in 100 different problems

Table 2 :

55M SE, and R 2 score between the predicted and the exact potential φ(x) for a different value of λ 2 , and λ 3 , and the different number of hidden layers, and neurons per hidden layer in PINN for 1000 different samples of the Test set.Here, λ 4 = 0.0001 is fixed and λ 1 = 1 − (λ 2 + λ 3 + λ 4 ).In this table bold numbers show cases with M SE < 0.1 and R 2 score > 0.9.

Table 3 :

56M SE and R 2 score between the predicted and the exact potential φ(x) for a different value of λ 2 , and λ 3 , and the different number of hidden layers, and neurons per hidden layer in PINN for 1000 different samples of the Extrapolate set.Here, λ 4 = 0.0001 is fixed and λ 1 = 1 − (λ 2 + λ 3 + λ 4 ).In this table bold number shows the best hyperparameters for our PINN-based model.

참고문헌 22건

  1. Electrochemical Capacitors for Energy Management Science · American Association for the Advancement of Science · 2008 10.1126/science.1158736
  2. Electrostatic layer correction with image charges: A linear scaling method to treat slab 2D+h systems with dielectric interfaces The Journal of Chemical Physics · American Institute of Physics · 2008 10.1063/1.3021064
  3. ICMMM2D: An accurate method to include planar dielectric interfaces via image charge summation The Journal of Chemical Physics · American Institute of Physics · 2007 10.1063/1.2790428
  4. On the limited memory BFGS method for large scale optimization Mathematical Programming · Springer Science+Business Media · 1989 10.1007/bf01589116
  5. Materials for electrochemical capacitors Nature Materials · Nature Portfolio · 2008 10.1038/nmat2297
  6. Electrochemical interface between an ionic liquid and a model metallic electrode The Journal of Chemical Physics · American Institute of Physics · 2007 10.1063/1.2464084
  7. An iterative, fast, linear-scaling method for computing induced charges on arbitrary dielectric boundaries The Journal of Chemical Physics · American Institute of Physics · 2010 10.1063/1.3376011
  8. The NumPy Array: A Structure for Efficient Numerical Computation Computing in Science & Engineering · AIP Publishing · 2011 10.1109/mcse.2011.37
  9. ESPResSo 3.1: Molecular Dynamics Software for Coarse-Grained Models Lecture notes in computational science and engineering · Springer Nature · 2012 10.1007/978-3-642-32979-1_1
  10. Efficient storage mechanisms for building better supercapacitors Nature Energy · Nature Portfolio · 2016 10.1038/nenergy.2016.70
  11. Finite Element Method Electromagnetics IEEE eBooks · Institute of Electrical and Electronics Engineers · 1998 10.1109/9780470544655
  12. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations Journal of Computational Physics · Elsevier BV · 2018 10.1016/j.jcp.2018.10.045
  13. Random Forests Machine Learning · Springer Science+Business Media · 2001 10.1023/a:1010933404324
  14. Keras: The Python Deep Learning library Astrophysics Source Code Library · 2018
  15. TensorFlow: learning functions at scale ACM SIGPLAN Notices · Association for Computing Machinery · 2016 10.1145/3022670.2976746
  16. CAVIAR: A simulation package for charged particles in environments surrounded by conductive boundaries AIP Advances · American Institute of Physics · 2020 10.1063/1.5140052
  17. Study on a Fast Solver for Poisson’s Equation Based on Deep Learning Technique IEEE Transactions on Antennas and Propagation · IEEE Antennas & Propagation Society · 2020 10.1109/tap.2020.2985172
  18. A highly accurate and efficient algorithm for electrostatic interactions of charged particles confined by parallel metallic plates The Journal of Chemical Physics · American Institute of Physics · 2016 10.1063/1.4963667
  19. Molecular dynamics investigation of charging process in polyelectrolyte-based supercapacitors Scientific Reports · Nature Portfolio · 2022 10.1038/s41598-022-04837-4
  20. Physics-informed data based neural networks for two-dimensional turbulence Physics of Fluids · American Institute of Physics · 2022 10.1063/5.0090050
  21. Classical electrodynamics Nuclear Physics · Elsevier BV · 1963 10.1016/0029-5582(63)90551-0
  22. Matrix Computations Johns Hopkins University Press eBooks · Johns Hopkins University Press · 2013 10.56021/9781421407944