Arc parameter spline interpolation method, system, equipment, medium and product
By calculating the arc length between the measured points and constructing a cubic spline interpolation function with arc length as independent variables, the limitation of the cubic spline interpolation method on monotonic boundaries is solved, and the ability to draw smooth curves on non-monotonic boundaries is realized.
Patent Information
- Application Number
- CN202411815262.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-04
AI Technical Summary
The cubic spline interpolation method is only suitable for strict monotonic boundaries, and it is impossible to effectively draw smooth curves with non-monotonic boundaries.
By calculating the arc lengths between multiple measured points, a cubic spline interpolation function with arc length as independent variables is constructed, and aliquots and interpolations are performed respectively to obtain the arc parameter spline interpolation curve.
The ability to draw smooth curves under non-monotonic boundary conditions is realized. The curve is not only continuous, but also has good overall smoothness, which is suitable for monotonic and non-monotonic boundary situations.
Smart Images

Figure CN119762620A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to an arc parameter spline interpolation method, system, device, medium and product. Background Art
[0002] In the fields of shipbuilding, aerospace, water conservancy engineering, etc., it involves drawing a smooth curve from some measured data points. When the sequence formed by the horizontal coordinates or vertical coordinates of these data points is a strictly monotonic series, the cubic spline interpolation method can be used to achieve it. However, if the sequence formed by the horizontal coordinates or vertical coordinates of these data points is not monotonic, the cubic spline interpolation method will fail. If the data points are divided into several parts so that the sequence formed by the horizontal coordinates or vertical coordinates of each part of the data points is strictly monotonic, several smooth curves can be obtained by using the cubic spline interpolation method respectively, but the connection point between the two curves is not smooth, which makes the entire curve not smooth.
[0003] Therefore, the cubic spline interpolation method is only applicable to the case of strictly monotone boundaries, and cannot draw a smooth curve for non-strictly monotone boundaries. Summary of the invention
[0004] The purpose of this application is to provide an arc parameter spline interpolation method, system, device, medium and product, which can not only interpolate scenarios with monotonic boundaries, but also interpolate scenarios with non-monotonic boundaries to draw smooth curves.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides an arc parameter spline interpolation method, comprising:
[0007] Obtain coordinate data of multiple measured points;
[0008] Calculate the arc lengths of each arc between the multiple measured points according to the coordinate data of the multiple measured points to obtain the arc length corresponding to each measured point;
[0009] Adopting the cubic spline interpolation method, determining the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function; wherein the abscissa cubic spline interpolation function represents a cubic spline interpolation function with arc length as an independent variable and x-axis coordinate as a function value; the ordinate cubic spline interpolation function represents a cubic spline interpolation function with arc length as an independent variable and y-axis coordinate as a function value;
[0010] Each arc length interval is equally divided to obtain an arc length division point sequence; the arc length interval is an interval consisting of arc lengths corresponding to two adjacent measured points;
[0011] According to the arc length point sequence, the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function are used to determine the interpolation point sequence;
[0012] The points in the interpolation point sequence are connected in sequence to obtain an arc parameter spline interpolation curve.
[0013] In a second aspect, the present application provides an arc parameter spline interpolation system, comprising:
[0014] A data acquisition module, used to acquire coordinate data of multiple measured points;
[0015] The arc length determination module is used to calculate the arc length of each arc between the multiple measured points according to the coordinate data of the multiple measured points, and obtain the arc length corresponding to each measured point;
[0016] A function determination module, used to determine a cubic spline interpolation function of a horizontal coordinate and a cubic spline interpolation function of a vertical coordinate by using a cubic spline interpolation method; wherein the cubic spline interpolation function of the horizontal coordinate represents a cubic spline interpolation function with arc length as an independent variable and x-axis coordinate as a function value; and the cubic spline interpolation function of the vertical coordinate represents a cubic spline interpolation function with arc length as an independent variable and y-axis coordinate as a function value;
[0017] The arc length equal division module is used to divide each arc length interval equally to obtain an arc length division point sequence; the arc length interval is an interval consisting of arc lengths corresponding to two adjacent measured points;
[0018] A point sequence determination module, used to determine an interpolation point sequence according to the arc length point sequence by using the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function;
[0019] The curve drawing module is used to connect the points in the interpolation point sequence in sequence to obtain an arc parameter spline interpolation curve.
[0020] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned arc parameter spline interpolation method.
[0021] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, characterized in that the computer program implements the above-mentioned arc parameter spline interpolation method when executed by a processor.
[0022] In a fifth aspect, the present application provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, the above-mentioned arc parameter spline interpolation method is implemented.
[0023] According to the specific embodiments provided in this application, this application has the following technical effects:
[0024] The present application provides an arc parameter spline interpolation method, system, equipment, medium and product. By calculating the arc length of each arc segment between multiple measured points, two cubic spline interpolation functions with arc length as the independent variable and x-axis coordinates or y-axis coordinates as function values are constructed. The method is applicable to both monotone boundary cases and non-monotone boundary cases. Each arc length interval is further divided into equal parts, and two cubic spline interpolation functions are used to determine the interpolation point sequence. The points in the interpolation point sequence are connected in sequence. The resulting curve is not only continuous, but also has good overall smoothness. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 This is an application environment diagram of an arc parameter spline interpolation method in one embodiment of the present application;
[0027] Figure 2 A schematic diagram of a flow chart of an arc parameter spline interpolation method provided in one embodiment of the present application;
[0028] Figure 3 A rope loop curve diagram obtained by using arc parameter spline interpolation method in one embodiment of the present application;
[0029] Figure 4 This is a schematic diagram of a river bank boundary obtained by using a piecewise linear interpolation method in an embodiment of the present application;
[0030] Figure 5 This is a schematic diagram of a river bank boundary obtained by using a cubic spline interpolation method in an embodiment of the present application;
[0031] Figure 6 This is a schematic diagram of a river bank boundary obtained by using piecewise cubic spline interpolation in an embodiment of the present application;
[0032] Figure 7 This is a schematic diagram of a river bank boundary obtained by using arc parameter spline interpolation in an embodiment of the present application;
[0033] Figure 8 The riverbed elevation contour map of the Daliushu River section obtained by using the reduced-dimensional arc parameter spline interpolation method in one embodiment of the present application;
[0034] Fig. 9A comparison diagram of terrain data obtained by using various interpolation methods in an embodiment of the present application;
[0035] Fig.10 A schematic diagram of the functional modules of an arc parameter spline interpolation system provided in one embodiment of the present application;
[0036] Fig.11 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0038] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0039] First, some technical terms involved in the embodiments of the present application are introduced.
[0040] (1) Description of the problem.
[0041] Given N+1 distinct points x0,x1,…,x on a closed interval [a,b] N-1 ,x N The function values at are y0,y1,…,y N-1 ,y N , construct a quadratic continuously differentiable function y=S(x) on the interval [a,b], that is, S∈C 2 [a,b], so that the interpolation condition is satisfied: y k =S(x k ), 0≤k≤N. Its geometric meaning is: given N+1 points on the plane P0(x0,y0),P1(x1,y1),…,P N (x N ,y N ), find a smooth curve passing through these N+1 different points.
[0042] (2) Cubic spline interpolation method.
[0043] The most commonly used method to solve the above problem is the cubic spline interpolation method (Cubic Spline Interpolation). This method is widely used in computer-assisted design (CAD), computer-assisted manufacturing (CAM), computational fluid dynamics (CFD) and other fields. The relevant definitions and properties of the cubic spline function are listed as follows:
[0044] Definition 1 (cubic spline interpolation function): Given N+1 different points on the interval [a,b]: a=x0<x1<…<x N-1 <x N =b,x i The corresponding function value is y i (i=0,1,…,N), the function S(x) is quadratically continuously differentiable on [a,b], and in each interval [x i ,x i+1 ](i=0,1,2,…,N-1) is a cubic polynomial function and satisfies the interpolation condition S(x i )=y i (i=0,1,2,…,N), then S(x) is called cubic spline interpolation function.
[0045] The cubic spline interpolation function that satisfies the above interpolation conditions is not unique, and additional boundary conditions are required to make the interpolation function unique. Two commonly used boundary conditions are given below:
[0046] Definition 2 (fixed boundary conditions): If the derivative of S(x) satisfies S'(a) = d0, S'(b) = d0 at the boundary point [a, b] N , then it is called a fixed boundary condition. d0 is the first-order derivative of the spline function at x0, d N is the spline function at x N The first-order derivative value of .
[0047] Definition 3 (natural boundary condition): If the derivative of S(x) satisfies S”(a) = 0, S”(b) = 0 at the boundary point [a, b], it is called a natural boundary condition.
[0048] It can be proved that the cubic spline interpolation function that satisfies the mandatory boundary conditions or natural boundary conditions is unique.
[0049] (3) Convergence and error estimation of cubic spline interpolation.
[0050] Let f∈C 4 ([a,b]), y k =f(x k )(k=0,1,2,…,N). S(x)∈C 2 [a,b] is a cubic spline interpolation function that satisfies fixed boundary conditions or natural boundary conditions, h k :=x k -x k-1 ,k=1,2,…,N, Then there exist constants C0, C1, C2 such that:
[0051] ||f(x)-S(x)|| ∞ ≤C0||f (4) (x)|| ∞ h 4 ;
[0052] ||f'(x)-S'(x)|| ∞ ≤C1||f (4) (x)|| ∞ h 3 ;
[0053] ||f”'(x)-S”'(x)|| ∞ ≤C2||f (4) (x)|| ∞ h 2 ;
[0054] in, and
[0055] According to the above conclusions, when h→0, not only does S(x) converge uniformly to f(x), but the first-order and second-order derivatives of S(x) also converge to the first-order and second-order derivatives of f(x), respectively.
[0056] It can be seen that the prerequisite for the cubic spline interpolation method to be valid is the given N+1 points x0, x1,…, x N is strictly monotonically increasing (or strictly monotonically decreasing).
[0057] When using the cubic spline interpolation method to interpolate a plane curve, if the horizontal coordinates of the measured N+1 points are not strictly monotonic, the cubic spline interpolation method cannot be used.
[0058] To this end, this application constructs a new interpolation method based on the cubic spline interpolation method, namely the arc parameter spline interpolation method, which can obtain the approximate curve of this curve through interpolation according to the coordinates of some points on an arbitrary plane curve, without being restricted by the strict monotonicity of the interpolation nodes.
[0059] The arc parameter spline interpolation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, or it can be integrated on the server 104, or it can be placed on the cloud or other servers. The terminal 102 can send the coordinate data of multiple measured points to the server 104. After receiving the coordinate data of the multiple measured points, the server 104 performs arc parameter spline interpolation to obtain an arc parameter spline interpolation curve. The server 104 can feedback the arc parameter spline interpolation curve to the terminal 102. In addition, in some embodiments, the arc parameter spline interpolation method can also be implemented separately by the server 104 or the terminal 102.
[0060] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.
[0061] In an exemplary embodiment, Figure 2 As shown, an arc parameter spline interpolation method is provided, which is executed by a computer device, and can be specifically executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used for explanation, and the steps include the following steps 201 to 206.
[0062] Step 201, obtaining coordinate data of multiple measured points.
[0063] Specifically, input the coordinate data of N+1 points P0(x0,y0), P1(x1,y1),…,P N (x N ,y N ), the horizontal and vertical coordinates of the N+1 points can be stored in two one-dimensional arrays x and y, that is, x = [x0, x1, ..., x N ],y=[y0,y1,…,y N ].
[0064] Step 202, calculating the arc lengths of each arc between the plurality of measured points according to the coordinate data of the plurality of measured points, and obtaining the arc length corresponding to each measured point.
[0065] In an exemplary embodiment, the arc length corresponding to each measured point is obtained using the following formula:
[0066] 1≤i≤N;
[0067] L0<L1<…<L N ;
[0068] Among them, L0 is the arc length corresponding to the 0th measured point, L i is the arc length corresponding to the i-th measured point, L N is the arc length corresponding to the Nth measured point, N+1 is the number of measured points, and the measured points are different points. j is the x-axis coordinate of the jth measured point, x j-1 is the x-axis coordinate of the j-1th measured point, y j is the y-axis coordinate of the jth measured point, y j-1 is the y-axis coordinate of the j-1th measured point.
[0069] The calculated arc length can be stored in a one-dimensional array L, that is, L = [L0, L1, ..., L N ]. By calculating the length of the broken line segment of each point starting from P0, it can be ensured that the arc length is monotonically increasing, so that L can be used as the independent variable and the x-axis coordinate or the y-axis coordinate as the function value to perform cubic spline interpolation and obtain the interpolation function.
[0070] Step 203: using a cubic spline interpolation method, determine a cubic spline interpolation function of the abscissa and a cubic spline interpolation function of the ordinate.
[0071] The abscissa cubic spline interpolation function represents a cubic spline interpolation function with arc length as an independent variable and x-axis coordinate as a function value. The ordinate cubic spline interpolation function represents a cubic spline interpolation function with arc length as an independent variable and y-axis coordinate as a function value.
[0072] In an exemplary embodiment, step 203 includes the following steps 301 and 302 .
[0073] Step 301, according to the abscissa arc length point sequence, under the first fixed boundary condition or the first natural boundary condition, a first quadratic continuously differentiable function is obtained by using a cubic spline interpolation method, so that the first quadratic continuously differentiable function satisfies the abscissa interpolation condition, so as to obtain an abscissa cubic spline interpolation function. The abscissa arc length point sequence includes the abscissa of each measured point and the corresponding arc length.
[0074] Specifically, since the point sequence X i (L i ,x iThe abscissa of (i = 0, 1, 2, ..., N) satisfies the necessary condition of cubic spline interpolation, that is, the monotonicity condition. Therefore, for a given point, under fixed boundary conditions or natural boundary conditions, a quadratic continuously differentiable function x = S1 (L) can be obtained by cubic spline interpolation, so that it satisfies the abscissa interpolation condition: x k =S1(L k ), 0≤k≤N and the horizontal coordinate fixed boundary conditions: S1'(L0)=d0, S1'(L N ) = d N Or the natural boundary condition of the horizontal axis: S1”(L0)=0, S1”(L N )=0.
[0075] Step 302: Based on the ordinate arc length point sequence, under the second fixed boundary condition or the second natural boundary condition, a second quadratic continuously differentiable function is obtained by using a cubic spline interpolation method, so that the second quadratic continuously differentiable function satisfies the ordinate interpolation condition, so as to obtain a ordinate cubic spline interpolation function. The ordinate arc length point sequence includes the ordinate of each measured point and the corresponding arc length.
[0076] Specifically, since the point sequence Y i (L i ,y i )(i=0,1,2,…,N), under fixed boundary conditions or natural boundary conditions, a quadratic continuously differentiable function y=S2(L) can be obtained by cubic spline interpolation method, so that it satisfies the ordinate interpolation condition: y k =S2(L k ), 0≤k≤N and vertical coordinate fixed boundary conditions: S2'(L0)=c0, S2'(L N )=c N Or the natural boundary condition of the vertical coordinate: S2”(L0)=0, S2”(L N )=0. c0 is the first-order derivative of the spline function at y0, c N is the spline function in y N The first-order derivative value of .
[0077] Step 204: divide each arc length interval equally to obtain an arc length division point sequence. The arc length interval is an interval consisting of arc lengths corresponding to two adjacent measured points.
[0078] Specifically, the arc length point sequence includes the arc length corresponding to each measured point and the point arc length of each arc length interval.
[0079] Each arc length interval [L i ,L i+1 ](i=0,1,2,…,N-1) is divided into m equal parts, and the dividing points are L i1 ,Li2 ,…,L i,m-1 , then the new arc length sequence is stored in a one-dimensional array, that is, the arc length point sequence is:
[0080] L new =[L0,L 0,1 ,L 0,2 ,...,L 0,m-1 ,L1,L 1,1 ,...,L 1,m-1 ,...,L N-1 ,L N-1,1 ,...,L N-1,m-1 ,L N ];
[0081] Among them, L new is the arc length point sequence, L0 is the arc length corresponding to the 0th measured point, L N is the arc length corresponding to the Nth measured point, N+1 is the number of measured points, L 0,1 To L 0,m-1 is the arc length of the 0th arc length interval. The 0th arc length interval is the interval consisting of the arc lengths corresponding to the 0th measured point and the 1st measured point. L 1,1 To L 1,m-1 is the arc length of the dividing point of the first arc length interval. The first arc length interval is the interval composed of the arc lengths corresponding to the first measured point and the second measured point. m is the equal fraction of the arc length interval.
[0082] The number of elements in the arc length point sequence is n = Nm + 1, which can be re-labeled as L new =[T0,T1,…,T n-1 ].
[0083] Step 205: According to the arc length point sequence, the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function are used to determine an interpolation point sequence.
[0084] The interpolation point sequence includes a horizontal coordinate and a vertical coordinate corresponding to each arc length in the arc length point sequence.
[0085] Specifically, each arc length in the arc length point sequence is substituted into the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function respectively to obtain the abscissa and ordinate corresponding to each arc length in the arc length point sequence.
[0086] Relabel the arc length point sequence as L new =[T0,T1,…,T n-1 ], and then according to the cubic spline interpolation function of the horizontal axis and the cubic spline interpolation function of the vertical axis, x can be obtained respectively i =S1(T i ),yi =S2(T i ),i=0,1,2,…,n-1.
[0087] Step 206: add the points (x i ,y i ), i=0,1,2,…,n-1 are connected in sequence to obtain the arc parameter spline interpolation curve.
[0088] Regarding the accuracy of the arc parameter spline interpolation method, the following theorem holds:
[0089] Theorem 1: Given a point sequence consisting of N+1 mutually different points: A i :=(x i ,y i ), 0≤i≤N, which is distributed on the curve p determined by the following parametric equation in the rectangular coordinate system:
[0090]
[0091] Where L is the arc length corresponding to each point, C 4 [a,b] represents the set of four times continuously differentiable functions on the interval [a,b], ψ(L i )=y i , 0≤i≤N. Then there exists a unique curve q determined by the following parametric equation in the rectangular coordinate system:
[0092]
[0093] Among them, S1 and S2 are cubic spline interpolation functions that meet fixed boundary conditions or natural boundary conditions and satisfy: S1(L i )=x i , S2(L i )=y i , 0≤i≤N.
[0094] Further, if Q=:(S1(t),S2(t)),t∈[0,L N ] are points on the curves p and q respectively, then the distance between point P and point Q can be estimated as follows:
[0095]
[0096] in, h i =L i -L i-1 ,1≤i≤N,
[0097] Theorem 2: Under the conditions of Theorem 1, if there exists a real number δ>0, and |S1'(t)|≥δ, for any t∈[a,b], then there exists a parametric equation The function y=y(x) is determined by the parametric equation Given a function y=S(x), for positive constants M1 and M2, |y'(x)-S'(x)|≤M1h 3 , y”(x)-S”(x)|≤M2h 2 .
[0098] in, Representative function The derivative function of , S1'(t) represents the derivative function of function S1(t).
[0099] The present application defines an arc length for each data point based on the restriction condition of the cubic spline interpolation method on the monotonicity of the sequence of the horizontal coordinates of the data points, that is, the broken line distance between this point and the starting point of the data point sequence, so that the arc length sequence is strictly monotonic; then, the arc length of the data point is used as the independent variable, and its horizontal coordinate and vertical coordinate are used as the function value respectively, and the two point series are reconstructed. The sequences formed by the horizontal coordinates of the two point series are strictly monotonic, so that cubic spline interpolation can be applied respectively to obtain two cubic spline interpolation functions x=S1(L), y=S2(L), and they can be connected to obtain the parametric equation form corresponding to the cubic spline interpolation function.
[0100] The arc parameter spline interpolation method proposed in this application can draw a smooth curve based on the coordinate data of the measured boundary points. It can be used not only for the monotonic boundary interpolation of the sequence formed by the horizontal coordinates and vertical coordinates of the boundary point sequence, but also for the boundary interpolation of the sequence formed by the horizontal coordinates and vertical coordinates of the boundary point sequence that are not monotonic. The obtained curve is not only continuous, but also has good overall smoothness. Compared with the cubic spline interpolation method, the arc parameter spline interpolation method has a wider range of applications. It is applicable to both monotonic boundaries and non-monotonic boundaries. Compared with the piecewise linear interpolation and piecewise cubic spline interpolation methods, the obtained curve has better overall smoothness.
[0101] The arc parameter spline interpolation method provided in the present application can be applied to the interpolation scene of river bank boundary points, that is, multiple measured points are the boundary points of the river bank. The arc parameter spline interpolation curve is the boundary curve of the river bank.
[0102] like Figure 3 The loop line shown, due to the given point column {A k The sequences formed by the horizontal coordinates or vertical coordinates of} are all non-monotonic sequences, and cannot be interpolated using the cubic spline interpolation method, but can be interpolated using the arc parameter spline interpolation method proposed in this application.
[0103] For another example, the riverbank boundary measurement data of a certain section of the Yellow River is shown in Table 1. It can be seen that, regardless of the left bank or the right bank, the sequence formed by its horizontal or vertical coordinates is not monotonic, that is, both banks have non-monotonic boundaries.
[0104] Table 1 Measured river bank coordinates of a section of the Yellow River
[0105]
[0106] Figure 4 The river bank boundary obtained by piecewise linear interpolation method is given. It can be found that the curve obtained by this method is a broken line and is not smooth.
[0107] Figure 5 This is the river bank boundary obtained directly using the cubic spline method. It can be seen that the curve obtained directly using the cubic spline interpolation method is completely distorted, cannot reflect the actual river bank boundary, and cannot be used for numerical simulation.
[0108] If the piecewise cubic spline interpolation method is used, we can get Figure 6 As shown in the figure, it can be seen that although the smoothness of the river bank boundary obtained by the piecewise cubic spline interpolation method is improved, the curve is not smooth at the curve connection point.
[0109] Figure 7 This is the river bank boundary obtained by using the arc-length spline interpolation method proposed in this application. It can be seen that the curve obtained by using the arc-length spline interpolation method can reflect the actual river bank boundary and is relatively smooth.
[0110] In addition, the arc length spline interpolation method can be further used to obtain the reduced-dimensional arc parameter spline interpolation method to interpolate the riverbed or reservoir bottom elevation. The basic steps of the reduced-dimensional arc parameter spline method are as follows:
[0111] (1) Given an irregular boundary region on a plane, namely the physical region G, it is transformed into a rectangular region, namely the computational region H, using the body-fitting coordinate transformation method.
[0112] (2) The computational area H is uniformly meshed and projected onto the physical area according to the Poisson equation method to obtain a mesh on the physical area G. This mesh is a structured mesh, which is interwoven with two types of grid lines, including ξ lines and η lines. The former is parallel to the river bank, while the latter is orthogonal to the river bank. The measurement section can be selected to be located on the η line.
[0113] (3) Using the arc parameter spline interpolation method, the riverbed elevation at the grid node on the η line is obtained based on the riverbed elevation measured on the measurement section.
[0114] (4) Based on the obtained riverbed elevation, the arc parameter spline interpolation method is used to obtain the riverbed elevation at all grid nodes on each ξ line.
[0115] (5) Scan all ξ lines to obtain the riverbed elevations at all grid nodes.
[0116] Figure 8 The riverbed elevation of the Daliushu River section obtained by using the reduced-dimensional arc parameter spline interpolation method is given. The actual riverbed elevation is the elevation in the figure plus 1200, in meters.
[0117] Fig. 9 The riverbed elevations obtained by different interpolation methods were compared. The interpolation methods used were scattered data interpolation, two-dimensional reverse cubic spline interpolation, and arc parameter spline interpolation. Figure 7 The four lines in the figure are the two river bank boundaries, namely the left bank (ξ-line 1), the right bank (ξ-line 31), and two curves parallel to the river bank boundaries, which are 1 / 3 and 2 / 3 of the river width away from the left bank respectively (ξ-line 11 and ξ-line 21).
[0118] It can be seen that since the measured data in this example is concentrated on the section, and the section spacing is large, the direct use of the scattered data interpolation method commonly used in engineering will result in too large an error, and the data will be completely distorted and cannot be used normally. However, using the two-dimensional reverse cubic spline interpolation method, it is necessary to convert the physical area into a calculation area, interpolate on the calculation area, and then project it onto the physical area. Since an evenly divided grid is used on the calculation area, and the physical area is encrypted as needed, it is generally an unevenly divided grid. Therefore, the riverbed elevation obtained by the two-dimensional cubic spline interpolation method on the calculation area is projected onto the physical area, and there is also a large error. The reduced-dimensional arc parameter spline interpolation method proposed in this application directly interpolates on the physical area, which is consistent with the measured value and has a higher calculation accuracy.
[0119] Based on the same inventive concept, the embodiment of the present application also provides an arc parameter spline interpolation system for implementing the arc parameter spline interpolation method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more arc parameter spline interpolation system embodiments provided below can refer to the limitations of the arc parameter spline interpolation method above, and will not be repeated here.
[0120] In an exemplary embodiment, Fig.10 As shown, an arc parameter spline interpolation system is provided, including: a data acquisition module 401, an arc length determination module 402, a function determination module 403, an arc length equal division module 404, a point sequence determination module 405 and a curve drawing module 406.
[0121] The data acquisition module 401 is used to acquire coordinate data of multiple measured points.
[0122] The arc length determination module 402 is used to calculate the arc length of each arc between the multiple measured points according to the coordinate data of the multiple measured points, and obtain the arc length corresponding to each measured point.
[0123] The function determination module 403 is used to determine the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function by using the cubic spline interpolation method. The abscissa cubic spline interpolation function represents a cubic spline interpolation function with arc length as an independent variable and x-axis coordinate as a function value. The ordinate cubic spline interpolation function represents a cubic spline interpolation function with arc length as an independent variable and y-axis coordinate as a function value.
[0124] The arc length dividing module 404 is used to divide each arc length interval equally to obtain an arc length dividing point sequence. The arc length interval is an interval consisting of arc lengths corresponding to two adjacent measured points.
[0125] The point sequence determination module 405 is used to determine the interpolation point sequence according to the arc length point sequence by using the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function.
[0126] The curve drawing module 406 is used to connect the points in the interpolation point sequence in sequence to obtain an arc parameter spline interpolation curve.
[0127] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used for the coordinate data of multiple measured points. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an arc parameter spline interpolation method is implemented.
[0128] Those skilled in the art will understand that Fig.11The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0129] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0130] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0131] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0132] In this application, all actions to obtain signals, information or data are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0134] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0135] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. An arc parameter spline interpolation method, characterized in that: The arc parameter spline interpolation method comprises: Obtain coordinate data of multiple measured points; Calculate the arc lengths of each arc between the multiple measured points according to the coordinate data of the multiple measured points to obtain the arc length corresponding to each measured point; Adopting the cubic spline interpolation method, determining the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function; wherein the abscissa cubic spline interpolation function represents a cubic spline interpolation function with arc length as an independent variable and x-axis coordinate as a function value; the ordinate cubic spline interpolation function represents a cubic spline interpolation function with arc length as an independent variable and y-axis coordinate as a function value; Each arc length interval is equally divided to obtain an arc length division point sequence; the arc length interval is an interval consisting of arc lengths corresponding to two adjacent measured points; According to the arc length point sequence, the interpolation point sequence is determined by using the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function; The points in the interpolation point sequence are connected in sequence to obtain an arc parameter spline interpolation curve.
2. The arc parameter spline interpolation method according to claim 1, characterized in that: The arc length corresponding to each measured point is obtained using the following formula: L0<L1<…<L N ; Among them, L0 is the arc length corresponding to the 0th measured point, L i is the arc length corresponding to the i-th measured point, L N is the arc length corresponding to the Nth measured point, N+1 is the number of measured points, x j is the x-axis coordinate of the jth measured point, x j-1 is the x-axis coordinate of the j-1th measured point, y j is the y-axis coordinate of the jth measured point, y j-1 is the y-axis coordinate of the j-1th measured point.
3. The arc parameter spline interpolation method according to claim 1, characterized in that: The cubic spline interpolation method is used to determine the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function, which specifically includes: According to the abscissa arc length point sequence, under the first fixed boundary condition or the first natural boundary condition, a first quadratic continuously differentiable function is obtained by using a cubic spline interpolation method, so that the first quadratic continuously differentiable function satisfies the abscissa interpolation condition, so as to obtain an abscissa cubic spline interpolation function; the abscissa arc length point sequence includes the abscissa of each measured point and the corresponding arc length; According to the ordinate arc length point sequence, under the second fixed boundary condition or the second natural boundary condition, the cubic spline interpolation method is used to obtain the second quadratic continuously differentiable function, so that the second quadratic continuously differentiable function satisfies the ordinate interpolation condition to obtain the ordinate cubic spline interpolation function; the ordinate arc length point sequence includes the ordinate of each measured point and the corresponding arc length.
4. The arc parameter spline interpolation method according to claim 1, characterized in that: The arc length point sequence includes the arc length corresponding to each measured point and the arc length of each point in the arc length interval; The arc length point sequence is: L new =[L0,L 0,1 ,L 0,2 ,...,L 0,m-1 ,L1,L 1,1 ,...,L 1,m-1 ,...,L N-1 ,L N-1,1 ,...,L N-1,m-1 ,L N ]; Among them, L new is the arc length point sequence, L0 is the arc length corresponding to the 0th measured point, L N is the arc length corresponding to the Nth measured point, N+1 is the number of measured points, L 0,1 To L 0,m-1 is the arc length of the 0th arc length interval. The 0th arc length interval is the interval consisting of the arc lengths corresponding to the 0th measured point and the 1st measured point. L 1,1 To L 1,m-1 is the arc length of the dividing point of the first arc length interval. The first arc length interval is the interval composed of the arc lengths corresponding to the first measured point and the second measured point. m is the equal fraction of the arc length interval.
5. The arc parameter spline interpolation method according to claim 4, characterized in that: The interpolation point sequence includes the horizontal coordinate and the vertical coordinate corresponding to each arc length in the arc length point sequence; According to the arc length point sequence, the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function are used to determine the interpolation point sequence, which specifically includes: Substitute each arc length in the arc length point sequence into the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function to obtain the abscissa and ordinate corresponding to each arc length in the arc length point sequence.
6. The arc parameter spline interpolation method according to claim 1, characterized in that: The plurality of measured points are boundary points of the river bank; the arc parameter spline interpolation curve is the boundary curve of the river bank.
7. An arc parameter spline interpolation system, applied to the arc parameter spline interpolation method according to any one of claims 1 to 6, characterized in that: The arc parameter spline interpolation system comprises: A data acquisition module, used to acquire coordinate data of multiple measured points; The arc length determination module is used to calculate the arc length of each arc between the multiple measured points according to the coordinate data of the multiple measured points, and obtain the arc length corresponding to each measured point; A function determination module, used to determine a cubic spline interpolation function of a horizontal coordinate and a cubic spline interpolation function of a vertical coordinate by using a cubic spline interpolation method; wherein the cubic spline interpolation function of the horizontal coordinate represents a cubic spline interpolation function with arc length as an independent variable and x-axis coordinate as a function value; and the cubic spline interpolation function of the vertical coordinate represents a cubic spline interpolation function with arc length as an independent variable and y-axis coordinate as a function value; The arc length dividing module is used to divide each arc length interval equally to obtain an arc length dividing point sequence; the arc length interval is an interval consisting of arc lengths corresponding to two adjacent measured points; A point sequence determination module, used to determine an interpolation point sequence according to the arc length point sequence by using the abscissa cubic spline interpolation function and the ordinate cubic spline interpolation function; The curve drawing module is used to connect the points in the interpolation point sequence in sequence to obtain an arc parameter spline interpolation curve.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the arc parameter spline interpolation method described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the arc parameter spline interpolation method described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the arc parameter spline interpolation method described in any one of claims 1 to 6 is implemented.