# Visual Simulation for Numerical Solution of Fourth-Order Partial Differential Equations Based on the Improved Neural Network Algorithm

Authors: Jing Zhang; Yongyan Fan; Zhixiao Li
Journal: Mobile Information Systems
 (2022)

---

## Abstract

The topic of this paper is to study the numerical solution of the fourth-order partial differential equation and analyze its visual application in software simulation. Therefore, for the initial circular domain, the expansion should be transformed into a fourth-order problem in the plane dimension. Then, we introduced appropriate-weighted Sobolev space based on the improved neural network algorithm and established a weak form and the corresponding discrete form for each one-dimensional fourth-order problem. The approximation properties of the cubic Hermite interpolation operator are used to verify the error value of the approximation solution. After obtaining the relevant algorithms, numerical empirical analysis is carried out to prove that the proposed algorithm is effective. Therefore, this article applies it to the visualization simulation technology, and the visualization module mainly completes two tasks: collecting geometric data and drawing models. At present, the application of the visualization module in the program mainly has two aspects: on the one hand, the boundary information of geometry can be obtained by screening the existing database so that the boundary model can be displayed in the visualization; on the other hand, from the calculation result file. Read the geometric information of particles and boundaries and perform dynamic simulation playback of the calculated results.


---

## Body

## 1. Introduction

There are many numerical methods for solving fourth-order equations, such as spectral methods and finite difference methods. As far as we know, although the solution domain of the finite element method is flexible, it is cumbersome to deal with some areas with curved boundaries, especially the high-dimensional fourth-order equations on the boundary areas of some curved surfaces [1]. Although classical finite element methods have been widely used in fourth-order equations, they are solved directly in two- or three-dimensional regions. Since the basis function of the approximation space generally needs to be continuously differentiable at the unit boundary, solving the fourth-order equation directly in these special regions will consume a lot of calculation time and memory capacity [2]. Therefore, the objective of this paper is to solve the fourth-order partial differential equations numerically, with the help of the improved neural network algorithm in the sphere domain and the circle domain. For the spherical domain, in order to overcome the pole singularity introduced by the spherical coordinate transformation, we first obtain the essential pole condition of the pole [3]. Based on the intersecting feature of sphere domain and plane, the existing sphere domain problem is transformed into a plane dimension solution method, and then weighted Sobolve space is introduced, and the weak form and the corresponding discrete form of each one-dimensional fourth-order problem are derived [4]. From the Lax–Milgram theorem and from the approximation properties of the cubic Hermite interpolation operator, the unique existence and error estimation of weak solutions and numerical solutions are proved. Finally, we give some numerical examples, using the numerical solutions presented in this article, the numerical results also illustrate the effectiveness of our algorithm [5]. Then this article applies it to the visualization simulation technology. Although the visualization module of the fourth-order partial differential equation simulation analysis software can already be used for particle modeling, boundary modeling, and dynamic playback of calculation result files, better simulation results are obtained, but with the continuous improvement and optimization of the software proposed in this article, the continuous expansion of simulation analysis functions, more information needs to be displayed on the screen in a visual manner, and more and more complex visual effects and the function of the extended program display module need to be displayed [6]. This article uses methods such as color, light processing, color mixing, and stylization to add functions to the visualization module of the simulation analysis software and a global display of the deflection direction of the boundary. Display the OXYZ coordinate system. When playing the calculation result file, it has the function of displaying the simulation time and the actual playing time, which makes the software display module more user-friendly [7]; the simulation particle color setting function is added, and more particle attributes can be obtained in a visual form displayed in the visualization window, and it enriches the effect of particle simulation display; the new border model color and transparency setting function makes the simulation border display effect more realistic, beautiful, and changeable. By integrating the mathematical calculation method with the reconstructed neural network, the optimized algorithm is introduced into the neural network to improve the simulation calculation ability of the system. Display in the visualization window is to make the visualization effect more excellent and to improve the accuracy of recognition so as to better serve the function. By adding these functions, the visual simulation analysis software display module of fourth-order partial differential equations has been better expanded, which can provide users with better observation effects and better visual experience.


## 2. Related Work

The OpenGL array stack operation mode realizes the synchronous rotation of the boundary and small coordinates of two different geometric contour models at different origins and realizes the visual effects of asynchronous movement and asynchronous scaling of these two models [8]. The light source is associated with the color, and the function of setting the color of the particle is realized so that the simulated particle can display different colors according to its size, speed, and type so that multiple physical attributes can be displayed on the screen intuitively [9]; it enables OpenGL blending attributes to combine colors, realizes the function of border transparency after coloring, makes the display effect more beautiful and changeable enhances the virtual edge display effect through grid operation, makes the visualization effect more realistic, and uses the timer mechanism in MFC to perform the display of simulation time and playback time function [10]. The program reads and displays the STL file, adds a manual sphere filling method based on the original particle sphere automatic filling method, and manually enters the radius and position of the sphere used to fill the particle model through the dialog box, which is finally determined by the operator and the size and shape of the aspheric particle model [11]. The literature studies the Kohonen intrusion detection method based on the Kohonen network as the main algorithm and adds an output layer after the network concurrency layer, making the unsupervised Kohonen neural network a supervised Kohonen neural network, which is used to solve the problem that the classification category is larger than the actual category. The problem is as follows. In the face of a neural network, its initial weight is set, and the set number is often random, which will cause problems such as low classification accuracy and unstable network output [12]. In view of this problem, the determination of random weights has certain defects, so it is necessary to use a certain neural network optimization algorithm to make it clear. The system first uses packet capture software to capture packets, then analyzes and extracts the data, and finally uses MATLAB for system design. Data are detected through the designed intrusion detection system and the detection results are displayed on the page [13]. The relevant knowledge and existing problems of Kohonen neural network improves the neural network for this problem and then makes a brief analysis of the emerging metaheuristic algorithm of invading weeds algorithm [14, 15]. For the definite local values, the differential evolution algorithm should be used to optimize the initial weights [16]. First, introduce the data set used in the experiment and then digitize and normalize the data set. Then a brief description of several evaluation indicators used in the intrusion detection model is given. Finally, a comparative test is set up. Through the analysis of the experimental results, the superiority of the model proposed in this paper is proved.


## 3. Research on the Numerical Solution of Fourth-Order Partial Differential Equations

### 3.1. Design of the Dimensionality Reduction Scheme for Fourth-Order Partial Differential Equations

We will focus on the case where Ω is a spherical region, namely, Ω = {(x, y, z) ∈ R3: x2 + y2 + z2 < R3}. First, define the differential operator as(1)Lv=1r2∂∂rr2∂v∂r+1r2Δsv,of which(2)Δsv=1sinθ∂∂θsinθ∂v∂θ+1sin2θ∂2v∂ϕ2.It can be clearly seen that the weak form of (1) and (2) find u ∈ H20(Ω) such that(3)∫ΩΔuΔv¯dxdydz+α∫Ω∇u∇v¯dxdydz,+β∫Ωuv¯dxdydz=∫Ωfv¯dxdydz,∀v∈H02Ω.Applying the spherical coordinate transformationx = r sinθ cosφ, y = r sinθ sin φ, z = r cos θ in (1) and (2), we can get(4)L2ψ−αLψ+βψ=g,r,θ,ϕ∈D=0,R×0,π×0,2π,(5)ψR,θ,ϕ=∂ψ∂rR,θ,ϕ=0,θ∈0,π.Of which:(6)ψr,θ,ϕ=ursinθcosϕ,rsinθsinϕ,rcosθ,gr,θ,ϕ=frsinθcosϕ,rsinθsinϕ,rcosθ.From equation (2), we know that the weak form of (3) and (4) is(7)aψ,φ=g,φ,of which(8)aψ,φ=∫0R∫Sr2LψLφ¯drdS+α∫0R∫Sr2Lψφ¯drdS,+β∫0R∫Sr2ψφ¯drdS,g,φ=∫0R∫Sr2gφ¯drdS.Here,S is the unit sphere. Yml is a characteristic function of the operator Δs, namely,(9)ΔsYml=−mm+1Yml,m≥0,l≤m,and(10)∫SYmlYm′l′dS=δmm′δll′.Make(11)ψr,θ,ϕ=∑m=0∞∑l=0mψmlYml,φr,θ,ϕ=∑m=0∞∑l=0mφmlYml,gr,θ,ϕ=∑m=0∞∑l=0mgmlYml.According to (1) and (11),(12)Lψ=∑m=0∞∑l=0m1r2∂rr2∂rψml−mm+1r2ψmlYml.Therefore, the essential conditions that make (12) more meaningful are(13)mm+1ψml0=0.Using extreme condition (10), a series of one-dimensional fourth-order problems equivalent to equations (3) and (4) can be obtained as follows:(14)lm2ψml−αlmψml+βψml=gmlr,r∈0,R,(15)1ψmlR=ψml′R=0,m=0,(16)2ψml0=0,ψmlR=ψml′R=0,m≥1.


### 3.2. Discrete Format Design of Fourth-Order Partial Differential Equations

To derive the weak form of equations (14)–(16) and its discrete form, we first introduce appropriate-weighted Sobolev space as (17)Lω2I≔f:∫Iωf2dx<∞.The corresponding inner product and norm can be given as(18)f,gω=∫Iωfgdx,f∥w=∫Iωf2dx1/2,where I = (0,1) and ω = x2 is the weight function. Then, we further introduce the nonuniform weighted Sobolev space as follows:(19)H˜0,ω,m2I:=u:Lmf∈Lω2I,mm+1uml0=uml1=uml′1=0.The corresponding inner product and norm are(20)f,g2,ω,m=Lmf,Lmgω,∥f∥2,ω,m=f,f2,ω,m1/2.Therefore, the weak form of equations (14)–(16) is(21)amuml,vml=Fmvml,∀vml∈H˜0,ω,m2I.


### 3.3. Error Estimation and Reasoning of Fourth-Order Partial Differential Equations

From the extreme conditions (15) and (16), we can get(22)∫I2xuml″v′+uml′v″dx=−2∫uml′v′dx,∫I2mxuml′v+umlv′dx=2m∫I1x2umlvdx,∫Imuml″v+umlv″dx=−2m∫Iuml′v′dx.For∀uml∈H˜0,ω,m2I, the following inequality holds true:(23)∫Ixuml2dx≲∫Ixuml′2+mm+1uml2dx,∫Ixuml′2+mm+1uml2dx≲∫IxLmuml2dx.


### 3.4. Effective Implementation and Verification of the Numerical Solution

Using the algorithm proposed in this article for differentM and different N, respectively, list the error (uM ℎ(x, y, z) and u(x, y, z)) in Tables 1 and 2, respectively.Table 1
For differentM and N, the error between the exact solution and the approximate solution.
NM = 2M = 4M = 6M = 8105.9017 ± 075.9017 ± 075.9017 ± 075.9017 ± 07151.1921 ± 071.1921 ± 071.1921 ± 071.1921 ± 07203.8197 ± 083.8197 ± 083.8197 ± 083.8197 ± 08251.5768 ± 081.5768 ± 081.5768 ± 081.5768 ± 08Table 2
Different convergence rates forM and ℎ.
hM = 2M = 4M = 6M = 81/40.06560.06550.04037.4179 ± 061/80.06410.06410.06410.06411/160.06340.06340.06340.06341/320.06330.06330.06330.0633The convergence rates for differentM and ℎ are shown in Table 2:In this paper, the approximate solution and the exact solution image are shown in Figure1.Figure 1
WhenN = 20, M = 12, the graph of the approximate solution (a) and the exact solution (b).To verify the effectiveness of the algorithm, it is necessary to clarify the error between the approximate solution and the exact solution, so the algorithm simulation shown in Figure2 is designed and implemented.Figure 2
The error graph of the approximate solution and the exact solution whenN = 10, M = 6, N = 25, and M = 10.


## 3.1. Design of the Dimensionality Reduction Scheme for Fourth-Order Partial Differential Equations

We will focus on the case where Ω is a spherical region, namely, Ω = {(x, y, z) ∈ R3: x2 + y2 + z2 < R3}. First, define the differential operator as(1)Lv=1r2∂∂rr2∂v∂r+1r2Δsv,of which(2)Δsv=1sinθ∂∂θsinθ∂v∂θ+1sin2θ∂2v∂ϕ2.It can be clearly seen that the weak form of (1) and (2) find u ∈ H20(Ω) such that(3)∫ΩΔuΔv¯dxdydz+α∫Ω∇u∇v¯dxdydz,+β∫Ωuv¯dxdydz=∫Ωfv¯dxdydz,∀v∈H02Ω.Applying the spherical coordinate transformationx = r sinθ cosφ, y = r sinθ sin φ, z = r cos θ in (1) and (2), we can get(4)L2ψ−αLψ+βψ=g,r,θ,ϕ∈D=0,R×0,π×0,2π,(5)ψR,θ,ϕ=∂ψ∂rR,θ,ϕ=0,θ∈0,π.Of which:(6)ψr,θ,ϕ=ursinθcosϕ,rsinθsinϕ,rcosθ,gr,θ,ϕ=frsinθcosϕ,rsinθsinϕ,rcosθ.From equation (2), we know that the weak form of (3) and (4) is(7)aψ,φ=g,φ,of which(8)aψ,φ=∫0R∫Sr2LψLφ¯drdS+α∫0R∫Sr2Lψφ¯drdS,+β∫0R∫Sr2ψφ¯drdS,g,φ=∫0R∫Sr2gφ¯drdS.Here,S is the unit sphere. Yml is a characteristic function of the operator Δs, namely,(9)ΔsYml=−mm+1Yml,m≥0,l≤m,and(10)∫SYmlYm′l′dS=δmm′δll′.Make(11)ψr,θ,ϕ=∑m=0∞∑l=0mψmlYml,φr,θ,ϕ=∑m=0∞∑l=0mφmlYml,gr,θ,ϕ=∑m=0∞∑l=0mgmlYml.According to (1) and (11),(12)Lψ=∑m=0∞∑l=0m1r2∂rr2∂rψml−mm+1r2ψmlYml.Therefore, the essential conditions that make (12) more meaningful are(13)mm+1ψml0=0.Using extreme condition (10), a series of one-dimensional fourth-order problems equivalent to equations (3) and (4) can be obtained as follows:(14)lm2ψml−αlmψml+βψml=gmlr,r∈0,R,(15)1ψmlR=ψml′R=0,m=0,(16)2ψml0=0,ψmlR=ψml′R=0,m≥1.


## 3.2. Discrete Format Design of Fourth-Order Partial Differential Equations

To derive the weak form of equations (14)–(16) and its discrete form, we first introduce appropriate-weighted Sobolev space as (17)Lω2I≔f:∫Iωf2dx<∞.The corresponding inner product and norm can be given as(18)f,gω=∫Iωfgdx,f∥w=∫Iωf2dx1/2,where I = (0,1) and ω = x2 is the weight function. Then, we further introduce the nonuniform weighted Sobolev space as follows:(19)H˜0,ω,m2I:=u:Lmf∈Lω2I,mm+1uml0=uml1=uml′1=0.The corresponding inner product and norm are(20)f,g2,ω,m=Lmf,Lmgω,∥f∥2,ω,m=f,f2,ω,m1/2.Therefore, the weak form of equations (14)–(16) is(21)amuml,vml=Fmvml,∀vml∈H˜0,ω,m2I.


## 3.3. Error Estimation and Reasoning of Fourth-Order Partial Differential Equations

From the extreme conditions (15) and (16), we can get(22)∫I2xuml″v′+uml′v″dx=−2∫uml′v′dx,∫I2mxuml′v+umlv′dx=2m∫I1x2umlvdx,∫Imuml″v+umlv″dx=−2m∫Iuml′v′dx.For∀uml∈H˜0,ω,m2I, the following inequality holds true:(23)∫Ixuml2dx≲∫Ixuml′2+mm+1uml2dx,∫Ixuml′2+mm+1uml2dx≲∫IxLmuml2dx.


## 3.4. Effective Implementation and Verification of the Numerical Solution

Using the algorithm proposed in this article for differentM and different N, respectively, list the error (uM ℎ(x, y, z) and u(x, y, z)) in Tables 1 and 2, respectively.Table 1
For differentM and N, the error between the exact solution and the approximate solution.
NM = 2M = 4M = 6M = 8105.9017 ± 075.9017 ± 075.9017 ± 075.9017 ± 07151.1921 ± 071.1921 ± 071.1921 ± 071.1921 ± 07203.8197 ± 083.8197 ± 083.8197 ± 083.8197 ± 08251.5768 ± 081.5768 ± 081.5768 ± 081.5768 ± 08Table 2
Different convergence rates forM and ℎ.
hM = 2M = 4M = 6M = 81/40.06560.06550.04037.4179 ± 061/80.06410.06410.06410.06411/160.06340.06340.06340.06341/320.06330.06330.06330.0633The convergence rates for differentM and ℎ are shown in Table 2:In this paper, the approximate solution and the exact solution image are shown in Figure1.Figure 1
WhenN = 20, M = 12, the graph of the approximate solution (a) and the exact solution (b).To verify the effectiveness of the algorithm, it is necessary to clarify the error between the approximate solution and the exact solution, so the algorithm simulation shown in Figure2 is designed and implemented.Figure 2
The error graph of the approximate solution and the exact solution whenN = 10, M = 6, N = 25, and M = 10.


## 4. Visualization Software Simulation and Result Analysis Based on the Improved Neural Network Algorithm

### 4.1. Improved Neural Network Algorithm Design

In order to facilitate calculation, the data set is divided into two parts: normal data set and abnormal data set. The abnormal data are divided into four major attack categories, namely, Dos, Probe, U2U, and R2L. Use the Kohonen neural network to select and classify part of the data set. The results are shown in Table3.Table 3
Experimental results.
CategoryNode number11,6215,20 ∼ 737 ∼ 9,1544 ∼ 4,11 ∼ 12,17514As can be seen from Table3, when classifying data sets, data sets correspond to nodes in the network. If the divided regions correspond to one category, the ranking result often exceeds five categories, which makes the classification result not good. Aiming at the above shortcomings, an improved method of adding an output layer converts the unsupervised Kohonen neural network into a supervised learning network (SKohonen network). The SKohonen network structure diagram is shown in Figure 3:Figure 3
Improved neural network structure diagram.As can be seen from Figure3, the difference between the two data networks is that SKohonen has one more output layer than unsupervised Kohonen, and the number of nodes in this output layer is related to the data type brought in. Therefore, when two data networks are converted, these two layers need to be converted.


### 4.2. Visualization Implementation Method Based on Software

Although OpenGL provides many efficient graphics rendering functions that can be independent of the operating system and window system, OpenGL does not include any event response mechanism or input or window management, which makes it impossible to carry out related messages between OpenGL and Windows. Therefore, if people want to use OpenGL for 3D modeling and animation display in the Windows environment, people must use a window system, and MFC (Visual C++ Basic Class Library) has powerful events, window management, and control functions and is considered as 3D visualization software which develop more commonly used platforms. The 3D discrete element method simulation analysis software developed by the research group combines OpenGL and MFC to perform the related functions of its visual simulation system. OpenGL is used to create and draw complex 3D models of particles and boundaries.In MFC, the CView explains that class is the base class of all view classes and is associated with the CDocument base class to implement the display function and interactive working mechanism of document data. Use App Wizard and Class Wizard in Visual C++ environment to generate the application framework. In this document view structure, the document class is mainly responsible for computing operations, and the visual class is responsible for displaying content in the window. In the visual class CView, the CDC device scene class can be directly used to draw simple two-dimensional graphics, but Visual C++ does not provide a ready-made class that can directly use OpenGL for drawing, so the program is derived from the CView class to create a TDEMView class, encapsulate the resources, device description table, and palette used for OpenGL drawing, and complete the association between the Windows window and OpenGL in the process. Graphics Device Interface (GDI) objects in Windows are drawn through a device handle (DC) device driver, while OpenGL drawing requires a Render Context (RC) drawing environment, and it must be the current drawing environment. Generating the current OpenGL drawing environment requires the following three steps: setting the window pixel format, generating RC, and setting it as the current RC. After allocating the drawing environment for OpenGL and completing the initialization operations such as clearing the cache and setting lighting, the OpenGL function library can be directly used to call OpenGL drawing commands to render 3D graphics.The TDEMView class defines member functions for scene initialization and 3D drawing:bool CTDEMView: Initialized OpenGL (CDC ∗pDC) function is used to generate drawing description table and set device description table and color palette; void CTDEMView: the SceneInit() function is used to initialize OpenGL parameters and set static scenes such as material and lighting information; bool CTDEMView: the RenderScene() function is used to draw graphics, and all drawing and rendering operations are implemented in this function. These functions are called by the corresponding message handle in CView of MFC. After a window is created, a message named WM_CREATE is sent to the operating system. The OnCreate() function in MFC is used to feedback the message. The function InitializeOpenGL(CDC ∗pDC) is called in OnCreate() to create a visual window and allocate device handles and the current drawing environment for the graphics device interfaces GDI and OpenGL. Since it takes a lot of processing time to generate an RC, in order to obtain a smoother and higher performance display effect, the RC is only generated once and used all the time. The drawing environment is not deleted until the OnDestroy() function is called at the end of the program. In MFC CView, the OnDraw (CDC ∗ pDC) function is used to complete most of the graphic design work. All codes for drawing operations in the client area of the application window must be written in this function. When the window changes, such as resizing the window, showing or hiding the window area, OnDraw(CDC∗ pDC) will be called to redraw the window to refresh and fill the view client area again. In addition, people can also call the visual class member function Invalidate () to explicitly trigger the call to the OnDraw() function. In order to enable the mouse operation to act on the displayed image to change the display effect, the Invalidate() function is called in the function OnMouseMove() in response to the mouse sliding operation and the function OnMouseWheel() in response to the mouse scroll operation. The program calls the SceneInit() function and the RenderScene() function in the OnDraw() function to enable the 3D graphics drawn by OpenGL to be displayed in the client area and refresh the image when the client area changes. The visualization module of the 3D discrete element method simulation analysis software is carried out in this framework.The postprocessing module of the 3D discrete element method simulation analysis software includes two parts: simulation display and performance analysis. Therefore, not only must all geometric information be written into the result file for display during the calculation process but also a large number of parameters, physics, and other information must be analyzed and stored for performance. The simulation process often involves tens of thousands of particles, and the calculation process involves the force, velocity, angular velocity, flow, and other information of the physical movement of each particle. In order to meet the user’s calculation and simulation needs while saving computer storage space, TDEM implements a selective storage function to selectively store physical particle information. This information is written into multiple files with different suffixes. The suffixes of the files used for simulation visualization are tdeh, tdep, tdec, tdeb, and tdei. The correspondence between these file suffixes and file content is shown in Table4.Table 4
Correspondence table of file suffix and storage content.
File extensionStore contenttdehThe relevant parameters and control information set by the user in the calculation module through the dialog boxtdepParticle attribute information, number, geometric parameters (size and sphere center coordinates), physical information (force, velocity, and angular velocity), etctdecIdentify the parameters of the particle information selection and storage used to calculate the length of the relevant information of each particle in the tdep filetdebBoundary attribute information, geometric parameters (shape and position), motion information (translation and rolling), etctdeiAttribute information, geometric information, movement information, etc. of the inletIn the simulation process, four files other than the tdeh file should be read multiple times in units of time steps. Whenever the simulation information is read in the current time step, it must be configured for each file. Mark the offset variable of the current reading position. The next time the file is read, it will be read from this offset position. The tdeh file is only read when the program reads the file for the first time, that is, when the play() function is called for the first time. File parameters are quantitative during the simulation process, such as the parameters m_nPModeIndex and m_nInModeIndex representing the shape of the particles and the inlet shape, the m_nFModeIndex parameter representing the mechanical model, the m_dWholeTime parameter representing the simulation time, and the time step interval representing the m_dDeltaTime parameter interval of the model Wait. These parameters will not change with the simulation time step and are used to control the subsequent file reading and the operation of the entire drawing process. Since particle information can be selectively stored, the size of the memory occupied by each particle is uncertain. There are three marker parameters in the tdec file: li, sudu, and jiaosudu, which are used to determine whether the particle strength, velocity, and angular velocity information are stored in the tdep file. Only when these three parameters are known can you get the proportion of each particle in the file. The length is the particle offset, and the correct reading of the particle information is completed. Therefore, whenever the play() function is called, the tdec file must be read and the offset of the particle must be read, and then the tdep file of the particle must be read. When reading information from the tdep file, each time you read a particle, you need to reread the tdec file to determine what information is currently being read from the particle until all the particle information in a time step is read. Update the read position. Each time the play() function is called, the information in the tdeb file and the tdei file will also be read to obtain all relevant information about the inner boundary and the feed inlet of a time step.


### 4.3. Technical Analysis of Visual Modeling and Adjustment of the Sphere

To implement the manual sphere filling modeling function, we must first create a new dialog resource dedicated to manual modeling of the filling sphere with the help of MFC, and the number is IDD_NONAUTO, and the dialog title is “Manually Fill the Sphere.” This resource creates a dialog box class CNonAuto and encapsulates all the functions that respond to the dialog box operation in this class. In the manual modeling process, even if the operation dialog box is opened, it is necessary to be able to use the main view window of the program. Therefore, the “Manually Fill the Sphere” dialog box should be created as a modeless dialog box. To create a modeless dialog box, first allocate memory for the dlg_NonAuto pointer through the new CNonAuto() operation, then use the dlg_NonAuto- > Create (IDD_NONAUTO) command, and finally use the dlg_NonAuto-command > ShowWindow (SW_SHOWNORMAL) to manually complete the creation of the dialog box. Screen the dialog box for filling the sphere which appears on the top. In addition, in order to facilitate the user to perform manual filling operations correctly according to the content of the 3D scan file, the range of the center position of the sphere must be adjusted in the operation dialog box. The three directions ofx, y, and z must be provided. These ranges are correct. People can determine them after scanning the document and reading it. In the dialog box “Manually Fill the Ball” dialog box at initialization, these range values are assigned to the corresponding static text control. Eight types of text captions are operated by SetWind owText() and range information can be displayed in the corresponding position of the displayed dialog box.In order to facilitate the operation of the sphere data and ensure safety, the program defines a sphere class to encapsulate the attributes of the sphere. The double type member array is used to store the sphere center position attribute of the sphere, and the s_radius member variable is used to represent the radius of the sphere. Create a sphere type container Sp in the CParticle_fillView class. The effective filling balls set by the “Manually Fill the Sphere” dialog box are stored in the container for subsequent display and operation; the Sp1 sphere container type is also created in the CNonAuto dialog box, which is used to store relevant information during manual modeling. Fill the sphere with temporary information. The CNonAuto class adds four member functions: OnBnClickedADD(), OnBnClickedDEL(), OnOK(), and OnBnClickedCancel(), which are used to respond to the “application,” “cancel application,” “OK,” and “cancel” operations in the dialog box.When the “Apply” button is clicked, the OnBnClickedADD() response function is activated and called. If the geometric information of the input ball is legal, put the ball into the container Sp1 through the push_back() operation. The value of the variable sID representing the number of particles plus 1 is used to number the ball, and the value is specified as the corresponding static in the dialog box. The text title of the text control implements the effect of automatic numbering of filled balls. Next, call the Invalidate() function to initiate the refresh operation of the visualization window and redraw all the spheres saved in Sp1 in the RenderScene() function so that the currently set component spheres are displayed on the specified position of the visualization window. The method of implementing “cancel application” is similar to that of “application.” After clicking the button to activate the OnBnClickedDEL() function, if the Sp1 container is not empty, use the Sp1.pop_back() operation to remove a ball element at the end of the Sp1 container, and then redraw all the constituent spheres in Sp1 to move from the visualization window in addition to the effect of the new configuration of the composition of the ball.Finally, if you click the “OK” button, the On OK() function will put all the particle elements in the current Sp1 into the Sp container, determine the effective composition spheres in the filling model, and complete a manual sphere filling modeling operation; if you click “Cancel” button, the OnBnClickedCancel() function clears the temporary container through Sp1.clear() and triggers refreshing of the view window to cancel this modeling operation.After completing the manual modeling of the particle model using the “Manually Fill the Sphere” dialog box, select the file import option in the manual modeling module to save the information about the filled model data to a file. In this operation, add the void CParticle_fillView:OnNonAuto_Filesave() response function, define a CString type variable original name in the function, and specify the default file name of the saved file as the particle name set in the dialog box. The program uses the CFileDialog class constructor to create a file save dialog box and specify the default file name. The specific statement is as follows:CFileDialog∗hFileDlg = newCFileDialog(FALSE, “txt,“originalname, OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFileFilter, NULL)After successfully creating a file using the Save File dialog box, use the C++ formatted write function fprintf() to write the position coordinates of the center of each ball and the radius of the ball in floating point format (% f) to the file. Using the fputs() function standardizes the save file format and saves the geometric information of the spheres in the file in units of lines, and each sphere information occupies a line in the file. After importing the model information into the file, you can view the contents of the saved file in the view window through the view calculation result file option under the view function bar. OpenGL provides a method glutSolidSphere() that directly represents the sphere. In the RenderScene() function, the geometric information read from the result file is used to draw all the constituent spheres, which can complete the visual presentation of the entire particle model.The results of manual modeling are saved in a file, and the filled particle model can also be written into a database table using the database import function. For the manually filled multisphere particle model, the program uses ODBC database connection when implementing database storage, which requires the CDatabase and CRecordSet of the database-related classes in the MFC base class library. The CDatabase database class is responsible for connecting and operating the data source; the CRecordSet record set class is responsible for binding the record set extracted from the data source. In the 3D aspheric particle modeling software, there are two tables used to store the manually filled multisphere particle model information, and the table names are lsy_combined_sphere and lsy_combined_particle.When the manually filled particle model is written into the database table, you must first call the Open() function to open the lsy_combined_sphere table, and use the MoveLast() function to move the file pointer to the last record in the table. If the table allows adding data, then import data into the table. After completing data delivery, update the record set through Update(), and call the function Close() to close the table. In order to ensure the consistency of the database, use the previous method to write to the lsy_combined_particle table to ensure that the same primary key data in the two tables is consistent.


### 4.4. Analysis of the Visual Simulation Effect

Since the improved program changes the file reading and writing operations of the original program, it is necessary to perform simulation calculations in the two versions of the program before and after the improvement and to match the corresponding calculation result files for the two different versions of the program in order to separately and perform correct playback. In order to be able to compare the playback effects before and after the improvement, the simulation parameters selected in the two versions of the program must be exactly the same. However, due to the unreproducibility of engineering calculations, even if the simulation process is exactly the same, it is difficult to obtain exactly the same reproduction results. It can only ensure that the overall trend of particle movement is consistent. When playing a file, the current simulation time and actual playing time can be displayed at the upper left corner of the screen at the same time. In the case of the same simulation time, the shorter the actual playback time, the faster the rendered image, and the smoother the playback effect. Aiming at the complexity of the boundary and the number of particles, spherical particles with uniform radius, simple cylindrical barrel boundary, and complex spiral conveyor boundary are used as simulation objects, and experiments are carried out on the playing effects of the program before and after the improvement. The selection of relevant parameters in the simulation calculation process is shown in Table5.Table 5
Simulation calculation parameter selection table.
ParameterGranules and granulesGrain and boundaryNormal stiffness coefficient (N/Kg)520010400Tangential stiffness coefficient (N/Kg)34686934Normal damping coefficient (Ns/m)0.350.58Tangential damping coefficient (Ns/m)0.290.49Coefficient of static friction0.280.36Sliding friction coefficient0.240.25Rolling friction coefficient0.000060.00006Particle density (Kg/m3)1238Particle radius (mm)6Actual movement time of simulated particles (s)7After opening the simulation result file and selecting the entity playback mode, we click the boundary effect setting button to open the boundary effect setting dialog box. We click the color setting button in the dialog box to specify a color for the boundary model. After setting the color for the boundary of the cylinder and the boundary of the screw conveyor, the display effect is shown in Figure4. Through the test, the usability and correctness of the border color setting function are verified.Figure 4
Simple border color setting display effect.After selecting the entity playback mode, the border transparency can be set through the slider operation in the border effect setting dialog box. The display effects of adjusting the boundary of the cylinder and the transparency of the boundary of the screw conveyor are shown in Figure5. Through the test, it can be found that the border transparency display effect meets the setting requirements so that the usability and correctness of the border transparency setting function are verified.Figure 5
Simple border transparency setting display effect.


## 4.1. Improved Neural Network Algorithm Design

In order to facilitate calculation, the data set is divided into two parts: normal data set and abnormal data set. The abnormal data are divided into four major attack categories, namely, Dos, Probe, U2U, and R2L. Use the Kohonen neural network to select and classify part of the data set. The results are shown in Table3.Table 3
Experimental results.
CategoryNode number11,6215,20 ∼ 737 ∼ 9,1544 ∼ 4,11 ∼ 12,17514As can be seen from Table3, when classifying data sets, data sets correspond to nodes in the network. If the divided regions correspond to one category, the ranking result often exceeds five categories, which makes the classification result not good. Aiming at the above shortcomings, an improved method of adding an output layer converts the unsupervised Kohonen neural network into a supervised learning network (SKohonen network). The SKohonen network structure diagram is shown in Figure 3:Figure 3
Improved neural network structure diagram.As can be seen from Figure3, the difference between the two data networks is that SKohonen has one more output layer than unsupervised Kohonen, and the number of nodes in this output layer is related to the data type brought in. Therefore, when two data networks are converted, these two layers need to be converted.


## 4.2. Visualization Implementation Method Based on Software

Although OpenGL provides many efficient graphics rendering functions that can be independent of the operating system and window system, OpenGL does not include any event response mechanism or input or window management, which makes it impossible to carry out related messages between OpenGL and Windows. Therefore, if people want to use OpenGL for 3D modeling and animation display in the Windows environment, people must use a window system, and MFC (Visual C++ Basic Class Library) has powerful events, window management, and control functions and is considered as 3D visualization software which develop more commonly used platforms. The 3D discrete element method simulation analysis software developed by the research group combines OpenGL and MFC to perform the related functions of its visual simulation system. OpenGL is used to create and draw complex 3D models of particles and boundaries.In MFC, the CView explains that class is the base class of all view classes and is associated with the CDocument base class to implement the display function and interactive working mechanism of document data. Use App Wizard and Class Wizard in Visual C++ environment to generate the application framework. In this document view structure, the document class is mainly responsible for computing operations, and the visual class is responsible for displaying content in the window. In the visual class CView, the CDC device scene class can be directly used to draw simple two-dimensional graphics, but Visual C++ does not provide a ready-made class that can directly use OpenGL for drawing, so the program is derived from the CView class to create a TDEMView class, encapsulate the resources, device description table, and palette used for OpenGL drawing, and complete the association between the Windows window and OpenGL in the process. Graphics Device Interface (GDI) objects in Windows are drawn through a device handle (DC) device driver, while OpenGL drawing requires a Render Context (RC) drawing environment, and it must be the current drawing environment. Generating the current OpenGL drawing environment requires the following three steps: setting the window pixel format, generating RC, and setting it as the current RC. After allocating the drawing environment for OpenGL and completing the initialization operations such as clearing the cache and setting lighting, the OpenGL function library can be directly used to call OpenGL drawing commands to render 3D graphics.The TDEMView class defines member functions for scene initialization and 3D drawing:bool CTDEMView: Initialized OpenGL (CDC ∗pDC) function is used to generate drawing description table and set device description table and color palette; void CTDEMView: the SceneInit() function is used to initialize OpenGL parameters and set static scenes such as material and lighting information; bool CTDEMView: the RenderScene() function is used to draw graphics, and all drawing and rendering operations are implemented in this function. These functions are called by the corresponding message handle in CView of MFC. After a window is created, a message named WM_CREATE is sent to the operating system. The OnCreate() function in MFC is used to feedback the message. The function InitializeOpenGL(CDC ∗pDC) is called in OnCreate() to create a visual window and allocate device handles and the current drawing environment for the graphics device interfaces GDI and OpenGL. Since it takes a lot of processing time to generate an RC, in order to obtain a smoother and higher performance display effect, the RC is only generated once and used all the time. The drawing environment is not deleted until the OnDestroy() function is called at the end of the program. In MFC CView, the OnDraw (CDC ∗ pDC) function is used to complete most of the graphic design work. All codes for drawing operations in the client area of the application window must be written in this function. When the window changes, such as resizing the window, showing or hiding the window area, OnDraw(CDC∗ pDC) will be called to redraw the window to refresh and fill the view client area again. In addition, people can also call the visual class member function Invalidate () to explicitly trigger the call to the OnDraw() function. In order to enable the mouse operation to act on the displayed image to change the display effect, the Invalidate() function is called in the function OnMouseMove() in response to the mouse sliding operation and the function OnMouseWheel() in response to the mouse scroll operation. The program calls the SceneInit() function and the RenderScene() function in the OnDraw() function to enable the 3D graphics drawn by OpenGL to be displayed in the client area and refresh the image when the client area changes. The visualization module of the 3D discrete element method simulation analysis software is carried out in this framework.The postprocessing module of the 3D discrete element method simulation analysis software includes two parts: simulation display and performance analysis. Therefore, not only must all geometric information be written into the result file for display during the calculation process but also a large number of parameters, physics, and other information must be analyzed and stored for performance. The simulation process often involves tens of thousands of particles, and the calculation process involves the force, velocity, angular velocity, flow, and other information of the physical movement of each particle. In order to meet the user’s calculation and simulation needs while saving computer storage space, TDEM implements a selective storage function to selectively store physical particle information. This information is written into multiple files with different suffixes. The suffixes of the files used for simulation visualization are tdeh, tdep, tdec, tdeb, and tdei. The correspondence between these file suffixes and file content is shown in Table4.Table 4
Correspondence table of file suffix and storage content.
File extensionStore contenttdehThe relevant parameters and control information set by the user in the calculation module through the dialog boxtdepParticle attribute information, number, geometric parameters (size and sphere center coordinates), physical information (force, velocity, and angular velocity), etctdecIdentify the parameters of the particle information selection and storage used to calculate the length of the relevant information of each particle in the tdep filetdebBoundary attribute information, geometric parameters (shape and position), motion information (translation and rolling), etctdeiAttribute information, geometric information, movement information, etc. of the inletIn the simulation process, four files other than the tdeh file should be read multiple times in units of time steps. Whenever the simulation information is read in the current time step, it must be configured for each file. Mark the offset variable of the current reading position. The next time the file is read, it will be read from this offset position. The tdeh file is only read when the program reads the file for the first time, that is, when the play() function is called for the first time. File parameters are quantitative during the simulation process, such as the parameters m_nPModeIndex and m_nInModeIndex representing the shape of the particles and the inlet shape, the m_nFModeIndex parameter representing the mechanical model, the m_dWholeTime parameter representing the simulation time, and the time step interval representing the m_dDeltaTime parameter interval of the model Wait. These parameters will not change with the simulation time step and are used to control the subsequent file reading and the operation of the entire drawing process. Since particle information can be selectively stored, the size of the memory occupied by each particle is uncertain. There are three marker parameters in the tdec file: li, sudu, and jiaosudu, which are used to determine whether the particle strength, velocity, and angular velocity information are stored in the tdep file. Only when these three parameters are known can you get the proportion of each particle in the file. The length is the particle offset, and the correct reading of the particle information is completed. Therefore, whenever the play() function is called, the tdec file must be read and the offset of the particle must be read, and then the tdep file of the particle must be read. When reading information from the tdep file, each time you read a particle, you need to reread the tdec file to determine what information is currently being read from the particle until all the particle information in a time step is read. Update the read position. Each time the play() function is called, the information in the tdeb file and the tdei file will also be read to obtain all relevant information about the inner boundary and the feed inlet of a time step.


## 4.3. Technical Analysis of Visual Modeling and Adjustment of the Sphere

To implement the manual sphere filling modeling function, we must first create a new dialog resource dedicated to manual modeling of the filling sphere with the help of MFC, and the number is IDD_NONAUTO, and the dialog title is “Manually Fill the Sphere.” This resource creates a dialog box class CNonAuto and encapsulates all the functions that respond to the dialog box operation in this class. In the manual modeling process, even if the operation dialog box is opened, it is necessary to be able to use the main view window of the program. Therefore, the “Manually Fill the Sphere” dialog box should be created as a modeless dialog box. To create a modeless dialog box, first allocate memory for the dlg_NonAuto pointer through the new CNonAuto() operation, then use the dlg_NonAuto- > Create (IDD_NONAUTO) command, and finally use the dlg_NonAuto-command > ShowWindow (SW_SHOWNORMAL) to manually complete the creation of the dialog box. Screen the dialog box for filling the sphere which appears on the top. In addition, in order to facilitate the user to perform manual filling operations correctly according to the content of the 3D scan file, the range of the center position of the sphere must be adjusted in the operation dialog box. The three directions ofx, y, and z must be provided. These ranges are correct. People can determine them after scanning the document and reading it. In the dialog box “Manually Fill the Ball” dialog box at initialization, these range values are assigned to the corresponding static text control. Eight types of text captions are operated by SetWind owText() and range information can be displayed in the corresponding position of the displayed dialog box.In order to facilitate the operation of the sphere data and ensure safety, the program defines a sphere class to encapsulate the attributes of the sphere. The double type member array is used to store the sphere center position attribute of the sphere, and the s_radius member variable is used to represent the radius of the sphere. Create a sphere type container Sp in the CParticle_fillView class. The effective filling balls set by the “Manually Fill the Sphere” dialog box are stored in the container for subsequent display and operation; the Sp1 sphere container type is also created in the CNonAuto dialog box, which is used to store relevant information during manual modeling. Fill the sphere with temporary information. The CNonAuto class adds four member functions: OnBnClickedADD(), OnBnClickedDEL(), OnOK(), and OnBnClickedCancel(), which are used to respond to the “application,” “cancel application,” “OK,” and “cancel” operations in the dialog box.When the “Apply” button is clicked, the OnBnClickedADD() response function is activated and called. If the geometric information of the input ball is legal, put the ball into the container Sp1 through the push_back() operation. The value of the variable sID representing the number of particles plus 1 is used to number the ball, and the value is specified as the corresponding static in the dialog box. The text title of the text control implements the effect of automatic numbering of filled balls. Next, call the Invalidate() function to initiate the refresh operation of the visualization window and redraw all the spheres saved in Sp1 in the RenderScene() function so that the currently set component spheres are displayed on the specified position of the visualization window. The method of implementing “cancel application” is similar to that of “application.” After clicking the button to activate the OnBnClickedDEL() function, if the Sp1 container is not empty, use the Sp1.pop_back() operation to remove a ball element at the end of the Sp1 container, and then redraw all the constituent spheres in Sp1 to move from the visualization window in addition to the effect of the new configuration of the composition of the ball.Finally, if you click the “OK” button, the On OK() function will put all the particle elements in the current Sp1 into the Sp container, determine the effective composition spheres in the filling model, and complete a manual sphere filling modeling operation; if you click “Cancel” button, the OnBnClickedCancel() function clears the temporary container through Sp1.clear() and triggers refreshing of the view window to cancel this modeling operation.After completing the manual modeling of the particle model using the “Manually Fill the Sphere” dialog box, select the file import option in the manual modeling module to save the information about the filled model data to a file. In this operation, add the void CParticle_fillView:OnNonAuto_Filesave() response function, define a CString type variable original name in the function, and specify the default file name of the saved file as the particle name set in the dialog box. The program uses the CFileDialog class constructor to create a file save dialog box and specify the default file name. The specific statement is as follows:CFileDialog∗hFileDlg = newCFileDialog(FALSE, “txt,“originalname, OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, szFileFilter, NULL)After successfully creating a file using the Save File dialog box, use the C++ formatted write function fprintf() to write the position coordinates of the center of each ball and the radius of the ball in floating point format (% f) to the file. Using the fputs() function standardizes the save file format and saves the geometric information of the spheres in the file in units of lines, and each sphere information occupies a line in the file. After importing the model information into the file, you can view the contents of the saved file in the view window through the view calculation result file option under the view function bar. OpenGL provides a method glutSolidSphere() that directly represents the sphere. In the RenderScene() function, the geometric information read from the result file is used to draw all the constituent spheres, which can complete the visual presentation of the entire particle model.The results of manual modeling are saved in a file, and the filled particle model can also be written into a database table using the database import function. For the manually filled multisphere particle model, the program uses ODBC database connection when implementing database storage, which requires the CDatabase and CRecordSet of the database-related classes in the MFC base class library. The CDatabase database class is responsible for connecting and operating the data source; the CRecordSet record set class is responsible for binding the record set extracted from the data source. In the 3D aspheric particle modeling software, there are two tables used to store the manually filled multisphere particle model information, and the table names are lsy_combined_sphere and lsy_combined_particle.When the manually filled particle model is written into the database table, you must first call the Open() function to open the lsy_combined_sphere table, and use the MoveLast() function to move the file pointer to the last record in the table. If the table allows adding data, then import data into the table. After completing data delivery, update the record set through Update(), and call the function Close() to close the table. In order to ensure the consistency of the database, use the previous method to write to the lsy_combined_particle table to ensure that the same primary key data in the two tables is consistent.


## 4.4. Analysis of the Visual Simulation Effect

Since the improved program changes the file reading and writing operations of the original program, it is necessary to perform simulation calculations in the two versions of the program before and after the improvement and to match the corresponding calculation result files for the two different versions of the program in order to separately and perform correct playback. In order to be able to compare the playback effects before and after the improvement, the simulation parameters selected in the two versions of the program must be exactly the same. However, due to the unreproducibility of engineering calculations, even if the simulation process is exactly the same, it is difficult to obtain exactly the same reproduction results. It can only ensure that the overall trend of particle movement is consistent. When playing a file, the current simulation time and actual playing time can be displayed at the upper left corner of the screen at the same time. In the case of the same simulation time, the shorter the actual playback time, the faster the rendered image, and the smoother the playback effect. Aiming at the complexity of the boundary and the number of particles, spherical particles with uniform radius, simple cylindrical barrel boundary, and complex spiral conveyor boundary are used as simulation objects, and experiments are carried out on the playing effects of the program before and after the improvement. The selection of relevant parameters in the simulation calculation process is shown in Table5.Table 5
Simulation calculation parameter selection table.
ParameterGranules and granulesGrain and boundaryNormal stiffness coefficient (N/Kg)520010400Tangential stiffness coefficient (N/Kg)34686934Normal damping coefficient (Ns/m)0.350.58Tangential damping coefficient (Ns/m)0.290.49Coefficient of static friction0.280.36Sliding friction coefficient0.240.25Rolling friction coefficient0.000060.00006Particle density (Kg/m3)1238Particle radius (mm)6Actual movement time of simulated particles (s)7After opening the simulation result file and selecting the entity playback mode, we click the boundary effect setting button to open the boundary effect setting dialog box. We click the color setting button in the dialog box to specify a color for the boundary model. After setting the color for the boundary of the cylinder and the boundary of the screw conveyor, the display effect is shown in Figure4. Through the test, the usability and correctness of the border color setting function are verified.Figure 4
Simple border color setting display effect.After selecting the entity playback mode, the border transparency can be set through the slider operation in the border effect setting dialog box. The display effects of adjusting the boundary of the cylinder and the transparency of the boundary of the screw conveyor are shown in Figure5. Through the test, it can be found that the border transparency display effect meets the setting requirements so that the usability and correctness of the border transparency setting function are verified.Figure 5
Simple border transparency setting display effect.


## 5. Conclusion

With the improvement of the fourth-order partial differential equations studied in this article, the continuous improvement and optimization of the fourth-order partial differential equation simulation analysis software, the continuous expansion of simulation analysis functions, more information is displayed on the screen in a visual manner, and more complex visual effects. After analyzing the research background, in this paper, the evaluation of the fourth-order partial differential equation as the basis algorithm with the help of improved neural network related technology and the construction of visual software simulation technology uses the basic class library MFC of OpenGL and Visual C++ to optimize the existing visualization module and improve its functions and to provide users with better observation and visual experience. In addition, on the basis of the existing 3D aspheric particle modeling software of the research group, related functions have been added to the software file reading module and the sphere filling module. Finally, in order to verify the correctness and usability of the work carried out, the visualization module of the fourth-order partial differential equation simulation analysis software was added to improve the existing visualization module of the software and was compared with the improved fourth-order partial differential equation simulation analysis software so as to simulate the effect and test the relevant new functions.



---

*Source: 6732861-2022-09-16.xml*