Animation generation method based on ship modal analysis result
The ship modal analysis results are processed by interpolation and filtering techniques, and the genetic algorithm is used to extract key frames and generate smooth continuous frames. This solves the problem of animation smoothness caused by insufficient or excessive frames and achieves better data display effects.
Patent Information
- Application Number
- CN202510717301.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-09-12
AI Technical Summary
Existing technologies make it difficult to effectively display the results of ship modal analysis, especially when the number of frames is insufficient or excessive, resulting in unsmooth animation or excessive information volume, making it impossible to accurately capture key change details. Traditional methods cannot effectively display complex three-dimensional structures and multi-physics field coupling phenomena.
Interpolation and filtering techniques are used to process frame data, genetic algorithms are used to extract key frames, and smooth continuous frame data are generated through B-spline interpolation and adaptive Gaussian filtering. Animation display is achieved by combining SAM software.
The smoothness of animation and the effectiveness of information display are improved, users can better understand the structural response, and the intuitiveness of data display and rendering efficiency are improved.
Smart Images

Figure CN120635259A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship structure mechanics analysis, and in particular to an animation generation method based on ship modal analysis results. Background Art
[0002] Modal analysis is particularly important in the marine industry, as ships operate in complex marine environments and are subject to a variety of external factors, including waves, wind, and loads. Modal analysis helps engineers gain a deep understanding of the dynamic characteristics of hull structures, identifying natural frequencies, mode shapes, and damping ratios, thereby assessing the stability and safety of ships under various operating conditions. This is crucial for optimizing designs, reducing vibration, and improving passenger comfort.
[0003] Modal analysis results typically include information such as natural frequencies, mode shapes, and vibration amplitudes. These results not only provide a theoretical basis for structural design but also play a vital role in subsequent structural health monitoring and maintenance. However, as the complexity of analysis results increases, effectively presenting this information, particularly through animations that enable users to intuitively understand the results, has become an important research topic.
[0004] When implementing animation display capabilities, several pressing challenges remain. First, insufficient frames can result in a less-than-smooth animation, making it difficult to accurately capture subtle changes and comprehend the dynamic response of the structure. Second, excessive frames can lead to an overload of information, making it easy for viewers to miss key details during rapid playback. Furthermore, traditional visualization methods often fail to effectively display complex three-dimensional structures and multi-physics coupling phenomena, potentially leading to the omission or misunderstanding of important information. Summary of the Invention
[0005] The inventors have studied the intelligent animation generation of modal analysis output results, aiming to improve the intuitiveness and effectiveness of data display. They have proposed an animation generation method based on ship modal analysis results. The technical solution of the present invention is as follows:
[0006] The overall design concept of an animation generation method based on ship modal analysis results is as follows: First, the ship modal analysis result data output by the SAM software is read, and the results at each unit integration point are extracted and extrapolated to the unit nodes to obtain the raw frame data. Next, for cases with a small number of frames (i.e., when the raw frame number is less than the set optimal frame number), the raw frame data is interpolated and filtered. For cases with a large number of frames (i.e., when the raw frame number is greater than the set optimal frame number), a genetic (GA) algorithm is used to extract keyframe data from the raw frame data. Intermediate frames are then interpolated and filtered. B-spline interpolation is used to insert intermediate frames between keyframes. Finally, the generated continuous frame data is subjected to adaptive Gaussian filtering to generate smooth continuous frame data. Finally, animation display is achieved using the SAM software. When the raw frame number is equal to the set optimal frame number, the animation display is directly based on the raw frame data.
[0007] The beneficial technical effects of the present invention are:
[0008] This method can generate intermediate frames between frames through interpolation when the number of output frames is small, thus achieving a more refined animation effect. Combined with adaptive Gaussian filtering, it can smooth the transition between multiple frames, allowing users to experience more coherent dynamic changes and better understand the structural response.
[0009] When the number of output frames is large, keyframe extraction technology is used to reduce the rendering burden. This application uses a GA algorithm to select representative keyframes from a large amount of raw frame data and insert intermediate frames between these keyframes to generate a smooth transition animation. This not only improves animation rendering efficiency but also ensures animation fluidity, allowing users to quickly capture key dynamic information and better understand the results of modal analysis.
[0010] The animation generation method based on the ship modal analysis results provided in this application will help the shipping industry conduct modal analysis and its intelligent animation generation research, which will not only improve the intuitiveness and effectiveness of data display, but also provide important support for ship design and optimization, ensuring the safety and performance of ships in complex marine environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 This is the overall design flow chart of the animation generation method based on the ship modal analysis results provided by this application.
[0012] Figure 2 This is a flow chart of the implementation scheme of the animation generation method provided by this application.
[0013] Figure 3 This is a schematic diagram of the ship modal analysis result file output by the SAM solver provided in this application.
[0014] Figure 4 This is a schematic diagram of Gaussian filtering provided by this application.
[0015] Figure 5 This is a schematic diagram of the SAM animation display effect provided by this application. DETAILED DESCRIPTION
[0016] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0017] This application provides an animation generation method based on the results of ship modal analysis, please refer to Figure 1 As shown, the method includes: first, reading the ship modal analysis result data, extracting the results of each unit integration point, and extrapolating them to the unit nodes to obtain the original frame data. Then, for the case of a large number of frames, a genetic (GA) algorithm is used to extract key frame data from the original frame data, and the key frame data is interpolated and filtered to generate smooth continuous frame data for animation display. For the case of a small number of frames, the original frame data is directly used as the key frame data, and the key frame data is interpolated and filtered. That is, intermediate frame data is inserted between the key frames using B-spline interpolation technology, and the generated continuous frame data is adaptively Gaussian filtered. For the case of a moderate number of frames, the original frame data is directly used for animation display.
[0018] In order to better understand the above technical content, a specific implementation scheme is provided below, and each step is explained in detail. Figure 2 As shown in FIG, the animation generation method based on the ship modal analysis results specifically includes the following steps:
[0019] Step 1: Read the H5 file of the ship modal analysis results output by the SAM software, extract the results of each unit integration point and extrapolate them to the unit nodes to obtain the original frame data. Figure 3 As shown, the H5 file contains the ship modal analysis result data, that is, it contains the frame results of different frequencies. For example, Frame0 is 0 frequency (0hz). The data of each frequency can generate a cloud map, each cloud map represents a frame of data, and animation is generated based on these cloud maps. The data shown in the window represents the components of the vibration amplitude in the xyz direction, and each value represents the value at a certain integration point of the unit. In finite element analysis, each small unit contains multiple nodes, and by setting a specific set of positions within the unit as integration points, the stiffness matrix and load vector required for the unit can be derived.
[0020] Among them, extracting the results of each unit integration point and extrapolating them to the unit node specifically includes: the transformation relationship between the known Gaussian integral coordinate system and the node coordinate system is Where ξ and η represent dimensionless parameters at specific locations within the unit in the Gaussian integral coordinate system (local coordinates). Represents the dimensionless parameter in the nodal coordinate system (global coordinates). Using the shape function of the i-th node of the element Project the integral result V of any point in the unit to the corresponding node to obtain the interpolated result σ Gi Assuming that a unit has four nodes, the projection is expressed as:
[0021]
[0022] Finally, the data on each unit node constitutes the original frame data Frame = [X, Y, Z, Value], where (X, Y, Z) represents the node coordinates and Value represents the result of interpolation to the node.
[0023] Step 2: Parameter initialization, including: assuming that the software displays the optimal number of frames as L and the default length of the key frame as Lg = 0.3*L, which can be adjusted by the user according to actual needs. This value does not participate in algorithm optimization; setting the maximum number of iterations to MaxGen, setting the termination condition to reach the maximum number of iterations, or terminating the genetic algorithm early when the fitness change rate for five consecutive generations is less than the set threshold α; the initial population size is PopSize.
[0024] Step 3: When the number of Frames is less than L, the original frame data is used as key frame data for interpolation and filtering, that is, jumping to step 11 to start execution; when the number of Frames is equal to L, the original frame data is directly used for animation display with the help of SAM software. Optionally, in order to improve the quality of animation display, the original frame data can also be smoothed and filtered before animation display; when the number of Frames is greater than L, the key frame data is extracted from the original frame data using a genetic algorithm, that is, starting from step 4.
[0025] Step 4: Initialize the population in parallel based on the original frame data. This step specifically includes the following:
[0026] 1) Randomly generate PopSize individuals to form the initial population. Each individual is a binary gene string of a certain length, with a gene value of 0 or 1, where "1" indicates that the frame data corresponding to the gene position is used as key frame data, and "0" indicates that the frame data corresponding to the gene position is not used as key frame data. In this example, the default PopSize = 2*Lg, and the length of the individual gene string is L k The number of frames.
[0027] 2) Parallel calculation of the single-frame motion features in the original frame data, that is, parallel calculation of the square sum of displacement SSE, maximum value MAX and minimum value MIN of each frame data, which are expressed as:
[0028]
[0029] MAX=MAX{Value1,Value2,…,Value N-1 ,Value N}
[0030] MIN=MIN{Value1,Value2,…,Value N-1 ,Value N}
[0031] Where N is the number of nodes in each frame of data.
[0032] 3) After PopSize threads have finished running, determine the threshold of each type of motion feature. According to the displacement square sum SSE, maximum value MAX and minimum value MIN of each frame data, calculate the mean and standard deviation of each type of motion feature data, and add them up as the threshold of each type of motion feature, that is, σ SSE =mean(SSE)+std(SSE),σ max =mean(MAX)+std(MAX) and σ min =mean(MIN)+std(MIN).
[0033] 4) Generate 4 heuristic individuals. Compare the displacement sum of squares, maximum and minimum values of each frame data with the corresponding thresholds, and generate an heuristic individual based on the comparison results of each type of motion feature. For example, traverse the frame and compare the displacement sum of squares SSE of each frame data with the threshold σ SSE The size of the current frame, if the SSE>σ SSE , then the gene value corresponding to the frame is 1, otherwise it is 0. After the traversal, A1 with updated gene value is obtained as the first heuristic individual; the maximum value MAX of each frame data is compared with the threshold σ in turn. max The size of the current frame, if MAX>σ max , the gene value corresponding to that frame is 1, otherwise it is 0. At the end of the traversal, the updated gene value A2 is obtained as the second inspiring individual. Similarly, the third inspiring individual A3 can be generated. At the same time, the displacement sum of squares, maximum value, and minimum value of each frame data are compared with the corresponding threshold value. Based on the comparison results, the fourth inspiring individual A4 is generated. The gene value of this individual is 1 if the displacement sum of squares SSE, maximum value MAX, and minimum value MIN of the corresponding frame data are all greater than the corresponding threshold value. Otherwise, the gene value is 0.
[0034] 5) Finally, the four generated heuristic individuals A1 to A4 are used to replace any four individuals in the initial population. In this embodiment, the first four individuals in the initial population are replaced with A1 to A4.
[0035] Step 5: Calculate the fitness value of each individual in the current population. The fitness function F designed in this embodiment is generated by multi-objective optimization and is expressed as: F = w1*F d +w2*F c ,in:
[0036] R is the maximum length of consecutive gene values of 1 in an individual gene string;
[0037] S i is the motion feature score of the i-th frame data in the individual gene string, expressed as S i =SSE i +|MAX i -MIN i |+0.5|SSE i -SSE i-1 |, max(S) is the maximum motion feature score of all frame data in the individual gene string.
[0038] w1 and w2 represent the target weight coefficients, respectively. In this example, w1 = 0.85 and w2 = 0.15. In actual application, PopSize threads are opened for each individual, the gene string statistics R are scanned, and the fitness value Fitness of each individual is calculated based on the fitness function F.
[0039] Step 6: Based on the fitness value, use the selection operator to select a certain number of individuals as parents. Specifically, sort the fitness value of each individual in the current population in descending order, extract the first half of the individuals in the sequence and remove duplicate individuals. These individuals and a certain number of randomly generated individuals form the intermediate population individual, and the population size is maintained at PopSize.
[0040] Then, the roulette wheel selection is used to select the intermediate population individuals to obtain a certain number of individuals as parents. Specifically, first, the individual fitness value Fitness in the intermediate population individual is calculated i and the total global fitness of the population Next, the fitness values of each individual in the intermediate population (individual) are sorted in descending order, concentrating high-quality individuals at the front of the list. A prefix sum array is constructed, where the i-th element of the array records the cumulative fitness value of the first i individuals, partial_sum[i]. Next, PopSize threads are run in parallel, each generating a random number rand∈[0,SumP). A binary search is then performed on the prefix sum array to quickly locate the minimum index i that satisfies partial_sum[i]≥rand. The i-th individual in the intermediate population (individual) corresponding to this minimum index is then selected. After all threads have completed their selections, the parent generation (Selected) is aggregated, maintaining its size at PopSize.
[0041] Step 7: Use the crossover operator to perform a crossover operation on the selected parent generation to generate a new child generation. Specifically, two different crossover points R1 and R2 (0≤R1 <R2≤L k ), the adjacent matching strategy is used to select two adjacent individuals from the selected parent generation Selected, and the two adjacent parent generation individuals exchange genes in the [R1, R2] segment to generate two new offspring.
[0042] Step 8: Use the mutation operator to perform mutation operations on the offspring generated by the crossover to generate new offspring. Specifically, calculate the mutation probability Pe = 0.25*(1-current_gen / MaxGen), where current_gen is the current iteration number; for each offspring generated by the crossover, generate L k Random numbers are traversed. If the current random number is greater than the mutation probability Pe, the corresponding gene value in the corresponding offspring will be inverted.
[0043] Step 9: Replace the two individuals with the lowest fitness in the current population with the two offspring generated by the mutation, and calculate the fitness value FitnessNow of each individual in the population after the population update and the total global fitness of the population.
[0044] Step 10: Determine whether the set termination conditions are met, calculate the difference between the total global fitness of the current population and the total global fitness of the previous generation population as the fitness change rate, if the fitness change rate of five consecutive generations is less than the preset threshold α, it indicates that the algorithm has converged and the iteration can be terminated early; if the fitness change rate is still significant and has not reached the maximum number of iterations MaxGen, return to step 6 to continue the iterative calculation; if current_gen = MaxGen, output the individual with the highest fitness in the current population, extract the gene position whose gene value is "1", and form the key frame set keyFrame.
[0045] Step 11: Interpolate intermediate frame data between key frame data using B-spline interpolation technology. Specifically, starting from the first key frame, insert Mk intermediate frames between two adjacent key frames in sequence. The parameters of the intermediate frames are expressed as:
[0046] The value range of j is [0,Mk-1].
[0047] Then recursively calculate the cubic B-spline basis function of the current key frame:
[0048] Among them, t i is the node of the parameter interval.
[0049] Next, calculate the intermediate frame data F j =B(t)*keyFrame(i)+B(1-t)*keyFrame(i+1), where F j is the data of the jth intermediate frame between key frames, B(t) and B(1-t) are simplified representations of the cubic B-spline basis functions of the previous key frame and the next key frame. Calculate the Mk intermediate frames inserted in all Lg key frames in a loop, and finally combine the key frames and intermediate frames into the animation display frame variable D0 = [X, Y, Z, Value], with a variable length of L n , where L n =k0*L, k0∈[0.5,1].
[0050] Step 12: Perform adaptive Gaussian filtering on each frame of the animation display frame variable D0. Specifically, first determine the filter window size to be L s , solve the Gaussian filter:
[0051] Among them, g is the Gaussian kernel size, σ is the standard deviation of the Gaussian kernel, and the Gaussian filter is normalized.
[0052] Then, Gaussian filtering is applied to each frame of data D0, that is, In addition, at the D0 boundary, the L at the end s -1 frame data is appended to the beginning and end of the frame data. By supplementing the insufficient data at the beginning and end positions to meet the needs of the filter window, the frame data in each filter window is multiplied by the Gaussian coefficient and accumulated to obtain the output value out of the group of data. Figure 4 As shown. Finally, the animation frame variable D is obtained, and the variable length is L+L s -1.
[0053] Step 13: Output the filtered animation frame D to the SAM software for intelligent animation display, such as Figure 5 shown.
[0054] The above description is only a preferred embodiment of the present application, and the present invention is not limited to the above embodiment. It is understood that other improvements and variations directly derived or imagined by those skilled in the art without departing from the spirit and concept of the present invention should be considered to be included in the scope of protection of the present invention.
Claims
1. A method for generating animation based on ship modal analysis results, characterized in that: The method comprises: Read the ship modal analysis result data, extract the results of each unit integration point and extrapolate them to the unit node to obtain the original frame data; When the original frame number is greater than the set optimal frame number, a genetic algorithm is used to extract key frame data from the original frame data, and the key frame data is interpolated and filtered to generate smooth continuous frame data for animation display; When the original frame number is less than the set optimal frame number, directly using the original frame data as the key frame data, and executing the steps of interpolating and filtering the key frame data; When the original frame number is equal to the set optimal frame number, the animation display is directly realized using the original frame data.
2. The animation generation method based on ship modal analysis results according to claim 1 is characterized in that: Extract the results of each unit integration point and extrapolate them to the unit node to obtain the original frame data, including: Given the transformation relationship between the Gaussian integral coordinate system and the node coordinate system, the shape function of the i-th node of the unit is used to project the integral result of any point in the unit onto the corresponding node to obtain the interpolated result; The data on each unit node constitutes the original frame data Frame = [X, Y, Z, Value], where (X, Y, Z) represents the node coordinates and Value represents the result of interpolation to the node.
3. The animation generation method based on ship modal analysis results according to claim 1 is characterized in that: Extracting key frame data from the original frame data using a genetic algorithm includes: Based on the original frame data, a population is initialized in parallel, where each individual is a binary gene string of a certain length, and the gene value is 0 or 1, where 1 indicates that the frame data corresponding to the gene position is used as the key frame data; Calculate the fitness value of each individual in the current population; According to the fitness value, a certain number of individuals are selected as parents using a selection operator; For the selected parent generation, use the crossover operator to perform a crossover operation to generate a new offspring generation; For the offspring generated by crossover, use the mutation operator to perform mutation operation to generate new offspring; Replace the individuals with the lowest fitness in the current population with the offspring generated by mutation to update the population; Determine whether the set termination condition is met. If so, output the individual with the highest fitness in the current population, extract the gene bits with their gene values 1, and form a key frame set; otherwise, re-execute the step of selecting a certain number of individuals as parents based on the fitness value using the selection operator; The termination condition is set to reach the maximum number of iterations, or the fitness change rate for N consecutive generations is less than a set threshold.
4. The animation generation method based on ship modal analysis results according to claim 3 is characterized in that: Based on the original frame data, the population is initialized in parallel, including: Randomly generate PopSize individuals to form the initial population; Parallel calculation of single-frame motion features in the original frame data, including the sum of squares of displacement, maximum value, and minimum value of each frame data; Determine the threshold value of each type of motion feature, compare the displacement sum of squares, maximum value and minimum value of each frame data with the corresponding threshold value, and generate an inspiring individual based on the comparison result of each type of motion feature, wherein the gene value of the individual is 1 if the displacement sum of squares, maximum value or minimum value of the corresponding frame data is greater than the corresponding threshold value, otherwise the gene value is 0; At the same time, the displacement sum, maximum value and minimum value of each frame data are compared with the corresponding threshold value, and an inspiring individual is generated based on the comparison result. The gene value of the individual is 1, indicating that the displacement sum, maximum value and minimum value of the corresponding frame data are all greater than the corresponding threshold value, otherwise the gene value is 0; Replace any four individuals in the initial population with the generated four inspiring individuals.
5. The animation generation method based on ship modal analysis results according to claim 4 is characterized in that: The step of determining a threshold value for each type of motion feature includes: The mean and standard deviation of each type of motion feature data are calculated based on the displacement square sum, maximum value and minimum value of each frame of data, and the sum is used as the threshold of each type of motion feature.
6. The animation generation method based on ship modal analysis results according to claim 3 is characterized in that: The calculation of the fitness value of each individual in the current population includes: The fitness function F adopts multi-objective optimization and is expressed as: F = w1*F d +w2*F c ,in: R is the maximum length of consecutive gene values of 1 in an individual gene string; S i is the motion feature score of the i-th frame data in the individual gene string, max(S) is the maximum motion feature score of all frame data in the individual gene string, and N is the number of nodes in each frame data; w1+w2=1, w1>w2, respectively represent the target weight coefficients; Among them, S i =SSE i +|MAX i -MIN i |+0.5|SSE i -SSE i-1 |, SSE i , MAX i MIN i are the square sum, maximum value and minimum value of the displacement of the i-th frame data respectively.
7. The animation generation method based on ship modal analysis results according to claim 3 is characterized in that: Based on the fitness value, a selection operator is used to select a certain number of individuals as parents, including: Arrange the fitness value of each individual in the current population in descending order, extract the first half of the individuals in the sequence and remove duplicate individuals, and form an intermediate population with a certain number of randomly generated individuals, while keeping the population size unchanged; A roulette wheel selection is used to implement a selection operation on the intermediate population to obtain a certain number of individuals as parents.
8. The animation generation method based on ship modal analysis results according to claim 3 is characterized in that: The method of performing a crossover operation on the selected parent generation using a crossover operator to generate a new child generation includes: Randomly generate two different intersection points R1 and R2, and 0≤R1 <R2≤L k , L k is the length of the individual gene string; Adopting the adjacent mating strategy, two individuals are selected from the selected parent generation. The two parent generation individuals exchange genes in the [R1, R2] segment to generate two new offspring.
9. The animation generation method based on ship modal analysis results according to claim 3 is characterized in that: For the offspring generated by the crossover, mutation operators are used to perform mutation operations to generate new offspring, including: Calculate the mutation probability Pe = 0.25*(1-current_gen / MaxGen), current_gen is the current number of iterations, MaxGen is the maximum number of iterations Generate L k Random numbers are traversed, and if the current random number is greater than the mutation probability Pe, the corresponding gene value in the offspring generated by the crossover is reversed, where L k is the length of the individual gene string.
10. The animation generation method based on ship modal analysis results according to claim 1, characterized in that: The interpolation and filtering processing of the key frame data includes: Intermediate frame data are inserted between the key frame data by using B-spline interpolation technology, and adaptive Gaussian filtering is performed on the generated continuous frame data.