Ocean engineering equipment coupling collision dynamics modeling simulation method and device

By improving the collision detection and contact force calculation methods, the efficiency and accuracy of rigid-flexible multibody coupled collision dynamics modeling for marine engineering equipment have been improved. This solves the problems of low collision detection efficiency and inaccurate contact force calculation in existing technologies, and achieves more efficient and accurate simulation results.

CN119783397BActive Publication Date: 2025-10-21HARBIN ENG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510062736.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-10-21
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

In the existing modeling and simulation methods for the rigid-flexible multi-body coupled collision dynamics of marine engineering equipment, the collision detection efficiency is low and the contact force calculation is not accurate enough, especially in complex contact and friction situations.

Method used

A collision detection strategy with broad-stage, medium-stage, and fine-stage approaches is adopted. Combined with a static boundary volume hierarchy and improved sweep and culling algorithms, the contact point information is calculated using the MPR algorithm. The contact force is defined as a convex optimization problem, and the contact force is solved using an optimization algorithm.

Benefits of technology

It significantly improves the efficiency of collision detection and the accuracy of contact force calculation, can more accurately simulate the dynamic behavior of complex marine engineering equipment, and is suitable for systems containing a large number of rigid and flexible bodies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783397B_ABST
    Figure CN119783397B_ABST
Patent Text Reader

Abstract

Ocean engineering equipment coupling collision dynamics modeling simulation method and device belong to the field of virtual simulation technology of ship and ocean engineering, especially relate to ocean engineering equipment rigid-flexible multi-body coupling collision dynamics modeling simulation. The method solves the problems of low collision detection efficiency and inaccurate contact force calculation existing in the existing simulation method. The method comprises the following steps: motion simulation step: adopting a time-domain motion simulation model of the working equipment to simulate, updating the external force according to the obtained contact force, solving the acceleration of the working equipment, and obtaining the motion speed and pose of the working equipment through the fourth-order Runge-Kutta method integration, and completing the simulation. The ocean engineering equipment coupling collision dynamics modeling simulation method and device are suitable for the dynamic modeling simulation of the rigid-flexible multi-body coupling collision of the ocean engineering equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of virtual simulation of ships and ocean engineering, and in particular to modeling and simulation of rigid-flexible multi-body coupled collision dynamics of ocean engineering equipment. Background Art

[0002] In the field of ocean engineering, modeling and simulation of rigid-flexible multi-body coupled collision dynamics is a crucial research area. With the deepening of ocean development and technological advancements, an increasing number of complex ocean engineering equipment (or operational equipment) are being designed and deployed, such as offshore wind turbines, deep-sea drilling platforms, and underwater robots. During actual operation, these equipment encounters a variety of complex mechanical environments, such as waves, currents, and wind loads. These environmental factors can cause collisions between equipment components or between the equipment and its surroundings. Therefore, accurately simulating and predicting these collision behaviors is crucial to ensuring the safe and reliable operation of these equipment.

[0003] The existing methods for modeling and simulating the rigid-flexible multi-body coupled collision dynamics of marine engineering equipment have the following problems:

[0004] (1) Low collision detection efficiency: When dealing with collision detection of large-scale systems, traditional simulation methods have very high computational costs and low detection efficiency because they need to consider the possible collisions between each pair of collision bodies.

[0005] (2) Inaccurate calculation of contact force: In traditional simulation methods, the calculation of contact force is often not accurate enough, especially when complex contact and friction are involved.

[0006] In summary, there is an urgent need for a modeling and simulation method for the rigid-flexible multi-body coupled collision dynamics of marine engineering equipment with high collision detection efficiency and accurate contact force calculation. Summary of the Invention

[0007] The present invention proposes a method and device for modeling and simulating coupled collision dynamics of marine engineering equipment, which solves the problems of low collision detection efficiency and inaccurate contact force calculation in existing simulation methods.

[0008] The method for modeling and simulating coupled collision dynamics of marine engineering equipment according to the present invention comprises the following steps:

[0009] Initialization step: Obtain a set of mass points including rigid bodies and flexible bodies of the working equipment and use it as the system to be simulated; initialize the states of all collision bodies in the system to be simulated, including the initial position, initial linear velocity and angular velocity of each collision body in three-dimensional space, as well as the external forces acting on each collision body in the initial stage; the external forces are all forces except gravity, Coriolis force and centrifugal force;

[0010] Collision detection step: performing collision detection on the initialized system to be simulated, identifying the collision body pairs that collide in the system to be simulated, and determining the contact point information;

[0011] Contact force solution step: Based on the contact point information, a contact constraint condition is applied to the system to be simulated; for the system to be simulated with the contact constraint condition applied, the contact force is defined as the unique global solution of a convex optimization problem, and the convex optimization problem is solved using an optimization algorithm to obtain the contact force;

[0012] Motion simulation steps: Use the time-domain motion simulation model of the working equipment for simulation. Based on the obtained contact force, update the external force, solve and obtain the acceleration of the working equipment, and obtain the motion speed and posture of the working equipment through the fourth-order Runge-Kutta method to complete the simulation.

[0013] Furthermore, a preferred embodiment is provided, wherein the time-domain motion simulation model of the working equipment includes:

[0014]

[0015] The input conditions of the time-domain motion simulation model of the operating equipment include:

[0016] Operating equipment mass and moment of inertia M RB ; Centripetal force and Coriolis force matrix C of working equipment RB (v) Additional mass and additional moment of inertia M of the operating equipment A ; Fluid centripetal force and Coriolis force matrix C A (v r ); first-order damping and second-order damping matrices D(v r ); fluid memory effect force μ of the working equipment; static stiffness matrix G of the working equipment; ballast force g0 on the working equipment; self-weight of the water structure g b ; Contact force f; Flexible connecting cable force τ Line ; Wind load τ Wind ; Wave load τ Wave ; Relative velocity v of the operating equipment in the body coordinate system r ;

[0017] The calculation results of the time domain motion simulation model of the operating equipment include:

[0018] The acceleration a, velocity v, and posture q of the working equipment, as well as the external force τ required for calculating the contact force f, where:

[0019] When the operating equipment is a floating structure, the external force τ required to calculate the contact force f is:

[0020] τ=τ Line +τ Wind +τWave -C A (v r )v r -d(v r )v r -μ-Gq-g0;

[0021] When the operating equipment is a rigid structure on water, the external force τ required to calculate the contact force f is:

[0022] τ=τ Line +τ Wind .

[0023] Furthermore, a preferred embodiment is provided, wherein the collision detection step comprises the following steps:

[0024] Candidate generation step: Generate candidate collision body pairs;

[0025] Mid-stage collision detection step: Use the axis-aligned bounding box in the static bounding volume hierarchy to perform mid-stage collision detection on the candidate collision body pairs to obtain the screened candidate collision body pairs;

[0026] Filtering collision body pairs: using a collision body filter to filter the screened candidate collision body pairs to obtain filtered candidate collision body pairs;

[0027] Detailed collision detection steps: perform detailed collision detection on the filtered candidate collision body pairs to obtain the collision body pairs that collide in the system to be simulated; based on the collision body pairs that collide in the system to be simulated, use the MPR algorithm to calculate the contact point information; the contact point information includes the contact point position, contact point normal vector, contact point distance and contact point speed.

[0028] Furthermore, a preferred embodiment is provided, wherein applying contact constraints to the system to be simulated based on the contact point information comprises the following steps:

[0029] Spatial mapping step: Based on the contact point information, a spatial velocity mapping matrix is ​​constructed to map the spatial velocity of the collision body to the spatial velocity in the contact coordinate system;

[0030] Calculating the contact matrix step: calculating the contact Jacobian matrix based on the spatial velocity mapping matrix and the basis vector matrix; the basis vector matrix is ​​associated with the contact force;

[0031] Insert constraint step: insert the contact Jacobian matrix into the Jacobian matrix of the system to be simulated to impose contact constraint conditions on the system to be simulated.

[0032] Furthermore, a preferred embodiment is provided, wherein for a system to be simulated with contact constraints imposed, the contact force is defined as a unique global solution to a convex optimization problem, and an optimization algorithm is used to solve the convex optimization problem. Obtaining the contact force includes the following steps:

[0033] Original problem steps: define an original problem based on constrained acceleration, wherein the original problem implicitly includes contact force;

[0034] Problem conversion steps: using contact force as the Lagrangian multiplier of the original problem to convert the original problem into its Lagrangian dual problem; the Lagrangian dual problem is a convex optimization problem about the contact force, and the contact force is the only global solution to the convex optimization problem;

[0035] Optimization algorithm solving steps: using the optimization algorithm to solve the convex optimization problem and obtain the contact force.

[0036] Furthermore, a preferred embodiment is provided, in the step of solving the contact force:

[0037] The original problem is as follows:

[0038]

[0039] in:

[0040] is the constrained acceleration; is the constrained deformation acceleration; R is the diagonal regularization matrix; a ref is the reference acceleration; x is the optimization variable, representing the actual acceleration; y is the slack variable in the constraint space; represents the product of contact friction cones; represents the duality of the friction cone; is the submatrix of all rows of the Jacobian matrix corresponding to the contact constraints;

[0041] The Lagrangian dual problem is:

[0042]

[0043] subject to λ∈Ω

[0044] Where:

[0045] A=JM -1 J T ;

[0046]

[0047] in:

[0048] A is the inverse inertia matrix in the contact space; a0 is the unconstrained acceleration in the contact space; f is the contact force; J is the contact Jacobian matrix; M is the inertia matrix; c is the bias force; is the constraint acceleration; λ is the Lagrange multiplier; Ω is the convex set of feasible contact forces;

[0049] The optimization algorithm is the Projected Gauss-Seidel algorithm.

[0050] The present invention also proposes a coupled collision dynamics modeling and simulation device for marine engineering equipment, which includes the following modules:

[0051] Initialization module: Obtain a collection of mass points of the working equipment, including rigid bodies and flexible bodies, and use it as the system to be simulated; initialize the states of all collision bodies in the system to be simulated, including the initial position, initial linear velocity and angular velocity of each collision body in three-dimensional space, as well as the external forces acting on each collision body in the initial stage; the external forces are all forces except gravity, Coriolis force and centrifugal force;

[0052] Collision detection module: performs collision detection on the initialized system to be simulated, identifies the collision body pairs that collide in the system to be simulated, and determines the contact point information;

[0053] Contact force solution module: Based on the contact point information, contact constraints are applied to the system to be simulated. For the system to be simulated with contact constraints applied, the contact force is defined as the unique global solution of a convex optimization problem, and the convex optimization problem is solved using an optimization algorithm to obtain the contact force.

[0054] Motion simulation module: The time-domain motion simulation model of the working equipment is used for simulation. Based on the obtained contact force, the external force is updated, the acceleration of the working equipment is solved, and the motion speed and posture of the working equipment are obtained through the fourth-order Runge-Kutta method integration to complete the simulation.

[0055] The present invention also proposes a computer device, comprising: a processor and a memory, wherein the memory is used to store executable instructions of the processor, and the processor is configured to execute any one of the above-mentioned methods for modeling and simulating coupled collision dynamics of marine engineering equipment by executing the executable instructions.

[0056] The present invention also proposes a computer storage medium, in which a computer program is stored. When the computer program is run, any one of the above-mentioned methods for modeling and simulating coupled collision dynamics of marine engineering equipment is executed.

[0057] The present invention also proposes a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of any one of the above-mentioned methods for modeling and simulating coupled collision dynamics of marine engineering equipment.

[0058] The present invention has the following beneficial effects:

[0059] 1. The coupled collision dynamics modeling and simulation method for marine engineering equipment described in this invention significantly reduces the number of collision pairs requiring detailed detection by employing broad-stage, medium-stage, and fine-stage collision detection strategies. In particular, the modified sweep and culling algorithm and the axis-aligned bounding box (AABB) technique of a static bounding volume hierarchy (BVH) enable efficient identification of potential collision pairs, significantly improving collision detection efficiency.

[0060] 2. The coupled collision dynamics modeling and simulation method for marine engineering equipment described in the present invention converts the calculation of contact force into a convex optimization problem and uses an efficient optimization algorithm to solve it, thereby ensuring that the calculation of contact force is not only accurate but also can be completed within a reasonable calculation time.

[0061] 3. The coupled collision dynamics modeling and simulation method for marine engineering equipment described in the present invention can better simulate the non-rigid constraints commonly found in actual systems, such as friction between contact points, by introducing the concept of virtual constraints (such as virtual constraint damping and virtual constraint stiffness).

[0062] 4. The coupled collision dynamics modeling and simulation method for marine engineering equipment of the present invention provides a flexible way to define model parameters, especially the impedance parameter (d) and the reference acceleration (a ref ); the behavior of the model can be adjusted according to specific engineering needs, such as adjusting the impedance parameters to control the hardness of the constraints to adapt to different physical scenarios.

[0063] 5. The coupled collision dynamics modeling and simulation method for marine engineering equipment described in this paper provides a detailed mathematical description and implementation for complex friction models, such as elliptical and pyramidal friction cones. This not only improves the accuracy of the friction model but also makes the calculation of friction more realistic, especially when dealing with multiple contact points, and more realistically reflects the dynamic behavior of the system.

[0064] 6. The coupled collision dynamics modeling and simulation method for marine engineering equipment described in the present invention makes the entire simulation process more efficient and accurate for complex systems containing a large number of rigid bodies and flexible bodies through effective collision detection, contact force calculation and model parameterization.

[0065] 7. The marine engineering equipment coupled collision dynamics modeling and simulation method described in the present invention improves the efficiency of collision detection, enhances the accuracy of contact force calculation, and provides a flexible model parameterization scheme for the field of marine engineering simulation, thereby enabling more accurate and efficient simulation of complex marine engineering equipment rigid-flexible multi-body coupled collision dynamics problems.

[0066] The method and device for modeling and simulating coupled collision dynamics of marine engineering equipment described in the present invention are suitable for dynamic modeling and simulation of coupled collision of rigid and flexible multi-bodies of marine engineering equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0068] Figure 1 This is a flow chart of a method for modeling and simulating coupled collision dynamics of marine engineering equipment in one embodiment of the present invention;

[0069] Figure 2 FIG1 is a flow chart of the MPR algorithm in one embodiment of the present invention; FIG1 is a flow chart of the MPR algorithm in one embodiment of the present invention; FIG1 is a step of determining the relative position of the origin ray and the Minkowski difference; FIG1 is a step of finding a candidate entrance; FIG1 is a step of iteratively finding a new entrance (finding a new support point by using the outward normal); FIG1 is a step of iteratively finding a new entrance (replacing the triangle vertex located inside the plane); FIG1 is a step of determining a hit (obtaining a new support point); FIG1 is a step of determining a miss (refining the search); FIG1 is a step of determining a miss (refining the search);

[0070] Figure 3 Schematic diagram of a method for constructing a basis vector matrix E in one embodiment of the present invention, showing a complete basis vector set when n=6;

[0071] Figure 4 A schematic diagram of a visual simulation of contact force in an offshore engineering floatation installation operation in one embodiment of the present invention;

[0072] Figure 5 This is a schematic diagram of setting a barge fender collision body in one embodiment of the present invention. DETAILED DESCRIPTION

[0073] In order to make the technical solutions and advantages of the present invention more clearly described, the specific embodiments of the present invention will be further described in detail and completely in conjunction with the accompanying drawings. The various embodiments described below are only part of the preferred embodiments of the present invention, rather than all implementation plans; the various embodiments described below are intended to explain the present invention and cannot be understood as limiting the present invention; the reasonable combination of the technical features defined in the various embodiments of the present invention, as well as all other implementation plans obtained by ordinary technicians in this field based on the embodiments of the present invention without making creative work, all fall within the scope of protection of the present invention.

[0074] 1. In one embodiment, a method for modeling and simulating coupled collision dynamics of marine engineering equipment is provided, the method comprising the following steps:

[0075] Initialization step: Obtain a set of mass points including rigid bodies and flexible bodies of the working equipment and use it as the system to be simulated; initialize the states of all collision bodies in the system to be simulated, including the initial position, initial linear velocity and angular velocity of each collision body in three-dimensional space, as well as the external forces acting on each collision body in the initial stage; the external forces are all forces except gravity, Coriolis force and centrifugal force;

[0076] Collision detection step: performing collision detection on the initialized system to be simulated, identifying the collision body pairs that collide in the system to be simulated, and determining the contact point information;

[0077] Contact force solution step: Based on the contact point information, contact constraints are applied to the system to be simulated; the contact force is defined as the unique global solution of a convex optimization problem, and the convex optimization problem is solved using an optimization algorithm to obtain the contact force of the system to be simulated with the contact constraints applied;

[0078] Motion simulation steps: Use the time-domain motion simulation model of the working equipment for simulation. Based on the obtained contact force, update the external force, solve and obtain the acceleration of the working equipment, and obtain the motion speed and posture of the working equipment through the fourth-order Runge-Kutta method to complete the simulation.

[0079] In this embodiment, the set of particles refers to a mathematical model composed of a group of particles or a system of particles. By simplifying an object into particles or a group of particles, the shape and size of the object can be ignored, and only its mass and motion state can be focused on, thereby simplifying the complexity of the problem.

[0080] In this embodiment, the operating equipment is also referred to as offshore operating equipment or marine engineering equipment.

[0081] In this embodiment, the initial position of each collision body in the three-dimensional space is represented by Cartesian coordinates.

[0082] In this embodiment, the initial linear velocity and angular velocity of each collision body in the three-dimensional space are represented by a linear velocity vector and an angular velocity vector, respectively.

[0083] In addition, in one embodiment, the system to be simulated is initialized using an initial configuration file of the system to be simulated and a time-domain motion simulation model of the operating equipment.

[0084] In this embodiment, the initial configuration file of the system to be simulated includes a CAD model, kinematic parameters, and dynamic parameters.

[0085] In addition, in one embodiment, the initial configuration file is used to initialize the initial position, initial linear velocity, and angular velocity of each collision body in three-dimensional space.

[0086] In addition, in one embodiment, the time-domain motion simulation model of the working equipment is used to calculate the external force acting on each collision body in the initial stage based on the initial position, initial linear velocity and angular velocity of each collision body, and complete the initialization of the state of all collision bodies.

[0087] In this embodiment, after the initialization is completed, the system to be simulated is in a known initial state, which provides a basis for subsequent simulations.

[0088] In addition, in one embodiment, the time-domain motion simulation model of the working equipment includes:

[0089]

[0090] The input conditions of the time-domain motion simulation model of the operating equipment include:

[0091] Operating equipment mass and moment of inertia M RB ; Centripetal force and Coriolis force matrix C of working equipment RB (v) Additional mass and additional moment of inertia M of the operating equipment A ; Fluid centripetal force and Coriolis force matrix C A (v r ); first-order damping and second-order damping matrices D(v r ); fluid memory effect force μ of the working equipment; static stiffness matrix G of the working equipment; ballast force g0 on the working equipment; self-weight of the water structure g b ; Contact force f; Flexible connecting cable force τ Line ; Wind load τ wind ; Wave load τ wave ; Relative velocity v of the operating equipment in the body coordinate system r ;

[0092] The calculation results of the time domain motion simulation model of the operating equipment include:

[0093] The acceleration a, velocity v, and posture q of the working equipment, as well as the external force τ required for calculating the contact force f, where:

[0094] When the operating equipment is a floating structure, the external force τ required to calculate the contact force f is:

[0095] τ=τ Line +τ Wind +τ Wave -C A (v r )v r -D(v r )v r -μ-Gq-g0;

[0096] When the operating equipment is a rigid structure on water, the external force τ required to calculate the contact force f is:

[0097] τ=τ Line +τ Wind .

[0098] In this embodiment, during the calculation process of the external force τ required for calculating the contact force f:

[0099] If the operating equipment is a floating structure, the buoyancy and gravity are considered to be in equilibrium, so that g b is 0, then:

[0100] τ=τ Line +τ Wind +τ Wave -C A (v r )v r -D(v r )v r -μ-Gq-g0;

[0101] If the operating equipment is a rigid structure on water, the calculation process does not include the calculation of hydrodynamic force, hydrostatic restoring force and wave load in environmental load, so that the additional mass and additional moment of inertia M A , fluid centripetal force and Coriolis force matrix C A (v r ), first-order damping and second-order damping matrix D(v r ), the fluid memory effect force μ of the operating equipment, the static stiffness matrix G of the operating equipment, the ballast force g0 on the operating equipment, and the wave load τ Wave are all 0, then:

[0102] τ=τ Line +τ Wibd .

[0103] In this embodiment, collision detection is a key step in the simulation process, which is used to identify pairs of collision bodies that may (potentially) collide in the system to be simulated and determine contact point information.

[0104] In addition, in one embodiment, the collision detection step includes the following steps:

[0105] Candidate generation step: Generate candidate collision body pairs;

[0106] Mid-stage collision detection step: Use the axis-aligned bounding box in the static bounding volume hierarchy to perform mid-stage collision detection on the candidate collision body pairs to obtain the screened candidate collision body pairs;

[0107] Filtering collision body pairs: using a collision body filter to filter the screened candidate collision body pairs to obtain filtered candidate collision body pairs;

[0108] Detailed collision detection steps: perform detailed collision detection on the filtered candidate collision body pairs to obtain the collision body pairs that collide in the system to be simulated; based on the collision body pairs that collide in the system to be simulated, use the MPR algorithm to calculate the contact point information; the contact point information includes the contact point position, contact point normal vector, contact point distance and contact point speed.

[0109] In addition, in one embodiment, the candidate generation step includes the following steps:

[0110] Wide-stage collision detection step: using an improved sweep and culling algorithm, sorting based on the main eigenvectors of the covariance matrix of all collision body centers to generate potential collision pairs;

[0111] Define explicit collision body pairs: Define explicit collision body pairs;

[0112] Candidate set step: The generated potential collision pairs and the defined explicit collision pairs are taken as candidate collision pairs.

[0113] In this embodiment, sweeping and culling algorithms are two commonly used algorithms in the fields of computer graphics and computational geometry, each of which has unique characteristics and application scenarios.

[0114] A sweep algorithm, also known as a scanline algorithm, collects and processes relevant information by simulating the movement of one or more scan lines through a graphic or dataset. This algorithm is often used to solve geometric problems in two- or three-dimensional space, such as area calculation, intersection detection, and boundary determination. The core idea of ​​a sweep algorithm is to decompose a complex geometric problem into a series of simpler one- or two-dimensional problems. By simulating the movement of a scanline, the algorithm gradually collects and processes information about geometric elements such as key points, line segments, and polygons within the graphic or dataset. This information is then used to solve the original geometric problem.

[0115] A culling algorithm is an algorithm used to reduce unnecessary elements in a data set or graphics. In fields such as graphics processing and computer vision, culling algorithms are often used to optimize rendering performance, reduce the amount of computation, or improve data processing efficiency. Culling algorithms can remove unnecessary elements based on a variety of criteria, such as distance, angle, area, volume, etc. For example, in 3D rendering, culling algorithms can remove objects or parts of the scene that are outside the camera's field of view to reduce the rendering burden and increase the frame rate. In addition, culling algorithms can be combined with other algorithms to achieve more complex graphics processing tasks. For example, in collision detection, culling algorithms can be combined with space segmentation algorithms to quickly eliminate pairs of objects that are unlikely to collide.

[0116] In addition, in one embodiment, the improved sweep and cull algorithm improves the sweep and cull algorithm in a method of selecting a sorting axis.

[0117] It should be noted that in sweep algorithms, the choice of sorting axis is crucial to the algorithm's performance and accuracy. By selecting a sorting axis that maximizes data distribution, the algorithm can process data more efficiently, reduce unnecessary computations, and improve overall efficiency. For example, in two-dimensional space, if the data points are primarily distributed along the X-axis, then choosing the X-axis as the sorting axis may be a wise choice, as this helps the algorithm find and process geometric elements such as key points and line segments more quickly.

[0118] Similarly, in the culling algorithm, the choice of sorting axis also affects the performance and effectiveness of the algorithm. By maximizing the distribution of data along the sorting axis, the algorithm can more easily identify and remove unnecessary or redundant elements, thereby optimizing the data set or graph processing process.

[0119] Additionally, in one embodiment, the improved sweep and cull algorithm differs from the traditional sweep and cull algorithm in that principal component analysis is used to select the sorting axis:

[0120] The main eigenvector of the covariance matrix of the center point of the geometry is selected as the sorting axis.

[0121] In this embodiment, the covariance matrix of geometric center points (Covariance Matrix of GeomCenters) is a mathematical tool used to describe the distribution characteristics of a group of geometric center positions.

[0122] In this embodiment, principal component analysis is used to select a sorting axis, thereby maximizing the dispersion of objects on the axis, thereby reducing unnecessary candidate collision pairs and improving the efficiency of subsequent collision detection.

[0123] In this embodiment, the collision detection efficiency is improved by improving the sweeping and culling algorithms.

[0124] In this embodiment, the static bounding volume hierarchy (BVH) is an important scene management technology in computer graphics. It is a spatial partitioning data structure that can effectively organize objects in the scene and support efficient collision detection.

[0125] In this embodiment, the Axis-Aligned Bounding Box (AABB) in the static bounding volume hierarchy is a simple and effective space partitioning technique.

[0126] In addition, in one embodiment, the explicit collision body pairs are defined in a configuration file. Specifically, the geometric body pairs specified by specific elements in the configuration file are used as explicit collision body pairs and directly as candidate collision body pairs.

[0127] In addition, in one embodiment, the collision volume filter includes:

[0128] Collider type filter: ensures that the types of the two colliders in the filtered candidate collider pair must correspond to a collision function that can perform detailed collision detection;

[0129] Same or parent-child rigid body filter: ensures that the two colliders in the filtered candidate collider pair do not belong to the same rigid body or the parent-child rigid body;

[0130] BoundingFilter: Applies a bounding sphere test for filtering.

[0131] It should be noted that collisions between certain geometry types are not supported, such as collisions between planes. A collision type filter is used to filter out such unsupported collisions.

[0132] It should be noted that the edges of the objects being collided may be so close that they appear to be touching. The purpose of using the boundary filter, i.e., the bounding sphere test, is to filter out objects whose edges are very close but not overlapping (i.e., colliding) from the candidate collision pairs.

[0133] In this embodiment, the bounding sphere test is applied for filtering, and the process is as follows:

[0134] Create bounding spheres: Create a bounding sphere for each object that needs to be collided with; this bounding sphere should wrap around the object as tightly as possible to ensure accuracy while maintaining efficiency.

[0135] Calculate the distance between the centers of the spheres: For any pair of objects that may collide, calculate the distance between the centers of their respective bounding spheres.

[0136] Compare the center-to-center distance to the sum of the radii: Compare the distance between the center points of the bounding spheres calculated above with the sum of the radii of the two bounding spheres. If the center-to-center distance is less than or equal to the sum of the radii, the two bounding spheres overlap (or touch or intersect), indicating a possible collision.

[0137] Filter non-contact edges: In some cases, even if the two bounding spheres do not completely overlap, their edges may be so close that they are considered "touching"; based on the comparison of the distance between the sphere centers and the sum of the radii, objects whose distance between the sphere centers is greater than the sum of the radii are filtered out from the screened candidate collision pairs, that is, objects whose edges are very close but not overlapping are filtered out.

[0138] In this embodiment, the contact point position is the coordinate of the contact point in three-dimensional space.

[0139] In this embodiment, the contact point normal vector is a normal vector at the contact point, and is used to describe the direction of the contact surface.

[0140] In this embodiment, the contact point distance is the distance at the contact point, which is less than the set boundary parameter.

[0141] In this embodiment, the contact point velocity is the relative velocity at the contact point, which is used to calculate the collision force.

[0142] In this embodiment, the detailed collision detection step is based on the MPR algorithm. The MPR (Minkowski Portal Refinement) algorithm is an efficient algorithm for collision detection, and is particularly suitable for collision detection between convex polygons or convex polyhedrons.

[0143] In this implementation, the MPR algorithm combines mathematical concepts such as Minkowski difference, simplex, and support function, and achieves accurate detection of convex body collisions through two steps: entrance search and entrance simplification. Algorithm principle:

[0144] Minkowski Difference:

[0145] The MPR algorithm first calculates the Minkowski difference of two convex bodies. The Minkowski difference is the difference between the sets of points on the two convex bodies, that is, the set of points obtained by subtracting the points on one convex body from the points on the other convex body.

[0146] If two convex bodies collide, then the convex hull formed by their Minkowski difference must contain the origin.

[0147] Simplex:

[0148] Within the object formed by the Minkowski difference, the algorithm iteratively forms a polyhedron (or polygon) that surrounds the origin as much as possible. This polyhedron is called a simplex.

[0149] In two-dimensional space, a simplex is a triangle; in three-dimensional space, a simplex is a tetrahedron.

[0150] Support functions:

[0151] Given two convex bodies and a direction, the support function returns the point in the shape of the Minkowski difference of the two convex bodies that is farthest away in that direction.

[0152] By continuously calling the support function, the algorithm can find an initial simplex in the Minkowski difference space.

[0153] Entry search and entry simplification:

[0154] Entrance search: The algorithm finds a line segment or triangle (in two-dimensional or three-dimensional space) that represents the collision entrance through a series of iterations. This entrance is the path that the light can take from the origin of the Minkowski difference to the collision point.

[0155] Entrance simplification: After finding the initial entrance, the algorithm iterates and simplifies until it finally obtains a precise collision entrance. This process includes updating the simplex vertices and determining whether the ray can reach the origin.

[0156] If two convex bodies collide, the light starting from the origin of the Minkowski difference will first reach the collision entrance and then reach the other convex body.

[0157] On the contrary, if the light can reach the origin directly without passing through the collision portal, then the two convex bodies have not collided.

[0158] The MPR algorithm uses the Minkowski Sum concept in geometry to determine whether two objects intersect. The shape formed by subtracting one convex shape from another is called the Minkowski difference of the two shapes.

[0159] In this embodiment, in the MPR algorithm, the Minkowski difference of two convex bodies is often calculated.

[0160] Suppose two convex bodies are A and B, and the Minkowski difference of the two convex bodies is BA; this Minkowski difference can be regarded as a new convex body, which is obtained by vector subtraction from all points in B to all points in A:

[0161] If BA contains the origin, then A and B must overlap. If BA does not contain the origin, then A and B are separated, specifically:

[0162] When the origin is found in the Minkowski Difference BA, it can be concluded that the original two convex bodies A and B overlap in space. This is because if the origin is obtained by subtracting a point in A from a point in B, it means that A and B overlap in the direction of the vector formed by these two points.

[0163] On the contrary, if the origin cannot be found in the Minkowski difference BA, it means that A and B are completely separated in space and there is no overlap.

[0164] In this embodiment, the problem of detecting collision can be simplified to two convex shapes A and B using the following equation to determine whether the origin is located within a single convex shape BA:

[0165] S B-A (n) = S B (n)-S A (-n);

[0166] This formula is used to calculate the support point of the Minkowski difference BA in a certain direction N, where:

[0167] S B (n) represents the support point of the convex body B in direction n, S A (-n) represents the support point of the convex body A in the direction -n (i.e., the opposite direction of n);

[0168] When the support point S from B B (n) Subtract the support point S of A in the opposite direction A(-n) When the result is the Minkowski difference BA support point S in direction n, B-A (n).

[0169] This formula in the MPR algorithm allows the shape of the Minkowski difference to be constructed by calculating only the support points without explicitly generating all the points, which greatly improves the efficiency of collision detection.

[0170] By calculating the Minkowski difference and determining whether it contains the origin, it is possible to accurately determine whether two convex bodies collide.

[0171] In addition, in one embodiment, the detailed collision detection step includes:

[0172] Step 1: Determine the relative position of the origin ray and the Minkowski difference:

[0173] Select an interior point: First, pick a point V0 that lies inside the Minkowski difference BA; this can usually be achieved by selecting a point from B and subtracting a point from A, for example by using the center of mass (or collision center) of the two convex bodies for calculation;

[0174] Draw the origin ray: Starting from the internal point V0, draw a ray passing through the origin;

[0175] Determine the position: If the ray passes through the surface of BA before reaching the origin, then the origin is outside BA; if the ray passes through the origin first, then the origin may be inside BA.

[0176] Step 2: Find candidate entry steps:

[0177] Use support map: Using the support map of BA, find three points V1, V2 and V3 that are not on the same plane and can form a candidate triangle entrance;

[0178] The V1, V2 and V3 are support points found in a specific direction using the support mapping of BA. The candidate triangle entrances they form are paths that the origin ray may pass through and are used for subsequent collision detection.

[0179] Step 3: Test candidate entry steps:

[0180] Check intersection: Check if the origin ray intersects the candidate triangle; this can be done by checking if the origin lies inside the three planes formed by the triangle edges and the interior point V0; the three planes are denoted as (v0,v1,v2), (v0,v2,v3), and (v0,v3,v1);

[0181] Determine validity: If the origin exists on all three planes, then a valid entry has been found.

[0182] Step 4: Iterate to find new entry points:

[0183] Replace vertices: If the origin is outside one of the planes, use the outward normal of the plane to find a new support point and replace the triangle vertices (V1, V2 and V3) inside the plane to form a new candidate entrance;

[0184] The "inside of the plane" referred to in "replacing the triangle vertices located inside the plane" is one of the three planes formed by the edges of the current candidate triangle and the internal point V0; if it is found during intersection detection that the origin is not located inside these three planes, that is, the origin is outside one of the planes, then it is necessary to use the outward normal of the plane to find a new support point to replace the triangle vertices located "inside" of the plane (the "inside" here is relative to the plane formed by the triangle and the point V0); the "inside" here actually refers to the inside of the plane corresponding to the spatial area where the origin ray and the triangle may intersect.

[0185] Repeat the test: Repeat steps 3 and 4 until a valid entry is found.

[0186] Step 5: Confirm the hit step (if the origin is inside the entrance, it means hit):

[0187] Determine the origin's location: Points V0, V1, V2, and V3 form a tetrahedron. Due to the convexity of the BA, the entire tetrahedron lies within the BA. Considering that the origin ray originates from the interior point V0 and passes through the candidate portal into the tetrahedron, if the origin lies within the triangular portal defined by V1, V2, and V3, then it must also lie within the tetrahedron and, therefore, within the Minkowski difference BA. In this case, a "hit" is achieved.

[0188] Obtaining a new support point: If the algorithm reaches this step and the origin is not found within the tetrahedron, it means that the origin may be on the side opposite the entrance. Further exploration is required to determine whether the origin is close to the outside of the Minkowski Difference BA surface or completely outside it. To do this, the outward normal of the entrance triangle is used to find a new support point.

[0189] Step 6, miss judgment step (if the starting point is outside the support plane, it means "miss"):

[0190] Miss: If the origin lies outside the new support plane formed by the support normal and the new support point, then the origin is outside the BA and the algorithm reports an error.

[0191] Refine the search: The origin lies between the entry and the supporting plane, so the search needs to be refined by finding a new entry that is closer to the BA surface. Consider the tetrahedron formed by the support point and the entry. The origin enters the tetrahedron through the entry, so it is guaranteed to pass through one of the three outer surfaces formed by the support point and the three edges of the tetrahedron in three-dimensional space. This step determines which outer surface the ray passes through and replaces the old one with this new entry. To determine which outer surface the origin ray passes through, the origin is tested against three planes: (V4, V0, V1), (V4, V0, V2), and (V4, V0, V3). The origin will be on the same side of these two planes. The boundary surface between these two planes will become the new entry.

[0192] The detailed collision detection steps provide contact point information:

[0193] This can be done by continuing to project the origin ray onto the Minkowski difference surface; this means pushing the objects along the straight line connecting their interior points until they just touch and using the normal vector of the first contact as the collision normal vector; this method is efficient and simple, and can stably obtain contact point information.

[0194] It is also possible to find the relative velocity of a pair of overlapping points, one from each object, and then project a new ray from the origin to the BA surface along the negative velocity vector; computing penetration along the direction of motion can produce more realistic dynamic collisions.

[0195] In this embodiment, the detailed collision detection step supports several basic collision shapes: plane, sphere, capsule, cylinder, ellipsoid and cuboid, which are used to simulate the collision of working equipment. These basic collision shapes are all convex collision shapes.

[0196] In this embodiment, in the collision detection step, the shape of the collision body is limited to a convex collision body.

[0197] In geometry, a convex set is one in which the line segment connecting any two points in the set also lies entirely within the set. Extending this concept to three-dimensional space yields a "convex collider"—a surface with no inward indentations, where the line connecting any two points lies entirely within or on the surface of the collider.

[0198] When performing collision detection, the system only supports convex collision bodies. This is because convex collision bodies have a series of mathematical properties that are beneficial to collision detection, which can greatly simplify the calculation process and improve detection efficiency.

[0199] In this embodiment, in the collision detection step, in order to model a non-convex object, it is necessary to decompose the non-convex object into a union of convex collision bodies (that is, to decompose it into a combination of multiple convex collision bodies) and attach them to the same collision body (that is, the combination of multiple convex collision bodies is treated as a whole).

[0200] In order to build a collision model that can represent a non-convex object, it is first necessary to decompose it into a number of convex colliders. These convex colliders can closely fit the surface of the non-convex object, thus approximately simulating its shape.

[0201] Next, these convex collision bodies need to be "unionized," that is, treated as a unified collision body. This does not mean physically merging them, but rather treating their collision responses as a whole when performing collision detection. In this way, when an external object collides with this "whole" composed of convex collision bodies, the system can accurately calculate key information such as the collision point (i.e., contact point) and collision force (i.e., contact force) based on the position and shape of these convex collision bodies.

[0202] Finally, this "whole" of convex colliders is attached to the actual physical object so that it can correctly respond to collision events in the physics simulation. Pre-processing the colliders will result in faster and more stable simulations at runtime.

[0203] In addition, in one embodiment, applying contact constraints to the system to be simulated based on the contact point information includes the following steps:

[0204] Spatial mapping step: Based on the contact point information, a spatial velocity mapping matrix is ​​constructed to map the spatial velocity of the collision body to the spatial velocity in the contact coordinate system;

[0205] Calculating the contact matrix step: calculating the contact Jacobian matrix based on the spatial velocity mapping matrix and the basis vector matrix; the basis vector matrix is ​​associated with the contact force;

[0206] Insert constraint step: insert the contact Jacobian matrix into the Jacobian matrix of the system to be simulated to impose contact constraint conditions on the system to be simulated.

[0207] In addition, in one embodiment, the space velocity mapping matrix is ​​S, which is a matrix of 6 rows and nV columns, mapping the collision body space velocity v to the space velocity Sv in the contact coordinate system;

[0208] Where n is the dimension of the constraint force at the contact point; V is the system-level velocity vector, which represents the velocity of all degrees of freedom in the entire system to be simulated; and nV is the number of degrees of freedom.

[0209] In addition, in one embodiment, constructing a space velocity mapping matrix based on the contact point information to map the collision body space velocity to the space velocity in the contact coordinate system includes:

[0210] Assume that the collision body pair includes a first collision body and a second collision body;

[0211] In the colliding pair of colliders:

[0212] The contact force is assumed to act from the first collision body toward the second collision body;

[0213] Assuming that the contact point is the first collision body, obtain the spatial Jacobian matrix between the contact point and the second collision body and set it as the first spatial Jacobian matrix;

[0214] Assuming that the contact point is the second collision body, obtain the spatial Jacobian matrix between the first collision body and the contact point, and set it as the second spatial Jacobian matrix;

[0215] The spatial velocity mapping matrix is ​​obtained by subtracting the second spatial Jacobian matrix from the first spatial Jacobian matrix.

[0216] In this embodiment, the spatial velocity of the collision body is also the generalized velocity of the system to be simulated.

[0217] In this embodiment, the contact point is a contact point between the first collision body and the second collision body obtained based on the contact point information.

[0218] In this embodiment, since it is stipulated that the contact force acts from the first collision body toward the second collision body,

[0219] When calculating the first spatial Jacobian matrix, the spatial Jacobian matrix of the contact point has a negative sign;

[0220] When calculating the second spatial Jacobian matrix, the spatial Jacobian matrix of the first collider has a negative sign.

[0221] In this embodiment, the spatial Jacobian matrix is ​​used to describe the relative motion between the contact point and the two geometric bodies (collision bodies).

[0222] In addition, in one embodiment, the contact Jacobian matrix is ​​E T S, where:

[0223] S is the space velocity mapping matrix;

[0224] E T is the transpose of E, where E is the basis vector matrix; the basis vector matrix E is a 6-dimensional basis vector, each of which is associated with each component of the contact force. The force / torque generated by the contact force in the contact coordinate system is E T f;

[0225] Assume that the Jacobian matrix of the system to be simulated is J, and E T S is inserted into J.

[0226] In this embodiment, the contact Jacobian matrix (or constraint Jacobian matrix) adds physical constraints such as penetration and friction to the contact points by combining the contact force.

[0227] In this embodiment, by inserting the contact Jacobian matrix into the Jacobian matrix of the system to be simulated, the local contact constraints are integrated into the global dynamic equations of the system to be simulated, ensuring that each part of the system to be simulated conforms to the laws of physics. This can be understood as integrating the information of different contact points together, thereby enabling more accurate dynamic analysis and calculations.

[0228] In addition, in one embodiment, for the system to be simulated with contact constraints imposed, the contact force is defined as a unique global solution to a convex optimization problem, and an optimization algorithm is used to solve the convex optimization problem to obtain the contact force, including the following steps:

[0229] Original problem steps: define an original problem based on constrained acceleration, wherein the original problem implicitly includes contact force;

[0230] Problem conversion steps: using contact force as the Lagrangian multiplier of the original problem to convert the original problem into its Lagrangian dual problem; the Lagrangian dual problem is a convex optimization problem about the contact force, and the contact force is the only global solution to the convex optimization problem;

[0231] Optimization algorithm solving steps: using the optimization algorithm to solve the convex optimization problem and obtain the contact force.

[0232] In this embodiment, the contact force f generates a constrained acceleration Constrained acceleration Contact constraints are a part of the general equation of motion that ensures that the motion of the system to be simulated complies with physical constraints.

[0233] In addition, in one embodiment, the original question is as follows:

[0234]

[0235] in, is the (spatial) constraint acceleration; is the constraint deformation velocity; R is the diagonal regularization matrix used to soften the constraint; a ref is the reference acceleration, which is used to stabilize the constraints and ensure that the behavior of the simulated system meets expectations; x is the optimization variable, which represents the actual acceleration; y is the slack variable in the constraint space; represents the product of contact friction cones; represents the duality of the friction cone; is the submatrix of all rows of the Jacobian matrix corresponding to the contact constraints.

[0236] In addition, in one embodiment, the Lagrangian dual problem is:

[0237]

[0238] subject to λ∈Ω

[0239] Where:

[0240] A=JM -1 J T ;

[0241]

[0242] in:

[0243] A is the inverse inertia matrix in the contact space; a0 is the unconstrained acceleration in the contact space; f is the contact force; R is the regularization matrix used to control the hardness of the contact; a ref is the reference acceleration; J is the contact Jacobian matrix; M is the inertia matrix (or mass matrix); τ is the external force; c is the bias force; is the constrained acceleration; λ is the Lagrange multiplier; Ω is the convex set of feasible contact forces, which defines the constraint set that the Lagrange multiplier must satisfy to ensure the feasibility and physical significance of the optimization problem.

[0244] In addition, in one embodiment, in the optimization algorithm solving step, the optimization algorithm is a Projected Gauss-Seidel algorithm.

[0245] In this embodiment, the contact force f is implicit in the original problem, that is, the contact force f does not directly appear as a variable in the original problem, but indirectly affects the motion of the system to be simulated through other variables (such as acceleration).

[0246] In this implementation, the constraints are restored by taking the dual of the original problem. And the dual of the dual of a cone is the cone itself.

[0247] In this implementation, since the original problem itself is constrained, a ref The relationship between and the contact force f is nonlinear.

[0248] In this implementation, the definition process of the original problem is as follows:

[0249] Consider the general equation of motion in continuous time as:

[0250]

[0251] Among them, the Jacobian matrix J establishes the relationship between the vectors of the collision body space coordinates and the constraint coordinates (i.e., contact coordinates, or constraint space coordinates). It maps the motion vector from the collision body space coordinate system to the contact coordinate system, so that the collision body space velocity v is mapped to the velocity Jv in the contact coordinate system.

[0252] Transpose of the Jacobian matrix J T Map the force vector from the constraint coordinate system back to the collision volume space coordinate system so that the contact force f is mapped to the force J in the collision volume space coordinate system T f.

[0253] The general equations of motion take into account all possible constraints and integrate them into the dynamic model.

[0254] The collision volume space inertia matrix M is always invertible, so there is a forward dynamics calculation:

[0255]

[0256] where τ is the external force; c is the bias force, which includes the Coriolis force, centrifugal force, and gravity, whose sum is calculated using the recursive Newton-Euler (RNE) algorithm; M is the inertia matrix, which is calculated using the composite rigid body (CRB) algorithm; and forward represents forward dynamics.

[0257] Using forward dynamics to calculate the acceleration of the system to be simulated, i.e. the spatial constraint acceleration, starting from the known state of the system to be simulated

[0258] The dual problem is a convex optimization problem of the contact force, and the contact force also acts as the Lagrange multiplier of the original problem. Specifically:

[0259] The expression of the original problem is also called the objective function. The original form of the objective function (original problem) is a generalization based on the Gaussian minimum constraint principle.

[0260] In its original form, Gauss's principle states the unconstrained dynamical equation Where M is the inertia matrix, represents the spatial constraint acceleration, and τ is the external force.

[0261] The unconstrained dynamics equation assumes that the system to be simulated is completely free and not affected by any geometric or physical constraints, that is, the natural motion state (or motion law) of the system to be simulated is only affected by external forces.

[0262] When acceleration constraints are applied:

[0263]

[0264] Among them, J is the Jacobian matrix, which is used to express the constraints; a ref is the reference acceleration vector.

[0265] The resulting constrained acceleration is:

[0266]

[0267] subjecttoJx=a ref

[0268] This constraint causes the constrained acceleration to deviate from the unconstrained acceleration M -1 The degree of τ reaches the minimum.

[0269] This principle is equivalent to the Lagrange–D'Alembert principle and is used to describe constrained motion.

[0270] On this basis, a soft constraint model is obtained by generalizing the constraints in Gauss's principle. In this way, non-rigid constraints commonly found in real systems, such as friction between contact points, can be better simulated.

[0271] The optimization goal of the original problem is to solve the constrained acceleration These two variables constitute the constrained dynamic behavior of the system to be simulated. After the constraints are introduced, the unconstrained dynamic equation is expanded into a constrained dynamic equation, forming the complete original problem:

[0272]

[0273] In the description, the diagonal regularization matrix R>0, which softens the constraints; the reference acceleration a ref , which stabilizes the constraints and ensures that the system behaves as expected. The slack variable y exists to model soft constraints. Symbol Represents the dual of the friction cone. By taking the dual of the original problem, the constraints are restored.

[0274] In this embodiment, the physical meaning of the slack variable y is:

[0275] Assume an augmented dynamic system with a position state of (q, z) and a velocity state of (v, ω); where z represents the constraint deformation; ω represents the velocity of the constraint deformation, which is the concretization of the slack variable y.

[0276] The augmented dynamic equation can be written as:

[0277]

[0278] Applying Gauss's principle to the system to be simulated will produce the original problem mentioned above. Now the above equation becomes:

[0279]

[0280] Expanding the above formula, we can obtain the explicit forms of original dynamics (unconstrained dynamics model, suitable for analyzing the free motion behavior of the system and simplifying calculations) and deformation dynamics (introducing constraints to more accurately simulate the actual motion behavior of the system, especially in the presence of contact, collision and friction):

[0281]

[0282] Therefore, R has the meaning of reverse deformation inertia, and a ref It has the meaning of non-force deformation acceleration. When the constraint force f is equal to f defined in the parameter section below + When , the deformation state is a static function of position and velocity, that is, z = r(q) and ω = J(q)v.

[0283] By introducing the constraint deformation velocity ω and the regularization matrix R, the behavior under constraint conditions can be better described, the contact force can be solved more accurately, and the robustness and stability of the solver can be improved.

[0284] In this embodiment, the calculation of contact force is as follows:

[0285] The constrained acceleration is obtained in forward dynamics The local constraint acceleration can be calculated

[0286] The contact force can be calculated using a1:

[0287]

[0288] subject to λ∈Ω

[0289] By comparing the KKT conditions of two convex optimization problems, we can verify that the solutions of the two problems are the same when the following conditions are met.

[0290] a1=a0+Af.

[0291] In this embodiment, R and a are calculated from the model parameters. ref :

[0292] Focus on the unconstrained minimization solution of the dual problem, namely:

[0293] f + =(A+R) -1 (a ref -a0)

[0294] If exactly f + ∈Ω, then f + = f is the contact force actually generated by the model. At any given time, the subset of active constraints in Ω is small, and this is also the only case that can be actually analyzed.

[0295] Substitute f + into the constrained dynamics equation a1 = a0 + Af and rearrange the terms to obtain:

[0296] a1 = A(A + R) -1 a ref + R(A + R) -1 a0

[0297] Therefore, the constrained acceleration a1 interpolates between the unconstrained acceleration and the reference acceleration. In particular:

[0298] In the limit as R → 0, it is a hard constraint, and at this time a1 = a ref ;

[0299] In the limit as R → ∞, it is an infinitely soft constraint (i.e., no constraint), and at this time a1 = a0.

[0300] Therefore, introduce a parameter that directly controls this interpolation. Call this parameter the impedance parameter and denote it as d. It is a vector of dimension n C such that 0 < d < 1 element-wise. By adjusting the impedance parameter to control the hardness of the constraint, different physical scenarios can be accommodated.

[0301] Once d is specified, the diagonal elements of the regularization matrix R can be calculated as:

[0302]

[0303] Here, an approximation of the diagonal of the A matrix is used. This approximation is constructed from the inertia matrices of all models in the initial configuration of the model. If this approximation is exact and A itself is exactly a diagonal matrix, then the acceleration of each scalar constraint will satisfy:

[0304] a 1,i = d i a ref,i +(1 - d i )a 0,i

[0305] Regarding the calculation of the reference acceleration a ref :

[0306] Here, a spring-damper model parameterized element-wise by damping and stiffness coefficients is used:

[0307] aref,i =-b i (Jv) i -k i r i

[0308] Where r is the position residual; Jv is the velocity projected into the contact space; the index symbol refers to a component of the projected velocity vector; the index i represents the velocity component mapped into the constraint space; b represents the virtual constraint damping; and k represents the virtual constraint stiffness.

[0309] About the friction cone and its corresponding Jacobian matrix:

[0310] Let f denote the contact force vector of a single contact point, μ denote the friction coefficient vector, and n denote the dimension of the contact. For n>1, the elliptical friction cone and pyramidal friction cone are defined as follows:

[0311]

[0312] By associating each component of f with a 6-dimensional basis vector, we can specify how the contact forces act on the system being simulated.

[0313] Basis vectors are space vectors: the first 3 components represent forces, and the second 3 components represent torques.

[0314] Arranging the basis vectors into columns of the matrix E, the force / torque generated by the contact force in the contact coordinate system is Ef. Since the matrix E is the identity matrix, the first three components of f are the forces acting along the axes of the contact coordinate system, while the last three components are the torques acting about those axes.

[0315] In this embodiment, the Projected Gauss-Seidel (PGS) algorithm is an improved algorithm based on the Gauss-Seidel iteration method, which is an iterative algorithm for convex quadratic programming and is commonly used to solve linear equations or linear complementarity problems (LCPs).

[0316] Gauss-Seidel iteration method basics:

[0317] The Gauss-Seidel method is an iterative method for solving linear equations Ax = b. It is an improvement on the Jacobi method, whose core feature is the immediate use of newly computed component information in each iteration to accelerate convergence. This method is particularly well-suited for solving linear equations involving large sparse matrices, particularly symmetric positive definite matrices.

[0318] Projected Gauss-Seidel algorithm features:

[0319] The PGS algorithm, based on the Gauss-Seidel iterative method, introduces a projection operation to solve linear complementarity problems (LCP) and similar problems. It is capable of handling complex constraints. LCP problems are linear programming problems where the system of linear equations Ax + b = y satisfies certain conditions, and the sum of the products of the corresponding components of x and y is zero. The PGS algorithm iteratively updates the value of x and projects it onto the set of constraints that satisfy the LCP problem, gradually approaching the solution.

[0320] Application of PGS algorithm:

[0321] The PGS algorithm is widely used in physics engines, engineering calculations, optimization problems, and other fields. In physics engines, it is particularly useful for solving constraints between multiple rigid bodies, such as contact constraints and hinge constraints. The PGS algorithm can efficiently calculate the motion state of rigid bodies that satisfies all constraints.

[0322] Implementation steps of the PGS algorithm:

[0323] Initialization: Select an initial solution vector x^(0). Usually, you can choose a zero vector or an approximate solution based on some physical meaning.

[0324] Iterative calculation: For each unknown x_i, use the updated values ​​in the solution vector x^(k) (i.e., x_1^(k+1), x_2^(k+1), ..., x_(i-1)^(k+1)) and the unupdated values ​​(i.e., x_(i+1)^(k), x_(i+2)^(k), ..., x_n^(k)) to calculate a new approximate solution x_i^(k+1). At the same time, project the new solution onto the constraint set that satisfies the LCP problem.

[0325] Convergence check: Repeat the iterative steps until the convergence conditions are met, such as reaching a predetermined number of iterations or the difference between the new and old approximate solutions is less than a preset threshold.

[0326] In addition, in one embodiment, a specific example is provided: In order to verify the effectiveness and effect of the modeling and simulation method, the simulation of offshore floating installation operation is taken as an example to illustrate:

[0327] Step 1: Initialize the status of the equipment in the floatover installation operation simulation:

[0328] Before the simulation begins, initialize the states of all collision bodies in the floatover installation simulation, including:

[0329] Initial positions of the transport barge, floatover module, and jacket, where the jacket is a fixed-position equipment whose position does not change over time;

[0330] Initial linear and angular velocities of the transport barge, floatover module, and jacket. The jacket is a fixed-position device, and its velocity (linear and angular) is always zero.

[0331] According to the time-domain motion simulation model of the operating equipment, all forces on the transport barge and floatation module except gravity, Coriolis force and centrifugal force are calculated.

[0332] The initialization process is implemented based on the system's initial configuration files and the time-domain motion simulation model of the operating equipment; these configuration files include CAD models, kinematic parameters, and dynamic parameters.

[0333] After initialization is completed, the system is in a known initial state, providing a basis for subsequent simulation.

[0334] The time-domain motion simulation model of the operating equipment calculates the external force based on the initialization position and velocity (linear velocity and angular velocity), and initializes the states of the transport barge and the floating assembly.

[0335] After the simulation starts, the contact force f obtained in the subsequent steps is taken into account, the external force τ is updated, and the acceleration a of the working equipment is solved. The motion speed v and posture q of the working equipment are obtained by integration using the fourth-order Runge-Kutta method.

[0336] The time domain motion simulation model of the transport barge (the time domain motion simulation model of the operating equipment) is:

[0337]

[0338] The model input conditions include: transport barge mass and moment of inertia M RB ; Transport barge centripetal force and Coriolis force matrix C RB (v) Additional mass and additional moment of inertia M of the transport barge A ; Fluid centripetal force and Coriolis force matrix C A (v r ); first-order damping and second-order damping matrices D(v r ); transport barge fluid memory effect force μ; transport barge static stiffness matrix G; transport barge ballast force g0; collision constraint force f; flexible connecting cable force τ Line ; Wind load τ Wind ; Wave load τ Wave ; Relative velocity v of the transport barge in the body coordinate system r .

[0339] The model calculation results include: the transport barge's motion acceleration a, velocity v, posture q, and the external force τ required for collision constraint force (i.e. contact force) calculation.

[0340] Since the transport barge is a floating structure, the external force τ required for collision restraint calculation is:

[0341] τ=τ Line +τ Wind +τ Wave -C RB (v)vC A (v r )v r -D(v r )v r -μ-Gq-g0

[0342] The time domain motion simulation model of the floatover module is:

[0343]

[0344] Model input conditions include: floatation block mass and moment of inertia M RB ; Floatation module centripetal force and Coriolis force matrix C RB (v); Floatation module gravity g b ; Constraint force f generated by collision; Flexible connecting cable force τ Line ; Wind load τ Wind .

[0345] The model calculation results include: the acceleration a, velocity v, posture q of the floating assembly, and the external force τ required for collision constraint force calculation.

[0346] The float assembly is a rigid structure on water. The external force τ required for collision restraint calculation is:

[0347] τ=τ Line +τ Wind

[0348] Step 2: Perform collision detection based on the collision entity attached to the underlying rigid body:

[0349] The Rigidbody plays a crucial role in physics simulation and collision detection. It is an important physics component that can give game objects or simulated objects physical properties such as mass, force, velocity, etc., allowing these objects to move and respond like objects in the real world.

[0350] Collision entities refer to colliders, which are another type of physics component used to define the shape and boundaries of an object for accurate collision detection in physics simulations. There are many types of colliders, such as box colliders, sphere colliders, capsule colliders, etc. These different types of colliders are suitable for simulated objects of different shapes.

[0351] In collision detection, rigid bodies and collision entities are inseparable. A collision entity must be attached to an underlying rigid body to function effectively in collision detection. This is because rigid bodies provide physical properties and motion, while collision entities define the object's shape and boundaries. When two rigid bodies with collision entities come into contact or overlap, the algorithm uses these definitions to calculate a collision response, such as a bounce, slide, or stop.

[0352] Once the rigid bodies and collision entities are combined, implementing collision detection becomes relatively straightforward. The algorithm continuously monitors the position and state of the rigid bodies and collision entities. When contact or overlap is detected between the two rigid bodies, a collision event is triggered. These events can be further processed to implement effects such as physics responses.

[0353] Together, rigidbodies and collision entities form the basis of physics simulation and collision detection, allowing simulated objects to move and respond like real-world objects.

[0354] During the collision detection process, the system generates a contact list as output. This contact list records in detail all pairs of collision entities that have come into contact; the contact points between these collision entity pairs (i.e., collision body pairs) are all within the contact distance of the boundary parameters set by the system or the user.

[0355] The contact points that actually make contact and generate contact forces are called active contact points; these active contact points can be stored in a global array and used to construct the constraint Jacobian matrix and calculate the contact forces.

[0356] Detailed detection of all these collision pairs is too costly for large systems; and some potential collisions are undesirable, so they can be excluded during the modeling phase (i.e., explicit collision pairs); while other collision pairs can be quickly pruned without detailed detection (i.e., the wide-stage collision detection step). Therefore, a flexible mechanism can be used to decide which collision pairs need to be detected in detail. Specifically:

[0357] Generate candidate collision body pairs through the candidate generation step;

[0358] Mid-stage collision detection step: Use the axis-aligned bounding box in the static bounding volume hierarchy to perform mid-stage collision detection on the candidate collision body pairs to obtain the screened candidate collision body pairs;

[0359] Filtering collision body pairs: using a collision body filter to filter the screened candidate collision body pairs to obtain filtered candidate collision body pairs;

[0360] Detailed collision detection steps: perform detailed collision detection on the filtered candidate collision body pairs to obtain the collision body pairs that collide in the system to be simulated; based on the collision body pairs that collide in the system to be simulated, use the MPR algorithm to calculate the contact point information; the contact point information includes the contact point position, contact point normal vector, contact point distance and contact point speed.

[0361] The candidate generation steps include:

[0362] Wide-stage collision detection step: using an improved sweep and culling algorithm, sorting based on the main eigenvectors of the covariance matrix of all collision body centers to generate potential collision pairs;

[0363] Define explicit collision body pairs: Define explicit collision body pairs;

[0364] Candidate set step: The generated potential collision body pairs and the defined explicit collision body pairs are taken as candidate collision body pairs, which can be stored or displayed in the form of a list.

[0365] Step 3: Apply contact constraints to the system to be simulated based on the contact point information:

[0366] Spatial mapping step: Based on the contact point information, a spatial velocity mapping matrix is ​​constructed to map the spatial velocity of the collision body to the spatial velocity in the contact coordinate system;

[0367] Calculating the contact matrix step: calculating the contact Jacobian matrix based on the spatial velocity mapping matrix and the basis vector matrix; the basis vector matrix is ​​associated with the contact force;

[0368] Insert constraint step: insert the contact Jacobian matrix into the Jacobian matrix of the system to be simulated to impose contact constraint conditions on the system to be simulated.

[0369] Step 4: For the system to be simulated with contact constraints, define the contact force as the unique global solution of a convex optimization problem. Use the optimization algorithm to solve the convex optimization problem and obtain the contact force:

[0370] Original problem steps: define an original problem based on constrained acceleration, wherein the original problem implicitly includes contact force;

[0371] Problem conversion steps: using contact force as the Lagrangian multiplier of the original problem to convert the original problem into its Lagrangian dual problem; the Lagrangian dual problem is a convex optimization problem about the contact force, and the contact force is the only global solution to the convex optimization problem;

[0372] Optimization algorithm solving steps: using the optimization algorithm to solve the convex optimization problem and obtain the contact force.

[0373] Step 5: Use the time-domain motion simulation model of the working equipment for simulation. Based on the obtained contact force, update the external force, solve and obtain the acceleration of the working equipment, and obtain the motion speed and posture of the working equipment through the fourth-order Runge-Kutta method to complete the simulation.

[0374] The above further describes the technical solution provided by the present invention in detail through several specific embodiments in order to highlight the advantages and benefits of the technical solution provided by the present invention. However, the several specific embodiments described above are not intended to limit the present invention. Any reasonable changes and improvements to the present invention, reasonable combinations of implementation methods and equivalent replacements based on the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A coupled collision dynamics modeling and simulation method for marine engineering equipment, characterized in that: The method comprises the following steps: Initialization step: Obtain a set of mass points including rigid bodies and flexible bodies of the working equipment and use it as the system to be simulated; initialize the states of all collision bodies in the system to be simulated, including the initial position, initial linear velocity and angular velocity of each collision body in three-dimensional space, as well as the external forces acting on each collision body in the initial stage; the external forces are all forces except gravity, Coriolis force and centrifugal force; Collision detection step: performing collision detection on the initialized system to be simulated, identifying the collision body pairs that collide in the system to be simulated, and determining the contact point information; Contact force solution step: Based on the contact point information, a contact constraint condition is applied to the system to be simulated; for the system to be simulated with the contact constraint condition applied, the contact force is defined as the unique global solution of a convex optimization problem, and the convex optimization problem is solved using an optimization algorithm to obtain the contact force; Motion simulation steps: Use the time-domain motion simulation model of the working equipment for simulation. Based on the obtained contact force, update the external force, solve and obtain the acceleration of the working equipment, and use the fourth-order Runge-Kutta method to obtain the motion speed and posture of the working equipment to complete the simulation. The time domain motion simulation model of the operating equipment includes: The input conditions of the time-domain motion simulation model of the operating equipment include: Operating equipment mass and moment of inertia ; Centripetal force and Coriolis force matrix of working equipment ; Additional mass and additional moment of inertia of operating equipment ; Fluid centripetal force and Coriolis force matrix ; First-order damping and second-order damping matrices ; Fluid memory effect of operating equipment ; Static stiffness matrix of working equipment ; Ballast force on operating equipment ; The gravity of the water structure itself Contact force ;Force acting on flexible connecting cable ; Wind load ; Wave load ; Relative flow velocity of operating equipment in the body coordinate system .

2. The coupled collision dynamics modeling and simulation method for marine engineering equipment according to claim 1, characterized in that: The calculation results of the time domain motion simulation model of the operating equipment include: Working equipment movement acceleration ,speed and posture , and contact forces Calculate the required external forces ,in: When the operating equipment is a floating structure, the contact force Calculate the required external forces for: ; When the operating equipment is a rigid structure on water, the contact force Calculate the required external forces for: 。 3. The coupled collision dynamics modeling and simulation method for marine engineering equipment according to claim 1, characterized in that: The collision detection step comprises the following steps: Candidate generation step: Generate candidate collision body pairs; Mid-stage collision detection step: Use the axis-aligned bounding box in the static bounding volume hierarchy to perform mid-stage collision detection on the candidate collision body pairs to obtain the screened candidate collision body pairs; Filtering collision body pairs: using a collision body filter to filter the screened candidate collision body pairs to obtain filtered candidate collision body pairs; Detailed collision detection steps: perform detailed collision detection on the filtered candidate collision body pairs to obtain the collision body pairs that collide in the system to be simulated; based on the collision body pairs that collide in the system to be simulated, use the MPR algorithm to calculate the contact point information; the contact point information includes the contact point position, contact point normal vector, contact point distance and contact point speed.

4. The coupled collision dynamics modeling and simulation method for marine engineering equipment according to claim 1, characterized in that: Applying contact constraints to the system to be simulated based on the contact point information includes the following steps: Spatial mapping step: Based on the contact point information, a spatial velocity mapping matrix is ​​constructed to map the spatial velocity of the collision body to the spatial velocity in the contact coordinate system; Calculating the contact matrix step: calculating the contact Jacobian matrix based on the spatial velocity mapping matrix and the basis vector matrix; the basis vector matrix is ​​associated with the contact force; Insert constraint step: insert the contact Jacobian matrix into the Jacobian matrix of the system to be simulated to impose contact constraint conditions on the system to be simulated.

5. The method for modeling and simulating coupled collision dynamics of marine engineering equipment according to claim 1, characterized in that: For the system to be simulated with contact constraints, the contact force is defined as the only global solution of a convex optimization problem, and the convex optimization problem is solved using an optimization algorithm to obtain the contact force The following steps are involved: Original problem steps: define an original problem based on constrained acceleration, wherein the original problem implicitly includes contact force; Problem transformation steps: Use contact force as the Lagrange multiplier of the original problem to transform the original problem into its Lagrange dual problem; The Lagrangian dual problem is a convex optimization problem about the contact force, and the contact force is the only global solution to the convex optimization problem; Optimization algorithm solving steps: using the optimization algorithm to solve the convex optimization problem and obtain the contact force.

6. The coupled collision dynamics modeling and simulation method for marine engineering equipment according to claim 5, characterized in that: In the step of solving the contact force: The original problem is as follows: in: is the constrained acceleration; is the constrained deformation acceleration; is a diagonal regularization matrix; is the reference acceleration; is the optimization variable, representing the actual acceleration; is the slack variable in the constraint space; represents the product of contact friction cones; represents the duality of the friction cone; is the submatrix of all rows of the Jacobian matrix corresponding to the contact constraints; The Lagrangian dual problem is: Where: ; ; in: is the inverse inertia matrix in the contact space; is the unconstrained acceleration in the contact space; is the contact force; is the contact Jacobian matrix; is the inertia matrix; is the bias force; is the constrained acceleration; is the Lagrange multiplier; is a convex set of feasible contact forces; The optimization algorithm is the Projected Gauss-Seidel algorithm.

7. Marine engineering equipment coupled collision dynamics modeling and simulation device, characterized by: The device comprises the following modules: Initialization module: obtains a set of mass points including rigid bodies and flexible bodies of the working equipment and uses it as the system to be simulated; initializes the states of all collision bodies in the system to be simulated, including the initial position, initial linear velocity and angular velocity of each collision body in three-dimensional space, as well as the external force acting on each collision body in the initial stage; The external forces are all forces except gravity, Coriolis force and centrifugal force; Collision detection module: performs collision detection on the initialized system to be simulated, identifies the collision body pairs that collide in the system to be simulated, and determines the contact point information; Contact force solution module: Based on the contact point information, contact constraints are applied to the system to be simulated. For the system to be simulated with contact constraints applied, the contact force is defined as the unique global solution of a convex optimization problem, and the convex optimization problem is solved using an optimization algorithm to obtain the contact force. Motion simulation module: This module uses the time-domain motion simulation model of the working equipment to perform simulations. Based on the obtained contact force, it updates the external force, solves and obtains the acceleration of the working equipment, and uses the fourth-order Runge-Kutta method to integrate the motion speed and posture of the working equipment to complete the simulation. The time domain motion simulation model of the operating equipment includes: The input conditions of the time-domain motion simulation model of the operating equipment include: Operating equipment mass and moment of inertia ; Centripetal force and Coriolis force matrix of working equipment ; Additional mass and additional moment of inertia of operating equipment ; Fluid centripetal force and Coriolis force matrix ; First-order damping and second-order damping matrices ; Fluid memory effect of operating equipment ; Static stiffness matrix of working equipment ; Ballast force on operating equipment ; The gravity of the water structure itself Contact force ;Force acting on flexible connecting cable ; Wind load ; Wave load ; Relative flow velocity of operating equipment in the body coordinate system .

8. A computer device comprising: A processor and a memory, characterized in that the memory is used to store executable instructions of the processor, and the processor is configured to execute the method for modeling and simulating coupled collision dynamics of marine engineering equipment as described in any one of claims 1 to 6 by executing the executable instructions.

9. A computer storage medium, characterized in that The storage medium stores a computer program, and when the computer program is run, the method for modeling and simulating coupled collision dynamics of marine engineering equipment according to any one of claims 1 to 6 is executed.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the method for modeling and simulating coupled collision dynamics of marine engineering equipment as described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Multi-rigid-body impact simulation method based on accurate wave effect

    CN105868425A

  • Contact dynamics simulation method and system for flexible multi-finger picking manipulator

    CN113343506A