Simulation method, device and equipment for multi-body dynamics, medium and product
By constructing a stochastic discrete Lagrangian function and a Bayesian neural network, and dynamically adjusting the time step and solution strategy, the problem of unifying physical structure and uncertainty adaptive control in multibody dynamics simulation is solved, thereby improving the reliability and robustness of the simulation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU GONGDING TECHNOLOGY CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-24
AI Technical Summary
Existing simulation methods struggle to reconcile physical structure preservation with uncertainty-adaptive control when dealing with multibody dynamics, resulting in insufficient simulation reliability.
By constructing a stochastic discrete Lagrangian function, a Bayesian neural network is used to perceive system uncertainties in real time. Based on the DEL equation, multiple samplings are performed, and the time step and solution strategy are dynamically adjusted to form a closed loop of perception-decision-control, ensuring the credibility and robustness of the simulation results.
While maintaining the physical structure, it effectively unifies uncertainty quantification and structure fidelity integral, significantly improving the credibility and robustness of simulation results in high-risk scenarios.
Smart Images

Figure CN121920209A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of simulation technology, and in particular to a simulation method, apparatus, equipment, medium and product for multibody dynamics. Background Technology
[0002] In the fields of scientific computing and engineering simulation, high-confidence dynamic system modeling technology is increasingly becoming a core support for key applications such as aerospace, robotics control, and climate prediction. As the requirements for simulation robustness of complex systems increase, modern simulation technology not only needs to accurately capture physical laws, but also needs to inherently handle multi-source uncertainties such as parameter disturbances, measurement noise, and model defects. This poses a fundamental challenge to traditional deterministic simulation frameworks.
[0003] Currently, existing technical approaches are mainly divided into two categories: one is traditional numerical integration methods, such as linear multistep methods, Runge-Kutta methods, and structure-fidelity integrators based on the variational principle of discrete mechanics, which maintain the long-term stability of the system through local truncation error control and symplectic geometric structures; the other is uncertainty quantification techniques, including interval methods based on boundary analysis, Bayesian posterior inference frameworks, and machine learning enhancement models (such as Bayesian neural networks). Some integrated schemes attempt to embed stochastic processes into variational frameworks or design uncertainty adaptive strategies, but most adopt modular decoupling architectures.
[0004] However, existing simulation methods suffer from the problem of insufficient reliability due to the difficulty in unifying physical structure preservation and uncertainty adaptive control. Summary of the Invention
[0005] The simulation methods, apparatus, equipment, media, and products for multibody dynamics provided in this application are intended to improve the reliability of simulations.
[0006] In a first aspect, embodiments of this application provide a simulation method for multibody dynamics, comprising:
[0007] Based on the state information and sampling weights of the simulation model of multibody dynamics in the current state, a stochastic discrete Lagrangian function is constructed, and the sampling weights characterize the uncertainty of the simulation model under different conditions.
[0008] The DEL equation is derived by deriving the stochastic discrete Lagrange function.
[0009] The DEL equation is sampled multiple times to obtain a trajectory set; the trajectory set represents the probability distribution of the simulation model in the next state; the next state is the state of the current state at the next time step;
[0010] Based on the uncertainty measure of the trajectory set, adjust the time step of the next state and the solution strategy of the simulation model;
[0011] Based on the time step of the next state and the solution strategy of the simulation model, the simulation model is run to obtain the simulation results.
[0012] In one possible implementation, a stochastic discrete Lagrangian function is constructed based on the state information and sampling weights of the multibody dynamics simulation model in the current state, including:
[0013] Sampling weights are randomly drawn from an uncertainty knowledge base, which represents the variational posterior distribution obtained by amortizing inference on a Bayesian neural network based on training data.
[0014] Based on the sampling weights and the state information of the simulation model in the current state, a stochastic discrete Lagrange function is constructed.
[0015] In one possible implementation, the method further includes, before randomly drawing sampling weights from the uncertain knowledge base:
[0016] Acquire training data for multibody dynamics, including benchmark data, measured noise data, and data from uncertain scenarios;
[0017] Feature data is obtained by extracting features from time step data at different time steps in the training data.
[0018] Based on the feature data and its data labels, an amortized inference is performed on the Bayesian neural network to obtain an uncertainty knowledge base representing the variational posterior distribution.
[0019] In one possible implementation, the DEL equations are sampled multiple times to obtain a trajectory set; the trajectory set represents the probability distribution of the simulation model in the next state, including:
[0020] Based on the DEL equation, Monte Carlo sampling is performed to randomly generate trajectories representing the uncertainty propagation state of the simulation model in the next state;
[0021] A set of trajectories is obtained based on the randomly generated trajectories.
[0022] In one possible implementation, the time step of the next state and the solution strategy of the simulation model are adjusted according to the uncertainty measure of the trajectory set, including:
[0023] Determine the confidence interval of the trace or trajectory set of the covariance matrix, which is obtained from the trajectory set;
[0024] The uncertainty measure of the trajectory set is obtained based on the confidence interval of the trace or trajectory set of the covariance matrix;
[0025] Based on the uncertainty measure of the trajectory set, adjust the time step of the next state and the solution strategy of the simulation model.
[0026] In one possible implementation, adjusting the time step of the next state based on an uncertainty measure of the trajectory set includes:
[0027] The ratio result is obtained based on the uncertainty measure and uncertainty threshold;
[0028] Determine the target ratio based on the comparison results between the ratio and the preset ratio range;
[0029] Based on the target ratio, the time step of the current state is adjusted to obtain the adjusted time step of the next state.
[0030] In one possible implementation, the solution strategy of the simulation model is adjusted based on the uncertainty measure of the trajectory set, including:
[0031] When the uncertainty measure is less than or equal to the first threshold, the solution strategy of the simulation model is the first solution strategy;
[0032] When the uncertainty measure is greater than the first threshold and less than or equal to the second threshold, the solution strategy of the simulation model is the second solution strategy.
[0033] When the uncertainty measure is greater than the second threshold, the solution strategy of the simulation model is the third solution strategy; the first, second and third solution strategies are different.
[0034] In one possible implementation, the simulation model is run according to the time step of the next state and the solution strategy of the simulation model to obtain simulation results, including:
[0035] The next state information is determined based on the time step of the next state and the solution strategy of the simulation model.
[0036] The next state information is used as the state information of the multibody dynamics simulation model in the current state. The steps of constructing a random discrete Lagrangian function based on the state information of the multibody dynamics simulation model in the current state and the uncertainty quantification neural network are repeated until the obtained uncertainty measure meets the preset conditions that characterize the uncertainty measure runaway or the probability of task success is less than the probability threshold. Then the simulation is determined to end and the simulation results are output.
[0037] In one possible implementation, when using the next-state information of the next state as the state information of the multibody dynamics simulation model in the current state, and re-executing the step of constructing a stochastic discrete Lagrangian function based on the state information of the multibody dynamics simulation model in the current state and the uncertainty quantization neural network, the method further includes:
[0038] If the time step of the next state represents the end of the preset time, then the simulation is considered to have ended and the simulation results are output.
[0039] If the simulation model triggers a preset event, the simulation is considered complete, and the simulation results are output.
[0040] Secondly, embodiments of this application provide a simulation device for multibody dynamics, comprising:
[0041] The module is used to construct a stochastic discrete Lagrangian function based on the state information and sampling weights of the simulation model of multibody dynamics in the current state. The sampling weights characterize the uncertainty of the simulation model under different conditions.
[0042] The first module is used to derive the stochastic discrete Lagrange function and obtain the DEL equation;
[0043] The second module is used to sample the DEL equation multiple times to obtain a trajectory set; the trajectory set represents the probability distribution of the simulation model in the next state; the next state is the state of the current state at the next time step;
[0044] The adjustment module is used to adjust the time step of the next state and the solution strategy of the simulation model based on the uncertainty measure of the trajectory set.
[0045] The simulation module is used to run the simulation model and obtain simulation results based on the time step of the next state and the solution strategy of the simulation model.
[0046] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0047] The memory stores the instructions that the computer executes;
[0048] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0049] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0050] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0051] The simulation methods, devices, equipment, media, and products for multibody dynamics provided in this application embed random discrete Lagrangian functions into the simulation model to form DEL equations based on Bayesian neural networks, allowing the system to maintain its variational structure and symplectic geometric properties within a probabilistic framework. Secondly, by sampling the DEL equations multiple times to generate trajectory sets, these trajectories not only represent the complete probability distribution of the next state but also implicitly contain the uncertainty propagation mode under physical constraints. Based on the uncertainty metric calculated from the trajectory set, the time step and solution strategy are dynamically adjusted. This allows the simulation model to be run according to the time step of the next state and the solution strategy of the simulation model to obtain simulation results. This enables the simulation system to maintain physical laws while dynamically adjusting its computational behavior according to the uncertainty level, thereby fundamentally solving the problem of the separation between maintaining physical structure and quantifying uncertainty in traditional methods, and improving the credibility of simulation results in high-risk scenarios. Attached Figure Description
[0052] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0053] Figure 1 A schematic diagram of a scenario for the simulation method for multibody dynamics provided in this application;
[0054] Figure 2 A flowchart illustrating the simulation method for multibody dynamics provided in this application. Figure 1 ;
[0055] Figure 3 A flowchart illustrating the simulation method for multibody dynamics provided in this application. Figure 2 ;
[0056] Figure 4 A schematic diagram of the structure of the simulation device for multibody dynamics provided in this application;
[0057] Figure 5 A schematic diagram of the structure of the electronic device provided in this application.
[0058] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0059] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0060] First, let me explain the terms used in this application:
[0061] Bayesian Neural Network (BNN) can refer to a probabilistic neural network model that treats network weights as random variables rather than deterministic parameters. It is used to learn physical relationships in the dynamics of multibody systems that are difficult to model accurately (such as nonlinear forces, contact characteristics, or unmodeled disturbances).
[0062] The DEL equation (Discrete Euler-Lagrange equation) refers to the system evolution equations derived by variationalizing discrete actions within the framework of discrete mechanics, used to replace the continuous-time Euler-Lagrange equations.
[0063] The core challenge facing current multibody dynamics simulation technology lies in the capability gaps caused by its modular development path. Traditional numerical integration methods (including structure-fidelity integrators) are mature in deterministic environments but cannot intrinsically handle uncertainty. Uncertainty quantification techniques (such as interval analysis, Bayesian inference, and machine learning methods), while each possessing unique characteristics, mostly exist as independent modules with loose coupling to the integration process. This fragmentation results in significant shortcomings in existing integrated schemes (such as stochastic variational integrators and adaptive strategies) in characterizing complex uncertainty patterns, balancing computational efficiency and accuracy, and achieving systematic integration. It also prevents the construction of real-time control mechanisms based on uncertainty feedback. Therefore, the field urgently needs a unified framework that deeply integrates advanced uncertainty quantification and structure-fidelity integration techniques. This framework must simultaneously achieve four core functions: real-time quantification and explicit output of predicted uncertainty; adaptive adjustment of the integration strategy using uncertainty information; handling complex uncertainty patterns while maintaining physical structure; and balancing computational efficiency and numerical stability, thereby forming a truly robust simulation platform with intrinsic uncertainty perception capabilities.
[0064] The simulation method for multibody dynamics provided in this application is based on the discrete variational principle, constructing a unified mathematical framework that deeply couples an uncertainty quantification module (BNN / normalized flow) with a structure-fidelity integrator. First, a Bayesian neural network is used to perceive the uncertainty of the system state in real time and output its probability distribution. Based on this, the integration step size, order, or model switching strategy is dynamically adjusted according to the uncertainty metric. This creates a closed loop of "perception-decision-control," ensuring the credibility and robustness of simulation results under complex and uncertain environments.
[0065] Figure 1 A scene illustration for the simulation method for multibody dynamics provided in this application, such as... Figure 1 As shown, the specific application scenario of this application can be a simulation system, which can be a server, such as a tablet or computer. This application does not restrict the executing entity, as long as it can construct a stochastic discrete Lagrangian function based on the state information and sampling weights of the simulation model of multibody dynamics in the current state. The sampling weights characterize the uncertainty of the simulation model under different conditions. The stochastic discrete Lagrangian function is derived to obtain the DEL equation. The DEL equation is sampled multiple times to obtain a trajectory set. The trajectory set represents the probability distribution of the simulation model in the next state. The next state is the state of the current state at the next time step. Based on the uncertainty measure of the trajectory set, the time step size of the next state and the solution strategy of the simulation model are adjusted. Based on the time step size of the next state and the solution strategy of the simulation model, the simulation model is run to obtain the simulation results.
[0066] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0067] Figure 2 A flowchart illustrating the simulation method for multibody dynamics provided in this application. Figure 1 ,like Figure 2 As shown, the method includes:
[0068] S201. Based on the state information and sampling weights of the simulation model of multibody dynamics in the current state, construct a stochastic discrete Lagrangian function. The sampling weights characterize the uncertainty of the simulation model under different conditions.
[0069] The current state information may include the generalized coordinates and generalized momentum of the simulation model at the current moment, wherein:
[0070] Generalized coordinates can refer to the smallest independent set of parameters used to describe the spatial configuration of a system. They are not limited to or directly use the Cartesian coordinates of every mass point in the system, and the most suitable parameterization method can be flexibly selected according to the system characteristics.
[0071] For example, for a multi-link robotic arm system, generalized coordinates can be represented as the rotation angles of each joint; for an elastic body structure, they can be represented as modal coordinates or finite element nodal displacements; for a fluid system, they can be represented as the stream function or the discrete coefficients of the vortex field.
[0072] Generalized momentum refers to the momentum variable conjugate with generalized coordinates, and can be defined as the partial derivative of the Lagrangian function with respect to generalized velocity. Generalized momentum characterizes the concentrated manifestation of a system's inertia in the generalized direction of motion. For example, in rigid body dynamics, linear generalized coordinates correspond to linear momentum, and angular coordinates correspond to angular momentum.
[0073] In this embodiment of the application, the state information of the simulation model in the current state can be used as the starting point for the calculation of the current time step.
[0074] The sampling weights, which characterize the uncertainty of a simulation model under different conditions, can refer to a set of specific parameter values extracted from the variational posterior distribution of a Bayesian neural network. Essentially, they represent a probabilistic realization of uncertainties in system dynamics (such as physical parameters like mass, inertia, friction, and stiffness). These sampling weights can characterize the cognitive uncertainty exhibited by the simulation model under different operating conditions (such as different configurations, velocities, or external disturbances). The concentration or dispersion of their distribution reflects the model's degree of certainty or doubt regarding the current conditions.
[0075] The stochastic discrete Lagrangian function (SDI) can refer to the energy functional obtained by probabilistically modeling the discrete expressions of the system's kinetic and potential energy within the discrete variational framework of multibody dynamics by introducing sampling weights. In the discrete variational integral method of multibody dynamics, it represents probabilistic dynamics constructed to model system uncertainties. It can be obtained by embedding terms representing randomness into a deterministic discrete Lagrangian function; these random terms can originate from the sampling weights, thus resulting in the stochastic discrete Lagrangian function.
[0076] S202. The DEL equation is obtained by deriving the random discrete Lagrange function.
[0077] The derivation of the stochastic discrete Lagrange function can refer to the process of deriving the integral format of the system state update based on the discrete variational principle and mathematical variational methods.
[0078] The DEL equations (Discrete Euler-Lagrange equations) refer to a class of structure-preserving numerical integral schemes rigorously derived from the discrete Lagrangian function based on the discrete variational principle. They are used to describe the dynamic evolution of a mechanical system over discrete time steps. By replacing the continuous action functional with a sum of discrete actions and setting its first variation to zero, a recursive relation connecting adjacent generalized coordinate states is obtained.
[0079] In this embodiment, the entire simulation period can be divided into several discrete time steps, and a discrete Lagrangian function dependent on the generalized coordinates and random parameters of the current and next time steps is defined between every two adjacent time steps. Then, the discrete Lagrangian functions over all time steps are summed to form a discrete action. Next, a variational operation is applied to this action, requiring its variation to be zero under fixed endpoint conditions. Through this variational process, a set of recursive relations, the DEL equations, can be obtained. These equations constitute the core integral scheme of the simulation model, inheriting not only the physical structural characteristics of continuous systems (such as the conservation of energy or momentum) but also, by introducing random parameters, intrinsically characterizing the uncertainties in the system dynamics, thus providing a numerical evolution rule for multibody systems that combines geometric fidelity and probabilistic consistency.
[0080] S203. Sample the DEL equation multiple times to obtain the trajectory set; the trajectory set represents the probability distribution of the simulation model in the next state; the next state is the state of the current state at the next time step.
[0081] Among them, sampling the DEL equation multiple times can refer to solving the DEL equation separately to obtain the corresponding next state prediction, that is, generating multiple state transition results that conform to the variational mechanics constraints through parameter randomization.
[0082] The trajectory set comprises multiple trajectories, each representing the next state point determined by a single parameter sampling in a single-step prediction. The entire set of trajectories collectively constitutes the empirical probability distribution of the next state, whose statistical properties (such as mean, variance, and multimodality) fully characterize the simulation model's cognitive uncertainty regarding the next state under current conditions. In other words, it is the set of multiple possible state realizations at the same time step.
[0083] S204. Based on the uncertainty measure of the trajectory set, adjust the time step of the next state and the solution strategy of the simulation model.
[0084] The uncertainty measure of the trajectory set can be a quantitative index obtained by calculating the statistical dispersion of the next-state trajectory set obtained from multiple samplings from the DEL equation. This index characterizes the level of cognitive uncertainty of the simulation model under current conditions. In some embodiments, the uncertainty measure may include the trace of the covariance matrix, prediction entropy, sample standard deviation, or quantile interval. A larger value indicates a more significant divergence in the system evolution results under different sampling weights, and a greater uncertainty in the model's grasp of the dynamic laws of the current region; conversely, a smaller value indicates more concentrated predictions and higher reliability.
[0085] The time step of the next state refers to the discrete step size used when advancing the simulation to the next time step, and its magnitude directly affects the accuracy and stability of numerical integration. In the uncertainty adaptive framework, this step size is no longer a preset constant, but is dynamically adjusted according to the uncertainty metric of the trajectory set: when the uncertainty metric exceeds a set threshold, the time step size is automatically reduced to improve local solution accuracy and suppress error accumulation; when the uncertainty is low, the step size can be appropriately increased to improve computational efficiency, thereby achieving intelligent step size control that allows for precise solutions where accuracy is required and rapid advancement in deterministic regions.
[0086] The solution strategy of the simulation model can refer to dynamically selecting different numerical solution modes based on the uncertainty metric reflected by the trajectory set. For example, when the uncertainty is low, priority is given to ensuring accuracy; when the uncertainty is medium, emphasis is placed on numerical robustness; and when the uncertainty is high, a data-driven emergency prediction mechanism is switched to achieve adaptive response of the solution behavior to the current confidence level.
[0087] S205. Based on the time step of the next state and the solution strategy of the simulation model, run the simulation model and obtain the simulation results.
[0088] Based on the current state, a state advancement calculation is performed by combining the adaptively adjusted time step with the solution mode that matches the current uncertainty level, thereby generating a next state prediction result that conforms to physical laws and is aware of uncertainty. This simulation result not only includes point estimates of state variables, but also implies their credibility information, providing a high-fidelity and highly robust dynamic evolution basis for subsequent time series simulations or decisions.
[0089] Therefore, the simulation method for multibody dynamics provided in this application embeds sampling weights characterizing the cognitive uncertainty of a multibody system into the construction of the discrete Lagrangian function. The derived DEL equation not only strictly maintains the geometric properties such as symplectic structure and momentum conservation guaranteed by the discrete variational principle, but also intrinsically integrates the uncertainty information of the system under the current state and different operating conditions. Furthermore, by sampling the DEL equation multiple times, a trajectory set realized by physical self-consistent dynamics is generated. This set is not a black-box statistical result, but a probabilistic state evolution constrained by variational mechanics. Thus, the simulation model can simultaneously output the uncertainty characterization of state transitions and structure consistency that conforms to the laws of multibody dynamics in a single-step prediction, providing a reliable basis for subsequent adaptive control based on uncertainty measurement. This unifies physical structure preservation and uncertainty quantification at the mechanism level, effectively overcoming the inherent defects of the separation between the two in traditional methods, and significantly improving the credibility and robustness of simulation results in high-risk scenarios.
[0090] Optionally, based on the state information and sampling weights of the multibody dynamics simulation model in the current state, a stochastic discrete Lagrangian function is constructed, including:
[0091] Sampling weights are randomly drawn from an uncertainty knowledge base, which represents the variational posterior distribution obtained by amortizing inference on a Bayesian neural network based on training data.
[0092] Based on the sampling weights and the state information of the simulation model in the current state, a stochastic discrete Lagrangian function is constructed.
[0093] The uncertainty knowledge base can represent a probabilistic parameter library built driven by training data, and its mathematical essence can be the variational posterior distribution of the weights of a Bayesian neural network. This knowledge base stores the uncertainty perception of model parameters (such as mass, stiffness, damping, etc.) of a multibody dynamics system under the constraints of observation data, and supports the efficient extraction of random parameter samples (i.e., sampling weights) that conform to physical laws during simulation, thereby providing an endogenous uncertainty representation capability for structure-preserving simulations.
[0094] Bayesian neural networks are not independent predictors, but rather serve as parameterization tools for the kinetic and potential energy terms in stochastic discrete Lagrangian functions. Their outputs are constrained by variational posterior distributions, ensuring that the generated dynamic behaviors are both expressive and conform to statistical laws.
[0095] Amortized inference refers to the technique of transforming traditional successive variational inference into an end-to-end trainable neural network mapping. By introducing an inference network, it takes the entire training trajectory dataset as input and directly outputs an approximate posterior distribution of the Bayesian neural network weights. Amortized inference can amortize the expensive posterior computation cost to the offline training stage, allowing for efficient sampling of weights from an uncertain knowledge base with only one forward propagation during online simulation, significantly improving real-time performance.
[0096] The variational posterior distribution refers to a parameterized approximation of the true posterior distribution, obtained through optimization by maximizing the lower bound of evidence (ELBO). This distribution characterizes the probabilistic properties of the weights of a Bayesian neural network given training data, and its shape (such as mean, variance, and multimodality) can reflect the strength of the constraints and uncertainty structure of the data on the system's dynamic parameters.
[0097] Random Discrete Lagrange Function satisfy:
[0098]
[0099] in, It is the discrete Lagrangian of the deterministic part, where, and These are standard notations, corresponding to deterministic and discrete characteristics, respectively. It is a Bayesian neural network, and its weights Follows the posterior distribution ( (for training data) It is a scaling factor to control the strength of the impact of uncertainty; and In discrete time steps Generalized coordinates on.
[0100] The random discrete Lagrange function To build upon the traditional deterministic discrete Lagrangian function, an additional term represented by a Bayesian neural network is introduced, thereby intrinsically embedding the model's uncertainties (including parameter errors, unmodeled dynamics, etc.) into the core description of the system's dynamics.
[0101] To construct a stochastic discrete Lagrange function, the method in the embodiments of this application may also be:
[0102] To handle uncertainty while preserving physical structure, we can start from the principle of stochastic variation. Continuous-time stochastic Lagrangian mechanics is based on:
[0103]
[0104] in, It is a continuous-time stochastic force function that describes how the system state affects the strength of random disturbances. For generalized coordinates, To The derivative of time, i.e., generalized velocity. This represents the Stratoovich integral. It is a Wiener process (describing random perturbations). It is a functional variational operator.
[0105] Based on its discretization scheme, a stochastic discrete Lagrange function is constructed:
[0106]
[0107] in, ; ( The integral step size is the increment of the discretized Wiener process. The mean is 0 and the variance is Gaussian random variables are used to describe the basic mathematical model of continuous-time stochastic processes. It provides the system with basic stochastic excitation, simulating white noise disturbances in the external environment, which forms the basis for constructing more complex uncertainty modes. It is a discrete approximation of random forces, and its mathematical formula is:
[0108]
[0109] Characterizing generalized coordinates and generalized speed The function.
[0110] Transforming continuous random forces into discrete forms enables the handling of randomness within a discrete variational framework.
[0111] Next, normalized flow is used to learn complex stochastic terms. Normalized flow is achieved through a series of invertible transformations. A simple base distribution (such as a Gaussian distribution) Mapping to a complex target distribution:
[0112]
[0113] in, No longer limited to Gaussian noise, it can capture multimodal and non-Gaussian uncertainties. Therefore, it can... Substitution Then, applying the discrete variational principle, the stochastic variational integral scheme is obtained:
[0114]
[0115] Here, it is not necessary to use it directly. (Gaussian noise), but instead uses the normalized flow generated It can capture complex uncertainty patterns such as multimodal, asymmetric, and heavy-tailed modes. It can be learned from training data and can more realistically reflect the uncertainty characteristics of real-world systems.
[0116] This framework, based on variational principles, constructs a unified mathematical framework that combines structure preservation and uncertainty quantification, enabling the natural propagation of uncertainty within discrete mechanics systems. On one hand, because the derivation is based on variational principles, the integrator naturally preserves physical properties such as symplectic structures. On the other hand, through normalization flow, it can learn and propagate complex uncertainty patterns, overcoming the limitation of traditional methods that can only handle simple random terms. The endogenous uncertainty propagation mechanism ensures accurate characterization of complex uncertainty patterns while preserving physical laws, addressing the shortcomings of traditional methods in uncertainty modeling.
[0117] Traditional deterministic variational integrators are based on the discrete variational principle, using discretized Lagrangian functions. The integral scheme is derived. Its core is the discrete Euler-Lagrange equations:
[0118]
[0119] in, Indicates the first Partial derivatives of each variable. These are the system at discrete time steps. The generalized coordinates on the coordinate system are used to describe the configuration (position and attitude) of the system at the corresponding moment. It is a discrete Lagrangian function. It is a continuous Lagrangian function. In time interval Approximations on the coordinate system are usually made by applying generalized coordinates. and speed It is obtained by discretization (e.g., using finite difference or numerical integration). It defines the state... arrive The "discrete action".
[0120] This formula is the core equation of the deterministic variational integrator. Its physical essence is d'Alembert's principle in discrete mechanics, which states that the evolution path of the system at any given time satisfies the "minimum of action". It describes the evolution law of a conservative mechanical system at discrete time points. By discretizing, this equation strictly preserves the inherent geometric structure of the original continuous system (such as symplectic structure, momentum conservation, etc.).
[0121] Replacing the normalized flow with a Bayesian neural network, which acts as an "uncertainty perceptron" and is directly embedded in the computational graph of the stochastic / interval variational integrator, forms an end-to-end joint computational framework. From this, the stochastic discrete Lagrangian function can be obtained. .
[0122] In this embodiment of the application, before randomly extracting sampling weights from the uncertainty knowledge base, the method further includes:
[0123] Acquire training data for multibody dynamics, including benchmark data, measured noise data, and data from uncertain scenarios;
[0124] Feature data is obtained by extracting features from time step data at different time steps in the training data.
[0125] Based on the feature data and its data labels, an amortized inference is performed on the Bayesian neural network to obtain an uncertainty knowledge base representing the variational posterior distribution.
[0126] Among them, the reference data can refer to the dynamic trajectory data of a multibody system obtained under ideal or high-fidelity conditions. It can be derived from high-precision numerical simulation (such as a reference solution obtained by using a small step size symplectic integrator) or precise measurement under a controlled experimental environment.
[0127] Noise measurement data can refer to a noisy state observation sequence collected from an actual physical system, including real-world factors such as sensor measurement errors, actuator disturbances, and unmodeled environmental interference.
[0128] Uncertainty scenario data refers to trajectory data collected when parameters are unknown, operating conditions are abnormal, or the system is in an edge state. Its characteristics are highly nonlinear dynamic behavior, sparseness, or distribution shift.
[0129] Feature data can refer to the structured representation obtained by performing time-series feature engineering or automatic encoding on the state sequence of each time step in the training data.
[0130] Specifically, for the raw observations at each time step in the training data, structured information that can effectively characterize the local dynamics of the system is extracted through design or learning methods to form feature data.
[0131] The extracted feature data is then used as input, with its corresponding true next state (or state transition increment) serving as the supervision label, to train an inference network. The goal of this network is to learn a mapping: given the features of the current state, it directly outputs the variational posterior distribution parameters (such as mean and variance) of the Bayesian neural network weights. By maximizing the lower bound of evidence (ELBO), the inference network completes a global approximation of the entire posterior distribution in the offline phase, thereby constructing an uncertainty knowledge base. Therefore, during online simulation, only the features of the current state need to be input to sample the model weights that conform to the cognitive uncertainty under that condition, without repeating the expensive Bayesian inference.
[0132] In this embodiment of the application, the lower bound of evidence satisfies:
[0133]
[0134] in, The lower bound of evidence is defined by its value in relation to the inference network. Trainable parameters The function is the objective function to be maximized.
[0135] Inference Networks It is an easily sampled distribution (such as a Gaussian distribution) parameterized by a neural network to approximate the true posterior. The network is based on the training dataset. As input, output the weights of the Bayesian Neural Network (BNN). An approximate posterior distribution.
[0136] Dataset It can contain state trajectory data collected from high-fidelity simulations or real-world systems. .
[0137] In the embodiments of this application, weight It is not a fixed value, but follows a distribution. For about distribution The expectation. It is a log-likelihood estimate, which measures the likelihood of a given set of weights. In this case, the model uses the training data The degree of fit. Maximizing this term means finding a model that can well explain the observed data. The prior distribution of the weights (such as a standard Gaussian distribution) represents the initial belief about the model before it sees the data.
[0138] The KL divergence measures the approximate posterior. With prior distribution The difference between them. Minimize this term (because it is in The negative sign (in the middle) can prevent the approximate posterior from deviating too much from the prior, thus playing a regularizing role and avoiding overfitting.
[0139] The above formula is the core of amortization inference, defining a method for training the inference network. The optimization objective (loss function) is to find the network parameters. , making Maximize. Maximizing this lower bound is equivalent to approximating the posterior. To get as close as possible to the true, but computationally difficult, posterior distribution. During online simulation, weights can be efficiently sampled from this network. This eliminates the need for expensive Monte Carlo Markov chain sampling or variational inference. Consequently, computational efficiency is optimized, i.e., the computational cost during training is amortized over countless fast online inferences.
[0140] In this embodiment of the application, in order to maintain the physical structure, it is ensured that the weights are consistent across all samples. Under these conditions, all stochastic variational integral schemes satisfy the Discrete Noether theorem. For example, if the original system is rotationally invariant at the continuous level, then the discrete integral scheme also guarantees the conservation of angular momentum:
[0141]
[0142] in, These are the system at time. and The generalized coordinates. These are infinitesimal generators related to system symmetries (such as rotation invariance). They can be matrices describing how symmetry transformations act on generalized coordinates. . It is a matrix The transpose of . It is a stochastic discrete Lagrangian function that incorporates uncertainties from the BNN. . It is a random discrete Lagrange function Its first variable The partial differential of . It is a random discrete Lagrange function Regarding its second variable The partial differential of .
[0143] In this embodiment, Noether's theorem states that every continuous symmetry in a continuous mechanical system corresponds to a conservation law (e.g., energy conservation for time translation symmetry, and angular momentum conservation for spatial rotational symmetry). Variational integrators can inherit this property at the discrete level. A discrete version of Noether's theorem can be naturally derived from the discrete variational principle. The formula above is precisely the expression of this discrete theorem. It shows that regardless of the sampled neural network weights... As long as the original system has rotational symmetry, the dynamic evolution calculated by this integral scheme will automatically satisfy the discrete angular momentum conservation equation (i.e., the left side of the formula is always equal to zero).
[0144] Therefore, this formula ensures structural fidelity. It can be mathematically proven that the method of this application does not sacrifice physical laws when dealing with uncertainty. The integrator does not exhibit non-physical energy or momentum drift in long-term simulations, thus guaranteeing numerical stability and the physical reliability of the results. This contrasts sharply with traditional methods that often destroy physical structures after introducing randomness.
[0145] Therefore, by using the lower bound formula of evidence to infer through amortization, the expensive Bayesian computation is transferred to the offline stage, achieving high efficiency in online computation. The angular momentum conservation formula, through the discrete Noether's theorem, ensures that the integrator strictly maintains the physical conservation laws under uncertain environments, achieving structural fidelity. The efficiency optimization mechanism ensures the feasibility of the entire system in engineering practice, enabling high-precision uncertainty perception and robust integration to be achieved under actual computational resource constraints.
[0146] Optionally, the DEL equations are sampled multiple times to obtain a trajectory set; the trajectory set represents the probability distribution of the simulation model in the next state, including:
[0147] Based on the DEL equation, Monte Carlo sampling is performed to randomly generate trajectories representing the uncertainty propagation state of the simulation model in the next state;
[0148] A set of trajectories is obtained based on the randomly generated trajectories.
[0149] Monte Carlo sampling refers to a numerical method based on random sampling. It independently extracts multiple sets of sampling weights from the variational posterior distribution (i.e., the uncertainty knowledge base) that characterizes the uncertainty of Bayesian neural network weights. Each set of weights is substituted into the DEL equation to obtain a physically consistent next-state prediction. By repeating this process multiple times, a set of state samples that obey the probabilistic dynamics of the system is generated. These samples together constitute a non-parametric approximation of the next-state posterior prediction distribution, and their statistical properties (such as mean, variance, and quantiles) can effectively characterize the propagation behavior of uncertainty in single-step state transitions.
[0150] In this embodiment of the application, the Discrete Euler-Lagrange equations (DEL equations) satisfy:
[0151]
[0152] because, The solution to this equation is random. It is also a probability distribution. The network weights are sampled using Monte Carlo methods. This allows us to obtain a series of possible trajectories, from which the state can be calculated. The confidence interval. This formula is obtained by applying the variational principle to the stochastic discrete Lagrangian function. It is formally consistent with the deterministic equation, but differs in its core... Since it is random, the solution to the equation (i.e. the evolution trajectory of the system) also changes from a deterministic sequence to a probability distribution.
[0153] The above derivation achieves end-to-end joint computation. Therefore, uncertainty is no longer analyzed through post-processing, but rather through... It is directly embedded into the core of the dynamic equations. This breaks the traditional open-loop architecture, allowing the integrator to "sense" the uncertainty of the model at every time step. The deep fusion architecture solves the fundamental problem of "disconnect between perception and decision-making" and establishes a direct feedback channel between uncertainty quantification and integral control.
[0154] Optionally, the time step of the next state and the solution strategy of the simulation model are adjusted according to the uncertainty measure of the trajectory set, including:
[0155] Determine the confidence interval of the trace or trajectory set of the covariance matrix, which is obtained from the trajectory set;
[0156] The uncertainty measure of the trajectory set is obtained based on the confidence interval of the trace or trajectory set of the covariance matrix;
[0157] Based on the uncertainty measure of the trajectory set, adjust the time step of the next state and the solution strategy of the simulation model.
[0158] The covariance matrix refers to a statistic constructed based on the set of next-state trajectories obtained from multiple samplings of the DEL equation. It is used to quantify the dispersion and interrelationship of these trajectories across different state dimensions. Specifically, the mean of all trajectories in the next state (i.e., the average trajectory point) can be calculated first. Then, the deviation vector of each trajectory from the mean can be calculated. These deviation vectors are then multiplied externally and averaged to obtain a symmetric matrix. Its diagonal elements represent the variance of each state variable (such as the predicted value of a generalized coordinate), reflecting the magnitude of uncertainty in that dimension; the off-diagonal elements represent the covariance between different state variables, revealing their coupling relationship in the propagation of uncertainty.
[0159] The trace of the covariance matrix refers to the sum of the main diagonal elements of the sample covariance matrix calculated over the set of next-state trajectories generated by Monte Carlo sampling; that is, the sum of the prediction variances across all state dimensions. This trace quantitatively reflects the dispersion of the trajectory in the overall state space. A larger trace indicates more significant divergence between different sampling paths and higher uncertainty in the model's understanding of the current state transition; conversely, a smaller trace indicates more concentrated predictions and higher reliability.
[0160] The confidence interval of a trajectory set can refer to the range of state variable values calculated based on the empirical distribution of the trajectory set across various state dimensions, according to a pre-set confidence level. It can be determined using the quantile method or by assuming an approximate normal distribution and using the mean ± a certain number of standard deviations. This interval intuitively represents the possible fluctuation boundary of the system's next state; its width directly reflects the intensity of local uncertainty. The wider the interval, the weaker the model's grasp of the dynamics in that region, requiring a more cautious numerical processing strategy.
[0161] In the embodiments of this application, uncertainty measurement satisfy:
[0162]
[0163] or,
[0164] in, In time step The uncertainty measure is a scalar value; the larger the value, the higher the uncertainty and the less reliable the prediction.
[0165] In time step The covariance matrix of the system state output by the uncertainty quantification neural network (BNN) describes the variance of each variable in the state vector and the covariance relationship between the variables.
[0166] Representation matrix The trace is the sum of the elements along its main diagonal. In state estimation, the trace variance equals the sum of the variances of each dimension of the state vector; it is a highly efficient and commonly used scalar measure of overall uncertainty.
[0167] and These represent the time steps. The upper and lower bounds of the confidence interval.
[0168] This is used to calculate the width of the confidence interval. The wider the interval, the less accurate the estimate of the state and the greater the uncertainty. This formula defines how to quantize a probability distribution into a scalar value to represent the state at time step [missing value]. At that time, the overall uncertainty of the system prediction can be the core input signal of the uncertainty adaptive strategy.
[0169] In this embodiment of the application, adjusting the time step of the next state based on the uncertainty measure of the trajectory set includes:
[0170] The ratio result is obtained based on the uncertainty measure and uncertainty threshold;
[0171] Determine the target ratio based on the comparison results between the ratio and the preset ratio range;
[0172] Based on the target ratio, the time step of the current state is adjusted to obtain the adjusted time step of the next state.
[0173] Among them, the uncertainty threshold can characterize the preset risk threshold and is used to quantify the maximum level of uncertainty that the system can tolerate. It can be the expected uncertainty threshold preset by the user according to the simulation accuracy requirements.
[0174] The ratio result can refer to the ratio of the uncertainty measure to the uncertainty threshold, which characterizes the degree to which the uncertainty measure of the current state exceeds / falls below the uncertainty threshold.
[0175] The preset scale range can refer to the minimum and maximum scale factors of the step size change to prevent drastic oscillations in the step size.
[0176] In this embodiment of the application, the time step of the next state satisfy:
[0177]
[0178] in, It is the current (number) The integral step size used in the step) It is a candidate step size for the next step. This refers to the level of uncertainty in the target. It can be a pre-set threshold of expected uncertainty determined by the user based on simulation accuracy requirements. near At that time, the step size remains stable. It is a smoothing factor that satisfies: . and It is the minimum and maximum scaling factor for step size changes, preventing drastic oscillations in step size. Its core logic is: reduce the step size for stability when uncertainty is high, and increase the step size for efficiency when uncertainty is low.
[0179] In this embodiment of the application, adjusting the solution strategy of the simulation model based on the uncertainty measure of the trajectory set includes:
[0180] When the uncertainty measure is less than or equal to the first threshold, the solution strategy of the simulation model is the first solution strategy;
[0181] When the uncertainty measure is greater than the first threshold and less than or equal to the second threshold, the solution strategy of the simulation model is the second solution strategy.
[0182] When the uncertainty measure is greater than the second threshold, the solution strategy of the simulation model is the third solution strategy; the first, second and third solution strategies are different.
[0183] The first threshold can refer to a lower critical value used to classify the degree of uncertainty in the simulation model. It can be set based on the system's tolerance for accuracy, stability, or computational resources. When the uncertainty measure does not exceed this threshold, it indicates that the system state is relatively certain and the disturbance is small, and a computationally efficient and sufficiently accurate solution method can be used.
[0184] The second threshold can refer to a higher critical value than the first threshold, used to further distinguish between scenarios with moderate and high uncertainty.
[0185] When the uncertainty measure exceeds the first threshold but does not exceed the second threshold, the system is in a state of moderate uncertainty, at which point a balance needs to be struck between computational cost and robustness. The setting of the second threshold is often combined with risk assessment indicators, confidence interval width, or model sensitivity analysis results.
[0186] When the uncertainty measure exceeds the second threshold, it indicates that the system is in a state of high uncertainty or severe disturbance, and traditional numerical solution methods based on deterministic assumptions may fail, diverge, or produce unreliable results.
[0187] The first solution strategy can be a high-precision, computationally complex numerical method, suitable for situations with low uncertainty. Under such conditions, the model input parameters are reliable and the perturbations are weak. Using a higher-order method can ensure the accuracy of the results while avoiding over-conservatism, thereby improving the overall simulation efficiency.
[0188] The second solution strategy can be a low-order or adaptive numerical method that balances computational efficiency and robustness. When the system has a moderate degree of uncertainty, this strategy maintains the stability and feasibility of the simulation process by reducing computational overhead and introducing certain fault-tolerance mechanisms.
[0189] The third solution strategy can be a data-driven alternative modeling method, such as a neural network surrogate model or Gaussian process regression. When the uncertainty metric is extremely high, traditional numerical methods are difficult to converge, or the computational cost is too high, such strategies can quickly provide approximate solutions by utilizing historical simulation data or online learning capabilities, sacrificing some physical fidelity in exchange for real-time performance and scalability. This approach is particularly suitable for real-time decision-making or large-scale uncertainty quantification scenarios.
[0190] In this embodiment of the application, the solution strategy (integration strategy) of the simulation model can satisfy:
[0191]
[0192] This formula defines a hierarchical decision system. When uncertainty is measured... When different thresholds are exceeded, the integrator will adopt a more conservative and robust integration strategy, or even temporarily replace the entire dynamic model to ensure that the simulation does not diverge.
[0193] in, This represents the low threshold (i.e., the first threshold). When the uncertainty is below this value, the system is considered to be in the "safe zone". This represents the high threshold (i.e., the second threshold). When uncertainty exceeds this value, the system is considered to be in a "high-risk zone".
[0194] Higher-order methods (first solution strategy) refer to high-precision integration schemes (such as higher-order Runge-Kutta methods and higher-order variational integrators). They are used when uncertainty is low in order to pursue high accuracy and high efficiency.
[0195] Low-order methods (second solution strategy) refer to simpler integration schemes with better numerical stability (such as Euler's method and implicit integrators). When uncertainty increases, this mode is switched to, sacrificing some accuracy for better robustness.
[0196] when Exceeding the threshold In situations where uncertainty is extremely high and traditional mechanics models are no longer reliable, the system will temporarily switch to a pre-trained neural network model to replace the original mechanics model for short-term state prediction (the third solution strategy). This surrogate model learns the dynamic behavior of the system from the data and may be more reliable than integrals based on faulty physical models in this extreme case, acting as a "safety net".
[0197] Thus, this strategy elevates adaptive control from being based on local truncation error (a purely numerical indicator) to being based on model uncertainty (a physical system indicator). It achieves coordinated optimization of step size and integral rules, and can trigger a "conservative mode" or "surrogate mode," effectively preventing simulation divergence in regions of accumulated uncertainty. Utilizing the information provided by the first two innovations, the intelligent adaptive strategy achieves precise control based on the degree of uncertainty, effectively improving simulation robustness under parameter fluctuations and external disturbances.
[0198] Optionally, based on the time step of the next state and the solution strategy of the simulation model, the simulation model is run to obtain simulation results, including:
[0199] The next state information is determined based on the time step of the next state and the solution strategy of the simulation model.
[0200] The next state information is used as the state information of the multibody dynamics simulation model in the current state. The steps of constructing a random discrete Lagrangian function based on the state information of the multibody dynamics simulation model in the current state and the uncertainty quantification neural network are repeated until the obtained uncertainty measure meets the preset conditions that characterize the uncertainty measure runaway or the probability of task success is less than the probability threshold. Then the simulation is determined to end and the simulation results are output.
[0201] The next-state information refers to the set of state variables of the system after the next time step, calculated in the current simulation step based on the selected solution strategy (such as high-order numerical methods, low-order adaptive integrals, or neural network surrogate models). This includes generalized coordinates and generalized velocity information such as the position, velocity, attitude, and angular velocity of each rigid body, as well as possible constraint forces, energy indices, or internal state characteristics. This information can reflect the continuous trajectory of the system's dynamic evolution and can also serve as the input basis for the next round of uncertainty quantification and the construction of the stochastic discrete Lagrangian function, driving the simulation iteration forward.
[0202] Uncertainty metrics satisfy preset conditions that characterize uncontrolled uncertainty or a task success probability below a probability threshold. These conditions can be defined as follows: when the uncertainty metric output by the uncertainty quantification neural network (such as prediction variance, entropy, confidence interval width, or distribution tail risk indicator) exceeds a preset safety upper limit, it indicates that the system behavior is highly unpredictable or the model's credibility has severely declined; or when the task success probability estimated based on the current state (e.g., derived through Bayesian inference, reinforcement learning value functions, or reliability analysis) is lower than a set probability threshold, it is considered that continuing the simulation can no longer support effective decision-making or that the task objective is difficult to achieve. At this point, a simulation termination mechanism is triggered, saving the current trajectory, state snapshot, and uncertainty assessment results as the final output for subsequent analysis, early warning, or strategy adjustment.
[0203] In this embodiment of the application, the simulation results may include output probability trajectories, uncertainty reports, and policy logs.
[0204] In this embodiment of the application, when using the next state information of the next state as the state information of the multibody dynamics simulation model in the current state, and re-executing the step of constructing a stochastic discrete Lagrangian function based on the state information of the multibody dynamics simulation model in the current state and the uncertainty quantization neural network, the method further includes:
[0205] If the time step of the next state represents the end of the preset time, then the simulation is considered to have ended and the simulation results are output.
[0206] If the simulation model triggers a preset event, the simulation is considered complete, and the simulation results are output.
[0207] Specifically, when the time step corresponding to the next state advanced according to the current state and the solution strategy is equal to or exceeds the pre-set simulation termination time (e.g., task planning duration, physical process duration, or experimental observation window), the simulation process is forcibly terminated regardless of whether the system state is stable or the task is completed. The accumulated state trajectory, uncertainty evolution data, and final system response are output as simulation results for subsequent evaluation, visualization, or decision support.
[0208] During the simulation, specific physical, logical, or safety-related events are detected and activated, such as collisions in multi-body systems, structural failures, attitude loss, abnormal energy dissipation, constraint violations, or achievement of key mission sub-objectives. These "preset events" can be identified in real time through event detection mechanisms (such as zero-crossing functions, Boolean conditional judgments, or rule-based monitors). Once triggered, the simulation is considered to have achieved its purpose or entered an abnormal state that cannot continue. The calculation is immediately terminated, and simulation results containing a snapshot of the state at the time of the event, context information, and a complete historical trajectory are output to support fault analysis, performance verification, or mission review.
[0209] The simulation method for multibody dynamics provided in this application significantly improves the reliability and robustness of multibody dynamics simulations by combining an endogenous uncertainty propagation mechanism with an adaptive strategy. First, the integration of Bayesian neural networks and normalized flow enables the system to model multimodal, non-Gaussian uncertainties in real time, overcoming the dependence of traditional methods on simple distributions. Second, the uncertainty-driven adaptive strategy achieves a dynamic balance between computational efficiency and numerical stability, avoiding simulation divergence due to uncertainty accumulation. Finally, the architecture based on the discrete variational principle ensures that the physical structural characteristics are maintained during uncertainty propagation, solving the problem of traditional methods violating physical laws after introducing randomness. Therefore, it provides a simulation solution for complex engineering scenarios that combines high accuracy, high efficiency, and high robustness.
[0210] Figure 3 A flowchart illustrating the simulation method for multibody dynamics provided in this application. Figure 2 ,like Figure 3 As shown, the method includes:
[0211] 1. Multi-source data acquisition;
[0212] Raw data for the multibody dynamics system were collected from three sources:
[0213] 1) The accurate data generated by the high-fidelity simulation model serves as the baseline truth;
[0214] 2) Noisy measured data collected by sensors in physics experiments;
[0215] 3) Inject uncertain scenario data of parameter disturbances and faults to teach the system to identify various uncertainty patterns.
[0216] 2. Preprocessing and feature engineering;
[0217] The raw data is cleaned, aligned, and transformed. The continuous trajectory is segmented into discrete "state-next state" data pairs. The system extracts physical features such as kinetic energy, potential energy, and momentum to prepare a structured, labeled dataset D for neural network training.
[0218] 3. BNN amortized inference training (maximizing ELBO);
[0219] A Bayesian neural network is trained using dataset D. The lower bound of evidence (ELBO) is optimized through amortized inference techniques, shifting the computational cost of Bayesian methods to an offline stage. This process enables the BNN to learn to predict the probability distribution of state transitions, rather than a single deterministic value.
[0220] 4. Generate pre-trained model and variational posterior ;
[0221] After training, the output is a pre-trained BNN model and an efficient variational posterior distribution. This distribution is an "uncertainty knowledge base" condensed from the data, from which rapid sampling can be performed to represent the possible uncertainty of the system under different conditions.
[0222] 5. Provide an uncertainty knowledge base;
[0223] The core results produced during the offline training phase (pre-trained BNN model and its variational posterior) This knowledge base is loaded into the online simulation system. It serves as the intelligent foundation for all uncertainty perception and fusion during the online phase.
[0224] 6. Initialize the online simulation system;
[0225] Load the pre-trained model and configure the parameters for the specific simulation task, including the physical parameters of the multibody system (which may include ranges), initial state, control commands, etc.
[0226] 7. Enter the current status ;
[0227] Reading system Generalized coordinates of time With generalized momentum This serves as the starting point for the calculation of the current time step.
[0228] 8. From Sampling weight ;
[0229] From variational posterior distribution Sample a set of weights from a BNN Each sampling is equivalent to selecting an interpretation of the current dynamical possibilities from an "uncertainty knowledge base," which is the source of introducing randomness.
[0230] 9. Constructing the stochastic Lagrangian ;
[0231] The sampled BNN output is combined with the deterministic Lagrangian function:
[0232] .
[0233] 10. Solve the DEL equation and obtain the probability distribution using Monte Carlo sampling;
[0234] Will Substitute the solutions into the stochastic discrete Euler-Lagrange equations and solve for the results. This is achieved through multiple sampling. The solution is then repeated (using the Monte Carlo method) to obtain a series of possible next states. Thus constituting a Predicting the complete probability distribution of the state at any given time.
[0235] 11. Calculate the uncertainty measure ;
[0236] For probability distribution Perform statistical analysis. Calculate the trace of its covariance matrix. Alternatively, the confidence interval width can be compressed into a scalar value representing the overall uncertainty. . The larger the value, the lower the reliability of the prediction.
[0237] 12. Adaptive step size adjustment ;
[0238] According to the formula The integral step size for the next time step is dynamically adjusted. If the limit is exceeded, the step size should be reduced to improve robustness. If the step size is too low, increase the step size to improve efficiency.
[0239] 13. Based on Assess the risks;
[0240] The calculated The system is compared with a preset threshold to determine its current risk level.
[0241] 14. Multi-mode switching;
[0242] a. (High-order precision mode): When Very low (e.g.) When the value is ≤0.1, a higher-order integration method is used to pursue high accuracy.
[0243] b. (Low-order robust mode): When Medium (e.g., 0.1 < When the value is ≤0.5, switch to a lower-order method with more stable values to balance accuracy and reliability.
[0244] c. (Neural Network Agent Mode): When Extremely high (e.g.) When the value is greater than 0.5, it is determined that the physical model may fail, and an emergency switch is made to a pure data-driven neural network surrogate model for short-term prediction as a "safety net" to prevent simulation divergence.
[0245] 15. Status feedback forms a closed loop;
[0246] Update the system status ( This arrow serves as the input for the next time step. This arrow constitutes the core simulation loop and allows the effects of adaptive decision-making (adjusting step size, switching modes) to be fed back into the next round of calculation, forming an intelligent closed loop of "perception-decision-execution".
[0247] If the simulation does not meet the termination conditions (such as the end time not being reached, no event being triggered, and the uncertainty being controllable), the loop continues to execute the next time step.
[0248] 16. State update, judgment, and output;
[0249] Among them, updating the system status:
[0250] The mean of the probability distribution obtained in stage B is used as the best estimate to update the current state of the system, and its confidence interval is recorded.
[0251] Simulation completion judgment:
[0252] Check the simulation termination conditions, including: 1) whether the time has reached the end point; 2) whether the preset event has been triggered (such as the robotic arm successfully grasping); 3) uncertainty. Whether the situation continues to spiral out of control, or whether the probability of mission success is too low. The latter reflects the system's ability to proactively terminate unreliable simulations.
[0253] Output result:
[0254] After the simulation, three key results are output: 1) probabilistic trajectory (mean and confidence interval); 2) uncertainty evolution report (…). 3) Adaptive strategy log (records all step size and mode switching decisions).
[0255] 17. Performance evaluation and model iteration;
[0256] The output results and logs can be used to evaluate the performance of the current pre-trained model in new scenarios. This new data can be fed back into the offline training phase for fine-tuning or retraining the BNN model, enabling the entire system to continuously learn and self-optimize.
[0257] The simulation method for multibody dynamics provided in this application can construct a closed-loop system of "perception-decision-control". The neural network, as an embedded "sensor", perceives uncertainty in real time; the integrator, as the "brain", immediately adjusts the strategy (step size, method, and even model) based on the perceived information. This solves the fundamental defect in existing technologies of "having perception but lacking intelligent response", enabling the simulation system to actively adapt to environmental changes.
[0258] Furthermore, by integrating Bayesian neural networks or normalized flows, the embodiments of this application inherit the powerful distribution fitting capabilities of these advanced models. This enables them to learn and characterize extremely complex uncertainty patterns from data, providing the integrator with richer and more accurate uncertainty information, thereby enabling more reliable decisions in complex and uncertain environments.
[0259] Furthermore, uncertainty-driven strategies represent a form of "global optimization." They consider the overall reliability of the model itself. When model uncertainty is low, a bold increase in step size improves efficiency; when uncertainty is high, a conservative strategy (reducing step size, lowering the order, or switching models) is quickly adopted to ensure robustness. This decision-making mechanism based on "reliability" is more forward-looking and has a more holistic perspective than decisions based on "instantaneous errors."
[0260] Finally, this application represents a native architectural innovation. It is not simply a "BNN + variational integrator," but rather deeply couples the two within a unified mathematical framework (such as the stochastic discrete variational principle) and computational graph. This allows the physical structure to be preserved; that is, the core advantages of the variational integrator (symplectic structure, momentum conservation) are natively maintained under uncertain conditions, rather than being corrected afterward. Furthermore, through the application of techniques such as "amortized inference," the neural network can provide near-free, high-quality uncertainty estimates after training, avoiding the enormous computational overhead of online runtime and achieving a balance between accuracy and speed.
[0261] Figure 4 A schematic diagram of the structure of the simulation device for multibody dynamics provided in this application is shown below. Figure 4 As shown, the simulation device 40 for multibody dynamics provided in this embodiment includes:
[0262] Module 401 is used to construct a stochastic discrete Lagrangian function based on the state information and sampling weights of the simulation model of multibody dynamics in the current state. The sampling weights characterize the uncertainty of the simulation model under different conditions.
[0263] The first module 402 is used to derive the random discrete Lagrangian function and obtain the DEL equation.
[0264] The second module 403 is used to sample the DEL equation multiple times to obtain a trajectory set; the trajectory set represents the probability distribution of the simulation model in the next state; the next state is the state of the current state at the next time step.
[0265] The adjustment module 404 is used to adjust the time step of the next state and the solution strategy of the simulation model based on the uncertainty measure of the trajectory set.
[0266] The simulation module 405 is used to run the simulation model and obtain simulation results based on the time step of the next state and the solution strategy of the simulation model.
[0267] In one possible implementation, the building module 401 can also be specifically used for:
[0268] Sampling weights are randomly drawn from an uncertainty knowledge base, which represents the variational posterior distribution obtained by amortizing inference on a Bayesian neural network based on training data.
[0269] Based on the sampling weights and the state information of the simulation model in the current state, a stochastic discrete Lagrangian function is constructed.
[0270] In one possible implementation, the building module 401 can also be specifically used for:
[0271] Acquire training data for multibody dynamics, including benchmark data, measured noise data, and data from uncertain scenarios;
[0272] Feature data is obtained by extracting features from time step data at different time steps in the training data.
[0273] Based on the feature data and its data labels, an amortized inference is performed on the Bayesian neural network to obtain an uncertainty knowledge base representing the variational posterior distribution.
[0274] In one possible implementation, the second obtaining module 403 can also be specifically used for:
[0275] Based on the DEL equation, Monte Carlo sampling is performed to randomly generate trajectories representing the uncertainty propagation state of the simulation model in the next state;
[0276] A set of trajectories is obtained based on the randomly generated trajectories.
[0277] In one possible implementation, the adjustment module 404 can also be specifically used for:
[0278] Determine the confidence interval of the trace or trajectory set of the covariance matrix, which is obtained from the trajectory set;
[0279] The uncertainty measure of the trajectory set is obtained based on the confidence interval of the trace or trajectory set of the covariance matrix;
[0280] Based on the uncertainty measure of the trajectory set, adjust the time step of the next state and the solution strategy of the simulation model.
[0281] In one possible implementation, the adjustment module 404 can also be specifically used for:
[0282] The ratio result is obtained based on the uncertainty measure and uncertainty threshold;
[0283] Determine the target ratio based on the comparison results between the ratio and the preset ratio range;
[0284] Based on the target ratio, the time step of the current state is adjusted to obtain the adjusted time step of the next state.
[0285] In one possible implementation, the adjustment module 404 can also be specifically used for:
[0286] When the uncertainty measure is less than or equal to the first threshold, the solution strategy of the simulation model is the first solution strategy;
[0287] When the uncertainty measure is greater than the first threshold and less than or equal to the second threshold, the solution strategy of the simulation model is the second solution strategy.
[0288] When the uncertainty measure is greater than the second threshold, the solution strategy of the simulation model is the third solution strategy; the first, second and third solution strategies are different.
[0289] In one possible implementation, the simulation module 405 can also be specifically used for:
[0290] The next state information is determined based on the time step of the next state and the solution strategy of the simulation model.
[0291] The next state information is used as the state information of the multibody dynamics simulation model in the current state. The steps of constructing a random discrete Lagrangian function based on the state information of the multibody dynamics simulation model in the current state and the uncertainty quantification neural network are repeated until the obtained uncertainty measure meets the preset conditions that characterize the uncertainty measure runaway or the probability of task success is less than the probability threshold. Then the simulation is determined to end and the simulation results are output.
[0292] In one possible implementation, the simulation module 405 can also be specifically used for:
[0293] If the time step of the next state represents the end of the preset time, then the simulation is considered to have ended and the simulation results are output.
[0294] If the simulation model triggers a preset event, the simulation is considered complete, and the simulation results are output.
[0295] The simulation device for multibody dynamics provided in this embodiment can execute the methods provided in the above-described method embodiments. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0296] Figure 5 A schematic diagram of the structure of the electronic device provided in this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.
[0297] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.
[0298] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0299] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0300] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0301] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0302] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0303] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0304] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0305] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0306] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0307] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0308] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0309] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0310] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0311] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A simulation method for multibody dynamics, characterized in that, include: Based on the state information and sampling weights of the simulation model of multibody dynamics in the current state, a stochastic discrete Lagrangian function is constructed, and the sampling weights characterize the uncertainty of the simulation model under different conditions. The DEL equation is obtained by deriving the random discrete Lagrange function. The DEL equation is sampled multiple times to obtain a trajectory set; The trajectory set represents the probability distribution of the simulation model in the next state; The next state is the state of the current state at the next time step; Based on the uncertainty measure of the trajectory set, adjust the time step of the next state and the solution strategy of the simulation model; Based on the time step of the next state and the solution strategy of the simulation model, the simulation model is run to obtain the simulation results.
2. The method according to claim 1, characterized in that, The construction of a stochastic discrete Lagrangian function based on the state information and sampling weights of the multibody dynamics simulation model in the current state includes: The sampling weights are randomly extracted from the uncertainty knowledge base, which represents the variational posterior distribution obtained by amortizing inference on a Bayesian neural network based on training data. Based on the sampling weights and the state information of the simulation model in the current state, a random discrete Lagrange function is constructed.
3. The method according to claim 2, characterized in that, Before randomly drawing the sampling weights from the uncertain knowledge base, the method further includes: Acquire training data for multibody dynamics, including benchmark data, measured noise data, and uncertain scenario data; Feature data is obtained by extracting features from time step data at different time steps in the training data; Based on the feature data and the data labels of the feature data, an amortized inference is performed on the Bayesian neural network to obtain an uncertainty knowledge base representing the variational posterior distribution.
4. The method according to claim 1, characterized in that, The process of sampling the DEL equation multiple times to obtain a trajectory set includes: Based on the DEL equation, Monte Carlo sampling is performed to randomly generate trajectories representing the uncertainty propagation state of the simulation model in the next state; The trajectory set is obtained based on the randomly generated trajectory.
5. The method according to claim 1, characterized in that, The step of adjusting the time step of the next state and the solution strategy of the simulation model based on the uncertainty measure of the trajectory set includes: Determine the trace of the covariance matrix or the confidence interval of the trajectory set, wherein the covariance matrix is obtained from the trajectory set; The uncertainty measure of the trajectory set is obtained based on the trace of the covariance matrix or the confidence interval of the trajectory set. Based on the uncertainty measure of the trajectory set, the time step of the next state and the solution strategy of the simulation model are adjusted.
6. The method according to any one of claims 1 or 5, characterized in that, Adjusting the time step of the next state based on the uncertainty measure of the trajectory set includes: The ratio result is obtained based on the uncertainty measure and uncertainty threshold. The target ratio is determined based on the comparison between the ratio result and the preset ratio range; Based on the target ratio, the time step of the current state is adjusted to obtain the adjusted time step of the next state.
7. The method according to any one of claims 1 or 5, characterized in that, Based on the uncertainty metric of the trajectory set, the solution strategy of the simulation model is adjusted, including: When the uncertainty measure is less than or equal to the first threshold, the solution strategy of the simulation model is the first solution strategy; When the uncertainty measure is greater than the first threshold and less than or equal to the second threshold, the solution strategy of the simulation model is the second solution strategy; When the uncertainty measure is greater than the second threshold, the solution strategy of the simulation model is the third solution strategy; the first solution strategy, the second solution strategy and the third solution strategy are different.
8. The method according to claim 1, characterized in that, The step of running the simulation model according to the time step of the next state and the solution strategy of the simulation model to obtain simulation results includes: The next state information is determined based on the time step of the next state and the solution strategy of the simulation model. The next state information of the next state is used as the state information of the multibody dynamics simulation model in the current state. The step of constructing a random discrete Lagrangian function based on the state information of the multibody dynamics simulation model in the current state and the uncertainty quantification neural network is re-executed until the obtained uncertainty metric meets the preset conditions that characterize the uncertainty metric as out of control or the probability of task success is less than the probability threshold. Then the simulation is determined to end and the simulation results are output.
9. The method according to claim 7, characterized in that, When using the next state information as the state information of the multibody dynamics simulation model in the current state, and re-executing the step of constructing a stochastic discrete Lagrangian function based on the state information of the multibody dynamics simulation model in the current state and the uncertainty quantization neural network, the method further includes: If the time step of the next state represents the end of a preset time, then the simulation is determined to be over and the simulation results are output. If the simulation model triggers a preset event, the simulation is considered complete, and the simulation results are output.
10. A simulation device for multibody dynamics, characterized in that, include: The module is used to construct a stochastic discrete Lagrangian function based on the state information and sampling weights of the simulation model of multibody dynamics in the current state. The sampling weights characterize the uncertainty of the simulation model under different conditions. The first module is used to derive the random discrete Lagrange function to obtain the DEL equation; The second module is used to sample the DEL equation multiple times to obtain a trajectory set; The trajectory set represents the probability distribution of the simulation model in the next state; The next state is the state of the current state at the next time step; An adjustment module is used to adjust the time step of the next state and the solution strategy of the simulation model based on the uncertainty metric of the trajectory set. The simulation module is used to run the simulation model according to the time step of the next state and the solution strategy of the simulation model to obtain simulation results.
11. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-9.
13. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-9.
Citation Information
Cited By
Simulation training method, device, medium and program product for robot control strategy
CN122194728A