Marine engineering equipment coupling collision dynamics modeling simulation method and device
By adopting collision detection strategies of wide-stage, medium-stage and fine-stage in the simulation system of marine engineering equipment and converting contact force calculation into convex optimization problems, the problems of low collision detection efficiency and insufficient contact force calculation in the existing technology are solved, and efficient and accurate collision dynamics modeling is achieved.
Patent Information
- Application Number
- CN202510062736.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2045-01-15
AI Technical Summary
In the existing marine engineering equipment rigid-flexible multi-body coupled collision dynamics modeling and simulation methods, the collision detection efficiency is low and the contact force calculation is not accurate enough.
By initializing the state of the system to be simulated, a collision detection strategy of wide-stage, medium-stage and fine-stage is adopted to identify the pair of collisions that occur and determine the contact point information. Define contact force as a convex optimization problem, solve it using optimization algorithm, update external action forces, and perform time-domain motion simulation.
It significantly improves the efficiency of collision detection and the accuracy of contact force calculation, can complete simulation within reasonable calculation time, and provides more accurate modeling of rigid and flexible multi-body coupled collision dynamics for marine engineering equipment.
Smart Images

Figure CN119783397A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of ship and ocean engineering virtual simulation, and in particular to modeling and simulation of rigid-flexible multi-body coupling collision dynamics of ocean engineering equipment. Background Art
[0002] In the field of marine engineering, rigid-flexible multi-body coupling collision dynamics modeling and simulation is a very important research direction. With the deepening of marine development and the advancement of technology, more and more complex marine engineering equipment (or operating equipment) are being designed and applied, such as offshore wind turbines, deep-sea drilling platforms, underwater robots, etc. These equipment will encounter various complex mechanical environments in actual operation, such as waves, currents, wind loads, etc. These environmental factors can cause collisions between equipment components or between equipment and the surrounding environment. Therefore, accurately simulating and predicting these collision behaviors is crucial to ensure the safe and reliable operation of the equipment.
[0003] The existing methods for modeling and simulating the collision dynamics of rigid-flexible multi-body coupling 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: obtaining a set of mass points including rigid bodies and flexible bodies of the working equipment and taking it as the system to be simulated; initializing 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, and the external force applied to each collision body in the initial stage; the external force is 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] Steps for solving contact force: based on the contact point information, applying contact constraints to the system to be simulated; for the system to be simulated with the contact constraints applied, defining the contact force as the only global solution of a convex optimization problem, using an optimization algorithm to solve the convex optimization problem, and obtaining the contact force;
[0012] Motion simulation steps: Use the time-domain motion simulation model of the operating equipment for simulation. Update the external force based on the obtained contact force, solve to obtain the acceleration of the operating equipment, and obtain the motion speed and posture of the operating equipment through the fourth-order Runge-Kutta method integration to complete the simulation.
[0013] Further, a preferred embodiment is provided, wherein the time domain motion simulation model of the working equipment comprises:
[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 of the operating equipment M A ; Fluid centripetal force and Coriolis force matrix C A (v r ); the first-order damping and second-order damping matrices D(v r ); operating equipment fluid memory effect force μ; operating equipment static stiffness matrix G; operating equipment ballast force g0; water structure self gravity 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 motion 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] Further, 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 step: 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] Further, 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 the system to be simulated with contact constraints imposed, the contact force is defined as the only global solution to a convex optimization problem, and the convex optimization problem is solved using an optimization algorithm, and obtaining the contact force comprises the following steps:
[0033] Original problem steps: define an original problem based on constrained acceleration, wherein the original problem implies contact force;
[0034] Problem conversion steps: using contact force as the Lagrangian multiplier of the original problem, converting 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] Further, 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 constraint 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 the contact friction cone; represents the dual 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] subjecttoλ∈Ω
[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, the device comprising the following modules:
[0051] Initialization module: 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, and the external force applied to each collision body in the initial stage; the external force is 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 solving module: based on the contact point information, the contact constraint condition is imposed on the system to be simulated; for the system to be simulated with the contact constraint condition imposed, 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;
[0054] Motion simulation module: The time-domain motion simulation model of the operating equipment is used for simulation. According to the obtained contact force, the external force is updated, the acceleration of the operating equipment is solved, and the motion speed and posture of the operating 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 running, 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 the present invention significantly reduces the number of collision body pairs that need to be detected in detail by adopting the collision detection strategies of the broad stage, the medium stage and the fine stage. In particular, by using the modified sweep and culling algorithm and the axis-aligned bounding box (AABB) technology of the static bounding volume hierarchy (BVH), possible collision pairs can be efficiently identified, thereby greatly improving the efficiency of collision detection.
[0060] 2. The coupled collision dynamics modeling and simulation method for marine engineering equipment described in the present invention transforms 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 of marine engineering equipment described in the present invention can better simulate the common non-rigid constraints 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 impedance parameters (d) and 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 the present invention provides a detailed mathematical description and implementation method for complex friction models, such as elliptical friction cones and pyramid friction cones. This not only improves the accuracy of the friction model, but also makes the calculation of friction more in line with the actual situation, especially when dealing with multiple contact points, and can more realistically reflect 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 being able to more accurately and efficiently simulate complex marine engineering equipment rigid-flexible multi-body coupled collision dynamics problems.
[0066] The method and device for dynamic modeling and simulation of coupled collision 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 drawings required for use in the embodiments will be briefly introduced below. 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 creative work.
[0068] Figure 1 A flowchart of a method for modeling and simulating coupled collision dynamics of marine engineering equipment in one embodiment of the present invention;
[0069] Figure 2 FIG. 1 is a flow chart of an MPR algorithm in one embodiment of the present invention; wherein FIG. (a) is a step of determining the relative position of the origin ray and the Minkowski difference; FIG. (b) is a step of finding a candidate entrance; FIG. (c) is an iterative step of finding a new entrance (using an outward normal to find a new support point); FIG. (d) is an iterative step of finding a new entrance (replacing the triangle vertex located inside the plane); FIG. (e) is a step of determining a hit (obtaining a new support point); and FIG. (f) is a step of determining a miss (refining the search).
[0070] Figure 3 A schematic diagram of a construction method of 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 visualized simulation of contact force for floating installation operations in an offshore engineering project 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 implementation methods of the present invention will be further described in detail and completely in conjunction with the accompanying drawings. The various implementation methods described below are only part of the preferred solutions of the present invention, rather than all implementation methods; the various implementation methods described below are intended to explain the present invention and cannot be understood as limitations on the present invention; the reasonable combination of technical features defined in the various implementation methods of the present invention, and all other implementation methods obtained by ordinary technicians in the field without creative work based on the implementation methods of the present invention, are 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: obtaining a set of mass points including rigid bodies and flexible bodies of the working equipment and taking it as the system to be simulated; initializing 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, and the external force applied to each collision body in the initial stage; the external force is 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] Steps for solving the contact force: based on the contact point information, applying contact constraints to the system to be simulated; defining the contact force as the only global solution to a convex optimization problem, using an optimization algorithm to solve the convex optimization problem, and obtaining 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 operating equipment for simulation. Update the external force based on the obtained contact force, solve to obtain the acceleration of the operating equipment, and obtain the motion speed and posture of the operating equipment through the fourth-order Runge-Kutta method integration 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 the 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 implementation, the initial position of each collision body in the three-dimensional space is represented by Cartesian coordinates.
[0082] In this implementation manner, 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 implementation manner, 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 exerted 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 states of all collision bodies.
[0087] In this implementation manner, 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 of the operating equipment M A ; Fluid centripetal force and Coriolis force matrix C A (v r ); the first-order damping and second-order damping matrices D(v r ); operating equipment fluid memory effect force μ; operating equipment static stiffness matrix G; operating equipment ballast force g0; water structure self gravity 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 motion 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, in the process of calculating 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 working equipment, the static stiffness matrix G of the working equipment, the ballast force g0 on the working equipment, and the wave load τ Wave are all 0, then:
[0102] τ=τ Line +τ Wibd .
[0103] In this implementation, collision detection is a key step in the simulation process, which is used to identify collision body pairs 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 step: 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: Use an improved sweep and culling algorithm to sort the main eigenvectors of the covariance matrix of all collision body centers to generate potential collision body pairs;
[0111] Define explicit collision body pairs: Define explicit collision body pairs;
[0112] Candidate set step: The generated potential collision body pairs and the defined explicit collision body pairs are taken as candidate collision body pairs.
[0113] In this implementation, the sweeping and culling algorithms are two commonly used algorithms in the fields of computer graphics and computational geometry, and each has unique characteristics and application scenarios.
[0114] The sweep algorithm, also known as the scan line algorithm, is an algorithm that collects and processes relevant information by simulating one or more scan lines passing through a graph or data set. This algorithm is usually used to solve geometric problems in two-dimensional or three-dimensional space, such as area calculation, intersection detection, boundary determination, etc. The core idea of the sweep algorithm is to decompose complex geometric problems into a series of simple one-dimensional or two-dimensional problems. By simulating the movement of the scan line, the algorithm can gradually collect and process information about geometric elements such as key points, line segments, polygons, etc. in the graph or data set. This information is then used to solve the original geometric problem.
[0115] Culling algorithms are algorithms used to reduce unnecessary elements in data sets or graphics. In fields such as graphics processing and computer vision, culling algorithms are often used to optimize rendering performance, reduce the amount of calculations, 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 scenes that are outside the camera's field of view to reduce the rendering burden and increase the frame rate. In addition, culling algorithms can also 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 exclude 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 the sweep algorithm, the choice of sorting axis is critical to the performance and accuracy of the algorithm. By choosing a sorting axis that maximizes the distribution of data, the algorithm can process data more efficiently, reduce unnecessary calculations, and improve overall efficiency. For example, in two-dimensional space, if the data points are mainly distributed on the X-axis, then choosing the X-axis as the sorting axis may be a wise choice, because this helps the algorithm find and process key points, line segments and other geometric elements faster.
[0118] Similarly, in the culling algorithm, the choice of sorting axis also affects the performance and effect of the algorithm. By maximizing the distribution of data on 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] In addition, in one embodiment, the improved sweep and remove algorithm is different from the traditional sweep and remove 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 implementation, 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 implementation, 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 implementation, 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 implementation, the axis-aligned bounding box (AABB) in the static bounding volume hierarchy is a simple and effective space partitioning technology.
[0126] In addition, in one embodiment, the explicit collision body pair is defined in a configuration file. Specifically, the geometric body pair specified by a specific element in the configuration file is used as the explicit collision body pair and directly used as the candidate collision body pair.
[0127] In addition, in one embodiment, the collision body 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 geometric body types are not supported, such as collisions between planes. Use the collision body type filter to filter out such unsupported collisions.
[0132] It should be noted that the edges of the objects to be collided may be so close that people may think that the edges of the two objects are in contact with each other. The boundary filter, i.e., the bounding sphere test, is used for filtering to filter out objects whose edges are very close but not overlapping (i.e., colliding) from the selected candidate collision body pairs.
[0133] In this implementation, a 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 the object as tightly as possible to ensure accuracy while maintaining efficiency.
[0135] Calculate the distance between the centers of spheres: For any pair of objects that may collide, calculate the distance between the center points of their respective bounding spheres.
[0136] Compare the distance between the sphere centers and 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 distance between the sphere centers is less than or equal to the sum of the radii, it means that the two bounding spheres overlap (or touch or intersect), which means that a collision may occur.
[0137] Filter non-contacting 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 between the sphere center distance and the sum of the radius, objects whose center distance is greater than the sum of the radius are filtered out from the screened candidate collision body pairs, that is, objects whose edges are very close but not overlapping are filtered out.
[0138] In this implementation manner, the contact point position is the coordinate of the contact point in three-dimensional space.
[0139] In this implementation manner, 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 implementation manner, the contact point distance is the distance at the contact point, which is less than the set boundary parameter.
[0141] In this implementation manner, the contact point velocity is a 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 realizes accurate detection of convex body collision 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 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) and makes this polyhedron surround 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 goes through a series of iterations to find a line segment or triangular face (in two-dimensional or three-dimensional space) that can represent the collision entrance. 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 continuously to finally obtain an accurate collision entrance. This process includes updating the vertices of the simplex and determining whether the light 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 entrance, then the two convex bodies have not collided.
[0158] The MPR algorithm is based on the concept of Minkowski Sum in geometry to determine whether two objects intersect. The shape formed by subtracting one convex shape from another convex shape is called the Minkowski difference of the two shapes.
[0159] In this implementation, 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 can be 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 implementation, 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 supporting point of the convex body B in direction n, S A (-n) represents the supporting 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) minus the support point S of A in the opposite direction A(-n), the result is the support point S of the Minkowski difference BA 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 is inside the Minkowski difference BA; this can usually be done by picking a point in B and subtracting a point in A, for example 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 BA’s support map, 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 intersections: 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 steps:
[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 by "replace 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, determine the hit step (if the origin is within the entrance, it means hit):
[0187] Determine the origin position: Points V0, V1, V2 and V3 form a tetrahedron. Due to the convexity of BA, the entire tetrahedron is located inside BA; considering that the origin ray starts from the internal point V0 and passes through the candidate entrance into the tetrahedron, if the origin is located within the triangular entrance defined by V1, V2 and V3, then it must also be located in this tetrahedron, and thus also within the Minkowski difference BA. In this case, a "hit" will be obtained.
[0188] Get a new support point: If the algorithm progresses to this step and the origin is not found inside the tetrahedron, it means that the origin may be on the side opposite the entrance. Further exploration is needed 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 is between the inlet and the supporting plane, so the search needs to be refined by finding a new inlet that is closer to the BA surface. Consider the tetrahedron formed by the supporting point and the inlet. The origin enters the tetrahedron through the inlet, so it is guaranteed to pass through one of the three outer surfaces formed by the supporting point and the three edges of the tetrahedron in 3D space. This step determines which outer surface the ray passes through and replaces the old one with this new inlet. To determine which outer surface the origin ray passes through, the origin needs to be 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 inlet.
[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 velocity vector in the negative direction; 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 body of the working equipment. These basic collision shapes are all convex collision bodies.
[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 means that for any two points in the set, the line segment connecting the two points is also completely inside the set. Extending this concept to three-dimensional space, we get a "convex collider" - that is, there is no inward concave part on its surface, and the line connecting any two points will be completely inside the collider or on its surface.
[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, to treat the combination of multiple convex collision bodies 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 fit the surface of the non-convex object closely, thus approximately simulating its shape.
[0201] Next, we need to "union" these convex collision bodies, that is, treat them as a unified collision body. This does not mean physically merging them, but 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. Preprocessing 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, and maps 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 represents 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 that collides includes a first collision body and a second collision body;
[0211] In the colliding collider pair:
[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 implementation manner, the spatial velocity of the collision body is also the generalized velocity of the system to be simulated.
[0217] In this implementation manner, 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 agreed 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 implementation, 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, the contact Jacobian matrix is inserted into the Jacobian matrix of the system to be simulated and 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 complies with 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 the convex optimization problem is solved using an optimization algorithm 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 implies contact force;
[0230] Problem conversion steps: using contact force as the Lagrangian multiplier of the original problem, converting 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 constraint acceleration Constrained Acceleration The contact constraints restrict the motion of the system to be simulated. They are part of the general equation of motion and ensure that the motion of the system to be simulated complies with the 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 system to be simulated 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 the contact friction cone; represents the dual of the friction cone; is the submatrix of all rows of the Jacobian matrix corresponding to contact constraints.
[0236] In addition, in one embodiment, the Lagrangian dual problem is:
[0237]
[0238] subjecttoλ∈Ω
[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 constraint 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 implementation, in the original problem, the contact force f is implicit, 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 Coriolis force, centrifugal force and gravity, and their 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; forward represents forward dynamics.
[0257] Using forward dynamics, we can calculate the acceleration of the system to be simulated, i.e. the spatial constraint acceleration, from the known state of the system to be simulated.
[0258] The dual problem is a convex optimization problem about the contact force. 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 is 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] Where 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, the non-rigid constraints commonly seen in actual systems, such as the 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 introduction of constraints, the unconstrained dynamic equation is expanded to a constrained dynamic equation, forming the complete original problem:
[0272]
[0273] In the description, the diagonal regularization matrix R>0, which makes the constraints softer; refer to the acceleration a ref , which stabilizes the constraints and ensures that the system behaves as expected. The slack variable y exists to model soft constraints. Notation 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] Suppose an augmented dynamic system, whose position state is (q,z) and velocity state is (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 get 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 unforced deformation acceleration. When the constraint force f is equal to f defined in the parameter section as follows + 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:
[0285] In forward dynamics, the constrained acceleration is obtained The local constraint acceleration can be calculated
[0286] The contact force can be calculated using a1:
[0287]
[0288] subjecttoλ∈Ω
[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] We 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 practically analyzed.
[0295] Substitute f + into the constrained dynamics equation a1 = a0 + Af and rearrange the terms to get:
[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 of R → 0, it is a hard constraint, and at this time a1 = a ref ;
[0299] While in the limit of R → ∞, it is an infinitely soft constraint (i.e., no constraint), and at this time a1 = a0.
[0300] Therefore, a parameter is introduced to directly control this interpolation. This parameter is called the impedance parameter and is denoted as d. It is a vector of dimension n C satisfying 0 < d < 1 element-wise. By adjusting the impedance parameter to control the hardness of the constraint, different physical scenarios can be adapted.
[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 at 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] Among them, 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 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 these axes.
[0315] In this implementation, 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 often used to solve linear equations or linear complementarity problems (LCPs).
[0316] Gauss-Seidel iteration method basics:
[0317] The Gauss-Seidel iteration method is an iterative method for solving the linear equation system Ax = b. It is based on the improvement of the Jacobi iteration method. The core is to use the newly calculated component information immediately in each iteration to accelerate the convergence of the iterative process. This method is particularly suitable for solving large-scale sparse matrices, especially symmetric positive definite matrices.
[0318] Projected Gauss-Seidel algorithm features:
[0319] The PGS algorithm is an algorithm that introduces projection operations to solve linear complementarity problems (LCP) or similar problems based on the Gauss-Seidel iteration method. It can handle complex constraints. The LCP problem refers to a linear programming problem that satisfies certain conditions, such as the linear equation system Ax+b=y, and the sum of the products of the corresponding components of x and y is 0. The PGS algorithm iteratively updates the value of x and projects it onto the constraint set that satisfies the LCP problem, thereby gradually approaching the solution to the problem.
[0320] Application of PGS algorithm:
[0321] The PGS algorithm is widely used in the fields of physics engines, engineering calculations, optimization problems, etc. Especially in physics engines, it is often used to solve constraint problems between multiple rigid bodies, such as contact constraints, hinge constraints, etc. Through the PGS algorithm, the motion state of rigid bodies that meet all constraints can be efficiently calculated.
[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 number 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 iteration steps until the convergence condition is 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 float-over installation operation simulation:
[0328] Before the simulation starts, initialize the states of all collision bodies in the floating installation operation simulation, including:
[0329] Initial positions of transport barge, floatation module and jacket, where the jacket is a fixed position equipment and its position does not change with time;
[0330] Initial linear velocity and angular velocity of the transport barge, floatation module and jacket. The jacket is a fixed position equipment and its velocity (linear velocity and angular velocity) is always 0.
[0331] According to the time-domain motion simulation model of the operating equipment, all forces on the transport barge and the floating assembly 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 speed (linear speed and angular speed) 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 through 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 ; Centripetal force and Coriolis force matrix C of transport barge RB (v) Additional mass and additional moment of inertia of the transport barge M A ; Fluid centripetal force and Coriolis force matrix C A (v r ); the 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 floating assembly is:
[0343]
[0344] The model input conditions include: the mass and moment of inertia M of the floatation module RB ; Floatation module centripetal force and Coriolis force matrix C RB (v); Floatation module gravity g b ; Constraint force f caused 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 floating assembly is a rigid structure on water, and 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] Rigidbody plays a vital 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., so that these objects can move and respond like objects in the real world.
[0350] Collision entities refer to colliders, which are another physical component used to define the shape and boundaries of an object for accurate collision detection in physical 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 the collision detection mechanism, rigid bodies and collision entities are inseparable. Collision entities need to be attached to the underlying rigid bodies to play their role in collision detection. This is because rigid bodies provide physical properties and motion states, while collision entities define the shape and boundaries of objects. When two rigid bodies with collision entities touch or overlap each other, the algorithm calculates the collision response based on these definitions, such as bounce, slide, or stop.
[0352] After implementing the combination of rigid bodies and collision entities, the implementation of collision detection becomes relatively intuitive. The algorithm constantly monitors the position and state of the rigid body with the collision entity, and when it detects that the two rigid bodies are in contact or overlap, a collision event is triggered. These events can be further processed to achieve effects such as physical response.
[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 the collision entity pairs that are in contact; and the contact distances between the contact points of these collision entity pairs (i.e., collision body pairs) are all less than the boundary parameters set in advance 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 of the potential collisions are undesirable, so they can be excluded at the modeling stage (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 step: 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 step includes:
[0362] Wide-stage collision detection step: Use an improved sweep and culling algorithm to sort the main eigenvectors of the covariance matrix of all collision body centers to generate potential collision body 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: Based on the contact point information, apply contact constraints to the system to be simulated:
[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, the contact force is defined as the only global solution to a convex optimization problem. The convex optimization problem is solved using an optimization algorithm to obtain the contact force:
[0370] Original problem steps: define an original problem based on constrained acceleration, wherein the original problem implies contact force;
[0371] Problem conversion steps: using contact force as the Lagrangian multiplier of the original problem, converting 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. Update the external force based on the obtained contact 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 integration to complete the simulation.
[0374] The technical solution provided by the present invention is further described in detail above through several specific implementation modes in order to highlight the advantages and benefits of the technical solution provided by the present invention. However, the several specific implementation modes described above are not intended to be used as limitations on the present invention. Any reasonable changes and improvements to the present invention, reasonable combinations of implementation modes and equivalent substitutions based on the spirit and principles of the present invention should be included in the protection scope 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: obtaining a set of mass points including rigid bodies and flexible bodies of the working equipment and taking it as the system to be simulated; initializing 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, and the external force applied to each collision body in the initial stage; the external force is 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; Steps for solving contact force: based on the contact point information, applying contact constraints to the system to be simulated; for the system to be simulated with the contact constraints applied, defining the contact force as the only global solution of a convex optimization problem, using an optimization algorithm to solve the convex optimization problem, and obtaining the contact force; Motion simulation steps: Use the time-domain motion simulation model of the operating equipment for simulation. Update the external force based on the obtained contact force, solve to obtain the acceleration of the operating equipment, and obtain the motion speed and posture of the operating equipment through the fourth-order Runge-Kutta method integration to complete the simulation.
2. The method for modeling and simulating coupled collision dynamics of marine engineering equipment according to claim 1, characterized in that: 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 M RB ; Centripetal force and Coriolis force matrix C of working equipment RB (v); Additional mass and additional moment of inertia of the operating equipment M A ; Fluid centripetal force and Coriolis force matrix C A (v r ); the first-order damping and second-order damping matrices D(v r ); operating equipment fluid memory effect force μ; operating equipment static stiffness matrix G; operating equipment ballast force g0; water structure self gravity 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 ; The calculation results of the time domain motion simulation model of the operating equipment include: The motion 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: When the operating equipment is a floating structure, the external force τ required to calculate the contact force f is: τ=τ Line +t Wind +t Wave -C A (v r )v r -D(v r )v r -μ-Gq-g0; When the operating equipment is a rigid structure on water, the external force τ required to calculate the contact force f is: τ=τ Line +t Wind 。 3. The method for modeling and simulating coupled collision dynamics of 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 step: 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 method for modeling and simulating coupled collision dynamics of 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 implies contact force; Steps for problem conversion: Use contact force as the Lagrange multiplier of the original problem to convert the original problem into its Lagrange dual problem; The Lagrangian dual problem is a convex optimization problem about 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 method for modeling and simulating coupled collision dynamics of 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; 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 the contact friction cone; represents the dual of the friction cone; is the submatrix of all rows of the Jacobian matrix corresponding to the contact constraints; The Lagrangian dual problem is: subject toλ∈Ω Where: <h2 style=";text-align:left;direction:ltr">A=JM<h2 style=";text-align:left;direction:ltr"> -1 <h2 style=";text-align:left;direction:ltr"> J<h2 style=";text-align:left;direction:ltr"> T <h2 style=";text-align:left;direction:ltr"> ; in: 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; The optimization algorithm is the Projected Gauss-Seidel algorithm.
7. Marine engineering equipment coupled collision dynamics modeling and simulation device, characterized in that: The device comprises the following modules: Initialization module: 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 force applied to 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 solving module: based on the contact point information, the contact constraint condition is imposed on the system to be simulated; for the system to be simulated with the contact constraint condition imposed, 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; Motion simulation module: The time-domain motion simulation model of the operating equipment is used for simulation. According to the obtained contact force, the external force is updated, the acceleration of the operating equipment is solved, and the motion speed and posture of the operating equipment are obtained through the fourth-order Runge-Kutta method integration to complete the simulation.
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 / instructions are 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
Movable cable motion simulation method based on position dynamics and controller
CN114237076A
Minimization function for friction solving
US20210089628A1
System and method for modeling rigid body motions with contacts and collisions
US20220245310A1
Cited By
Multi-sensor cooperative control method and system for floating support installation
CN120029355A
Component stackable review method and device, electronic equipment and storage medium
CN120832777A
Joint simulation method for structural collision effect in floating installation process of offshore converter station
CN121118771A
Collision positioning method and equipment of photoetching machine shock isolation table
CN121386312A
Collision positioning method and device for lithography machine isolation table
CN121386312B