Particle simulation method and device, electronic equipment, storage medium and program product
By dynamically setting the cutoff radius range and interaction weights, the problem of inaccurate simulation results caused by the non-uniformity of particle system density is solved, and efficient and accurate particle simulation in different particle systems is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- MOORE THREADS TECH CO LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-05-05
AI Technical Summary
Existing particle simulation technology struggles to ensure the accuracy of inter-particle interaction forces when dealing with particle systems of non-uniform density, thus affecting the accuracy of simulation results.
By dynamically setting the cutoff radius range, the interaction weights are determined based on the particle distance, thereby determining the interaction forces between particles, which is applicable to different particle systems.
It improves the accuracy and computational efficiency of particle simulation tasks and is applicable to various particle systems, especially particle systems with non-uniform density.
Smart Images

Figure CN121983154A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a particle simulation method and apparatus, electronic equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] In recent years, particle simulation technology has been gradually applied to various technical fields. It is an important technique in computer graphics, physics simulation, and computational science, representing the overall dynamics of complex systems by simulating the individual behaviors and interactions of a large number of tiny particles. Therefore, the behavior and interactions between particles significantly affect the accuracy of particle simulations.
[0003] In molecular dynamics (MD) simulations, potential functions are often used to sum the forces between particles to calculate the interactions between them. Since these forces decay with distance, a cutoff radius is typically introduced to reduce computational complexity; when the distance between particles exceeds this radius, the interaction force is considered negligible. However, in real-world applications, various particle systems exist, some with uniform density and others with non-uniform density. For non-uniform systems, the accuracy of the determined interactions between particles in different systems is difficult to guarantee, potentially affecting the accuracy of simulation results for particle simulation tasks based on these interactions. Summary of the Invention
[0004] This disclosure provides a particle simulation method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] Firstly, this disclosure provides a particle simulation method, including:
[0006] Based on the first position information of the first particle and the second position information of the second particle, the particle distance between the first particle and the second particle is determined, wherein the first particle and the second particle are any two of the multiple simulation particles to be analyzed in the simulation task.
[0007] Based on the preset cutoff radius range and particle distance, the interaction weight between the first particle and the second particle is determined, wherein the interaction weight changes continuously within the cutoff radius range as the particle distance changes.
[0008] The interaction force between the first and second particles is determined based on the interaction weights.
[0009] Based on the interaction forces between multiple simulated particles, a simulation task is executed to obtain the simulation results.
[0010] Secondly, this disclosure provides a particle simulation device, comprising:
[0011] The distance determination module is configured to determine the particle distance between the first particle and the second particle based on the first position information of the first particle and the second position information of the second particle, wherein the first particle and the second particle are any two of the multiple simulation particles to be analyzed in the simulation task;
[0012] The weight determination module is configured to determine the interaction weight between the first particle and the second particle based on a preset cutoff radius range and particle distance, wherein the interaction weight changes continuously within the cutoff radius range as the particle distance changes.
[0013] The force determination module is configured to determine the force between the first particle and the second particle based on the interaction weights.
[0014] The simulation module is configured to perform simulation tasks based on the interaction forces between multiple simulated particles and obtain the simulation results of the simulation tasks.
[0015] Thirdly, this disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the particle simulation method described above.
[0016] Fourthly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the aforementioned particle simulation method.
[0017] Fifthly, this disclosure provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device executes the particle simulation method described above.
[0018] The embodiments provided in this disclosure can dynamically set the cutoff radius interval. After determining the particle distance between the first particle and the second particle, the interaction weight between the first particle and the second particle is determined according to the set cutoff radius interval to measure the importance of the interaction force between the first particle and the second particle. Thus, the interaction force between the first particle and the second particle is determined based on the interaction weight. By determining the interaction force between the first particle and the second particle through the cutoff radius interval and the interaction weight, the corresponding simulation task is executed based on the interaction force between multiple simulated particles, and the simulation results are obtained. This achieves dynamic setting of the cutoff radius interval and determines the interaction force between each pair of particles according to the actual situation of the particle system. While ensuring the accuracy of the interaction force between particles, it is applicable to different particle systems, improving the accuracy of particle simulation tasks.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0020] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the embodiments of the present disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:
[0021] Figure 1 A flowchart of a particle simulation method provided in this disclosure embodiment;
[0022] Figure 2 A graph of interaction weights provided for embodiments of this disclosure;
[0023] Figure 3 A flowchart illustrating a particle simulation method provided in this embodiment of the disclosure;
[0024] Figure 4 A block diagram of a particle simulation device provided in an embodiment of this disclosure;
[0025] Figure 5 This is a block diagram of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0026] To enable those skilled in the art to better understand the technical solutions of this disclosure, exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of this disclosure to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0027] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0028] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0029] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Words such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.
[0030] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.
[0031] Molecular dynamics simulation, as an important computational simulation method, is widely used in many fields such as materials science, biophysics, chemical engineering, and drug design. This method uses numerical solutions to track the trajectory of each particle in a system over time, thereby revealing the structure, dynamics, and thermodynamic properties of matter from a microscopic perspective. During the simulation, the interaction forces between particles or molecules are the key factors determining the behavior of the system, and these interactions are typically described and calculated using potential functions for each pair of particles.
[0032] Since interparticle forces typically decay rapidly with increasing distance, summing all particle pairs across the entire space under limited computational resources would impose an extremely high computational burden. To improve computational efficiency, current practical applications commonly employ the technique of setting a cutoff radius. This involves setting a distance threshold; when the distance between particles exceeds this threshold, their interactions are considered negligible, thus eliminating the need for detailed calculations. The fixed cutoff method is currently the most common approach. To accelerate the distance determination process, parallel algorithms such as neighbor lists or Verlet lists are typically used for computation, thereby improving efficiency.
[0033] However, the method of implementing a fixed cutoff radius is not applicable to all particle systems. For particle systems with uneven particle density distribution, there will be problems such as unbalanced computational load and large boundary errors, which will further affect the subsequent particle simulation process.
[0034] According to the particle simulation method of this disclosure, by dynamically setting the cutoff radius range, the interaction force between every two particles can be determined in different particle systems, ensuring the accuracy of the interaction force between particles and improving the accuracy of subsequent particle simulations, thus achieving generalization applicable to different particle systems. In the process of determining the interaction force between particles, the interaction weight between the two particles is determined based on the particle distance and the cutoff radius range, and the interaction force between the two particles is determined based on the interaction weight and the cutoff radius range. This allows subsequent calculations to be performed based on the importance of the interaction force between the two particles, further improving the accuracy of determining the interaction force between particles. In addition, the resource load of the graphics processing unit (GPU) can be balanced according to the importance of the interaction force between particles, improving the utilization of the GPU.
[0035] The particle simulation method according to embodiments of this disclosure can be executed by electronic devices such as terminal devices or servers. Terminal devices can be in-vehicle devices, user equipment (UE), mobile devices, user terminals, terminals, cellular phones, cordless phones, personal digital assistants (PDAs), handheld devices, computing devices, in-vehicle devices, wearable devices, etc. This method can be implemented by a processor calling computer-readable program instructions stored in memory. Alternatively, the method can be executed by a server.
[0036] Figure 1 A flowchart illustrating a particle simulation method provided in an embodiment of this disclosure. See also... Figure 1 The method specifically includes the following steps:
[0037] Step 102: Determine the particle distance between the first particle and the second particle based on the first position information of the first particle and the second position information of the second particle.
[0038] In practical applications, particle simulation can be applied to multiple simulation scenarios, such as meteorological simulation scenarios, protein simulation scenarios, and chemical simulation scenarios. The particle simulation method provided in this disclosure can be used to execute the corresponding simulation tasks in these scenarios. For example, meteorological simulation tasks in meteorological simulation scenarios, where the simulated particles are air particles, water particles, wind particles, etc.; protein simulation tasks involving protein ligand docking in protein simulation scenarios, where the simulated particles are protein particles (receptors), small molecules (ligands), etc.; and ionic solvent simulation tasks and material modeling simulation tasks in chemical simulation scenarios.
[0039] In this context, the first particle and the second particle are any two of the multiple simulated particles to be analyzed in the simulation task; the simulation task is any one of the aforementioned simulation tasks, specifically determined based on the actual application; this disclosure does not limit the type of simulation task. The first position information is the position coordinates of the first particle; the second position information is the position coordinates of the second particle; and the particle distance is the distance between the first particle and the second particle.
[0040] Specifically, the motion states of the first and second particles at the current moment are obtained. These motion states include the simulated particle's position, velocity, and acceleration. From these motion states, the first position information of the first particle and the second position information of the second particle are determined. Based on these second position information, the particle distance between the first and second particles is then determined. In practical applications, the distance between the first and second particles can be directly calculated using their position coordinates.
[0041] In this embodiment of the disclosure, by acquiring the motion states of the first particle and the second particle, the first position information of the first particle and the second position information of the second particle are determined, and the particle distance between the first particle and the second particle is determined based on the first position information and the second position information, so as to facilitate subsequent calculation of whether it is necessary to consume GPU resources to measure the interaction force between the first particle and the second particle.
[0042] Step 104: Determine the interaction weight between the first particle and the second particle based on the preset cutoff radius range and particle distance.
[0043] As mentioned above, the method of determining whether interparticle forces can be ignored by setting a fixed cutoff radius is not applicable to various particle systems. Therefore, in this embodiment of the present disclosure, a cutoff radius range can be preset. Particles whose distances fall within the cutoff radius range and particles with smaller distances can be identified by the cutoff radius range. In this way, the interparticle forces identified based on the cutoff radius range can be determined in subsequent processes. This reduces the workload of calculating interparticle forces and further enhances the accuracy of identifying particles with calculable interparticle forces.
[0044] The cutoff radius range consists of the minimum and maximum cutoff radii; the interaction weight is used to measure the importance of a particle to an interaction.
[0045] In one specific embodiment provided in this disclosure, determining the interaction weight between the first particle and the second particle based on a preset cutoff radius range and particle distance includes: when the particle distance is less than or equal to the minimum cutoff radius, determining the interaction weight between the first particle and the second particle as a preset value, wherein the preset value is greater than 0; when the particle distance is greater than or equal to the maximum cutoff radius, determining the interaction weight between the first particle and the second particle as 0; and when the particle distance is greater than the minimum cutoff radius and less than the maximum cutoff radius, determining the interaction weight between the first particle and the second particle based on the particle distance, the minimum cutoff radius, and the maximum cutoff radius.
[0046] In practical applications, the cutoff radius interval divides the particle distance into three ranges: particles with a distance less than or equal to the minimum cutoff radius, indicating a relatively large inter-particle force; particles with a distance within the cutoff radius interval, meaning a distance greater than the minimum cutoff radius but less than the maximum cutoff radius, indicating a non-negligible inter-particle force; and particles with a distance greater than or equal to the maximum cutoff radius, indicating a small or even non-existent inter-particle force that can be disregarded. Based on this, the particle simulation method provided in this embodiment determines the inter-particle interaction weights by classifying particle distance into these three cases.
[0047] The preset value refers to a fixed value of the interaction weight that is set in advance, and the preset value is greater than 0. For example, the preset value can be set to 1, 10, etc., and the specific value is determined according to the actual application.
[0048] Specifically, if the particle distance between the first and second particles is less than or equal to the minimum cutoff radius, it indicates that the interaction force between the first and second particles is strong. In this case, the interaction weight between the first and second particles is set to a preset value, such as 1. If the particle distance between the first and second particles is greater than or equal to the maximum cutoff radius, it indicates that the interaction force between the first and second particles is weak, or even negligible. In this case, the interaction weight between the first and second particles is set to 0. If the particle distance between the first and second particles is greater than the minimum cutoff radius but less than the maximum cutoff radius, it indicates that the interaction force between the first and second particles is strong, but weaker than when the particle distance is less than or equal to the minimum cutoff radius. In this case, the interaction weight between the first and second particles needs to be determined based on the particle distance, the minimum cutoff radius, and the maximum cutoff radius.
[0049] In addition, in practical applications, fixed interaction weights can be set for the above three cases respectively. When the particle distance between the first particle and the second particle is greater than or equal to the maximum cutoff radius, the interaction weight between the first particle and the second particle is still set to 0. When the particle distance between the first particle and the second particle is less than or equal to the minimum cutoff radius, and when the particle distance between the first particle and the second particle is greater than the minimum cutoff radius but less than the maximum cutoff radius, the interaction weight between the first particle and the second particle is set to a value greater than 0, and the first weight (i.e., the interaction weight when the particle distance between the first particle and the second particle is less than or equal to the minimum cutoff radius) is greater than the second weight (i.e., the interaction weight when the particle distance between the first particle and the second particle is greater than the minimum cutoff radius but less than the maximum cutoff radius). For example, the first weight can be set to 1, and the second weight can be set to 0.5, etc. The specific values of the first weight and the second weight are determined according to the actual application situation, and this embodiment of the disclosure does not limit them here.
[0050] In this embodiment of the disclosure, the distance between different particles is divided into three ranges by setting a cutoff radius range. After determining the range to which the particle distance between the first particle and the second particle (particle pair) belongs, the interaction weights of the first particle and the second particle within the range to be determined are determined, thereby improving the accuracy of particle distance division and the accuracy of interaction weight determination.
[0051] Furthermore, the determination of the interaction weight between the first particle and the second particle is explained below when the particle distance between the first particle and the second particle is greater than the minimum cutoff radius and less than the maximum cutoff radius (i.e., the particle distance between the first particle and the second particle is within the cutoff radius range).
[0052] In one specific embodiment provided in this disclosure, the interaction weight between the first particle and the second particle is determined based on the particle distance, the minimum cutoff radius, and the maximum cutoff radius, including: determining the sum of the radii of the minimum cutoff radius and the maximum cutoff radius, and the difference between the radii of the minimum cutoff radius and the maximum cutoff radius; and processing the particle distance, the sum of the radii, and the difference between the radii based on a smoothing function to obtain the interaction weight.
[0053] The radius sum is the sum of the minimum and maximum cutoff radii; the radius difference is the difference between the maximum and minimum cutoff radii. Smoothing functions include, but are not limited to, hyperbolic tangent functions, cosine functions, polynomial functions, exponential functions, and error functions.
[0054] Specifically, the minimum cutoff radius is added to the maximum cutoff radius to obtain the radius sum, and the maximum cutoff radius is subtracted from the minimum cutoff radius to obtain the radius difference. A smoothing function (any of the functions mentioned above) is used to calculate the particle distance between the first and second particles, the calculated radius sum, and the radius difference to obtain the interaction weight between the first and second particles. See Formula 1 below for details:
[0055] Formula 1
[0056] in, For particles and particles Interaction weights between them For particles and particles The distance between particles, It is the hyperbolic tangent function. This is a smoothing factor used to control the steepness of the transition region. Minimum cutoff radius, This is the maximum cutoff radius.
[0057] The interaction weights between the first and second particles can be obtained by calculating the particle distance, radius, and radius difference between the first and second particles according to Formula 1 above.
[0058] Furthermore, by calculating the first derivative of Formula 1 above, we obtain the following Formula 2:
[0059] Formula 2
[0060] in, Interaction weights The first derivative. Based on Equation 2, it can be seen that the interaction weight function after differentiation is continuous and smooth, ensuring the continuity of subsequent particle potential energy and interactions.
[0061] See Figure 2 , Figure 2 A graph of interaction weights provided in this embodiment of the disclosure. Figure 2 The graphs show the interaction weights of the hyperbolic tangent function obtained with six different sets of smoothing factors, minimum cutoff radii, and maximum cutoff radii. Curve a represents the curve generated when the smoothing factor is 8.0, the minimum cutoff radius is 2.0 nm, and the maximum cutoff radius is 10.0 nm; curve b represents the curve generated when the smoothing factor is 15.0, the minimum cutoff radius is 1.0 nm, and the maximum cutoff radius is 9.0 nm; and curve c represents the curve generated when the smoothing factor is 8.0 and the minimum cutoff radius is... Curve d is generated when the minimum cutoff radius is 1.0 nm and the maximum cutoff radius is 9.0 nm; curve e is generated when the minimum cutoff radius is 1.0 nm and the maximum cutoff radius is 7.0 nm; curve f is generated when the minimum cutoff radius is 1.0 nm and the maximum cutoff radius is 7.0 nm; and curve d is generated when the minimum cutoff radius is 12.0 nm and the maximum cutoff radius is 1.0 nm; and curve f is generated when the minimum cutoff radius is 2.0 nm and the maximum cutoff radius is 6.0 nm. Figure 2 It can be seen that even if the smoothing factor has different values, the interaction weights calculated based on Formula 1 above can be infinitely close to 1 at the minimum cutoff radius and infinitely close to 0 at the maximum cutoff radius. Furthermore, the function is continuously second-differentiable near the critical points of the minimum and maximum cutoff radii, ensuring a smooth transition in the subsequent determination of particle potential energy and forces, and avoiding errors introduced by abrupt changes.
[0062] In this embodiment of the present disclosure, when the particle distance between the first particle and the second particle is within the cutoff radius range, a smoothing function is used to calculate the particle distance between the first particle and the second particle, the sum of the radii of the minimum cutoff radius and the maximum cutoff radius, and the radius difference. This makes the calculated interaction weight infinitely close to 1 at the minimum cutoff radius and infinitely close to 0 at the maximum cutoff radius, and the function is continuously differentiable, thus avoiding errors introduced by abrupt changes and improving the accuracy of the calculation.
[0063] Step 106: Determine the interaction force between the first and second particles based on the interaction weights.
[0064] As mentioned above, after determining the interaction weights between the first and second particles using a smoothing function, it can be further determined that the interaction weights are infinitely close to 1 at the minimum cutoff radius and infinitely close to 0 at the maximum cutoff radius. Therefore, combined with the attached... Figure 2The interaction weights of particle pairs with particle distances less than or equal to the minimum cutoff radius can be directly set to 1, and the interaction weights of particle pairs with particle distances greater than or equal to the maximum cutoff radius can be set to 0. For particle pairs with particle distances within the cutoff radius range, the corresponding interaction weights are determined according to Formula 1 above (the hyperbolic tangent function can be replaced with other smooth functions). Further, after determining the interaction weights between the first and second particles, the interaction force between the first and second particles is determined based on these interaction weights. The specific implementation method is as follows:
[0065] In one specific embodiment provided in this disclosure, determining the force between the first particle and the second particle based on the interaction weight includes: determining the force as 0 when the interaction weight is 0; and determining the target particle potential energy of the first particle based on the interaction weight and determining the force based on the target particle potential energy when the interaction weight is not 0.
[0066] The target particle potential energy refers to the improved particle potential energy obtained by superimposing interaction weights on the initial particle potential energy. The initial particle potential energy refers to the particle potential energy calculated directly without superimposing interaction weights.
[0067] Specifically, if the interaction weight between the first and second particles is determined to be 0, it means that the force between them can be ignored. Therefore, the force between them can be directly set to 0. If the interaction weight between them is not 0, it means that the interaction weight is 1, calculated based on Formula 1 above, or is another value. In this case, the target particle potential energy of the first particle can be determined based on the interaction weight, and the target particle potential energy can be converted into the force between the first and second particles.
[0068] It should be noted that after determining the interaction weights between the first and second particles, a swarm of nearest-neighbor particles corresponding to the first particle can be constructed based on these interaction weights. That is, particles with non-zero interaction weights with the first particle are identified as its nearest neighbors. This allows the subsequent determination of forces to be performed in parallel on the nearest neighbors of the first particle, improving computational efficiency. Similarly, after determining the particle distances and comparing them with the minimum and maximum cutoff radii, a swarm of nearest-neighbor particles corresponding to the first particle can also be constructed. In this case, the determination of interaction weights and subsequent determination of forces can be performed in parallel on the nearest neighbors of the first particle, further improving computational efficiency.
[0069] In this embodiment, after determining the interaction weights, the force of particles with an interaction weight of 0 can be directly determined as 0, while the force of particles with non-zero interaction weights can be determined based on the interaction weights. This saves computational effort and resources for determining the force of particles with an interaction weight of 0, and improves the computational efficiency for determining the force between every two simulated particles.
[0070] Furthermore, in a specific embodiment provided in this disclosure, determining the target particle potential energy of the first particle based on the interaction weight, and determining the force based on the target particle potential energy, includes: determining the initial particle potential energy of the first particle based on the interaction weight; determining the target particle potential energy of the first particle based on the interaction weight and the initial particle potential energy; and determining the force between the first particle and the second particle based on the target particle potential energy and the particle distance.
[0071] Specifically, after determining the interaction weights between the first and second particles, the initial particle potential energy of the first particle is determined based on the interaction weights. The target particle potential energy is obtained by superimposing the interaction weights onto the initial particle potential energy. Furthermore, the interaction force between the first and second particles is determined based on the target particle potential energy and the particle distance between the first and second particles. Further details on how the target particle potential energy is determined can be found in section 3 below.
[0072] Formula 3
[0073] in, For particles and particles The potential energy of the target particle between them For particles and particles The initial particle potential energy between the particles. After determining the target particle potential energy, the interaction force between the particles is further determined based on the relationship between potential energy and force. Since the interaction force is the negative gradient (i.e., negative derivative) of the potential energy, the interaction force between the first and second particles can be calculated by differentiating the target particle potential energy and the particle distance between the first and second particles respectively. The method for determining the interaction force between particles based on the target particle potential energy and the particle distance between the first and second particles can be found in the following formula 4:
[0074] Formula 4
[0075] in, For particles and particles The forces between them. Substituting Equation 3 into Equation 4 and expanding, we obtain Equation 5:
[0076] Formula 5
[0077] As can be seen from Formula 5 above, whether the interparticle force is continuous is mainly affected by whether the interaction weight function is differentiable. The particle simulation method provided in this embodiment determines the continuous and differentiable interaction weight function through a smoothing function, which is beneficial to realize the continuity of the determined interparticle force, improve the accuracy of determining the interparticle force, and improve the accuracy of subsequent particle simulation based on the determined interparticle force.
[0078] The following section will further explain the specific implementation of determining the initial particle potential energy of the first particle based on the interaction weights.
[0079] In one specific embodiment provided in this disclosure, determining the initial particle potential energy of the first particle based on the interaction weights includes: determining a target calculation method for calculating the initial particle potential energy based on the interaction weights and a preset weight threshold; and determining the initial particle potential energy based on the target calculation method.
[0080] Among them, the preset weight threshold refers to the pre-set interaction weight threshold, which is used to determine the target calculation method for calculating the initial particle potential energy; the target calculation method includes, but is not limited to, double precision calculation method, single precision calculation method, polynomial function calculation method, etc.
[0081] Specifically, after determining the interaction weights between the first and second particles, a preset weight threshold is obtained, and the interaction weights are compared with the preset weight thresholds to determine the target calculation method for calculating the initial particle potential energy. As mentioned above, the interaction weights are used to measure the importance of the force between the first and second particles. That is, the higher the interaction weight, the higher the importance of the force, and therefore the higher the accuracy requirement for the subsequent determination of the initial particle potential energy. Conversely, the lower the interaction weight, the lower the importance of the force, and therefore the lower the accuracy requirement for the subsequent determination of the initial particle potential energy. Therefore, determining the target calculation method for the initial particle potential energy based on the interaction weights is actually based on the accuracy requirement for the initial particle potential energy. After determining the target calculation method for the initial particle potential energy, the initial particle potential energy can be calculated based on the determined target calculation method.
[0082] In this embodiment of the disclosure, before determining the initial particle potential energy, the accuracy requirement for determining the initial particle potential energy can be evaluated based on the interaction weights between particles. Then, a target calculation method is determined based on the accuracy requirement for the initial particle potential energy, and the initial particle potential energy is calculated based on the target calculation method, so that the accuracy requirement for the initial particle potential energy is adapted to the interaction force between particles.
[0083] Furthermore, in a specific embodiment provided in this disclosure, determining a target calculation method for calculating the initial particle potential energy based on the interaction weight and a preset weight threshold includes: determining a target calculation method in a first candidate calculation set when the interaction weight is greater than or equal to the preset weight threshold, wherein the calculation accuracy of multiple calculation methods in the first candidate calculation set is within a first accuracy range and the calculation speed is within a first speed range; and determining a target calculation method in a second candidate calculation set when the interaction weight is less than the preset weight threshold, wherein the calculation accuracy of multiple calculation methods in the second candidate calculation set is within a second accuracy range and the calculation speed is within a second speed range, wherein the first accuracy range is higher than the second accuracy range and the first speed range is lower than the second speed range.
[0084] The first and second candidate computation sets each include various calculation methods for calculating the initial particle potential energy. The first precision range refers to the achievable precision range of the initial particle potential energy calculated using the methods in the first candidate computation set, such as 80%-100%. The first velocity range refers to the achievable velocity range of the initial particle potential energy calculated using the methods in the first candidate computation set, such as 0.3 milliseconds-0.4 milliseconds. The second precision range refers to the achievable precision range of the initial particle potential energy calculated using the methods in the second candidate computation set, such as 60%-80%. The second velocity range refers to the achievable velocity range of the initial particle potential energy calculated using the methods in the second candidate computation set, such as 0.1 milliseconds-0.2 milliseconds. In practical applications, the first candidate computation set includes double-precision calculation methods, polynomial function calculation methods, etc., while the second candidate computation set includes single-precision calculation methods, etc.
[0085] Specifically, if the interaction weight between the first particle and the second particle is greater than or equal to a preset weight threshold, it indicates that the calculation accuracy of the initial particle potential energy is required to be high. In this case, a target calculation method for calculating the initial particle potential energy is determined in the first candidate calculation set, such as a double-precision calculation method. If the interaction weight between the first particle and the second particle is less than a preset weight threshold, it indicates that the calculation speed of the initial particle potential energy is required to be high. In this case, a target calculation method for calculating the initial particle potential energy is determined in the second candidate calculation set, such as a single-precision calculation method.
[0086] In this embodiment of the disclosure, by pre-constructing a first candidate computation set and a second candidate computation set, the requirements for the accuracy and speed of the initial particle potential energy calculation are evaluated based on the different interaction weights between particles. The target calculation method is determined in the first candidate computation set and the second candidate computation set, so that the calculated initial particle potential energy can meet the user's expectations and improve the user experience.
[0087] Step 108: Execute the simulation task based on the interaction forces between multiple simulated particles to obtain the simulation results.
[0088] Based on the above method, the interaction forces between each pair of simulated particles to be analyzed in the simulation task can be obtained. Therefore, the corresponding simulation task can be executed based on the interaction forces between multiple simulated particles, and the simulation results can be obtained. The specific implementation method is as follows:
[0089] In one specific embodiment provided in this disclosure, a simulation task is performed based on the interaction forces between multiple simulated particles, including: updating the motion state of each simulated particle according to the interaction forces between the multiple simulated particles; and performing the simulation task based on the motion state of each simulated particle.
[0090] Specifically, the position, velocity, acceleration, etc. of each simulated particle at the next moment are determined based on the interaction forces between multiple simulated particles. When the next moment arrives, the motion state (i.e., position, velocity, acceleration, etc.) of each simulated particle is updated based on the determined position, velocity, acceleration, etc., and then the corresponding simulation task is executed according to the updated motion of each simulated particle.
[0091] In this embodiment, the interaction force between every two simulated particles is determined by truncating the radius range and the interaction weight, thereby improving the accuracy of the interaction force between particles. The motion state of each simulated particle is updated based on the interaction force between particles, so that the simulation results obtained by performing the simulation task based on the updated motion state are also more accurate.
[0092] Furthermore, after updating the motion state of each simulated particle, it is also necessary to determine whether it is necessary to continue to determine the force acting on the simulated particle based on the termination condition of the simulated particle, and update the motion state of the simulated particle at subsequent time points.
[0093] Based on this, in a specific embodiment provided in this disclosure, after updating the motion state of each simulated particle according to the interaction force between multiple simulated particles, the method further includes: determining whether multiple simulated particles have reached the termination condition; and ending the update of the motion state of multiple simulated particles if multiple simulated particles have reached the termination condition.
[0094] The termination condition includes any one of the following: the number of iterations of multiple simulated particles, the cumulative execution time of multiple simulated particles, or the convergence state of the force function of multiple simulated particles.
[0095] Specifically, after updating the motion state of multiple simulated particles, it is determined whether the multiple simulated particles have reached the termination condition. For example, whether the number of iterations of the multiple simulated particles has reached the number threshold, or whether the cumulative execution time of the multiple simulated particles has reached the duration threshold, or whether the force function of the multiple simulated particles has converged. If the multiple simulated particles have reached the termination condition, such as the number of iterations of the multiple simulated particles reaching the number threshold, or the cumulative execution time of the multiple simulated particles reaching the duration threshold, or the force function of the multiple simulated particles starting to converge, it means that there is no need to update the motion state of the multiple simulated particles anymore, and the simulation task can be executed subsequently.
[0096] In this embodiment of the disclosure, a termination condition is set to determine when to stop updating the motion state of multiple simulated particles and to determine when the corresponding simulation task can be started.
[0097] This embodiment implements a method for dynamically setting a cutoff radius interval. After determining the particle distance between the first and second particles, it determines the interaction weight between the first and second particles based on the set cutoff radius interval to measure the importance of the interaction force between them. Thus, the interaction force between the first and second particles is determined based on the interaction weight. By determining the interaction force between the first and second particles through the cutoff radius interval and interaction weight, the corresponding simulation task is executed based on the interaction forces between multiple simulated particles, and the simulation results are obtained. This method achieves dynamic setting of the cutoff radius interval and determines the interaction force between each pair of particles according to the actual situation of the particle system. While ensuring the accuracy of the interaction forces, it is applicable to different particle systems, improving the accuracy of particle simulation tasks.
[0098] The following is in conjunction with the appendix Figure 3 The particle simulation method provided in the embodiments of this disclosure will be further explained and described. Figure 3 A flowchart of a particle simulation method provided in this disclosure is shown below. Figure 3 As shown, the particle parameters of each simulated particle are initialized, including the particle's position, velocity, acceleration, etc., and the cutoff radius range and smoothing factor are determined. For particle i among the multiple simulated particles to be analyzed, all other particles in the multiple simulated particles are traversed. The following explanation uses particle j as an example. The particle distance r between particle i and particle j is determined based on the position information of particle i and particle j. ij Determine the distance r between particles ij If the radius is less than or equal to the minimum cutoff radius, then directly adjust the interaction weight w between particle i and particle j. ij Set the value to 1, and determine particle j as a nearest neighbor of particle i. Further, determine the interaction weight w between particle i and particle j.ij If the initial particle potential energy is greater than or equal to a preset weight threshold, it indicates a high precision requirement for calculating the initial particle potential energy. In this case, a target calculation method for calculating the initial particle potential energy can be determined from the first candidate calculation set, such as a double-precision calculation method or a polynomial calculation method, and the initial particle potential energy of particle i is determined based on the determined target calculation method. If not, it indicates a high speed requirement for calculating the initial particle potential energy. In this case, a target calculation method for calculating the initial particle potential energy can be determined from the second candidate calculation set, such as a single-precision calculation method, and the initial particle potential energy of particle i is determined based on the determined target calculation method. Furthermore, based on the initial particle potential energy, interaction weights w are superimposed. ij That is, determining the interaction weights w ij The target particle potential energy of particle i is obtained by multiplying the initial particle potential energy with the target particle potential energy. Finally, the target particle potential energy of particle i is converted into a force, which can be determined based on the target particle potential energy and the particle distance between particle i and particle j (see Formula 4 above).
[0099] If the particle distance r ij If the distance is greater than the minimum cutoff radius, then the particle distance r is further determined. ij Is it greater than or equal to the maximum cutoff radius? If not, it indicates the particle distance r between particle i and particle j. ij If the particle is within the cutoff radius range, the interaction weight w between particle i and particle j is determined according to Formula 1 above. ij The hyperbolic tangent function can be replaced by a cosine function, polynomial function, exponential function, error function, etc. Subsequent steps are related to the particle distance r mentioned above. ij The case where the radius is less than or equal to the minimum cutoff radius is the same, and will not be repeated here. If the particle distance r ij If the value is greater than or equal to the maximum cutoff radius, then the interaction weight w between particle i and particle j is directly applied. ij Setting it to 0 allows us to directly determine the force between particle i and particle j as 0.
[0100] Using the same method, after determining the interaction forces between multiple simulated particles, the motion state of the multiple simulated particles can be updated according to the interaction forces. When the termination condition is met, the update of the motion state is stopped, and the corresponding simulation task is executed based on the updated motion state of the multiple simulated particles to obtain the simulation results of the simulation task.
[0101] This embodiment implements a method for dynamically setting a cutoff radius interval. After determining the particle distance between particle i and particle j, the interaction weight between particle i and particle j is determined based on the minimum and maximum cutoff radii within the cutoff radius interval. This weight measures the importance of the interaction force between particle i and particle j, thereby determining the force between particle i and particle j based on the interaction weight. By determining the force between particle i and particle j through the cutoff radius interval and interaction weight, the corresponding simulation task is executed based on the interaction forces between multiple simulated particles, and simulation results are obtained. This method achieves dynamic setting of the cutoff radius interval and determines the interaction force between every two particles according to the actual situation of the particle system. While ensuring the accuracy of the interaction forces, it is applicable to different particle systems, improving the accuracy of particle simulation tasks.
[0102] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further. Those skilled in the art will understand that in the above methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.
[0103] In addition, this disclosure also provides a particle simulation device, an electronic device, and a computer-readable storage medium, all of which can be used to implement the particle simulation method provided in this disclosure. The corresponding technical solutions and descriptions are described in the corresponding section of the method and will not be repeated here.
[0104] Figure 4 This is a block diagram of a particle simulation device provided in an embodiment of the present disclosure.
[0105] See Figure 4 This disclosure provides a particle simulation device, which includes:
[0106] The distance determination module 402 is configured to determine the particle distance between the first particle and the second particle based on the first position information of the first particle and the second position information of the second particle, wherein the first particle and the second particle are any two of the multiple simulation particles to be analyzed in the simulation task.
[0107] The weight determination module 404 is configured to determine the interaction weight between the first particle and the second particle based on a preset cutoff radius range and particle distance, wherein the interaction weight changes continuously within the cutoff radius range as the particle distance changes.
[0108] The force determination module 406 is configured to determine the force between the first particle and the second particle based on the interaction weight;
[0109] Simulation module 408 is configured to perform simulation tasks based on the interaction forces between multiple simulated particles and obtain simulation results of the simulation tasks.
[0110] Optionally, the cutoff radius range includes the minimum cutoff radius and the maximum cutoff radius;
[0111] The weight determination module 404 is further configured as follows:
[0112] When the particle distance is less than or equal to the minimum cutoff radius, the interaction weight between the first particle and the second particle is determined to be a preset value, wherein the preset value is greater than 0;
[0113] When the particle distance is greater than or equal to the maximum cutoff radius, the interaction weight between the first and second particles is set to 0.
[0114] When the particle distance is greater than the minimum cutoff radius but less than the maximum cutoff radius, the interaction weight between the first and second particles is determined based on the particle distance, the minimum cutoff radius, and the maximum cutoff radius.
[0115] Optionally, the weight determination module 404 is further configured as follows:
[0116] Determine the sum of the minimum and maximum cutoff radii, and the difference between the minimum and maximum cutoff radii;
[0117] The interaction weights are obtained by processing the particle distance, radius, and radius difference using a smoothing function.
[0118] Optionally, the force determination module 406 is further configured to:
[0119] When the interaction weight is 0, the force is determined to be 0.
[0120] When the interaction weight is not zero, the target particle potential energy of the first particle is determined according to the interaction weight, and the force is determined according to the target particle potential energy.
[0121] Optionally, the force determination module 406 is further configured to:
[0122] The initial particle potential energy of the first particle is determined based on the interaction weights;
[0123] The target particle potential energy of the first particle is determined based on the interaction weights and the initial particle potential energy.
[0124] The interaction force between the first and second particles is determined based on the target particle's potential energy and the particle distance.
[0125] Optionally, the force determination module 406 is further configured to:
[0126] Based on the interaction weights and preset weight thresholds, the target calculation method for calculating the initial particle potential energy is determined.
[0127] The initial particle potential energy is determined based on the target calculation method.
[0128] Optionally, the force determination module 406 is further configured to:
[0129] When the interaction weight is greater than or equal to a preset weight threshold, a target calculation method is determined in the first candidate calculation set, wherein the calculation accuracy of multiple calculation methods in the first candidate calculation set is within a first accuracy range and the calculation speed is within a first speed range.
[0130] When the interaction weight is less than the preset weight threshold, the target calculation method is determined in the second candidate calculation set. The calculation accuracy of multiple calculation methods in the second candidate calculation set is within the second accuracy range and the calculation speed is within the second speed range. The first accuracy range is higher than the second accuracy range and the first speed range is lower than the second speed range.
[0131] Optionally, simulation module 408 is further configured as follows:
[0132] The motion state of each simulated particle is updated based on the interaction forces between multiple simulated particles.
[0133] The simulation task is executed based on the motion state of each simulated particle.
[0134] The particle simulation apparatus provided in this embodiment includes: a distance determination module configured to determine the particle distance between a first particle and a second particle based on a first position information of a first particle and a second position information of a second particle, wherein the first particle and the second particle are any two of a plurality of simulated particles to be analyzed in a simulation task; a weight determination module configured to determine the interaction weight between the first particle and the second particle based on a preset cutoff radius interval and the particle distance; a force determination module configured to determine the force between the first particle and the second particle based on the interaction weight; and a simulation module configured to execute a simulation task based on the force between the plurality of simulated particles and obtain the simulation result of the simulation task.
[0135] This embodiment implements a method for dynamically setting a cutoff radius interval. After determining the particle distance between the first and second particles, it determines the interaction weight between the first and second particles based on the set cutoff radius interval to measure the importance of the interaction force between them. Thus, the interaction force between the first and second particles is determined based on the interaction weight. By determining the interaction force between the first and second particles through the cutoff radius interval and interaction weight, the corresponding simulation task is executed based on the interaction forces between multiple simulated particles, and the simulation results are obtained. This method achieves dynamic setting of the cutoff radius interval and determines the interaction force between each pair of particles according to the actual situation of the particle system. While ensuring the accuracy of the interaction forces, it is applicable to different particle systems, improving the accuracy of particle simulation tasks.
[0136] Figure 5 This is a block diagram of an electronic device provided in an embodiment of the present disclosure.
[0137] See Figure 5 This disclosure provides an electronic device 500, which includes: at least one processor 501; at least one memory 502; and one or more I / O interfaces 503 connected between the processor 501 and the memory 502; wherein the memory 502 stores one or more computer programs that can be executed by the at least one processor 501, and the one or more computer programs are executed by the at least one processor 501 to enable the at least one processor 501 to perform the particle simulation method described above.
[0138] This disclosure also provides a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the particle simulation method described above. The computer-readable storage medium may be volatile or non-volatile.
[0139] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in the processor of an electronic device, the processor in the electronic device executes the particle simulation method described above.
[0140] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
[0141] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0142] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0143] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0144] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0145] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0146] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0147] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0148] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0149] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A particle simulation method, characterized in that, include: Based on the first position information of the first particle and the second position information of the second particle, the particle distance between the first particle and the second particle is determined, wherein the first particle and the second particle are any two of the multiple simulation particles to be analyzed in the simulation task; Based on a preset cutoff radius range and the particle distance, the interaction weight between the first particle and the second particle is determined, wherein the interaction weight changes continuously within the cutoff radius range as the particle distance changes; The interaction force between the first particle and the second particle is determined based on the interaction weight; The simulation task is executed based on the interaction forces between the multiple simulated particles, and the simulation results of the simulation task are obtained.
2. The method as described in claim 1, characterized in that, The cutoff radius range includes the minimum cutoff radius and the maximum cutoff radius; The step of determining the interaction weight between the first particle and the second particle based on a preset cutoff radius range and the particle distance includes: When the particle distance is less than or equal to the minimum cutoff radius, the interaction weight between the first particle and the second particle is determined to be a preset value, wherein the preset value is greater than 0; If the particle distance is greater than or equal to the maximum cutoff radius, the interaction weight between the first particle and the second particle is determined to be 0; When the particle distance is greater than the minimum cutoff radius and less than the maximum cutoff radius, the interaction weight between the first particle and the second particle is determined based on the particle distance, the minimum cutoff radius, and the maximum cutoff radius.
3. The method as described in claim 2, characterized in that, Determining the interaction weight between the first particle and the second particle based on the particle distance, the minimum cutoff radius, and the maximum cutoff radius includes: Determine the sum of the minimum cutoff radius and the maximum cutoff radius, and the difference between the minimum cutoff radius and the maximum cutoff radius; The interaction weights are obtained by processing the particle distance, radius, and radius difference using a smoothing function.
4. The method according to any one of claims 1-3, characterized in that, Determining the force between the first particle and the second particle based on the interaction weight includes: When the interaction weight is 0, the force is determined to be 0; If the interaction weight is not zero, the target particle potential energy of the first particle is determined according to the interaction weight, and the force is determined according to the target particle potential energy.
5. The method as described in claim 4, characterized in that, The step of determining the target particle potential energy of the first particle based on the interaction weight, and determining the force based on the target particle potential energy, includes: The initial particle potential energy of the first particle is determined based on the interaction weights. The target particle potential energy of the first particle is determined based on the interaction weights and the initial particle potential energy. The interaction force between the first particle and the second particle is determined based on the target particle's potential energy and the particle's distance.
6. The method as described in claim 5, characterized in that, Determining the initial particle potential energy of the first particle based on the interaction weights includes: Based on the interaction weights and the preset weight threshold, a target calculation method for calculating the initial particle potential energy is determined; The initial particle potential energy is determined based on the target calculation method.
7. The method as described in claim 6, characterized in that, The step of determining the target calculation method for calculating the initial particle potential energy based on the interaction weights and a preset weight threshold includes: When the interaction weight is greater than or equal to the preset weight threshold, the target calculation method is determined in the first candidate calculation set, wherein the calculation accuracy of multiple calculation methods in the first candidate calculation set is within a first accuracy range and the calculation speed is within a first speed range. When the interaction weight is less than the preset weight threshold, the target calculation method is determined in the second candidate calculation set, wherein the calculation accuracy of multiple calculation methods in the second candidate calculation set is within a second accuracy range and the calculation speed is within a second speed range, the first accuracy range is higher than the second accuracy range, and the first speed range is lower than the second speed range.
8. The method according to any one of claims 1-3, characterized in that, The step of executing the simulation task based on the interaction forces between the plurality of simulated particles includes: The motion state of each simulated particle is updated according to the interaction forces between the multiple simulated particles. The simulation task is executed based on the motion state of each simulated particle.
9. A particle simulation device, characterized in that, include: The distance determination module is configured to determine the particle distance between the first particle and the second particle based on the first position information of the first particle and the second position information of the second particle, wherein the first particle and the second particle are any two of the multiple simulation particles to be analyzed in the simulation task; The weight determination module is configured to determine the interaction weight between the first particle and the second particle based on a preset cutoff radius range and the particle distance, wherein the interaction weight changes continuously within the cutoff radius range as the particle distance changes; The force determination module is configured to determine the force between the first particle and the second particle based on the interaction weight; The simulation module is configured to execute the simulation task based on the interaction forces between the plurality of simulated particles, and obtain the simulation results of the simulation task.
10. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-8.
12. A computer program product, characterized in that, Includes computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is executed in a processor of an electronic device, the processor in the electronic device performs the method as described in any one of claims 1-8.