Method and device for calculating magnetic field of magnetic dipole and storage medium
Through the polynomial fitting method, the relationship function of the magnetic dipole magnetic field intensity and position vector and the change function of the magnetic field vector direction are obtained, which solves the error problem of near-field region in magnetic dipole magnetic field calculation, and achieves more accurate magnetic field calculation.
Patent Information
- Application Number
- CN202510366080.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-08-01
AI Technical Summary
When calculating the magnetic field of magnetic dipoles, especially in the near field region, the calculation results are ignored by the higher order terms, resulting in inaccurate calculation results, which cannot reflect the nonlinear change trend of the magnetic field, resulting in large errors.
Through polynomial fitting, the relationship function of the total magnetic field intensity of the magnetic dipole and the position vector is obtained, and the relationship function of the change direction of the magnetic field vector is combined to accurately calculate the three components of the magnetic field.
The calculation error is reduced and the real changes in magnetic field strength and direction can be more accurately reflected, especially in the near-field area, improving the accuracy of the calculation.
Smart Images

Figure CN120408939A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of magnetic field calculation, and particularly relates to a method, device, and storage medium for calculating the magnetic field of a magnetic dipole. Background Art
[0002] A magnetic dipole is a physical model established by analogy with an electric dipole. In electromagnetism, a system composed of two point magnetic charges with equal magnitudes and opposite signs is called a magnetic dipole. The physical model of a magnetic dipole is usually a closed-loop current, such as a coil with a constant current flowing through it, also known as a current-carrying loop.
[0003] When calculating the magnetic field of a magnetic dipole, since there is no exact analytical solution for the magnetic field expression of the magnetic dipole model, the magnetic field is usually approximately calculated based on the first-order Taylor expansion of the magnetic dipole, and the three components of the magnetic field vector of the magnetic dipole are approximately calculated. This method can quickly provide an approximate solution of the magnetic field in a local area, with a relatively small amount of calculation, and can obtain a relatively accurate calculation result in the far field (such as the area more than 10 radii away from the center of the magnetic dipole). However, when performing the first-order Taylor expansion approximation calculation, only the first-order term is retained, and the second-order and higher-order terms are ignored. In the near-field region, the contributions of these higher-order terms to the magnetic field cannot be ignored, and ignoring them will cause the calculation result to not accurately reflect the actual magnetic field situation. For example, in the near field, the magnetic field may have a non-linear change trend, and the higher-order terms can capture these changes, but they are ignored in the approximate calculation, resulting in a large error.
[0004] The above content is only used to assist in understanding the technical solution of the present application, and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of the present application is to provide a method, device, and storage medium for calculating the magnetic field of a magnetic dipole, aiming to solve the technical problem of how to accurately calculate the magnetic induction intensity of a magnetic dipole.
[0006] To achieve the above purpose, the present application proposes a method for calculating the magnetic field of a magnetic dipole, and the method for calculating the magnetic field of the magnetic dipole includes:
[0007] Perform polynomial fitting on the variation relationship between the magnitude of the first magnetic induction intensity at the center of the magnetic dipole, the magnitude of the target magnetic induction intensity at the target point, and the first position vector of the target point relative to the center of the magnetic dipole, to obtain a first relationship function between the magnitude of the target magnetic induction intensity and the first position vector;
[0008] Determine the magnitude of the target magnetic induction intensity at the target point according to the first relationship function;
[0009] Perform polynomial fitting on the variation relationship between the second position vector corresponding to the determined second magnetic induction intensity and the vector direction of the second position vector to obtain a second relationship function between the second position vector and the vector direction of the second position vector;
[0010] Determine the target direction of the vector of the magnetic induction intensity at the target point according to the second relationship function;
[0011] Determine the target magnetic induction intensity at the target point according to the magnitude of the target magnetic induction intensity and the target direction.
[0012] In one embodiment, the step of performing polynomial fitting on the variation relationship between the magnitude of the first magnetic induction intensity at the center of the magnetic dipole, the magnitude of the target magnetic induction intensity at the target point, and the first position vector of the target point relative to the center of the magnetic dipole to obtain the first relationship function between the magnitude of the target magnetic induction intensity and the first position vector includes:
[0013] Select any spatial point in the space corresponding to the magnetic dipole as the target point;
[0014] Segment the first position vector according to a preset quantity to obtain a plurality of sub-vectors;
[0015] Perform polynomial fitting on the variation relationship between the magnitude of the first magnetic induction intensity corresponding to each sub-vector, the magnitude of the target magnetic induction intensity, and the first position vector to obtain the first relationship function.
[0016] In one embodiment, the step of performing polynomial fitting on the variation relationship between the magnitude of the first magnetic induction intensity corresponding to each sub-vector, the magnitude of the target magnetic induction intensity, and the first position vector to obtain the first relationship function includes:
[0017] Determine each sub-vector, and the magnitude of the first magnetic induction intensity and the magnitude of the target magnetic induction intensity corresponding to the sub-vector;
[0018] Perform polynomial fitting on the logarithm of the magnitude of the first magnetic induction intensity and the ratio of the magnitude of the first magnetic induction intensity, and perform polynomial fitting on the logarithm of the magnitude of the sub-vector;
[0019] According to the fitting result, obtain the first relationship function, and the first relationship function is: Among them, B T is the magnitude of the target magnetic induction intensity, B T_C is the magnitude of the first magnetic induction intensity, and r is the magnitude of the first position vector, is the included angle between the first position vector and the positive direction of the Z-axis, a is the natural constant, is the fitting coefficient, N1 is the fitting order, and i represents the item number index.
[0020] In one embodiment, after the step of performing polynomial fitting on the variation relationship between the magnitude of the first magnetic induction intensity corresponding to each sub-vector, the magnitude of the target magnetic induction intensity, and the first position vector to obtain the first relationship function, the following steps are further included:
[0021] Obtain the initial fitting coefficient in the first relationship function;
[0022] Determine the variation value of the initial fitting coefficient corresponding to the change in the included angle between the first position vector and the positive direction of the Z-axis;
[0023] If the variation value is greater than the preset variation range, divide the included angle to obtain multiple sub-included angles;
[0024] Perform polynomial fitting on each sub-included angle to obtain the second fitting coefficient, and update the first relationship function according to the second fitting coefficient. The formula for performing polynomial fitting on the sub-included angle is: where M1 is the fitting order, g i,j is the fitting coefficient, is the sub-included angle.
[0025] In one embodiment, the step of determining the magnitude of the target magnetic induction intensity of the target point according to the first relationship function includes:
[0026] Based on the known magnitude of the magnetic induction intensity at the center of the first current coil, determine the magnitude of the first magnetic induction intensity through the proportional relationship between the current and the radius of the current coil. The formula for determining the magnitude of the first magnetic induction intensity is:
[0027]
[0028] where B T_c0 is the magnitude of the magnetic induction intensity at the center of the first current coil when the current intensity is I0, I0 is the current of the first current coil, R0 is the radius of the first current coil, I is the current of the corresponding target current coil, and R is the radius of the target current coil;
[0029] According to the first relationship function and the first magnetic induction intensity, determine the magnitude of the target magnetic induction intensity. The formula for determining the magnitude of the target magnetic induction intensity is:
[0030] where, is the first relational expression.
[0031] In one embodiment, after the step of determining the magnitude of the target magnetic induction intensity of the target point according to the first relationship function, the following steps are further included:
[0032] Obtain the relative error between the magnitude of the standard magnetic induction intensity and the magnitude of the target magnetic induction intensity;
[0033] If the relative error is not within a preset error range, adjust the fitting order in the first relationship function.
[0034] In one embodiment, the step of performing polynomial fitting on the variation relationship between the second position vector corresponding to the determined second magnetic induction intensity and the vector direction of the second position vector to obtain the second relationship function between the second position vector and the vector direction of the second magnetic induction intensity includes:
[0035] Obtain the angle between the second magnetic induction intensity and the positive direction of the Z-axis;
[0036] According to the angle between the second magnetic induction intensity and the positive direction of the Z-axis, and the vector direction of the second position vector, perform polynomial fitting to obtain the second relationship function, where the second relationship function is: Wherein, is the angle between the second magnetic induction intensity and the positive direction of the Z-axis, are fitting coefficients, and N2 is the fitting order.
[0037] In one embodiment, the step of determining the target magnetic induction intensity of the target point according to the magnitude of the target magnetic induction intensity and the target direction includes:
[0038] Determine the angle between the first position vector and the positive direction of the Z-axis as the target direction;
[0039] According to the magnitude of the target magnetic induction intensity and the angle between the first position vector and the positive direction of the Z-axis, obtain the Z component of the magnetic field at the target point;
[0040] According to the magnitude of the target magnetic induction intensity and the projection of the first position vector on the X-Y plane, obtain the X component and Y component of the magnetic field at the target point.
[0041] In addition, to achieve the above object, the present application also proposes a magnetic dipole magnetic field calculation device, the device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program is configured to implement the steps of the magnetic dipole magnetic field calculation method as described above.
[0042] In addition, to achieve the above object, the present application also provides a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the magnetic dipole magnetic field calculation method described above are implemented.
[0043] The present application provides a magnetic dipole magnetic field calculation method. Based on the polynomial fitting method, a first relationship function between the total magnetic field intensity of the magnetic dipole and the position vector of the spatial position of the magnetic dipole magnetic field to be calculated relative to the center of the magnetic dipole, and a second relationship function between the vector direction of the magnetic dipole magnetic field and the position vector of the spatial position of the magnetic dipole magnetic field to be calculated relative to the center of the magnetic dipole are obtained. Based on the obtained first relationship function and second relationship function, the values of the three components of the magnetic field vector at the position to be calculated are calculated.
[0044] In the present application, through polynomial fitting, the relationships between the magnetic field intensity and the vector direction of the magnetic field, and the position vector of the spatial position of the magnetic dipole magnetic field to be calculated relative to the center of the magnetic dipole are considered. Since polynomial fitting can more flexibly capture the complex non-linear relationship between the magnetic field intensity and the change of the position vector, even in the near-field region, polynomial fitting can more accurately reflect the real change of the magnetic field intensity, thereby reducing the calculation error. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0046] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0047] Figure 1 It is a schematic flowchart provided for Embodiment 1 of the magnetic dipole magnetic field calculation method of the present application;
[0048] Figure 2 It is a schematic diagram of a magnetic dipole provided by the present application;
[0049] Figure 3 It is a schematic flowchart provided for Embodiment 2 of the magnetic dipole magnetic field calculation method of the present application;
[0050] Figure 4 It is another schematic flowchart provided for Embodiment 2 of the magnetic dipole magnetic field calculation method of the present application;
[0051] Figure 5This is a schematic structural diagram of the hardware operating environment involved in the magnetic field calculation method of the magnetic dipole in the embodiments of the present application.
[0052] The implementation, functional features, and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. Specific embodiments
[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0054] To better understand the technical solutions of the present application, the following will be described in detail with reference to the accompanying drawings of the specification and specific embodiments.
[0055] The main solution of the embodiments of the present application is as follows: perform polynomial fitting on the variation relationship among the modulus of the first magnetic induction intensity at the center of the magnetic dipole, the modulus of the target magnetic induction intensity at the target point, and the first position vector of the target point relative to the center of the magnetic dipole to obtain the first relationship function between the modulus of the target magnetic induction intensity and the first position vector; determine the modulus of the target magnetic induction intensity at the target point according to the first relationship function; perform polynomial fitting on the variation relationship between the second position vector corresponding to the determined second magnetic induction intensity and the vector direction of the second position vector to obtain the second relationship function between the second position vector and the vector direction of the second magnetic induction intensity; determine the target direction of the vector of the magnetic induction intensity at the target point according to the second relationship function; and determine the target magnetic induction intensity at the target point according to the modulus of the target magnetic induction intensity and the target direction.
[0056] A magnetic dipole is a physical model established by analogy with an electric dipole. In electromagnetism, a system composed of two point magnetic charges with equal values and opposite signs is called a magnetic dipole. The physical model of a magnetic dipole is usually a closed-loop current, such as a coil with a constant current flowing through it, also known as a current-carrying loop.
[0057] When calculating the magnetic field of a magnetic dipole, since there is no exact analytical solution for the magnetic field expression of the magnetic dipole model, the magnetic field is usually approximately calculated based on the first-order Taylor expansion of the magnetic dipole, and the three components of the magnetic field vector of the magnetic dipole are approximately calculated. This method can quickly provide an approximate solution of the magnetic field in a local area, with a relatively small amount of calculation, and can obtain relatively accurate calculation results in the far field (such as the area more than 10 radii away from the center of the magnetic dipole). However, when performing the first-order Taylor expansion approximation calculation, only the first-order term is retained, and the second-order and higher-order terms are ignored. In the near-field region, the contributions of these higher-order terms to the magnetic field cannot be ignored, and ignoring them will cause the calculation results to not accurately reflect the actual magnetic field situation. For example, in the near field, the magnetic field may have a non-linear change trend, and the higher-order terms can capture these changes, but they are ignored in the approximate calculation, resulting in a large error. In another magnetic field calculation method, the integral form in the magnetic field expression of the magnetic dipole model is replaced with a series summation form, which can accurately calculate the magnetic field value at any point in the entire space of the magnetic dipole. However, the calculation amount of this method is large.
[0058] To solve the above problems, the present application provides a magnetic field calculation method for a magnetic dipole, which obtains the total magnetic field strength of the magnetic dipole, the first relationship function between the position vector of the spatial position of the magnetic dipole magnetic field to be calculated relative to the center of the magnetic dipole, and the vector direction of the magnetic dipole magnetic field, and the second relationship function between the position vector of the spatial position of the magnetic dipole magnetic field to be calculated relative to the center of the magnetic dipole based on the polynomial fitting method. Based on the obtained first relationship function and second relationship function, the values of the three components of the magnetic field vector at the position to be calculated are calculated.
[0059] In the present application, through polynomial fitting, the relationships between the magnetic field strength and the vector direction of the magnetic field, and the position vector of the spatial position of the magnetic dipole magnetic field to be calculated relative to the center of the magnetic dipole are considered. Since polynomial fitting can more flexibly capture the complex non-linear relationship between the magnetic field strength and the change of the position vector, even in the near-field region, polynomial fitting can more accurately reflect the real change of the magnetic field strength, thereby reducing the calculation error.
[0060] It should be noted that the execution subject of this embodiment can be a computing service device with network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device or device capable of implementing the above functions. Hereinafter, taking the magnetic field calculation device of the magnetic dipole as an example, this embodiment and the following embodiments will be described.
[0061] Based on this, the embodiment of the present application provides a magnetic field calculation method for a magnetic dipole, referring to Figure 1 , Figure 1 is a schematic flowchart of the first embodiment of the magnetic field calculation method for the magnetic dipole of the present application.
[0062] In this embodiment, the magnetic field calculation method of the magnetic dipole is applied to a magnetic field calculation device of the magnetic dipole. The method includes steps S100 to S400:
[0063] Step S100: Perform polynomial fitting on the variation relationship among the magnitude of the first magnetic induction intensity at the center of the magnetic dipole, the magnitude of the target magnetic induction intensity at the target point, and the first position vector of the target point relative to the center of the magnetic dipole, to obtain a first relationship function between the magnitude of the target magnetic induction intensity and the first position vector.
[0064] It should be noted that a magnetic dipole is a physical model established by analogy with an electric dipole. In electromagnetics, a small current-carrying closed loop (i.e., a small current loop) is a magnetic dipole. Polynomial fitting is a technique that uses methods such as the least squares method to find a polynomial function to approximately represent the relationship between a set of data points.
[0065] In addition, it should be noted that the magnetic induction intensity in this embodiment is a vector.
[0066] In this embodiment, please refer to Figure 2 , take the center of the magnetic dipole as the origin of the coordinate system, and the circular current of the magnetic dipole is located in the X-Y plane to establish a rectangular coordinate system. At any arbitrary position P in space as the target point, the position vector of point P relative to the center of the magnetic dipole is r (= [x, y, z]), and the angle between r and the positive Z-axis is The projection point of point P on the X-Y plane is P', and the angle between the positive X-axis and the vector OP' is θ. That is, the coordinates of position P in the spherical coordinate system are The radius of the magnetic dipole is R, the position vector of any arbitrary position P in space relative to the center of the magnetic dipole is r, and the magnitude of the vector r is denoted as r. Let the total magnetic induction intensity at the center of the magnetic dipole be B T_c , and the total magnetic induction intensity at position P is B T ; thus, when the angle between the position vector r and the plane where the circular current of the magnetic dipole is located is fixed, the variation relationship of BT / BT_c with r satisfies a specific law.
[0067] In this embodiment, the position vector r is made dimensionless using the radius R of the magnetic dipole. Exemplarily, r = [-10, 20, 5] meters and R = 5 meters. After being made dimensionless, r = [-2, 4, 1]R, that is, the distance unit of r is R. Making dimensionless reduces the number and range of variables, reduces the computational complexity, and avoids numerical errors caused by dimensional differences, thereby improving the computational efficiency and accuracy.
[0068] It should be noted that according to the Biot-Savart law, the magnetic induction intensity B TThe relationship with the position vector r can be expressed as the product of a power function of r and some angular functions. When the angle between the position vector r and the plane where the circular current of the magnetic dipole is located is fixed, these angular functions become constants. The magnetic induction intensity B T mainly depends on the power function of r. Therefore, after obtaining the relationship between B T and r, the total magnetic induction intensity of the magnetic dipole at any position P in space can be obtained from the relationship.
[0069] In this embodiment, when studying the relationship between the magnetic induction intensity B T of the magnetic dipole and the change of the first position vector r, polynomial fitting can be used to smooth the magnetic induction intensity and the position vector, and the specific change relationship can be determined according to the actual data, avoiding the noise or error in the data obtained from experiments or theoretical calculations. In addition, after determining the first change function obtained by polynomial fitting, only by substituting the corresponding parameter values (such as different radii, different current intensities, etc.), the magnetic induction intensity of the magnetic dipole with different parameters can be calculated, and the versatility is relatively high.
[0070] Step S200, determining the magnitude of the target magnetic induction intensity at the target point according to the first relationship function.
[0071] In this embodiment, after obtaining the first relationship function, according to the first relationship function between the target magnetic induction intensity and the first position vector, the magnitude of the total magnetic induction intensity of the magnetic dipole at any position P in space can be obtained. According to the Biot-Savart law, the magnetic field intensity is proportional to the current intensity and inversely proportional to the coil radius. When the radius, length of a current coil, and the total magnetic induction intensity at the center of the current coil are known, according to the proportional relationship between the magnetic field and the current and the radius, the magnitude of the target magnetic induction intensity at the unknown target point can be deduced.
[0072] Step S200, determining the magnitude of the target magnetic induction intensity at the target point according to the first relationship function may include the following steps:
[0073] Based on the known magnitude of the total magnetic induction intensity at the center of the first current coil, determining the magnitude of the first magnetic induction intensity through the proportional relationship between the current and the radius of the current coil;
[0074] Determining the magnitude of the target magnetic induction intensity according to the first relationship function and the magnitude of the first magnetic induction intensity.
[0075] Exemplarily, it is known that the magnitude of the total magnetic induction intensity at the center of the first current coil with a radius of R0 and a current intensity of I0 is B T_c0 . Then the formula for calculating the magnitude B T_c of the first magnetic induction intensity with a coil radius of R and a current intensity of I is:
[0076]
[0077] After determining the magnitude B of the first magnetic induction intensity at the center of the magnetic dipole T_c then, according to the polynomial fitting of Log a B T / B T_C and Log a r alone, the obtained first relationship function. The magnitude of the target magnetic induction intensity at any point P The calculation formula is:
[0078]
[0079] Step S300: Perform polynomial fitting on the variation relationship between the second position vector corresponding to the determined second magnetic induction intensity and the vector direction of the second position vector, to obtain the second relationship function between the second position vector and the vector direction of the second position vector.
[0080] Step S400: Determine the target direction of the vector of the magnetic induction intensity at the target point according to the second relationship function.
[0081] It should be noted that the magnetic induction intensity of the magnetic dipole has the following characteristics: (1) It has axial symmetry with respect to the axis of the magnetic dipole; (2) In the plane containing the axis of the magnetic dipole, the vector corresponding to the magnetic induction intensity is parallel to this plane. On the plane containing the axis of the magnetic dipole, only by confirming the angle ψ between the vector corresponding to the magnetic induction intensity and the positive direction of the Z-axis, the direction of the vector corresponding to the magnetic induction intensity can be obtained. Therefore, on the plane containing the axis of the magnetic dipole, only by clarifying the variation relationship of the interval ψ with r, the distribution of the vector direction of the magnetic dipole B in the entire space can be calculated according to the spatial distribution characteristics of the vector direction of the magnetic dipole.
[0082] In a feasible implementation manner, step S300 may include:
[0083] Obtain the angle between the second magnetic induction intensity and the positive direction of the Z-axis.
[0084] According to the angle between the second magnetic induction intensity and the positive direction of the Z-axis, and the vector direction of the second position vector, perform polynomial fitting to obtain the second relationship function, and the second relationship function is: Wherein, is the angle between the second magnetic induction intensity and the positive direction of the Z-axis, is the fitting coefficient, and N2 is the fitting order.
[0085] In this embodiment, the accurate magnetic induction intensity B (i.e., the second magnetic induction intensity) of the magnetic dipole and the corresponding parameter ψ are obtained through numerical analysis, experimental measurement, etc. B . Using ψ B and the second position vector r of the magnetic dipole center corresponding to the second magnetic induction intensity, polynomial fitting is performed to obtain the second relationship function between the second position vector and ψ. In the logarithmic case, when r > 5R, ψ approximately shows a linear relationship with Log a r; while when r < 5R, ψ shows an obvious non-linear relationship with Log a r. To obtain more accurate magnetic field calculation results, r is divided into several segments, and polynomial fitting is performed on ψ and Log a r for each segment to obtain the relationship between ψ and Log a r.
[0086] In this embodiment, the current intensity is set to I0, taking a fixed value. Using the data ψ B and the corresponding position parameter r, the following relationship can be obtained through polynomial fitting:
[0087]
[0088] where, are fitting coefficients.
[0089] Optionally, the base a of the logarithm can take the value of the natural constant or 10, or other values; the value of the fitting coefficient is related to , and can also be obtained by polynomial, and its expression is as follows:
[0090]
[0091] where, h i,j are fitting coefficients.
[0092] Optionally, can be in degrees or radians. If changes smoothly in a certain interval with , while in another interval of changes significantly with , then can be divided into several segments; polynomial fitting as shown in equation (4) is performed separately for each segment of .
[0093] In this embodiment, Evaluate the calculation error of Equation (3) and select an appropriate value of N2 according to the requirements for the calculation accuracy of the magnetic dipole field. Compare the calculated error with the preset error range. If the error is within the preset range, it is considered that the current N2 meets the requirements of the calculation application. If the error exceeds the preset range, adjust N2 until the obtained error is within the preset error range. The error range can be determined according to the requirements and accuracy level of the actual application.
[0094] In this embodiment, to evaluate the calculation error of Equation (4), the fitting result of Equation (4) can be compared with that calculated by Equation (3). Obtain the calculation error according to the comparison result. The error can be an absolute error, a relative error, or other forms of error metrics. Change the value of M2, refit and calculate the error using Equation (4) again, and record the variation of the calculation error under different values of M2. Select an appropriate value of M2 according to the requirements for the calculation accuracy of the magnetic dipole field.
[0095] Step S500: Determine the target magnetic induction intensity of the target point according to the modulus of the target magnetic induction intensity and the target direction.
[0096] In this embodiment, based on the relationship between the acquired target and the magnetic field vector direction and r, the values of the three components of the magnetic field vector at any position are calculated. At r (= [x, y, z]), the total magnetic field intensity of the magnetic dipole is The angle between the vector of the magnetic induction intensity and the positive direction of the Z-axis is
[0097] Therefore, the Z component of the magnetic field is:
[0098]
[0099] The projection of the magnetic field on the X-Y plane is:
[0100] According to the characteristics of the magnetic field lines of the magnetic dipole, the projection of the magnetic field on the X-Y plane is parallel to the vector
[0101] The expressions of the three components of the magnetic induction intensity of the magnetic dipole at r are as follows:
[0102]
[0103] Among them, is obtained by calculating Equation (2), is obtained by calculating Equation (3), and the value of τ is as follows:
[0104]
[0105] In this embodiment, by calculating the X component, Y component of the magnetic field in the horizontal direction and the Z component in the vertical direction, the distribution and direction of the magnetic field in space can be completely represented.
[0106] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar content as that in the above-mentioned first embodiment can be referred to the above introduction and will not be repeated hereinafter. On this basis, please refer to Figure 3 , in step S100, it may include steps S110 to S130:
[0107] Step S110, select any spatial point in the space corresponding to the magnetic dipole as the target point.
[0108] Step S120, segment the first position vector according to a preset quantity to obtain a plurality of sub-vectors.
[0109] Step S130, perform polynomial fitting on the variation relationship between the modulus of the first magnetic induction intensity, the modulus of the target magnetic induction intensity corresponding to each sub-vector, and the first position vector to obtain the first relationship function.
[0110] In this embodiment, for more accurate polynomial fitting, r can be divided into N segments, such as r i <r ≤ r i+1 , where i = 1, 2, 3... N; perform separate polynomial fitting on Log a B T / B T_C and Log a r for each segment.
[0111] Please refer to Figure 4 , in a feasible implementation manner, step S130 includes steps S131 to S133:
[0112] Step S131, determine each sub-vector, and the modulus of the first magnetic induction intensity and the modulus of the target magnetic induction intensity corresponding to the sub-vector.
[0113] Step S132, perform polynomial fitting on the logarithm of the modulus of the first magnetic induction intensity and the ratio of the modulus of the first magnetic induction intensity, and perform polynomial fitting on the logarithm of the modulus of the sub-vector.
[0114] Step S133, obtain the first relationship function according to the fitting result.
[0115] It should be noted that in the case of logarithm, when r > 5R, Log a B T / B T_C varies with Loga r approximately shows a linear relationship, where B T_C is the total magnetic induction intensity at the center of the magnetic dipole; while when 5R > r > R, Log a B T / B T_C shows an obvious non - linear relationship with Log a r.
[0116] In this embodiment, the relationship between Log a B T / B T_C and Log a r is obtained by polynomial fitting. By the ratio of B T and B T_c , the influence of the proportionality coefficient related to the characteristics of the magnetic dipole itself in the magnetic field formula can be eliminated, so that the research focuses on the variation law of the magnetic field strength with distance.
[0117] In this embodiment, the current intensity is set as I = I0 (for example, I0 = 1A, or other values), taking a fixed value, the first relationship function obtained by polynomial fitting is as follows:
[0118]
[0119] where the base a of the logarithm can take the value of the natural constant or 10, or other values; the fitting coefficient c i (φ) is related to φ and can also be obtained by polynomial means. Its expression is as follows:
[0120]
[0121] It should be noted that is obtained by fitting through equation (7) under specific value - taking conditions of the angle . It should be noted that the unit of can be degrees or radians.
[0122] In a feasible embodiment, when the first position vector and the included angle change, the change value of the initial fitting coefficient obtained through formula (7) is determined. If this change value is greater than the preset change range, it indicates that during the angle change process, the characteristics related to the magnetic field (reflected by the fitting coefficient) have changed greatly, and the original fitting may not accurately describe the magnetic field change in the entire angle range. At this time, the included angle is divided into several segments to obtain multiple sub - included angles. For each interval of , polynomial fitting as shown in equation (8) is separately implemented, and the corresponding fitting coefficients g i,j and value to obtain a more accurate (i.e., the second fitting coefficient). By dividing the angle, more accurate fitting results can be obtained for the different variation characteristics of the magnetic field in different angle ranges.
[0123] In a feasible implementation manner, after step 200, the following may further be included:
[0124] Obtain the relative error between the modulus of the standard magnetic induction intensity and the modulus of the target magnetic induction intensity.
[0125] If the relative error is not within the preset error range, adjust the fitting order in the first relationship function.
[0126] In this implementation manner, in order to evaluate the calculation error of equation (7), the accurate total magnetic induction intensity of the magnetic dipole can be obtained through numerical analysis or other means, denoted as B T_ref Use |B T - B T_ref | / B T_ref to evaluate the error of B calculated by equation (7), and then select an appropriate value of N1 according to the requirement of the calculation accuracy of the magnetic dipole magnetic field. To evaluate the calculation error of equation (8), the fitting result of equation (8) can be compared with T to obtain a comparison difference, compare the comparison difference with the preset difference range, and then select an appropriate value of M1 according to the requirement of the calculation accuracy of the magnetic dipole magnetic field. Optionally, if the value range of is divided into several segments and separate fittings are performed for each segment, the value of M1 selected for the polynomial fitting of each segment can be different, and the corresponding fitting coefficients g and i,j and are also different. The determination methods of N1 and M1 are the same as the determination methods of N2 and M2 described above, and will not be elaborated here.
[0127] This application provides a magnetic dipole magnetic field calculation device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the magnetic dipole magnetic field calculation method in the first embodiment above.
[0128] Next, refer to Figure 5, which shows a schematic structural diagram of a magnetic dipole magnetic field calculation device suitable for implementing the embodiments of the present application. The magnetic dipole magnetic field calculation device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistant), PADs (portable android devices: tablet computers), PMPs (Portable Media Player), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The shown magnetic dipole magnetic field calculation device is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.
[0129] As Figure 5 shown, the magnetic dipole magnetic field calculation device may include a processing device 1001 (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM: Random Access Memory) 1004. In the RAM 1004, various programs and data required for the operation of the magnetic dipole magnetic field calculation device are also stored. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems may be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the magnetic dipole magnetic field calculation device to communicate with other devices wirelessly or wiredly to exchange data. Although the figure shows a magnetic dipole magnetic field calculation device with various systems, it should be understood that it is not required to implement or have all the shown systems. More or fewer systems may be alternatively implemented or had.
[0130] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program contains program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by a processing device 1001, the above functions defined in the methods of the embodiments disclosed in the present application are executed.
[0131] The magnetic dipole magnetic field calculation device provided by the present application adopts the magnetic dipole magnetic field calculation method in the above embodiments, and can solve the technical problem of how to accurately calculate the magnetic induction intensity of a magnetic dipole. Compared with the prior art, the beneficial effects of the magnetic dipole magnetic field calculation device provided by the present application are the same as those of the magnetic dipole magnetic field calculation method provided by the above embodiments, and other technical features in the magnetic dipole magnetic field calculation device are the same as the features disclosed in the method of the previous embodiment, and will not be elaborated here.
[0132] It should be understood that the various parts disclosed in the present application can be implemented by hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in a suitable manner in any one or more embodiments or examples.
[0133] As described above, the above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, and all should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
[0134] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., computer programs) stored thereon, and the computer-readable program instructions are used to execute the magnetic dipole magnetic field calculation method in the above embodiments.
[0135] The computer-readable storage medium provided by the present application can be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or flash memory, optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this embodiment, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or component. The program code contained on the computer-readable storage medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0136] The above computer-readable storage medium can be included in a magnetic dipole magnetic field calculation device; or it can exist alone and not be assembled into a magnetic dipole magnetic field calculation device. The above computer-readable storage medium carries one or more programs. When the one or more programs are executed by a magnetic dipole magnetic field calculation device, the magnetic dipole magnetic field calculation device is caused to: perform polynomial fitting on the variation relationship between the modulus of the first magnetic induction intensity at the center of the magnetic dipole, the modulus of the target magnetic induction intensity at the target point, and the first position vector of the target point relative to the center of the magnetic dipole, to obtain a first relationship function between the modulus of the target magnetic induction intensity and the first position vector; determine the modulus of the target magnetic induction intensity at the target point according to the first relationship function; perform polynomial fitting on the variation relationship between the second position vector corresponding to the determined second magnetic induction intensity and the vector direction of the second position vector, to obtain a second relationship function between the second position vector and the vector direction of the second position vector; determine the target direction of the vector of the magnetic induction intensity at the target point according to the second relationship function; and determine the target magnetic induction intensity at the target point according to the modulus of the target magnetic induction intensity and the target direction.
[0137] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).
[0138] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0139] The modules described in the embodiments of this application can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation on the unit itself in some cases.
[0140] The readable storage medium provided by this application is a computer-readable storage medium. The computer-readable storage medium stores computer-readable program instructions (i.e., computer programs) for performing the above-mentioned magnetic dipole magnetic field calculation method, and can solve the technical problem of how to accurately calculate the magnetic induction intensity of the magnetic dipole. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by this application are the same as those of the magnetic dipole magnetic field calculation method provided by the above embodiments, and will not be elaborated here.
[0141] The above are only some embodiments of the present application, and thus do not limit the patent scope of the present application. Any equivalent structural transformation made under the technical concept of the present application by using the content of the specification and drawings of the present application, or any direct / indirect application in other related technical fields is included in the patent protection scope of the present application.
Claims
1. A method for calculating the magnetic field of a magnetic dipole, characterized in that, The method described includes: Performing polynomial fitting on the variation relationship among the magnitude of the first magnetic induction intensity at the center of the magnetic dipole, the magnitude of the target magnetic induction intensity at the target point, and the first position vector of the target point relative to the center of the magnetic dipole, to obtain a first relationship function between the magnitude of the target magnetic induction intensity and the first position vector; Determining the magnitude of the target magnetic induction intensity at the target point according to the first relationship function; Performing polynomial fitting on the variation relationship between the second position vector corresponding to the determined second magnetic induction intensity and the vector direction of the second position vector, to obtain a second relationship function between the second position vector and the vector direction of the second position vector; Determining the target direction of the vector of the magnetic induction intensity at the target point according to the second relationship function; Determining the target magnetic induction intensity at the target point according to the magnitude of the target magnetic induction intensity and the target direction.
2. The magnetic field calculation method of the magnetic dipole according to claim 1, characterized in that, The step of performing polynomial fitting on the variation relationship among the magnitude of the first magnetic induction intensity at the center of the magnetic dipole, the magnitude of the target magnetic induction intensity at the target point, and the first position vector of the target point relative to the center of the magnetic dipole, to obtain a first relationship function between the magnitude of the target magnetic induction intensity and the first position vector includes: Selecting any spatial point in the space corresponding to the magnetic dipole as the target point; Segmenting the first position vector according to a preset quantity to obtain a plurality of sub-vectors; Performing polynomial fitting on the variation relationship among the magnitude of the first magnetic induction intensity corresponding to each sub-vector, the magnitude of the target magnetic induction intensity, and the first position vector, to obtain the first relationship function.
3. The magnetic field calculation method of the magnetic dipole according to claim 2, characterized in that, The step of performing polynomial fitting on the variation relationship among the magnitude of the first magnetic induction intensity corresponding to each sub-vector, the magnitude of the target magnetic induction intensity, and the first position vector, to obtain the first relationship function includes: Determining each sub-vector, and the magnitude of the first magnetic induction intensity and the magnitude of the target magnetic induction intensity corresponding to the sub-vector; Performing polynomial fitting on the logarithm of the magnitude of the first magnetic induction intensity and the ratio of the magnitude of the first magnetic induction intensity, and performing polynomial fitting on the logarithm of the magnitude of the sub-vector; According to the fitting result, obtaining the first relationship function, and the first relationship function is: Among them, B T is the modulus of the target magnetic induction intensity, B T_C is the modulus of the first magnetic induction intensity, r is the modulus of the first position vector, is the angle between the first position vector and the positive direction of the Z-axis, a is the natural constant, is the fitting coefficient, N1 is the fitting order, and i represents the item number index.
4. The magnetic field calculation method of the magnetic dipole according to claim 2, characterized in that After the step of performing polynomial fitting on the variation relationship among the magnitude of the first magnetic induction intensity corresponding to each sub-vector, the magnitude of the target magnetic induction intensity, and the first position vector, to obtain the first relationship function, it further includes: Obtaining the initial fitting coefficients in the first relationship function; Determining the variation value of the corresponding initial fitting coefficients when the angle between the first position vector and the positive direction of the Z-axis changes; If the variation value is greater than a preset variation range, then dividing the angle to obtain a plurality of sub-angles; Performing polynomial fitting on each sub-angle to obtain second fitting coefficients, and updating the first relationship function according to the second fitting coefficients. The formula for performing polynomial fitting on the sub-angles is: Among them, M1 is the fitting order, and g i,j is the fitting coefficient, is the sub-angle.
5. The magnetic field calculation method of the magnetic dipole according to claim 1, characterized in that The step of determining the magnitude of the target magnetic induction intensity of the target point according to the first relationship function includes: Based on the known magnitude of the magnetic induction intensity at the center of the first current coil, determine the magnitude of the first magnetic induction intensity through the proportional relationship between the current and the radius of the current coil. The formula for determining the magnitude of the first magnetic induction intensity is: Among them, B T_c0 is the magnitude of the magnetic induction intensity at the center of the first current coil when the current intensity is I0, I0 is the current of the first current coil, R0 is the radius of the first current coil, I is the current of the corresponding target current coil, and R is the radius of the target current coil; According to the first relationship function and the first magnetic induction intensity, determine the magnitude of the target magnetic induction intensity. The formula for determining the magnitude of the target magnetic induction intensity is: Among them, is the first relational expression.
6. The magnetic field calculation method of the magnetic dipole according to claim 1, characterized in that, After the step of determining the magnitude of the target magnetic induction intensity of the target point according to the first relationship function, the following steps are also included: Obtain the relative error between the magnitude of the standard magnetic induction intensity and the magnitude of the target magnetic induction intensity; If the relative error is not within the preset error range, adjust the fitting order in the first relationship function.
7. The magnetic field calculation method of the magnetic dipole according to claim 1, characterized in that, The step of performing polynomial fitting on the variation relationship between the determined second position vector corresponding to the second magnetic induction intensity and the vector direction of the second position vector to obtain the second relationship function between the second position vector and the vector direction of the second magnetic induction intensity includes: Obtain the angle between the second magnetic induction intensity and the positive direction of the Z axis; According to the angle between the second magnetic induction intensity and the positive direction of the Z axis, and the vector direction of the second position vector, perform polynomial fitting to obtain the second relationship function. The second relationship function is: Among them, is the included angle between the second magnetic induction intensity and the positive direction of the Z-axis, is the fitting coefficient, and N2 is the fitting order.
8. The magnetic field calculation method of the magnetic dipole according to claim 1, characterized in that, The step of determining the target magnetic induction intensity of the target point according to the magnitude of the target magnetic induction intensity and the target direction includes: Determine the angle between the first position vector and the positive direction of the Z axis as the target direction; According to the magnitude of the target magnetic induction intensity and the angle between the first position vector and the positive direction of the Z axis, obtain the Z component of the magnetic field at the target point; According to the magnitude of the target magnetic induction intensity and the projection of the first position vector on the X-Y plane, obtain the X component and Y component of the magnetic field at the target point.
9. A magnetic field calculation device for a magnetic dipole, characterized in that, The device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor. The computer program is configured to implement the steps of the magnetic dipole magnetic field calculation method according to any one of claims 1 to 8.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, it implements the steps of the magnetic dipole magnetic field calculation method according to any one of claims 1 to 8.
Citation Information
Cited By
Indoor local magnetic field modeling method and device based on magnetic source equivalence principle
CN120970626A