A method for generating a random ellipse in a two-dimensional plane

Generating random numbers and algebraic discriminant judgments through Matlab, the efficiency problem of random ellipses in a two-dimensional plane is solved, and is suitable for concrete medium transmission modeling and aggregate stacking, improving the generation speed and efficiency.

CN114664394BActive Publication Date: 2025-07-25SOUTHEAST UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210251708.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-15
Publication Date
2025-07-25
Estimated Expiration
2042-03-15

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently generate random elliptical models in two-dimensional planes, especially when used in concrete for porous material transfer modeling and aggregate stacking problems, and there is a lack of effective generation methods.

Method used

The built-in rand function of Matlab is used to generate random numbers, calculate the center position, length and short axis and inclination angle of the ellipse, and judge the overlap and boundary of the ellipse through algebraic discriminant formula, discard the overlap or boundary of the ellipse until the preset number or area is reached, and a random ellipse that meets the conditions is generated.

Benefits of technology

It realizes the rapid and efficient generation of random ellipses, which are suitable for computer computing simulations, especially in concrete media transmission modeling and aggregate stacking to improve generation speed and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114664394B_ABST
    Figure CN114664394B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for generating random ellipses in a two-dimensional plane, and determines whether the ellipses overlap by using an algebraic discriminant. Specifically, random ellipses are generated; five random numbers between [0, 1] are generated by using the built-in rand function in Matlab, the position of the ellipse center is calculated through the random numbers and the maximum or minimum coordinate values included in the two-dimensional plane, the major and minor axes of the ellipse are calculated through the random numbers and the maximum or minimum semi-axis lengths included in the two-dimensional plane, and the tilt angle of the ellipse is calculated through the random numbers; the overlapping judgment is performed on each subsequent generated ellipse and each previously generated ellipse. If the subsequent newly generated ellipse overlaps with the already generated ellipses, then this ellipse is discarded; the loop is stopped until the preset number of ellipses is reached or the total area of the generated ellipses exceeds the preset total ellipse area. The present invention is particularly applicable to computer calculation simulations to solve the problems of medium transmission modeling in concrete or aggregate stacking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for generating random ellipses in a two-dimensional plane, and belongs to the technical field of porous material transport modeling or particle packing. Background Art

[0002] In the field of materials, problems of multiphase transport in porous materials, such as concrete materials, are often encountered. Generally, pores, cracks or aggregates in concrete can be simplified as ellipses. Therefore, by generating a random ellipse model in a two-dimensional plane, the transport modeling of media in concrete or the packing of aggregates can be solved. Summary of the Invention

[0003] The purpose of the present invention is to provide a method for generating random ellipses in a two-dimensional plane for calculating the packing of elliptical aggregates in concrete.

[0004] The method for generating random ellipses in a two-dimensional plane according to the present invention includes the following steps:

[0005] Generate random ellipses; use the built-in rand function in Matlab to regenerate 5 random numbers between [0, 1], calculate the position of the ellipse center through the random numbers and the maximum or minimum coordinate values included in the two-dimensional plane, calculate the major and minor axes of the ellipse through the random numbers and the maximum or minimum semi-axis lengths included in the two-dimensional plane, and calculate the tilt angle of the ellipse through the random numbers;

[0006] Overlap judgment: judge whether each ellipse generated subsequently overlaps with each previously generated ellipse. If the newly generated ellipse overlaps with the already generated ellipse, discard the ellipse;

[0007] Stop the loop until the preset number of ellipses is reached or the total area of the generated ellipses exceeds the preset total ellipse area.

[0008] Further, after the overlap judgment is qualified, save the qualified ellipse data.

[0009] Further, an ellipse boundary judgment needs to be performed before the overlap judgment. If the generated ellipse is larger than the set area, it is discarded.

[0010] Further, the minimum abscissa value X of the two-dimensional plane min , the maximum abscissa value X max , the minimum ordinate value Y min and the maximum ordinate value Y max ; the minimum major semi-axis a of the ellipse min , the maximum major semi-axis a max , the minimum minor semi-axis b min and the maximum minor semi-axis b max ; the above satisfies 2a max ≤Xmax -X min ,2a max ≤Y max -Y min 。

[0011] Use the built-in rand function in Matlab to regenerate 5 random numbers between [0,1] as R1 to R5, and let

[0012] X1 = X min +(X max -X min )R1, Y1 = Y min +(Y max -Y min )R2, a1 = a min +(a max -a min )R3, b1 = b min +(b max -b min )R4, α1 = πR5, and generate an initial ellipse with (X1, Y1) as the center of the ellipse, the major semi-axis and minor semi-axis being a1 and b1 respectively, and the inclination angle being α1.

[0013] Furthermore, according to X N , Y N , a N , b N , α N obtain the general form of the ellipse equation, and perform single-sided processing on the ellipse boundary and overlap according to the general form:

[0014] A N X 2 +B N XY + C N Y 2 +D N X + E N Y + F N = 0

[0015] where:

[0016]

[0017] D N = -2A N X N -B N Y N

[0018] E N = -2C N Y N -B N X N

[0019] F N =AX N 2 +B N X N Y N +C N Y N 2 -1

[0020] Furthermore, overlap judgment: according to the newly generated Nth elliptic equation, it is combined with the N-1 equations that have been generated to obtain N-1 quartic equations. The root-finding formula of the quartic equation determines whether the equation has a real solution. If all equations have no real solutions, the Nth ellipse does not intersect with the previous N-1 ellipses.

[0021] Furthermore, Δ1>0, Δ3>0, and Δ2<0 or A≤0. Where A=f3 2 -f4f2,B=f4f0-4f3f1,C=f4 2 f1-3f4f3f2+2f3 2 ,

[0022] f4, 4f3, 6f2, 4f1, and f0 are the coefficients of the quartic term, cubic term, quadratic term, linear term, and constant term of the quartic equation, respectively.

[0023] Δ1=B 3 -27D 2 ,

[0024] Δ2=12A 2 -f4 2 B.

[0025]

[0026] Where (X i1 ,Y i1 ) and (X i2 ,Y i2 ) is the i-th ( <N)个椭圆的两个焦点,a m is the larger of the major semi-axes of the i-th ellipse and the N-th ellipse.

[0027] Further, boundary judgment: According to the minimum horizontal coordinate minX, maximum horizontal coordinate maxX, minimum vertical coordinate minY and maximum vertical coordinate maxY of the ellipse equation, directly compare it with the X min , X max , Y min and Y max By comparison, if the coordinates on the ellipse equation are greater than the limited coordinates on the two-dimensional plane, the newly generated ellipse boundary exceeds its limited boundary.

[0028] Further, the boundary judgment condition is:

[0029]

[0030] Beneficial effects: Compared with the prior art, the present invention uses strict algebraic expressions for boundary judgment and overlap judgment, without making other assumptions, and has a fast generation speed and high efficiency, and is particularly suitable for computer calculation and simulation. Description of the Drawings

[0031] Figure 1 is the step flow chart of the method for generating a random ellipse in the two-dimensional plane according to the present invention;

[0032] Figure 2 is the result of the random ellipse in the two-dimensional plane generated in Embodiment 1 of the present invention;

[0033] Figure 3 is the result of the random ellipse in the two-dimensional plane generated in Embodiment 2 of the present invention;

[0034] Figure 4 is the result of the random ellipse in the two-dimensional plane generated in Embodiment 3 of the present invention;

[0035] Figure 5 is the result of the random ellipse in the two-dimensional plane generated in Embodiment 4 of the present invention;

[0036] Figure 6 is the result of the random ellipse in the two-dimensional plane generated in Embodiment 5 of the present invention. Detailed Embodiments

[0037] The present invention will be further described below with reference to the drawings and embodiments.

[0038] Embodiment 1

[0039] As Figure 1 shown, a method for generating a random ellipse in the two-dimensional plane includes the following steps:

[0040] 1) Input parameters: the minimum abscissa value X min , the maximum abscissa value X max , the minimum ordinate value Y min and the maximum ordinate value Y max ; the minimum major semi-axis a min , the maximum major semi-axis a max , the minimum minor semi-axis b min and the maximum minor semi-axis b max ; and satisfying 2a max ≤X max -X min 2amax ≤Y max -Y min 。

[0041] 2) Generate the initial ellipse: Use the built-in rand function in Matlab to generate 5 random numbers R1 to R5 between [0,1]. Let X1 = X min +(X max -X min )R1, Y1 = Y min +(Y max -Y min )R2, a1 = a min +(a max -a min )R3, b1 = b min +(b max -b min )R4, α1 = πR5. Then an initial ellipse with (X1,Y1) as the center of the ellipse, the major semi-axis and minor semi-axis being a1 and b1 respectively, and the inclination angle (the angle between the major semi-axis and the positive x-axis direction) being α1 can be generated, and its area is S1 = πa1b1.

[0042] 3) Boundary judgment: Judge whether the generated ellipse exceeds the boundary of the two-dimensional plane Ω. If it exceeds, re-perform step 1); otherwise, save X1, Y1, a1, b1, α1, S1, and perform step 4).

[0043] 4) Generate the Nth (≥2) ellipse: Use the built-in rand function in Matlab to regenerate 5 random numbers R1 to R5 between [0,1]. Let X N =X min +(X max -X min )R1, Y N =Y min +(Y max -Y min )R2, a N =a min +(a max -a min )R3, b N =b min +(b max -b min )R4, α N =πR5. Then an ellipse with (X N ,Y N ) as the center of the ellipse, the major semi-axis and minor semi-axis being a N and b N , and the inclination angle being α N can be generated, and its area is S N =πa Nb N 。

[0044] 5) Boundary judgment and overlap judgment: Determine whether the newly generated ellipse exceeds the boundary of the two-dimensional plane Ω and whether it overlaps with the already generated ellipses. If it exceeds the boundary or overlaps, repeat step 4); otherwise, save X N , Y N , a N , b N , α N , S N 。

[0045] 6) Repeat steps 4) and 5) until the preset number of ellipses is reached or the preset total ellipse area fraction is exceeded, then stop the loop and output all the generated ellipses.

[0046] In the two-dimensional plane Ω = [0, 100] × [0, 100] (length × width = 100 × 100), the minimum value of the major semi-axis a of the ellipse is set to 1, and the maximum value is 5; the minimum value of the minor semi-axis b is 0.1, and the maximum value is 1. The time taken for this model to generate 1000 random ellipses on a computer with an i7-10700 CPU and 16.0 GB RAM is approximately 1.450 seconds, and the area fraction is 0.3195. The calculation results are as Figure 2 shown.

[0047] Example 2

[0048] Different from Example 1, in the two-dimensional plane Ω = [0, 100] × [0, 100] (length × width = 100 × 100), the minimum value of the major semi-axis a of the ellipse is set to 1, and the maximum value is 5; the minor semi-axis b = 0.5a. The time taken for this model to generate 1000 random ellipses on a computer with an i7-10700 CPU and 16.0 GB RAM is approximately 5.560 seconds, and the area fraction is 0.5492. The calculation results are as Figure 3 shown.

[0049] Example 3

[0050] Different from Example 1, in the two-dimensional plane Ω = [0, 100] × [0, 100] (length × width = 100 × 100), the minimum value of the major semi-axis a of the ellipse is set to 1, and the maximum value is 5; the minimum value of the minor semi-axis b is 0.5, and the maximum value is 2.5. The time taken for this model to generate random ellipses with an area fraction of about 0.50 on a computer with an i7-10700 CPU and 16.0 GB RAM is approximately 2.351 seconds, and the number of ellipses is 604 (area fraction is 0.5005). The calculation results are as Figure 4 shown.

[0051] Example 4

[0052] Different from Example 1, in the two-dimensional plane Ω = [0,1]×[0,1] (length × width = 1×1), the minimum value of the major semi-axis a of the ellipse is set to 0.05, and the maximum value is 0.08; the minor semi-axis b = (0.1 - 0.2)a, without considering boundary judgment. On a computer with an i7-10700 CPU and 16.0GB RAM, the time taken to generate random ellipses with an area fraction of approximately 0.3127 is about 0.062 seconds, and the number of ellipses is 166 (area fraction is 0.3127). The calculation results are as Figure 5 shown.

[0053] Example 5

[0054] Different from Example 1, in the two-dimensional plane Ω = [0,1]×[0,1] (length × width = 1×1), the minimum value of the major semi-axis a of the ellipse is set to 0.05, and the maximum value is 0.08; the minor semi-axis b = (0.05 - 0.08)a, without considering boundary judgment. On a computer with an i7-10700 CPU and 16.0GB RAM, the time taken to generate random ellipses with an area fraction of approximately 0.1432 is about 0.045 seconds, and the number of ellipses is 176 (area fraction is 0.1434). The calculation results are as Figure 6 shown.

[0055] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification to better explain the principle and practical application of the present invention, so that those skilled in the art can understand and utilize the present invention well. The present invention is only limited by the claims and their full scope and equivalents.

Claims

1. A method for generating random ellipses in a two-dimensional plane, where the random ellipses are used to simulate pores, cracks or aggregates in concrete to solve the problem of medium transport modeling or aggregate packing in concrete, characterized in that , The method includes the following steps: Generate a random ellipse: Use the built-in rand function in Matlab to regenerate 5 random numbers between [0, 1]. Calculate the position of the ellipse center through the random numbers and the maximum or minimum coordinate values included in the two-dimensional plane. Calculate the major and minor axes of the ellipse through the random numbers and the maximum or minimum semi-axis lengths included in the two-dimensional plane. Calculate the tilt angle of the ellipse through the random numbers; Overlap judgment: Judge the overlap of each ellipse generated subsequently with each previously generated ellipse. If there is an overlap between the subsequently generated new ellipse and the already generated ellipse, then discard this ellipse; Stop the loop until the preset number of ellipses is reached or the total area of the generated ellipses exceeds the preset total ellipse area; The specific overlap judgment is as follows: Simultaneously solve the Nth newly generated ellipse equation with the N - 1 already generated equations respectively to obtain N - 1 quartic equations of one variable. Judge whether the equations have real solutions according to the root formula of the quartic equation of one variable. If none of the equations have real solutions, then the Nth ellipse does not intersect with the previous N - 1 ellipses; The overlap judgment condition is: , , and or , where , , , , , , , , are the coefficients of the quartic term, cubic term, quadratic term, linear term, and constant term of the quartic equation of one variable respectively; , , , Among them and are the two foci of the th ellipse, <N, the th ellipse and the larger value of the major semi-axes of the th ellipse and the Nth ellipse.

2. A method for generating a random ellipse in a two-dimensional plane according to claim 1, characterized in that: After the overlap judgment is qualified, save the qualified ellipse data.

3. A method for generating a random ellipse in a two-dimensional plane according to claim 1 or 2, characterized in that: Before the overlap judgment, it is necessary to perform an ellipse boundary judgment. If the generated ellipse is larger than the set area, then discard it.

4. A method for generating a random ellipse in a two-dimensional plane according to claim 3, characterized in that: The minimum abscissa value of the two-dimensional plane , the maximum abscissa value , the minimum ordinate value and the maximum ordinate value ; the minimum major semi-axis of the ellipse , the maximum major semi-axis , the minimum minor semi-axis and the maximum minor semi-axis ; the above satisfy , , 5 random numbers between [0, 1] are R1 to R5; let , , , , , generate an initial ellipse with as the center of the ellipse, the major semi-axis and minor semi-axis are respectively and , and the inclination angle is .

5. A method for generating random ellipses in a two-dimensional plane according to claim 1, characterized in that: According to , , , , obtain the general form of the ellipse equation, and judge the ellipse boundary and overlap according to the general form: Wherein: 。 6. A method for generating a random ellipse in a two-dimensional plane according to claim 5, characterized in that: Boundary judgment: Based on the minimum abscissa of the ellipse equation , the maximum abscissa , the minimum ordinate and the maximum ordinate , directly compare with the , , and in the two-dimensional plane. If the coordinates on the ellipse equation are greater than the limited coordinates in the two-dimensional plane, the newly generated ellipse boundary exceeds its limited boundary.

7. A method for generating a random ellipse in a two-dimensional plane according to claim 6, wherein, The boundary judgment condition is: 。

Citation Information

Patent Citations

  • Image pre-processing method of oval correction and circle normalization

    CN101383006A

  • Method for generating random elliptical reinforced phase in two-dimensional plane

    CN108229064A