A magnetic control method, device, storage medium and terminal for magnetic soft body
Through forward simulation and reverse optimization methods, the problem of inefficient modeling and design of magnetic software is solved, efficient simulation and control of magnetic software is achieved, and automated design capabilities are improved.
Patent Information
- Application Number
- CN202210622864.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-06-02
AI Technical Summary
The prior art lacks an effective continuous medium mechanical model and a robust numerical scheme to simulate the magnetoelastic behavior of magnetic software, resulting in inefficient design and manufacturing of magnetic software and lack of automated design support.
Forward simulation and reverse optimization methods are adopted to process the movement of magnetic software in the external magnetic field through time discretization, generate forward simulation results, and perform reverse optimization to update the variables to be optimized, and control the magnetic field strength and residual magnetic distribution of the external magnetic field, thereby realizing modeling and deformation control of magnetic software.
It improves the automation design efficiency of magnetic software, realizes simulation and control of magnetic phenomena, and improves the accuracy and efficiency of the design.
Smart Images

Figure CN115203892B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer graphics, and in particular to a magnetic control method, device, storage medium and terminal for magnetic software. Background Art
[0002] While extensive research has been conducted on the simulation of various magnetic materials, modeling magnetic soft bodies remains an unexplored problem due to the numerous difficulties in representing and simulating the dynamic magnetoelastic coupling processes in magnetic soft bodies. In particular, there are no effective continuum mechanics models to characterize the magnetoelastic behavior of magnetic soft bodies, let alone robust numerical schemes. On the other hand, the design and fabrication of magnetic soft bodies that exhibit specific elastic behavior under magnetic control has become a significant problem receiving widespread attention in physics and engineering sciences, with great potential for a variety of applications. However, most previous work on modeling / design of magnetic soft bodies has been based on engineers' intuition and extensive trial-and-error experiments.
[0003] Work on the simulation of magnetic rigid bodies has been highly successful, taking into account complex scenarios such as nonlinear magnetization and the interaction between the magnetized material and the magnetic field. For non-rigid materials such as magnetic fluids and viscoelastic bodies, novel numerical methods have also been proposed. However, in the field of graphics, there is no dedicated research on deformable magnetic soft bodies.
[0004] Currently, there are no simulation methods for magnetic thin-shell soft bodies in the field of graphics. Previous magnetic material simulations in graphics have focused on rigid bodies and fluids, lacking research on soft-body simulation. Consequently, inverse optimization based on differentiable physics simulations is impossible. Existing designs for magnetic soft bodies rely primarily on manual design and trial-and-error. On the one hand, very high mesh accuracy is required to prevent the Hessian matrix from becoming ill-conditioned during simulation, which incurs significant storage and computational overhead. On the other hand, current work has not addressed the issue of assisting in the optimal design of magnetic soft bodies. [Zhao et al., 2019] The design of magnetic soft robots also relies on manual design and experimental trials, which reduces efficiency.
[0005] Therefore, designing efficient simulation algorithms, differentiable optimizers, and design frameworks for magnetic soft bodies has become an urgent need to automate the design and understanding of various emerging applications related to magnetic-shell interactions. Summary of the Invention
[0006] The embodiments of the present application provide a magnetic control method, device, storage medium, and terminal for a soft magnetic object. To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is provided below. This summary is not intended to be a comprehensive review, identify key or important components, or delineate the scope of protection of these embodiments. Its sole purpose is to present some concepts in a simplified form, serving as a prelude to the detailed description that follows.
[0007] In a first aspect, an embodiment of the present application provides a magnetic control method for a magnetic soft body, the method comprising:
[0008] The motion of the magnetic soft body in the external magnetic field is discretized in time according to the preset simulation parameters to generate the forward simulation results of the magnetic soft body;
[0009] Perform reverse optimization based on the forward simulation results of the magnetic software and output the optimization results;
[0010] Update the preset variables to be optimized according to the optimization results and generate optimized variables;
[0011] When the optimized variable reaches a preset first threshold, the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft body are controlled according to the optimized variable to control the movement and deformation of the magnetic soft body.
[0012] Optionally, the motion of the magnetic soft body in the external magnetic field is time discretized according to preset simulation parameters to generate forward simulation results of the magnetic soft body, including:
[0013] Obtain the position and velocity parameters of the magnetic soft object in the external magnetic field at the current moment;
[0014] Input the current position and velocity parameters into the implicit time integrator, and output the energy parameters, force parameters and Hessian matrix of the magnetic soft body;
[0015] Input the energy parameters, force parameters and Hessian matrix of the magnetic soft body into the sparse linear equation solver, and output the target position parameters and target velocity parameters of the magnetic soft body at the next moment;
[0016] If the optimization is performed according to the preset quasi-static optimization method, the equilibrium state is calculated based on the target position parameters, target velocity parameters, and the force balance equation;
[0017] When the equilibrium state reaches a preset second threshold, the target speed parameter is determined as a forward simulation result of the magnetic soft body.
[0018] Optionally, when the equilibrium state reaches a preset second threshold, determining the target position parameter and the target speed parameter as forward simulation results of the magnetic soft body includes:
[0019] When the equilibrium state does not reach the preset second threshold, updating the position parameter and speed parameter at the current moment according to the target position parameter and target speed parameter at the next moment;
[0020] The target position parameters and target velocity parameters are determined as the position parameters and velocity parameters at the current moment, and the step of inputting the position parameters and velocity parameters at the current moment into the implicit time integrator is continued until the traversal is stopped when the equilibrium state reaches a preset second threshold, and the target velocity parameters finally output are determined as the forward simulation results of the magnetic soft body.
[0021] Optionally, the method further includes:
[0022] If optimization is performed according to a preset dynamic optimization method, the total number of frames in the preset simulation parameters is extracted;
[0023] When the current frame number reaches the total frame number, the target position parameter and target speed parameter of each frame are output;
[0024] The target position parameters and target velocity parameters of each frame are determined as the forward simulation results of the magnetic soft body.
[0025] Optionally, reverse optimization is performed based on the forward simulation results of the magnetic software, and the optimization results are output, including:
[0026] Calculate the function value and gradient based on the forward simulation results of the magnetic soft body and the objective function;
[0027] The optimizer is constructed using the moving asymptote method;
[0028] Input the function value, gradient, and preset range of the variable to be optimized into the optimizer, and output the descent direction and descent step size;
[0029] The product of the descent direction and the descent step length is determined as the optimization result.
[0030] Optionally, if optimization is performed according to a preset quasi-static optimization method, the preset variables to be optimized are the residual magnetization distribution and material properties on the magnetic soft body;
[0031] Update the preset variables to be optimized based on the optimization results and generate optimization variables, including:
[0032] According to the descent direction and descent step size, the residual magnetization distribution and material properties are updated in combination with the line search method to generate optimization variables.
[0033] Optionally, if optimization is performed according to a preset dynamic optimization method, the preset variable to be optimized is the external magnetic field vector of each frame;
[0034] Update the preset variables to be optimized based on the optimization results and generate optimization variables, including:
[0035] According to the descent direction and descent step size, the external magnetic field vector of each frame is updated in combination with the line search method to generate optimized variables.
[0036] In a second aspect, an embodiment of the present application provides a magnetic control device for a magnetic soft body, the device comprising:
[0037] A simulation result generation module is used to perform time discretization processing on the motion of the magnetic soft body in the external magnetic field according to preset simulation parameters, and generate forward simulation results of the magnetic soft body;
[0038] The optimization result output module is used to perform reverse optimization based on the forward simulation results of the magnetic software and output the optimization results;
[0039] An optimization variable generation module is used to update preset variables to be optimized according to the optimization results and generate optimization variables;
[0040] The magnetic control module is used to control the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft body according to the optimized variable when the optimized variable reaches a preset first threshold value, so as to control the movement and deformation of the magnetic soft body.
[0041] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions suitable for being loaded by a processor and executing the above-mentioned method steps.
[0042] In a fourth aspect, an embodiment of the present application provides a terminal, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0043] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0044] In an embodiment of the present application, a magnetic control device for a magnetic soft object first discretizes the motion of the magnetic soft object in an external magnetic field according to preset simulation parameters, generating forward simulation results for the magnetic soft object. Reverse optimization is then performed based on the forward simulation results, outputting optimization results. Preset variables to be optimized are updated based on the optimization results, generating optimized variables. When the optimized variables reach a preset first threshold, the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft object are controlled based on the optimized variables to control the motion and deformation of the magnetic soft object. Because the present application models the magnetic soft object through forward simulation and reverse optimization, and controls the motion and deformation of the magnetic soft object based on the modeled parameters, it achieves simulation of magnetic phenomena within the magnetic soft object, thereby improving the efficiency of automated design.
[0045] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0047] Figure 1 1 is a flow chart of a magnetic control method for a magnetic soft body provided in an embodiment of the present application;
[0048] Figure 2 This is a schematic block diagram of the processing flow of a simulation module provided by this application;
[0049] Figure 3 This is a schematic block diagram of the process of executing an optimization module provided by this application;
[0050] Figure 4 1 is a schematic structural diagram of a magnetic control device for a magnetic soft body provided in an embodiment of the present application;
[0051] Figure 5 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The following description and the drawings sufficiently illustrate specific embodiments of the invention to enable those skilled in the art to practice them.
[0053] It should be understood that the embodiments described are only a portion of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0054] In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with certain aspects of the present invention, as detailed in the appended claims.
[0055] In the description of the present invention, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In addition, in the description of the present invention, unless otherwise specified, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0056] This application provides a magnetic control method, device, storage medium, and terminal for a magnetic soft object to address the aforementioned related technical issues. The technical solution provided by this application utilizes forward simulation and reverse optimization to model the magnetic soft object, and controls the movement and deformation of the magnetic soft object based on the modeled parameters, thereby simulating the magnetic phenomena of the magnetic soft object and improving the efficiency of automated design. The following describes this in detail using exemplary embodiments.
[0057] The following will be combined with the Figure 1 -Attached Figure 3 This article details the magnetic control method for magnetic soft objects provided by the embodiments of this application. This method can be implemented using a computer program and run on a magnetic control device based on the von Neumann architecture. This computer program can be integrated into an application or run as a standalone tool.
[0058] See Figure 1 , provides a flow chart of a magnetic control method for a magnetic soft body according to an embodiment of the present application. Figure 1 As shown, the method of the embodiment of the present application may include the following steps:
[0059] S101, performing time discretization processing on the motion of the magnetic soft body in the external magnetic field according to preset simulation parameters to generate forward simulation results of the magnetic soft body;
[0060] A notable characteristic of soft shells compared to conventional soft bodies is that their thickness dimension is much smaller than the other two dimensions. The derivation of mechanical properties and equations of motion associated with thin shells is typically based on the Kirchhoff-Love hypothesis. While conventional soft bodies are spatially discretized using tetrahedral elements, thin shell materials are typically discretized using triangular facets. Thin shell simulations typically express the elastic energy of the shell as two components: membrane strain energy and bending strain energy, which are used to describe the shell's resistance to tension and compression, and its resistance to bending, respectively.
[0061] In an embodiment of the present application, when time discretization is performed on the movement of a magnetic soft body in an external magnetic field according to preset simulation parameters, the position parameters and velocity parameters of the magnetic soft body in the external magnetic field at the current moment are first obtained, and then the position parameters and velocity parameters at the current moment are input into an implicit time integrator, and the energy parameters, force parameters and Hessian matrix of the magnetic soft body are output, and then the energy parameters, force parameters and Hessian matrix of the magnetic soft body are input into a sparse linear equation solver, and the target position parameters and target velocity parameters of the magnetic soft body at the next moment are output.
[0062] In one possible implementation, if optimization is performed according to a preset quasi-static optimization method, the equilibrium state is calculated based on the target position parameters, target speed parameters, and the force balance equation. Finally, when the equilibrium state reaches a preset second threshold, the target speed parameter is determined as the forward simulation result of the magnetic soft body.
[0063] Furthermore, when the equilibrium state has not reached the preset second threshold, the position parameters and speed parameters at the current moment are updated according to the target position parameters and target speed parameters at the next moment, and finally the target position parameters and target speed parameters are determined as the position parameters and speed parameters at the current moment, and the step of inputting the position parameters and speed parameters at the current moment into the implicit time integrator is continued, and the traversal is stopped until the equilibrium state reaches the preset second threshold, and the target speed parameters finally output are determined as the forward simulation results of the magnetic software.
[0064] In another possible implementation method, first, if optimization is performed according to a preset dynamic optimization method, the total number of frames in the preset simulation parameters is extracted, and then when the current number of frames reaches the total number of frames, the target position parameters and target speed parameters of each frame are output, and finally the target position parameters and target speed parameters of each frame are determined as the forward simulation results of the magnetic software.
[0065] Specifically, the implicit time integrator integrates an elastic capacity model and a magnetic energy model, and the elastic energy model and the magnetic energy model are potential energy expressions of the magnetic soft body.
[0066] Specifically, the derivation process of the magnetic energy expression of the magnetic soft body is as follows:
[0067] When a magnetic soft body is immersed in a magnetic field, the magnetization of the material will in turn lead to the complex evolution of the magnetic field in space. In order to study the interaction between the two and characterize the total magnetic field in space, we need to introduce two physical quantities: magnetic induction intensity B and magnetic field intensity H. Many materials (such as ferromagnets) will undergo nonlinear magnetization in an external magnetic field, and their magnetization phenomenon needs to be described by a hysteresis loop (BH curve), which further increases the difficulty of magnetic soft body simulation. According to the different shapes of the hysteresis loops, such materials can be further divided into soft magnetic materials and hard magnetic materials. The hysteresis loop of the former is narrow and sharp, while the hysteresis loop of the latter is wider, corresponding to a larger coercive force. Starting from the Maxwell equations, when there is no free current and displacement current, the magnetic induction intensity B and magnetic field intensity H in the world space are related to those in the material space. Should meet the following requirements:
[0068] Where F is the deformation gradient and J is its determinant;
[0069] For ideal hard magnetic materials, the hysteresis loop is approximately a straight line within a range where the applied magnetic field intensity is lower than the coercive force, so it can be linearly simplified, namely:
[0070] B=μ0(H+M r ); where μ0 is the vacuum permeability constant, M r is the residual magnetization. Under this assumption, the residual magnetic field strength exists independently of the external magnetic field, that is:
[0071] It can be considered as an intrinsic property of the material and remains constant during the movement and deformation of the object.
[0072] Furthermore, we can derive the expression for magnetic energy:
[0073]
[0074] Pulling back to the material space gives:
[0075]
[0076] Assuming that the magnetic field induced by the magnetic material is much smaller than the external magnetic field, B in the above formula can be replaced by the external magnetic field B applied For thin shells, based on the KL hypothesis, it can be assumed that the remanent magnetization is constant in the surface normal direction. Therefore, integrating the energy along the normal direction yields:
[0077]
[0078] where F| z=0 represents the deformation gradient on the mid-surface of the shell, and h is the thickness of the shell.
[0079] From the above derivation, it can be seen that although the deformation induced by magnetic force and the deformation induced by elastic force will affect each other, we can write the expression of magnetic energy based on the deformation gradient tensor, so that the elastic potential energy and magnetic energy of the object can be written in a decoupled form, that is, the total energy is equal to the sum of elastic potential energy, magnetic energy, and other potential energy (such as gravitational potential energy).
[0080] Usually, we use triangular mesh to discretize thin shell objects, and the film strain G mem and bending strain G cur The induced energies together constitute the elastic potential energy of the shell.
[0081]
[0082] Where Y is the Young's modulus of the material, v is the Poisson's ratio of the material, is the area, thickness h and B of a single face of the triangular mesh in the material space appliedSampling is performed at the centroid of the triangle patch.
[0083] For example Figure 2 As shown, Figure 2 This is a schematic diagram of the processing flow of a simulation module provided by the present application, which uses the implicit Euler method to discretize the motion of the object in time, thereby realizing the forward simulation of the magnetic shell. The forward simulation algorithm of this software realizes two types of quasi-static simulation and dynamic simulation, which are used for different simulation and optimization tasks respectively. The difference lies in the energy function E. Compared with the former, the latter has an additional quadratic term in the energy expression to characterize the inertia of motion. Given the total number of frames s and the single-step time step △t, the simulation module will cyclically call the single-step forward simulation program to obtain the motion state sequence of the object. The single-step forward simulation accepts the object position and velocity at the current moment as input, and interacts with the elastic model and the magnetic model to obtain the energy, force, and Hessian matrix (the second-order derivative of energy) of the object at the current moment, and uses the implicit Euler method to calculate the object position and velocity at the next moment and update the state of the object, and outputs the object state (position, velocity) after one time step.
[0084] S102, performing reverse optimization based on the forward simulation results of the magnetic software and outputting the optimization results;
[0085] In an embodiment of the present application, when performing reverse optimization, the function value and gradient are first calculated based on the forward simulation results of the magnetic software and combined with the objective function, and then the moving asymptote method is used to construct an optimizer. Secondly, the function value, gradient, and the preset range parameters of the variable to be optimized are input into the optimizer, and the descent direction and descent step size are output. Finally, the product of the descent direction and descent step size is determined as the optimization result.
[0086] Specifically, if optimization is performed according to the preset quasi-static optimization method, the preset variables to be optimized are the residual magnetization distribution and material properties on the magnetic software, and the residual magnetization distribution and material properties are updated according to the descent direction and descent step size, combined with the line search method, to generate the optimization variables.
[0087] Specifically, if optimization is performed according to a preset dynamic optimization method, the preset variable to be optimized is the external magnetic field vector of each frame, and the external magnetic field vector of each frame is updated according to the descent direction and descent step size, combined with the line search method, to generate the optimized variable.
[0088] S103, updating the preset variables to be optimized according to the optimization results to generate optimized variables;
[0089] In one possible implementation, the goal of quasi-static optimization is to design the object's remanent magnetization distribution and material properties so that it can achieve a specified deformation under an external magnetic field. The algorithm will perform iterative optimization, continuously updating the optimization variables to be optimized, causing the objective function value to continuously decrease until the stopping condition is reached. In single-step optimization, the constraint condition is set to the object's force balance equation. First, a quasi-static simulation algorithm is used to calculate the equilibrium state achieved by the object under the current configuration. The objective function is set to characterize the difference between this equilibrium state and the target state, and its gradient is calculated using the adjoint method. The MMA method and line search method are used to calculate the descent direction and step size, and the optimized variables are updated.
[0090] Specifically, the variable to be optimized in quasi-static optimization is the residual magnetization distribution on the material. In order to obtain sharper wrinkles and clearer shapes, the material properties can be added to the variables to be optimized. Formal definition: let k be the variable to be optimized, F(x(k)) and g(x,k) are the objective function and constraints, where g is the force balance equation of the object, x refers to the position vector that achieves equilibrium under the parameter configuration of k (therefore, it is a function of k), and the objective function is x and the target deformation x * The optimization problem is formally defined as:
[0091] argmin k F(x(k))=|x(k)- * | 2 ,
[0092] subject to g(x,k)=0
[0093] After finding the value of the objective function using the above formula, we use the adjoint method to calculate the gradient of the objective function. Let λ be the Lagrange multiplier, and we can get the new function L = F + λ T g. Omitting the specific derivation process of the adjoint method, we can obtain:
[0094]
[0095] We use the moving asymptote method (MMA) as the optimizer, inputting information such as the objective function, gradient, and the range of the variable to be optimized. According to the descent direction and step size output by the optimizer, the variable to be optimized is updated through the line search method.
[0096] In one possible implementation, the goal of dynamic optimization is to design a time-varying external magnetic field so that a magnetic object can achieve a desired motion (such as following a trajectory or moving to a target position) under the influence of the field. Dynamic optimization differs from quasi-static optimization in that a single optimization run first requires running a dynamic simulation program to measure the difference between the current motion and the target and calculate the objective function value. The gradient of the objective function is then calculated using the adjoint method of spatiotemporal optimization to update the variables to be optimized.
[0097] Specifically, the variable to be optimized in dynamic optimization is the external magnetic field vector B in each frame. applied In the formal definition, k is still the variable to be optimized, s is the total number of frames for dynamic optimization, and the formal definition of the optimization problem is:
[0098] argmin k F({x n},k)=∑ n∈U |x n -x n* | 2 +F p (k)
[0099] subject to g n (v n ,v n+1 ,x n ,k)=0
[0100] and h n (x n ,x n-1 ,v n )=0
[0101] n=1,2,…,s
[0102] Among them, the first term of F is used to measure the degree of trajectory fit of the key frame, and the second term is a regular term added to prevent the external magnetic field value from being too large or meaningless jitter. n is the discretized Newton's second law in each frame (or the force balance equation with the inertia term), h n It is the constraint on the relationship between position and velocity in each frame. Let the mass matrix be M and the time step be Δt, that is:
[0103]
[0104] h n =(x n -x n-1 )-Δt v n =0
[0105] We need to introduce the Lagrange multiplier Then get For the Lagrange multiplier, we need to work backwards from the last frame to the first frame and calculate the values in sequence:
[0106]
[0107] The gradient of the objective function is:
[0108]
[0109] We continue to use the moving asymptotes method (MMA) as the optimizer. Although the Hessian matrix (i.e., the second-order partial derivative matrix) in the above formula is time-dependent and is the transpose of the Hessian matrix solved during the simulation, we do not need to store a matrix at each simulation step. Instead, we only need to store the position and velocity vectors for that frame, thus saving memory overhead.
[0110] S104, when the optimized variable reaches a preset first threshold, controlling the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft body according to the optimized variable to control the movement and deformation of the magnetic soft body.
[0111] In one possible implementation, after obtaining the optimization variables, when the optimization variables reach a preset first threshold, the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft body can be controlled according to the optimization variables to control the movement and deformation of the magnetic soft body.
[0112] For example Figure 3 As shown, Figure 3 This is a flowchart of the process of executing an optimization module provided by this application. It performs forward simulation and reverse design on a thin-shell soft body with magnetic elasticity. Specifically, it includes two modules: a simulation module and an optimization module. The simulation module implements two simulation methods: quasi-static simulation and dynamic simulation. The optimization module implements two optimization methods: quasi-static optimization and dynamic optimization (or "space-time optimization" and "trajectory optimization"), which are applied to different task scenarios respectively. First, the data of the magnetic soft body in the external magnetic field is input into the simulation module in combination with the set simulation parameters for dynamic simulation. After the simulation, the equilibrium state or motion trajectory is obtained. Then, it is input into the objective function for processing and calculation to obtain the function value and gradient. The function value and gradient are input into the MMA optimizer to obtain the descent direction and step size. After the preset conditions are met, the variables to be optimized are updated.
[0113] In the embodiments of the present application, an effective computational solution is provided to support forward simulation and inverse design tasks for a new class of physical objects that have not been addressed in the existing literature. For forward simulation, we developed the first continuum mechanics model based on the Kirchhoff-Love thin shell model to characterize the behavior of magnetoelastic thin shells under external magnetic stimulation. Its constitutive model decouples the total potential energy into elastic and magnetic components, and the magneto-mechanical coupling comes only from the change in residual magnetization intensity caused by elastic deformation in the applied magnetic field. Based on this model, a complete numerical formula is provided, including discretization formulas and Hessian matrix derivation. Due to its simplicity, this method can be easily integrated into the existing finite element thin shell framework to support the simulation of new magnetic phenomena. For inverse design problems, a fully differentiable simulation framework is constructed and combined with its adjoint solver to support a large number of design tasks ranging from magnetoelastic soft robots, functional origami to artwork and metamaterial design. For static and dynamic PDE constraint problems, the optimization performance of magnetoelastic thin shell structures is improved by differentiable solvers.
[0114] In an embodiment of the present application, a magnetic control device for a magnetic soft object first discretizes the motion of the magnetic soft object in an external magnetic field according to preset simulation parameters, generating forward simulation results for the magnetic soft object. Reverse optimization is then performed based on the forward simulation results, outputting optimization results. Preset variables to be optimized are updated based on the optimization results, generating optimized variables. When the optimized variables reach a preset first threshold, the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft object are controlled based on the optimized variables to control the motion and deformation of the magnetic soft object. Because the present application models the magnetic soft object through forward simulation and reverse optimization, and controls the motion and deformation of the magnetic soft object based on the modeled parameters, it achieves simulation of magnetic phenomena within the magnetic soft object, thereby improving the efficiency of automated design.
[0115] The following are embodiments of the apparatus of the present invention, which can be used to implement the method embodiments of the present invention. For details not disclosed in the apparatus embodiments of the present invention, please refer to the method embodiments of the present invention.
[0116] See Figure 4 , which shows a schematic structural diagram of a magnetic control device for a magnetic soft object according to an exemplary embodiment of the present invention. This magnetic control device can be implemented as all or part of a terminal through software, hardware, or a combination of both. The device 1 includes a simulation result generation module 10, an optimization result output module 20, an optimization variable generation module 30, and a magnetic control module 40.
[0117] A simulation result generating module 10 is used to perform time discretization processing on the motion of the magnetic soft body in the external magnetic field according to preset simulation parameters, and generate forward simulation results of the magnetic soft body;
[0118] The optimization result output module 20 is used to perform reverse optimization based on the forward simulation results of the magnetic software and output the optimization results;
[0119] An optimization variable generation module 30 is used to update preset variables to be optimized according to the optimization results and generate optimization variables;
[0120] The magnetic control module 40 is used to control the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft body according to the optimized variable when the optimized variable reaches a preset first threshold value, so as to control the movement and deformation of the magnetic soft body.
[0121] It should be noted that the aforementioned embodiments of the magnetic control device for a soft magnetic body, when used to implement a magnetic control method for a soft magnetic body, illustrate the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of the device can be divided into different functional modules to perform all or part of the functions described above. Furthermore, the aforementioned embodiments of the magnetic control device for a soft magnetic body and the embodiments of the magnetic control method for a soft magnetic body are based on the same concept. Their implementation process is detailed in the method embodiments and will not be further elaborated here.
[0122] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0123] In an embodiment of the present application, a magnetic control device for a magnetic soft object first discretizes the motion of the magnetic soft object in an external magnetic field according to preset simulation parameters, generating forward simulation results for the magnetic soft object. Reverse optimization is then performed based on the forward simulation results, outputting optimization results. Preset variables to be optimized are updated based on the optimization results, generating optimized variables. When the optimized variables reach a preset first threshold, the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft object are controlled based on the optimized variables to control the motion and deformation of the magnetic soft object. Because the present application models the magnetic soft object through forward simulation and reverse optimization, and controls the motion and deformation of the magnetic soft object based on the modeled parameters, it achieves simulation of magnetic phenomena within the magnetic soft object, thereby improving the efficiency of automated design.
[0124] The present invention also provides a computer-readable medium having program instructions stored thereon, which, when executed by a processor, implement the magnetic control method of the magnetic software provided by each of the above method embodiments.
[0125] The present invention also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the magnetic control method of the magnetic software of each of the above method embodiments.
[0126] See Figure 5 , provides a schematic diagram of the structure of a terminal according to an embodiment of the present application. Figure 5As shown, the terminal 1000 may include: at least one processor 1001 , at least one network interface 1004 , a user interface 1003 , a memory 1005 , and at least one communication bus 1002 .
[0127] The communication bus 1002 is used to implement the connection and communication between these components.
[0128] The user interface 1003 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 1003 may also include a standard wired interface and a wireless interface.
[0129] The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0130] The processor 1001 may include one or more processing cores. The processor 1001 utilizes various interfaces and circuits to connect the various components within the entire electronic device 1000. By running or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and calling data stored in the memory 1005, the processor 1001 performs various functions of the electronic device 1000 and processes data. Optionally, the processor 1001 may be implemented in the form of at least one hardware component selected from the group consisting of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 1001 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display; and the modem is responsible for handling wireless communications. It is understood that the modem may not be integrated into the processor 1001 and may be implemented separately on a single chip.
[0131] Among them, the memory 1005 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 1005 includes a non-transitory computer-readable storage medium. The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. As Figure 5 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a magnetic control application of magnetic software.
[0132] exist Figure 5 In the terminal 1000 shown, the user interface 1003 is mainly used to provide an input interface for the user and obtain user input data; and the processor 1001 can be used to call the magnetic control application of the magnetic software stored in the memory 1005 and perform the following operations:
[0133] The motion of the magnetic soft body in the external magnetic field is discretized in time according to the preset simulation parameters to generate the forward simulation results of the magnetic soft body;
[0134] Perform reverse optimization based on the forward simulation results of the magnetic software and output the optimization results;
[0135] Update the preset variables to be optimized according to the optimization results and generate optimized variables;
[0136] When the optimized variable reaches a preset first threshold, the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft body are controlled according to the optimized variable to control the movement and deformation of the magnetic soft body.
[0137] In one embodiment, when the processor 1001 performs time discretization processing on the motion of the magnetic soft object in the external magnetic field according to preset simulation parameters to generate forward simulation results of the magnetic soft object, the processor 1001 specifically performs the following operations:
[0138] Obtain the position and velocity parameters of the magnetic soft object in the external magnetic field at the current moment;
[0139] Input the current position and velocity parameters into the implicit time integrator, and output the energy parameters, force parameters and Hessian matrix of the magnetic soft body;
[0140] Input the energy parameters, force parameters and Hessian matrix of the magnetic soft body into the sparse linear equation solver, and output the target position parameters and target velocity parameters of the magnetic soft body at the next moment;
[0141] If the optimization is performed according to the preset quasi-static optimization method, the equilibrium state is calculated based on the target position parameters, target velocity parameters, and the force balance equation;
[0142] When the equilibrium state reaches a preset second threshold, the target speed parameter is determined as a forward simulation result of the magnetic soft body.
[0143] In one embodiment, when the processor 1001 determines the target position parameter and the target speed parameter as the forward simulation result of the magnetic software when the equilibrium state reaches the preset second threshold, the processor 1001 specifically performs the following operations:
[0144] When the equilibrium state does not reach the preset second threshold, updating the position parameter and speed parameter at the current moment according to the target position parameter and target speed parameter at the next moment;
[0145] The target position parameters and target velocity parameters are determined as the position parameters and velocity parameters at the current moment, and the step of inputting the position parameters and velocity parameters at the current moment into the implicit time integrator is continued until the traversal is stopped when the equilibrium state reaches a preset second threshold, and the target velocity parameters finally output are determined as the forward simulation results of the magnetic soft body.
[0146] In one embodiment, the processor 1001 further performs the following operations:
[0147] If optimization is performed according to a preset dynamic optimization method, the total number of frames in the preset simulation parameters is extracted;
[0148] When the current frame number reaches the total frame number, the target position parameter and target speed parameter of each frame are output;
[0149] The target position parameters and target velocity parameters of each frame are determined as the forward simulation results of the magnetic soft body.
[0150] In one embodiment, when the processor 1001 performs reverse optimization based on the forward simulation results of the magnetic software and outputs the optimization results, the processor 1001 specifically performs the following operations:
[0151] Calculate the function value and gradient based on the forward simulation results of the magnetic soft body and the objective function;
[0152] The optimizer is constructed using the moving asymptote method;
[0153] Input the function value, gradient, and preset value range parameters of the variable to be optimized into the optimizer, and output the descent direction and descent step size;
[0154] The product of the descent direction and the descent step length is determined as the optimization result.
[0155] In one embodiment, when updating the preset variables to be optimized according to the optimization results and generating the optimized variables, the processor 1001 specifically performs the following operations:
[0156] According to the descent direction and descent step size, the residual magnetization distribution and material properties are updated in combination with the line search method to generate optimization variables;
[0157] or,
[0158] According to the descent direction and descent step size, the external magnetic field vector of each frame is updated in combination with the line search method to generate optimized variables.
[0159] In an embodiment of the present application, a magnetic control device for a magnetic soft object first discretizes the motion of the magnetic soft object in an external magnetic field according to preset simulation parameters, generating forward simulation results for the magnetic soft object. Reverse optimization is then performed based on the forward simulation results, outputting optimization results. Preset variables to be optimized are updated based on the optimization results, generating optimized variables. When the optimized variables reach a preset first threshold, the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft object are controlled based on the optimized variables to control the motion and deformation of the magnetic soft object. Because the present application models the magnetic soft object through forward simulation and reverse optimization, and controls the motion and deformation of the magnetic soft object based on the modeled parameters, it achieves simulation of magnetic phenomena within the magnetic soft object, thereby improving the efficiency of automated design.
[0160] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The magnetic control program for the magnetic software can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory, or a random access memory.
[0161] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A magnetic control method for a magnetic soft body, characterized in that: The method comprises: The motion of the magnetic soft body in the external magnetic field is discretized in time according to the preset simulation parameters to generate the forward simulation results of the magnetic soft body; The motion of the magnetic soft body in the external magnetic field is discretized in time according to the preset simulation parameters to generate the forward simulation results of the magnetic soft body, including: Obtain the position and velocity parameters of the magnetic soft object in the external magnetic field at the current moment; Input the position parameters and velocity parameters at the current moment into the implicit time integrator, and output the energy parameters, force parameters and Hessian matrix of the magnetic soft body; Inputting the energy parameters, force parameters and Hessian matrix of the magnetic soft body into a sparse linear equation solver, and outputting the target position parameters and target velocity parameters of the magnetic soft body at the next moment; If the optimization is performed according to the preset quasi-static optimization method, the equilibrium state is calculated based on the target position parameters, the target speed parameters, and the force balance equation; When the equilibrium state reaches a preset second threshold, determining the target speed parameter as a forward simulation result of the magnetic soft body; Perform reverse optimization based on the forward simulation results of the magnetic software and output the optimization results; The reverse optimization is performed based on the forward simulation results of the magnetic software, and the optimization results are output, including: Calculating a function value and a gradient based on the forward simulation results of the magnetic soft body and in combination with an objective function; The optimizer is constructed using the moving asymptote method; Input the function value, gradient and preset value range parameters of the variable to be optimized into the optimizer, and output the descent direction and descent step size; Determine the product of the descending direction and the descending step length as an optimization result; Update the preset variables to be optimized according to the optimization results to generate optimized variables; When the optimization variable reaches a preset first threshold, the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft body are controlled according to the optimization variable to control the movement and deformation of the magnetic soft body; The method further comprises: If optimization is performed according to a preset dynamic optimization method, the total number of frames in the preset simulation parameters is extracted; When the current frame number reaches the total frame number, the target position parameter and target speed parameter of each frame are output; The target position parameters and target velocity parameters of each frame are determined as the forward simulation results of the magnetic soft body.
2. The method according to claim 1, characterized in that When the equilibrium state reaches a preset second threshold, determining the target position parameter and the target speed parameter as a forward simulation result of the magnetic soft body includes: When the equilibrium state does not reach a preset second threshold, updating the position parameter and speed parameter at the current moment according to the target position parameter and target speed parameter at the next moment; The target position parameter and the target speed parameter are determined as the position parameter and the speed parameter at the current moment, and the step of inputting the position parameter and the speed parameter at the current moment into the implicit time integrator is continued until the equilibrium state reaches a preset second threshold value and the traversal is stopped, and the target speed parameter finally output is determined as the forward simulation result of the magnetic software.
3. The method according to claim 1, characterized in that If the optimization is performed according to the preset quasi-static optimization method, the preset variables to be optimized are the residual magnetization distribution and material properties of the magnetic soft body; The updating of preset variables to be optimized according to the optimization results to generate optimized variables includes: According to the descent direction and descent step length, the residual magnetization distribution and material properties are updated in combination with a line search method to generate optimized variables.
4. The method according to claim 1, wherein If optimization is performed according to a preset dynamic optimization method, the preset variable to be optimized is the external magnetic field vector of each frame; The updating of preset variables to be optimized according to the optimization results to generate optimized variables includes: According to the descending direction and the descending step length, the external magnetic field vector of each frame is updated in combination with a line search method to generate an optimized variable.
5. A magnetic control device for a magnetic soft body realized by the method according to any one of claims 1 to 4, characterized in that: The device comprises: A simulation result generation module is used to perform time discretization processing on the motion of the magnetic soft body in the external magnetic field according to preset simulation parameters, and generate forward simulation results of the magnetic soft body; An optimization result output module, used for performing reverse optimization based on the forward simulation results of the magnetic software and outputting the optimization results; An optimization variable generation module is used to update preset variables to be optimized according to the optimization results and generate optimization variables; The magnetic control module is used to control the magnetic field strength of the external magnetic field and the residual magnetism distribution of the magnetic soft body according to the optimized variable when the optimized variable reaches a preset first threshold value, so as to control the movement and deformation of the magnetic soft body.
6. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method according to any one of claims 1 to 4.
7. A terminal, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
A fast simulation method of superelastic material
CN109002630A
Improved magneto-rheological damper reverse modeling method
CN109800517A