A method to improve the efficiency of batch construction of molecular dynamics models of periodic composite materials based on Matlab

By combining Matlab and Lammps programs, and utilizing the tolerance search method and cyclic modeling technique, the problems of low efficiency and errors in the construction of periodic boundary models of composite materials were solved, and efficient and accurate batch construction of molecular dynamics models of periodic composite materials was achieved.

CN117219178BActive Publication Date: 2025-10-28NORTHWEST INSTITUTE FOR NONFERROUS METAL RESEARCH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311199337.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-18
Publication Date
2025-10-28
Estimated Expiration
2043-09-18

AI Technical Summary

Technical Problem

Existing technologies for constructing periodic boundary models of composite materials are computationally complex, time-consuming, error-prone, inefficient, and difficult to implement in batches.

Method used

By combining the Matlab language with the tolerance search method and the Lammps program, the periodic model size of composite materials is automatically calculated and adjusted through iterative modeling, avoiding manual operation and enabling the batch construction of molecular dynamics models of periodic composite materials.

Benefits of technology

This significantly improves the efficiency of constructing periodic composite material models, reduces the amount of mathematical calculations and the possibility of human error, and ensures the accuracy and consistency of the models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117219178B_ABST
    Figure CN117219178B_ABST
Patent Text Reader

Abstract

This invention discloses a method based on Matlab to improve the efficiency of batch construction of molecular dynamics models for periodic composite materials. The method includes: 1. Determining the basic molecular dynamics model dimensions of the composite material; 2. Establishing the undetermined molecular dynamics model; 3. Iterative modeling; 4. Batch modeling. This invention not only reduces the mathematical computation required to calculate the dimensions of periodic boundaries and avoids repetitive, inefficient mechanical operations, but also mitigates the possibility of human error, significantly improving the efficiency of batch construction of composite materials with periodic boundaries. The construction of the composite material model lays the foundation for subsequent molecular dynamics simulations, and the periodic boundary conditions improve the accuracy of molecular dynamics calculations related to mechanical behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of molecular dynamics composite materials technology, and in particular relates to a method based on Matlab to improve the efficiency of batch construction of molecular dynamics models of periodic composite materials. Background Technology

[0002] With the development of computational materials science, numerical simulation methods such as molecular dynamics simulation, first-principles calculations, and machine learning have become effective research tools for studying the design and mechanisms of micro- and nano-scale structures. Among them, molecular dynamics simulation is a relatively mature method for studying the plastic deformation behavior of metals and their composite materials at the nanoscale.

[0003] When studying the mechanical behavior of materials based on molecular dynamics, it is first necessary to construct an initial molecular dynamics model. The construction of this initial model typically employs the concept of micro-elements, using a micro-element model for calculations to reflect the deformation behavior of the bulk material. The micro-element model is equivalent to studying a small region of the bulk material; countless micro-elements stacked periodically in three-dimensional space constitute the bulk material. When using a micro-element model for calculations, it is essential to ensure the periodicity of the model's boundaries. Constructing a periodic boundary model for a single material is relatively easy; simply ensure that the length of the coordinate axis is an integer multiple of the minimum lattice spacing in that direction. However, when a second phase is added to a metal or a multilayered material is formed, creating a composite material, ensuring the periodicity of the composite model's boundary conditions becomes difficult. The main reason is that when multiple materials are combined, the lattice constants of the components are inconsistent. Each component needs to satisfy the least common multiple of its minimum lattice spacing along the orthogonal coordinate axes to guarantee the periodicity of the overall model.

[0004] Literature reports indicate that relative crystal orientation is a significant factor influencing the mechanical properties of composite materials. When the relative crystal orientation of the components in a composite material changes—for example, if one component rotates around the normal direction of the composite interface—it easily rotates into an irregular boundary along the in-plane directions (x and y directions) in an orthogonal coordinate system. In this case, redetermining the periodic model dimensions of the composite material becomes extremely difficult, even through mathematical calculations. Given this situation, once the relative crystal orientation of the composite material changes, the corresponding periodic model dimensions also change. Thus, each adjustment of the relative crystal orientation parameters requires recalculating and re-establishing a model dimension. Batch adjustments of the relative crystal orientation require repeated manual calculations and modifications of the model dimension parameters, involving multiple modeling processes to ensure the periodicity of each model. This workload is enormous, time-consuming, inefficient, and prone to errors. Summary of the Invention

[0005] The technical problem this invention aims to solve is to address the shortcomings of the existing technology by providing a method based on Matlab to improve the efficiency of batch construction of molecular dynamics models for periodic composite materials. This method not only reduces the mathematical computation required to calculate the dimensions of periodic boundaries and avoids repetitive, inefficient mechanical operations, but also eliminates the possibility of human error, significantly improving the efficiency of batch construction of composite materials with periodic boundaries. The construction of composite material models lays the foundation for subsequent molecular dynamics simulations, and the periodic boundary conditions improve the accuracy of molecular dynamics calculations related to mechanical behavior.

[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a method for improving the efficiency of batch construction of molecular dynamics models of periodic composite materials based on Matlab, characterized in that: the method includes the following steps:

[0007] Step 1: Determine the dimensions of the basic molecular dynamics model of the composite material. The process is as follows:

[0008] Step 101: Determine the periodic model dimensions of the reinforcing phase: Determine the two basis vectors and rotation angle of the reinforcing phase. Using Matlab, calculate the multiple periodic model dimensions of the reinforcing phase according to the tolerance search method. The periodic model dimensions of the reinforcing phase include the dimension in the x-direction. and the dimension in the y direction

[0009] Step 102: Determine the periodic model size after adding the metal matrix: Based on the characteristics of the added metal matrix itself, determine the periodic model size of the metal matrix, i.e., the size in the x-direction. and the dimension in the y direction in, a fcc The lattice constant of the added metal matrix;

[0010] Step 103: Analyze the model dimensions in steps 101 and 102. or and or At this time, it can simultaneously ensure that the model dimensions of the reinforcing phase and the metal matrix are periodic, thus obtaining the basic molecular dynamics model dimensions of the composite material; where m is a constant and is a positive integer;

[0011] Step 2: Establish the undetermined molecular dynamics model: Modify the rotation angle of the reinforcing phase and the model size of the basic molecular dynamics model into undetermined variables, and establish the undetermined molecular dynamics model using Lammps; wherein, the undetermined molecular dynamics model size is set as undetermined variable 1, and the rotation angle of the reinforcing phase is set as undetermined variable 2; wherein undetermined variable 1 includes the size of the undetermined molecular dynamics model in the x-direction and the size in the y-direction.

[0012] Step 3, Iterative Modeling: Multiple undetermined molecular dynamics models from Step 2 are established using the Lammps loop;

[0013] Step 4, Batch Modeling: Import the model dimensions of the reinforcing phase rotation angle and the basic molecular dynamics model of the composite material obtained in Step 1 into the multiple undetermined molecular dynamics models in Step 3 to construct molecular dynamics models in batches.

[0014] The above-mentioned method for improving the efficiency of batch construction of periodic composite molecular dynamics models based on Matlab is characterized in that: in step 101, the process of obtaining multiple periodic model dimensions of the reinforcing phase according to the tolerance search method is as follows: a basis coordinate system is established with the two basis vectors of the reinforcing phase as the dimensions in the x-axis direction and the y-axis direction, respectively; the number of lattice points in the basis coordinate system of the reinforcing phase is calculated, and all lattice points are lattice points with integer coordinate values; a search circle is set in the basis coordinate system, and the coordinate dimensions of the lattice points in the tolerance zone within the search circle are the periodic model dimensions of the reinforcing phase.

[0015] The aforementioned method for improving the efficiency of batch construction of molecular dynamics models of periodic composite materials based on Matlab is characterized in that: the center of the search circle is the origin of the basis coordinate system, the search radius is R, and... Where k is the search factor and h is the altitude of the shorter side of the parallelogram formed by the two basis vectors.

[0016] The beneficial effects of this invention are that it not only reduces the amount of mathematical calculation required to determine the dimensions of periodic boundaries and avoids repetitive, low-efficiency mechanical operations, but also eliminates the possibility of human error, significantly improving the efficiency of batch construction of composite materials with periodic boundaries. The construction of the composite material model lays the foundation for subsequent molecular dynamics simulations, and the periodic boundary conditions improve the accuracy of molecular dynamics calculations related to mechanical behavior.

[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0018] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0019] like Figure 1 The method shown here is based on Matlab to improve the efficiency of batch construction of molecular dynamics models of periodic composite materials. The method includes the following steps:

[0020] Step 1: Determine the dimensions of the basic molecular dynamics model of the composite material. The process is as follows:

[0021] Step 101: Determine the periodic model dimensions of the reinforcing phase: Determine the two basis vectors and rotation angle of the reinforcing phase. Using Matlab, calculate the multiple periodic model dimensions of the reinforcing phase according to the tolerance search method. The periodic model dimensions of the reinforcing phase include the dimension in the x-direction. and the dimension in the y direction

[0022] Step 102: Determine the periodic model size after adding the metal matrix: Based on the characteristics of the added metal matrix itself, determine the periodic model size of the metal matrix, i.e., the size in the x-direction. and the dimension in the y direction in, a fcc The lattice constant of the added metal matrix;

[0023] Step 103: Analyze the model dimensions in steps 101 and 102. or and or At this time, it can simultaneously ensure that the model dimensions of the reinforcing phase and the metal matrix are periodic, thus obtaining the basic molecular dynamics model dimensions of the composite material; where m is a constant and is a positive integer;

[0024] In step one, calculating the periodic model size of the composite material using Matlab is crucial for improving modeling efficiency. The approach to calculating the periodic model size of the composite material using Matlab is as follows: first, find a series of model box sizes that allow the rotated reinforcing phase to form a periodic structure; then, select the size from these sizes that also allows the metal matrix to achieve periodicity and has the best matching degree as the final model size.

[0025] In step 103, as long as the dimensions in the x-direction and y-direction of the enhanced phase are respectively and A (close to) integer multiple of this can ensure that the metal matrix part constitutes a periodicity.

[0026] In step one, graphene is selected as the reinforcing phase, and a list of candidate graphene sizes is selected to ensure that the metal matrix forms a periodic pattern. Only the corresponding sizes in the candidate graphene size list need to be very close. and These dimensions can be integer multiples of each other, meaning that within a specific tolerance range, these dimensions can ensure that graphene and the metal matrix simultaneously form a periodicity.

[0027] In addition, if multiple sizes can meet this requirement simultaneously in step one, other additional filtering conditions can be added, such as limiting the minimum size (because a simulation box that is too small is detrimental to the accuracy of energy calculation), limiting the maximum size (due to considerations of computational load, if the simulation box is too large, the computational load will be too large), selecting the result with the smallest overall error, etc., to select the final simulation box size to be used.

[0028] Step 2: Establish the undetermined molecular dynamics model: Modify the rotation angle of the reinforcing phase and the model size of the basic molecular dynamics model into undetermined variables, and establish the undetermined molecular dynamics model using Lammps; wherein, the undetermined molecular dynamics model size is set as undetermined variable 1, and the rotation angle of the reinforcing phase is set as undetermined variable 2; wherein undetermined variable 1 includes the size of the undetermined molecular dynamics model in the x-direction and the size in the y-direction.

[0029] In step two, the undetermined molecular dynamics model size is set as undetermined variable 1, meaning that the model created at this stage is a model box with undetermined geometric dimensions. The rotation angle of the reinforcing phase is set as undetermined variable 2, used to set the corresponding basis vectors of the rotated graphene. The output model file name can also be set as undetermined variable 3 to specify the filename of the output model.

[0030] Step 3, Iterative Modeling: Multiple undetermined molecular dynamics models from Step 2 are established using the Lammps loop;

[0031] In step three, the Lammps program is modified into a loopable Lammps program. The `label` command in Lammps marks the loop, and the `next` and `jump` commands are used to enter the labeled location, initiating loop-controlled modeling. Loop-controlled modeling via the `label`, `next`, and `jump` commands in Lammps means that these commands execute loop control; that is, they read the command line content after the label mark and start a new round of modeling.

[0032] Step 4, Batch Modeling: Import the model dimensions of the reinforcing phase rotation angle and the basic molecular dynamics model of the composite material obtained in Step 1 into the multiple undetermined molecular dynamics models in Step 3 to construct molecular dynamics models in batches.

[0033] In step four, the periodic model dimensions are saved as separate files. These files are then read into the Lammps modeling program using the `variable` command. Modifying the file allows for changes to the model's geometric dimensions, and provides a clearer and more concise way to understand the dimensional information. Assigning meaningful filenames to variable 3 ensures independent naming for each model. Using filenames with relative orientation information establishes a connection between different model dimensions and the output model, facilitating rapid model identification.

[0034] This invention not only reduces the mathematical computation required to calculate the dimensions of periodic boundaries and avoids repetitive, inefficient mechanical operations, but also eliminates the possibility of human error, significantly improving the efficiency of batch construction of composite materials with periodic boundaries. The construction of the composite material model lays the foundation for subsequent molecular dynamics simulations, and the periodic boundary conditions improve the accuracy of molecular dynamics calculations related to mechanical behavior.

[0035] This invention has a wide range of applications, applicable to both two-dimensional and three-dimensional composite materials. It is also applicable to single-phase materials with different crystal orientations (rotational orientation θ), such as constructing single-crystal models that change the crystal orientation θ, and bicrystalline molecular dynamics periodic models with twisted grain boundaries.

[0036] In this embodiment, the process of obtaining multiple periodic model dimensions of the reinforcing phase in step 101 according to the tolerance search method is as follows: a basis coordinate system is established with the two basis vectors of the reinforcing phase as the dimensions in the x-axis direction and the y-axis direction, respectively; the number of lattice points in the basis coordinate system of the reinforcing phase is calculated, and all lattice points are lattice points with integer coordinate values; a search circle is set in the basis coordinate system, and the coordinate dimensions of the lattice points in the tolerance band within the search circle are the periodic model dimensions of the reinforcing phase.

[0037] In practical applications, if the reinforcing phase lattice points within the search circle fall within the x-axis tolerance zone, then the spatial coordinates of these reinforcing phase lattice points will satisfy periodicity in the y-direction. Similarly, if the reinforcing phase lattice points within the search circle fall within the y-axis tolerance zone, then the spatial coordinates of these reinforcing phase lattice points will satisfy periodicity in the x-direction. Lattice points falling within the x-axis tolerance zone are called x-direction size candidate points, and lattice points falling within the y-axis tolerance zone are called y-direction size candidate points. The distance between these reinforcing phase size candidate points and the axis is denoted as the error of the candidate size relative to the reinforcing phase portion. A series of candidate points can be searched as extensively as possible to form a list of reinforcing phase candidate model box sizes, so that sizes that also allow the metal matrix to achieve periodicity can be selected in subsequent operations.

[0038] The tolerance band is the thickness corresponding to the model boundary when creating a model using LAMMPS, within which atoms exhibit periodicity. Typically, the width of the tolerance band is 0.1 angstroms.

[0039] In this embodiment, the center of the search circle is the origin of the basis vector coordinate system, and the search radius is R. Where k is the search factor and h is the altitude of the shorter side of the parallelogram formed by the two basis vectors.

[0040] The above description is merely a preferred embodiment of the present invention and does not constitute any limitation on the present invention. Any simple modifications, alterations, or equivalent structural changes made to the above embodiments based on the technical essence of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for improving the efficiency of batch construction of molecular dynamics models of periodic composite materials based on Matlab, characterized in that, The method includes the following steps: Step 1: Determine the dimensions of the basic molecular dynamics model of the composite material. The process is as follows: Step 101: Determine the periodic model dimensions of the reinforcing phase: Determine the two basis vectors and rotation angle of the reinforcing phase. Using Matlab, calculate the multiple periodic model dimensions of the reinforcing phase according to the tolerance search method. The periodic model dimensions of the reinforcing phase include the dimension in the x-direction. and the dimension in the y direction Step 102: Determine the periodic model size after adding the metal matrix: Based on the characteristics of the added metal matrix itself, determine the periodic model size of the metal matrix, i.e., the size in the x-direction. and the dimension in the y direction in, a fcc The lattice constant of the added metal matrix; Step 103: Analyze the model dimensions in steps 101 and 102. or and or At this time, it can simultaneously ensure that the model dimensions of the reinforcing phase and the metal matrix are periodic, thus obtaining the basic molecular dynamics model dimensions of the composite material; where m is a constant and is a positive integer; Step 2: Establish the undetermined molecular dynamics model: Modify the rotation angle of the reinforcing phase and the model size of the basic molecular dynamics model into undetermined variables, and establish the undetermined molecular dynamics model using Lammps; wherein, the undetermined molecular dynamics model size is set as undetermined variable 1, and the rotation angle of the reinforcing phase is set as undetermined variable 2; wherein undetermined variable 1 includes the size of the undetermined molecular dynamics model in the x-direction and the size in the y-direction. Step 3, Iterative Modeling: Multiple undetermined molecular dynamics models from Step 2 are established using the Lammps loop; Step 4, Batch Modeling: Import the model dimensions of the reinforcing phase rotation angle and the basic molecular dynamics model of the composite material obtained in Step 1 into the multiple undetermined molecular dynamics models in Step 3 to construct molecular dynamics models in batches.

2. The method for improving the efficiency of batch construction of molecular dynamics models of periodic composite materials based on Matlab according to claim 1, characterized in that: In step 101, the process of obtaining multiple periodic model dimensions of the reinforcing phase according to the tolerance search method is as follows: a basis coordinate system is established with the two basis vectors of the reinforcing phase as the dimensions in the x-axis direction and the y-axis direction, respectively; the number of lattice points in the basis coordinate system of the reinforcing phase is calculated, and all lattice points are lattice points with integer coordinate values; a search circle is set in the basis coordinate system, and the coordinate dimensions of the lattice points in the tolerance band within the search circle are the periodic model dimensions of the reinforcing phase.

3. The method for improving the efficiency of batch construction of molecular dynamics models of periodic composite materials based on Matlab according to claim 2, characterized in that: The center of the search circle is the origin of the basis coordinate system, and the search radius is R. Where k is the search factor and h is the altitude of the shorter side of the parallelogram formed by the two basis vectors.

Citation Information

Patent Citations

  • Method for improving molecular dynamics batch modeling efficiency based on Shell language

    CN109920486A

  • Anisotropic single crystal material molecular dynamics model establishment method

    CN114065553A