Method and system for determining magnetic field coil flow function based on target field method and Adam
By combining the target field method and the Adam algorithm, the control vector of magnetic field coil structure is optimized, and the problem of uneven gradient gradient of the double-plane gradient coil in the prior art is solved, achieving more efficient magnetic field compensation and safer operation.
Patent Information
- Application Number
- CN202411705523.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-26
AI Technical Summary
In the prior art, when designing a double-plane gradient coil, it is difficult to obtain the optimal solution of the coil structure, resulting in uneven gradients of magnetic induction intensity.
Using the method based on the target field method and the Adam algorithm, the magnetic field coil flow function is determined by iteratively optimizing the magnetic field coil structure control vector, thereby designing a more uniform magnetic induction intensity gradient.
The accuracy of the coil generating compensation magnetic field is improved, the operation safety of the coil is ensured, and the technical requirements of medical solutions for near-zero background magnetic fields are better met.
Smart Images

Figure CN119623185A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of magnetic field coil design, and more specifically, to a method and system for determining a stream function of a magnetic field coil based on a target field method and Adam. Background Art
[0002] At present, magnetic shielding rooms can effectively shield the interference magnetic field of the external environment. After shielding, the magnetic field noise reaches the nT level. It is responsible for the testing of extremely weak magnetometers such as superconducting quantum magnetometers and spin-exchange relaxation-free atomic magnetometers, and solves the calibration problems of magnetic parameters such as temperature characteristics, magnetic field noise, sensitivity and orthogonality of these magnetometers. However, the magnetic field value in the central area of the magnetic shielding room changes drastically, and the magnetic field gradient is large, which cannot meet the technical requirements of near-zero background magnetic field for medical programs such as magnetoencephalography and magnetocardiography. Therefore, it is necessary to further eliminate the residual magnetic field in the central area of the magnetic shielding room. The dual-plane coil can generate a uniform magnetic field or magnetic field gradient in the target area, thereby eliminating the residual magnetic field in different directions.
[0003] The target field method is the most effective inverse method for designing dual-plane coils, which transforms the coil design problem into a multi-parameter nonlinear optimization problem. Since the equation for solving the coil structure is an overdetermined equation, the Tikhonov regularization method is required to solve its ill-posed problem. Common penalty terms include the curvature of the dual-plane coil streamlines and the total power of the coil. The specific structure of the coil is controlled by a vector, and the solution obtained by the target field method is usually a local optimal solution. When designing dual-plane gradient coils, the existing coil design method still uses the method of setting the expected magnetic induction intensity value of the target point, which limits the uniformity of the magnetic induction intensity gradient generated by the coil. Summary of the invention
[0004] In view of the defects of the prior art, the purpose of this application is to provide a method and system for determining the flow function of a magnetic field coil based on the target field method and Adam, aiming to solve the problem that the existing method obtains a coil structure corresponding to a local optimal solution.
[0005] To achieve the above objectives, in a first aspect, the present application provides a method for determining a stream function of a magnetic field coil based on a target field method and Adam, wherein the magnetic field coil is a dual-plane shim coil or a dual-plane gradient coil, and the method comprises:
[0006] S1. Use the target field method to solve the initial value of the control vector of the magnetic field coil structure;
[0007] S2. Use the Adam algorithm to iteratively optimize the magnetic field coil structure control vector;
[0008] S3. Solve the magnetic field coil stream function using the optimized magnetic field coil structure control vector.
[0009] Preferably, step S1 is specifically as follows: using the least square method to solve the coil structure control vector corresponding to the minimum value of the first evaluation function as the initial value P0 of the magnetic field coil structure control vector P, wherein the first evaluation function is used to measure the difference between the magnetic field / magnetic field gradient generated by the magnetic field coil and the expected value:
[0010] P0=(K T K+αG) -1 ·K T B
[0011] Among them, G is the heating power factor matrix of the magnetic field coil, and α is the weight coefficient of the penalty term;
[0012] For the dual-plane shim coil, K is the magnetic flux density coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic flux density values of the target point arranged in the distribution order;
[0013] For the dual-plane gradient coil, K is the magnetic induction intensity gradient coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic induction intensity gradient values of the target point arranged in distribution order.
[0014] Preferably, for the dual-plane gradient coil, the elements of the magnetic induction intensity gradient coefficient matrix K in the i-th row and the (m-1)×N+n-th column generated by the trigonometric function terms of different orders of the magnetic field coil stream function are:
[0015]
[0016] Where μ0 is the vacuum magnetic permeability, H is half the plane height of the magnetic field coil, L is half the plane length of the magnetic field coil, z is half the plane distance between the two coils, and r i is the coordinate vector of the i-th target point, z i is the z coordinate of the i-th target point, r s1 ,r s2 are the coordinate vectors of the current source points on the two coil planes in the magnetic field coil, || is the distance between the vectors, f1(m,x) and f2(n,y) are the types of trigonometric function terms of different orders in the x-direction and y-direction in the magnetic field coil stream function, which are determined according to the direction of the compensation magnetic field generated by the desired magnetic field coil, i=1,2,3…,Num, m=1,2,3…,M, n=1,2,3…,N, Num is the number of target points in the target compensation area, M and N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function, respectively.
[0017] Preferably, step S2 comprises:
[0018] S21. Calculate the gradient vector of the magnetic field coil structure control vector of the second evaluation function, where the second evaluation function is used to evaluate the quality of each iteration result of the Adam algorithm;
[0019] S22. Update the first-order moment and the second-order moment of the second evaluation function about the magnetic field coil structure control vector with the gradient vector;
[0020] S23. Calculate the first-order moment and second-order moment vector after deviation correction;
[0021] S24. Update the magnetic field coil structure control vector with the first-order moment and second-order moment vector after the deviation correction;
[0022] S25. Repeat the above operation until the iteration stop condition is met to obtain the optimized value of the magnetic field coil structure control vector.
[0023] Preferably, the second evaluation function E is specifically as follows:
[0024] E=‖KP-B‖ 2 +αP T GP
[0025] Among them, ‖‖ is the second norm of the vector, P is the magnetic field coil structure control vector, G is the magnetic field coil heating power factor matrix, and α is the penalty term weight coefficient;
[0026] For the dual-plane shim coil, K is the magnetic flux density coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic flux density values of the target point arranged in the distribution order;
[0027] For the dual-plane gradient coil, K is the magnetic induction intensity gradient coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic induction intensity gradient values of the target point arranged in distribution order.
[0028] Preferably, the second evaluation function E is specifically as follows:
[0029]
[0030] Among them, B * is the magnetic flux density / magnetic flux density gradient generated by the actual coil at the target point, B * =TP, T is the coefficient matrix of magnetic flux density / magnetic flux density gradient generated by the current in the magnetic coil, P is the magnetic field coil structure control vector, B * (i) is the vector B * The i-th element of B * avg For B * The average value of all elements in ;
[0031] For a dual-plane shim coil, T i,: The calculation formula is as follows:
[0032]
[0033] For a dual-plane gradient coil, T i,: The calculation formula is as follows:
[0034]
[0035] Among them, all elements in the same row of T are equal, T i,: is the value of the element in the i-th row of T, μ0 is the magnetic permeability of vacuum, N c is the number of closed streamlines of the magnetic coil, For l j The curve integral of j is the jth closed streamline of the magnetic coil, H is half of the plane height of the magnetic coil, L is half of the plane length of the magnetic coil, a is half of the plane distance between the two coils, r i is the coordinate vector of the i-th target point, z i is the z coordinate of the i-th target point, r s1 ,r s2 are the coordinate vectors of the current source points on the two coil planes in the magnetic field coil, || is the distance between the vectors, f1(m,x) and f2(n,y) are the types of trigonometric function terms of different orders in the x-direction and y-direction in the magnetic field coil stream function, which are determined according to the direction of the compensation magnetic field generated by the desired magnetic field coil, i=1,2,3…,Num, m=1,2,3…,M, n=1,2,3…,N, Num is the number of target points in the target compensation area, M and N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function, respectively.
[0036] Preferably, the updating magnetic field coil structure control vector is specifically as follows:
[0037]
[0038] in, m t =β1·+m t-1 (1-β1)·g t , v t =β2·v t-1 +(1-β2)·g t 2 ;
[0039] P t (i) is the magnetic field coil structure control vector P after the tth iteration update tThe i-th element, η1 is the learning rate of the magnetic field coil structure control vector, m t ′(i) is the first-order moment m after the deviation correction of the tth iteration t ′The i-th element, v t ′(i) is the second-order moment v after the deviation correction of the tth iteration t ′ is the i-th element, ε is the deviation correction constant, m t is the first-order moment of the second evaluation function of the t-th iteration with respect to the control vector of the magnetic field coil structure, v t is the second-order moment of the second evaluation function of the t-th iteration with respect to the control vector of the magnetic field coil structure, β1 and β2 are the weight coefficients of the first-order moment and the second-order moment respectively, i=1,2,…,M×N, M and N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function respectively.
[0040] Preferably, step S3 specifically includes:
[0041] The types of trigonometric functions of different orders in the magnetic field coil stream function and the optimized control vector are integrated to determine the magnetic field coil stream function S(x,y):
[0042]
[0043] Where (x, y) is the position coordinate of the midpoint of the coil plane, -H≤x≤H, -L≤y≤L, is the optimized coil structure control vector P * The (m-1)×N+nth element, H is half of the plane height of the magnetic field coil, L is half of the plane length of the magnetic field coil, f1(m,x), f2(n,y) are the types of trigonometric function terms of different orders in the x-direction and y-direction in the magnetic field coil stream function, respectively, which are determined according to the direction of the compensation magnetic field generated by the desired magnetic field coil, m=1,2,3…,M, n=1,2,3…,N, M, N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function, respectively.
[0044] Preferably, the method further comprises: S4. determining the specific structure of the magnetic field coil based on the stream function of the magnetic field coil.
[0045] To achieve the above-mentioned objectives, in a second aspect, the present application provides a system for determining the flow function of a magnetic field coil based on a target field method and Adam, comprising at least one processor and at least one memory; the at least one memory is used to store computer instructions; the at least one processor is used to execute at least part of the computer instructions to implement the method described in the first aspect.
[0046] It can be understood that the beneficial effects of the second aspect mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0047] In general, the above technical solutions conceived by this application have the following beneficial effects compared with the prior art:
[0048] This application proposes a method for determining the flow function of a magnetic field coil based on a target field method and Adam, using the target field method to solve the initial value of the magnetic field coil structure control vector, using the Adam algorithm to iteratively optimize the magnetic field coil structure control vector, and using the optimized magnetic field coil structure control vector to solve the flow function of the magnetic field coil. This application improves the target field method by designing a dual-plane gradient coil by setting the expected magnetic induction intensity gradient value of the target point, and using the Adam algorithm to optimize the coil structure control vector and to get as close as possible to the optimal solution of the coil structure, thereby improving the accuracy of the coil generating the compensation magnetic field and ensuring the safety of the coil operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flow chart of a method for determining the flow function of a magnetic field coil based on a target field method and Adam provided in an embodiment of the present application.
[0050] Figure 2 Schematic diagram of a dual-plane coil and a target compensation area provided in an embodiment of the present application.
[0051] Figure 3 is dB provided in the embodiment of the present application x Schematic diagram of the design of / dz gradient coil.
[0052] Figure 4 This is a finite element analysis result diagram of the compensation magnetic field generated by the coil provided in the embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.
[0055] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.
[0056] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0057] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.
[0058] Next, the technical solutions provided in the embodiments of the present application are introduced.
[0059] like Figure 1 As shown, the present application provides a method for determining a stream function of a magnetic field coil based on a target field method and Adam, wherein the magnetic field coil is a dual-plane shim coil or a dual-plane gradient coil, and the method comprises:
[0060] S1. Use the target field method to solve the initial value of the control vector of the magnetic field coil structure;
[0061] Selecting the total power of the dual-plane coil as the penalty term of the Tikhonov regularization can solve the ill-conditioned equation problem of the coil structure solution, while avoiding the coil structure being too complicated and the coil power being too high. Therefore, the evaluation function E is:
[0062] E=||KP-B|| 2 +αP T GP
[0063] Preferably, step S1 is specifically as follows: using the least square method to solve the coil structure control vector corresponding to the minimum value of the first evaluation function as the initial value P0 of the magnetic field coil structure control vector P, wherein the first evaluation function is used to measure the difference between the magnetic field / magnetic field gradient generated by the magnetic field coil and the expected value:
[0064] P0=(K T K+αG) -1 ·K T B
[0065] Among them, G is the heating power factor matrix of the magnetic field coil, and α is the weight coefficient of the penalty term;
[0066] For the dual-plane shim coil, K is the magnetic flux density coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic flux density values of the target point arranged in the distribution order;
[0067] For the dual-plane gradient coil, K is the magnetic induction intensity gradient coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic induction intensity gradient values of the target point arranged in distribution order.
[0068] Preferably, for a dual-plane shim coil, according to the symmetry and antisymmetry of the trigonometric function terms, the element in the i-th row and the (m-1)×N+n-th column of K is:
[0069]
[0070] Where μ0 represents the vacuum magnetic permeability, r i is the coordinate vector of the i-th target point, z i is the z coordinate of the i-th target point, r s1 ,r s2 are the coordinate vectors of the current source points on the two coil planes, || are the distances between them, i=1,2,3…,Num, m=1,2,3…,M, n=1,2,3…,N.
[0071] Preferably, for the dual-plane gradient coil, the elements of the magnetic induction intensity gradient coefficient matrix K in the i-th row and the (m-1)×N+n-th column generated by the trigonometric function terms of different orders of the magnetic field coil stream function are:
[0072]
[0073] Where μ0 is the vacuum magnetic permeability, H is half the plane height of the magnetic field coil, L is half the plane length of the magnetic field coil, a is half the plane distance between the two coils, and r i is the coordinate vector of the i-th target point, z i is the z coordinate of the i-th target point, r s1 ,r s2 are the coordinate vectors of the current source points on the two coil planes in the magnetic field coil, || is the distance between the vectors, f1(m,x) and f2(n,y) are the types of trigonometric function terms of different orders in the x-direction and y-direction in the magnetic field coil stream function, which are determined according to the direction of the compensation magnetic field generated by the desired magnetic field coil, i=1,2,3…,Num, m=1,2,3…,M, n=1,2,3…,N, Num is the number of target points in the target compensation area, M and N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function, respectively.
[0074]
[0075] Where δ is the resistivity of the magnetic field coil wire, t is the thickness of the wire, and J xJ represents the inverse of the partial derivative of the product of the trigonometric functions in the stream function with respect to y. y It represents the partial derivative of the product of the trigonometric functions in the stream function with respect to x, m = 1, 2…M, n = 1, 2,…,N.
[0076] The evaluation function value corresponding to P0 obtained from the above formula is the local minimum of E, and it is necessary to further optimize the coil structure and power to improve its performance.
[0077] S2. Use the Adam algorithm to iteratively optimize the magnetic field coil structure control vector;
[0078] Preferably, step S2 comprises:
[0079] S21. Calculate the gradient vector of the magnetic field coil structure control vector of the second evaluation function, where the second evaluation function is used to evaluate the quality of each iteration result of the Adam algorithm;
[0080] S22. Update the first-order moment and the second-order moment of the second evaluation function about the magnetic field coil structure control vector with the gradient vector;
[0081] S23. Calculate the first-order moment and second-order moment vector after deviation correction;
[0082] S24. Update the magnetic field coil structure control vector with the first-order moment and second-order moment vector after the deviation correction;
[0083] S25. Repeat the above operation until the iteration stop condition is met to obtain the optimized value of the magnetic field coil structure control vector.
[0084] Preferably, the second evaluation function E is specifically as follows:
[0085] E=‖KP-B‖ 2 +αP T GP
[0086] Among them, ‖‖ is the second norm of the vector, P is the magnetic field coil structure control vector, G is the magnetic field coil heating power factor matrix, and α is the penalty term weight coefficient;
[0087] For the dual-plane shim coil, K is the magnetic flux density coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic flux density values of the target point arranged in the distribution order;
[0088] For the dual-plane gradient coil, K is the magnetic induction intensity gradient coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic induction intensity gradient values of the target point arranged in distribution order.
[0089] After the evaluation function E converges, for example, the difference between two adjacent iteration functions is less than 1×10-5 , and obtain the optimized value P of the coil structure control vector * .
[0090] Preferably, the second evaluation function E is specifically as follows:
[0091]
[0092] Among them, B * is the magnetic flux density / magnetic flux density gradient generated by the actual coil at the target point, B * =TP, T is the coefficient matrix of magnetic flux density / magnetic flux density gradient generated by the current in the magnetic coil, P is the magnetic field coil structure control vector, B * (i) is the vector B * The i-th element of B * avg For B * The average value of all elements in ;
[0093] For a dual-plane shim coil, T i,: The calculation formula is as follows:
[0094]
[0095] For a dual-plane gradient coil, T i,: The calculation formula is as follows:
[0096]
[0097] Among them, all elements in the same row of T are equal, T i,: is the value of the element in the i-th row of T, μ0 is the magnetic permeability of vacuum, N c is the number of closed streamlines of the magnetic coil, For l j The curve integral of j is the jth closed streamline of the magnetic coil, h is half of the plane height of the magnetic coil, L is half of the plane length of the magnetic coil, a is half of the plane distance between the two coils, r i is the coordinate vector of the i-th target point, z i is the z coordinate of the i-th target point, r s1 ,r s2are the coordinate vectors of the current source points on the two coil planes in the magnetic field coil, || is the distance between the vectors, f1(m,x) and f2(n,y) are the types of trigonometric function terms of different orders in the x-direction and y-direction in the magnetic field coil stream function, which are determined according to the direction of the compensation magnetic field generated by the desired magnetic field coil, i=1,2,3…,Num, m=1,2,3…,M, n=1,2,3…,N, Num is the number of target points in the target compensation area, M and N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function, respectively.
[0098] After reaching the maximum number of iterations, the optimized value P of the coil structure control vector is obtained. * .
[0099] Preferably, the updating magnetic field coil structure control vector is specifically as follows:
[0100]
[0101] in, m t =β1·+m t-1 (1-β1)·g t , v t =β2·v t-1 +(1-β2)·g t 2 ;
[0102] P t (i) is the magnetic field coil structure control vector P after the tth iteration update t The i-th element, η1 is the learning rate of the magnetic field coil structure control vector, m t ′(i) is the first-order moment m after the deviation correction of the tth iteration t ′The i-th element, v t ′(i) is the second-order moment v after the deviation correction of the tth iteration t ′The i-th element, g t is the gradient vector of the tth iteration, g t 2 is the vector g t The corresponding elements are multiplied, ε is the deviation correction constant, n t is the first-order moment of the second evaluation function of the t-th iteration with respect to the control vector of the magnetic field coil structure, v t is the second-order moment of the second evaluation function of the t-th iteration about the control vector of the magnetic field coil structure, β1, β2 are the weight coefficients of the first-order moment and the second-order moment respectively, i=1,2,…,M×N, M, N are the order in the x direction and the order in the y direction in the Fourier expansion of the triangular form of the magnetic field coil stream function respectively. The initial values m0 and v0 of the first-order moment and the second-order moment are both 0, and the operation here is the bit-by-bit division / square root of each element of the vector.
[0103] The gradient vector g is the gradient of E to P, that is, the vector of derivative values:
[0104]
[0105] S3. Solve the magnetic field coil stream function using the optimized magnetic field coil structure control vector.
[0106] Preferably, step S3 specifically includes:
[0107] The types of trigonometric functions of different orders in the magnetic field coil stream function and the optimized control vector are integrated to determine the magnetic field coil stream function S(x,y):
[0108]
[0109] Where (x, y) is the position coordinate of the midpoint of the coil plane, -H≤x≤H, -L≤y≤L, is the optimized coil structure control vector P * The (m-1)×N+nth element, H is half of the plane height of the magnetic field coil, L is half of the plane length of the magnetic field coil, f1(m,x), f2(n,y) are the types of trigonometric function terms of different orders in the x-direction and y-direction in the magnetic field coil stream function, respectively, which are determined according to the direction of the compensation magnetic field generated by the desired magnetic field coil, m=1,2,3…,M, n=1,2,3…,N, M, N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function, respectively.
[0110] Preferably, the method further comprises: S4. determining the specific structure of the magnetic field coil based on the stream function of the magnetic field coil.
[0111] After obtaining the stream function of the magnetic field coil, there are many different methods to determine the specific structure of the magnetic field coil, including but not limited to: solving the current density distribution in the coil plane based on the relationship between current density and the curl of the stream function, and discretizing the specific coil structure using contour lines.
[0112] The magnitude of the coil excitation current is:
[0113]
[0114] Among them, S max ,S min are the maximum and minimum values of the stream function D(x,y) respectively.
[0115] The ith (i=1,2,3…,N c ) turns of coil corresponding to the stream function value:
[0116] S(i)=Smin +(i-0.5)I0.
[0117] Example
[0118] This implementation adopts the method proposed in this application to design dB x / dz dual-plane gradient coil. The length 2L and height 2H of the dual-plane coil plane are both 1.6m, the distance 2a between the two planes is 1.7m, the cube side length 2d of the target compensation area is 0.3m, the number of target points Num is 125, and the number of closed streamlines of the magnetic field coil N c Initialized to 24, the magnetic field coil wire resistivity δ is 1.724×10 -8 Ω·m, the wire thickness is 1mm. Clearly define the expected magnetic induction intensity / magnetic induction intensity gradient value of each target point in the target compensation area of the designed dual-plane coil. After specifying the number of target points, the principle of uniform distribution of target points in the target compensation area is adopted to determine the r of each target point. i and z i , where the x, y, z coordinate spacing of adjacent target points is
[0119] Set the Fourier order of the stream function M and N to 4, and initialize the penalty weight coefficient α to 4.1822×10 -14 In the specific implementation process, it is necessary to try several sets of hyperparameter combinations and select the combination with good convergence of the evaluation function and large decrease. In this embodiment, f1(m,x) is selected In this type, f2(n,y) selects This type.
[0120] In step S2, the learning rate of vector P is η1 = 1 × 10 -4 , the weight coefficient of the first-order moment β1 = 0.9, the weight coefficient of the second-order moment β2 = 0.999, and the deviation correction parameter ε = 1×10 -8 After 100 iterations under the setting of , the minimum value of the second evaluation function E is 0.7945%. Compared with the value of the second evaluation function E of the traditional target field method of 12.1672%, it has dropped significantly, proving the effectiveness of this method.
[0121] The specific structure of the coil obtained in step S4 is as follows: Figure 3 As shown, the blue and red loops represent clockwise and counterclockwise current directions, respectively.
[0122] This embodiment uses finite element analysis to solve the distribution of the compensation magnetic field generated by the double-plane coil. Specifically, it includes:
[0123] A three-dimensional finite element model for the magnetic field analysis of the double-plane coil is established to analyze the accuracy of the compensation magnetic field generated by the coil. The control equation of the three-dimensional finite element model for magnetic field analysis is:
[0124]
[0125] in, is the Hamiltonian operator, μ0 is the vacuum magnetic permeability, A is the vector magnetic potential, and J is the current density in the conductor, which is equal to the external excitation current density J e , B is the magnetic flux density, σ is the vacuum conductivity, V is the potential, and the electric field intensity E c Represents the Coulomb electric field component caused by the time-varying charge.
[0126] The x-direction magnetic field distribution in the target compensation area at x=-0.15m, 0m, and 0.15m planes obtained based on finite element magnetic field analysis is as follows Figure 4 As shown, there is an obvious dB x / dz magnetic field gradient.
[0127] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0128] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0129] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0130] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0131] It is understandable that the processor in the embodiment of the present application can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor.
[0132] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0133] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0134] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0135] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for determining the stream function of a magnetic field coil based on a target field method and Adam, characterized in that: The magnetic field coil is a dual-plane shim coil or a dual-plane gradient coil, and the method comprises: S1. Use the target field method to solve the initial value of the control vector of the magnetic field coil structure; S2. Use the Adam algorithm to iteratively optimize the magnetic field coil structure control vector; S3. Solve the magnetic field coil stream function using the optimized magnetic field coil structure control vector.
2. The method according to claim 1, characterized in that Step S1 is as follows: using the least square method to solve the coil structure control vector corresponding to the minimum value of the first evaluation function as the initial value P0 of the magnetic field coil structure control vector P, wherein the first evaluation function is used to measure the difference between the magnetic field / magnetic field gradient generated by the magnetic field coil and the expected value: P0=(K T K+αG) -1 ·K T B Among them, G is the heating power factor matrix of the magnetic field coil, and α is the weight coefficient of the penalty term; For the dual-plane shim coil, K is the magnetic flux density coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic flux density values of the target point arranged in the distribution order; For the dual-plane gradient coil, K is the magnetic induction intensity gradient coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic induction intensity gradient values of the target point arranged in distribution order.
3. The method according to claim 2, characterized in that For the dual-plane gradient coil, the elements of the magnetic induction intensity gradient coefficient matrix K in the i-th row and (m-1)×N+n-th column generated by the trigonometric function terms of different orders of the magnetic field coil stream function are: Where μ0 is the vacuum magnetic permeability, H is half the plane height of the magnetic field coil, L is half the plane length of the magnetic field coil, a is half the plane distance between the two coils, and r i is the coordinate vector of the i-th target point, z i is the z coordinate of the i-th target point, r s1 , r s2 are the coordinate vectors of the current source points on the two coil planes in the magnetic field coil, || is the distance between the vectors, f1(m, x) and f2(n, y) are the types of trigonometric function terms of different orders in the x-direction and y-direction in the magnetic field coil stream function, which are determined according to the direction of the compensation magnetic field generated by the desired magnetic field coil, i=1,2,3..., Num, m=1,2,3..., M, n=1,2,3..., N, Num is the number of target points in the target compensation area, M and N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function, respectively.
4. The method according to claim 1, characterized in that Step S2 includes: S21. Calculate the gradient vector of the magnetic field coil structure control vector of the second evaluation function, where the second evaluation function is used to evaluate the quality of each iteration result of the Adam algorithm; S22. Update the first-order moment and the second-order moment of the second evaluation function about the magnetic field coil structure control vector with the gradient vector; S23. Calculate the first-order moment and second-order moment vector after deviation correction; S24. Update the magnetic field coil structure control vector with the first-order moment and second-order moment vector after the deviation correction; S25. Repeat the above operation until the iteration stop condition is met to obtain the optimized value of the magnetic field coil structure control vector.
5. The method according to claim 4, characterized in that The second evaluation function E is specifically as follows: E||KP-B|| 2 +αP T GP Among them, || || is the second norm of the vector, P is the magnetic field coil structure control vector, G is the magnetic field coil heating power factor matrix, and α is the penalty term weight coefficient; For the dual-plane shim coil, K is the magnetic flux density coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic flux density values of the target point arranged in the distribution order; For the dual-plane gradient coil, K is the magnetic induction intensity gradient coefficient matrix generated by the trigonometric function terms of different orders of the magnetic field coil stream function, and B is the vector composed of the expected magnetic induction intensity gradient values of the target point arranged in distribution order.
6. The method according to claim 4, characterized in that The second evaluation function E is specifically as follows: Among them, B * is the magnetic flux density / magnetic flux density gradient generated by the actual coil at the target point, B * =TP, T is the coefficient matrix of magnetic flux density / magnetic flux density gradient generated by the current in the magnetic coil, P is the magnetic field coil structure control vector, B * (i) is the vector B * The i-th element of B * avg For B * The average value of all elements in ; For a dual-plane shim coil, T i,: The calculation formula is as follows: For a dual-plane gradient coil, T i,: The calculation formula is as follows: Among them, all elements in the same row of T are equal, T i,: is the value of the element in the i-th row of T, μ0 is the magnetic permeability of vacuum, N c is the number of closed streamlines of the magnetic coil, For l j The curve integral of l j is the first closed streamline of the magnetic coil, H is half of the plane height of the magnetic coil, L is half of the plane length of the magnetic coil, a is half of the plane distance between the two coils, r i is the coordinate vector of the i-th target point, z i is the z coordinate of the i-th target point, r s1 , r s2 are the coordinate vectors of the current source points on the two coil planes in the magnetic field coil, || is the distance between the vectors, f1(m, x) and f2(n, y) are the types of trigonometric function terms of different orders in the x-direction and y-direction in the magnetic field coil stream function, which are determined according to the direction of the compensation magnetic field generated by the desired magnetic field coil, i=1, 2, 3..., Num, m=1, 2, 3..., M, n=1, 2, 3..., N, Num is the number of target points in the target compensation area, M and N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function, respectively.
7. The method according to claim 4, characterized in that The updating magnetic field coil structure control vector is specifically as follows: Among them, m t =β1·+m t-1 (1-β1)·g t ,v t =β2·v t-1 +(1-β2)·g t 2 ; P t (i) is the magnetic field coil structure control vector P after the tth iteration update t The i-th element, η1 is the learning rate of the magnetic field coil structure control vector, m t ′(i) is the first-order moment m after the deviation correction of the tth iteration t ′The i-th element, v t ′(i) is the second-order moment v after the deviation correction of the tth iteration t ′The i-th element, g t is the gradient vector of the second evaluation function for the magnetic field coil structure control vector at the tth iteration, g t 2 is the vector g t The corresponding elements are multiplied, ε is the deviation correction constant, m t is the first-order moment of the second evaluation function of the t-th iteration with respect to the control vector of the magnetic field coil structure, v t is the second-order moment of the second evaluation function of the t-th iteration with respect to the control vector of the magnetic field coil structure, β1 and β2 are the weight coefficients of the first-order moment and the second-order moment respectively, i=1, 2, ..., M×N, M and N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function respectively.
8. The method according to claim 1, characterized in that Step S3 is specifically as follows: The types of trigonometric functions of different orders in the magnetic field coil stream function and the optimized control vector are integrated to determine the magnetic field coil stream function S(x, y): Where (x, y) is the position coordinate of the midpoint of the coil plane, -HδxδH, -LδyδL, is the (m-1)×N+nth element of the optimized coil structure control vector P*, H is half of the plane height of the magnetic field coil, L is half of the plane length of the magnetic field coil, f1(m, x) and f2(n, y) are the types of trigonometric function terms of different orders in the x-direction and y-direction in the magnetic field coil stream function, respectively, which are determined according to the direction of the compensation magnetic field generated by the desired magnetic field coil, m=1, 2, 3..., M, n=1, 2, 3..., N, M, N are the x-direction order and y-direction order in the Fourier expansion of the triangular form of the magnetic field coil stream function, respectively.
9. The method according to any one of claims 1 to 8, characterized in that The method also includes: S4. determining the specific structure of the magnetic field coil based on the stream function of the magnetic field coil.
10. A system for determining the stream function of a magnetic field coil based on the target field method and Adam, characterized in that: comprising at least one processor and at least one memory; The at least one memory is used to store computer instructions; The at least one processor is configured to execute at least part of the computer instructions to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Radio frequency coil methods and apparatus
CN107530026A
Biplanar coil design method and system for synchronously compensating magnetic field gradient and uniformity
CN116796528A
System and method for optimizing discrete wire positions used in gradient coil electromagnetic design
US20210231758A1
Cited By
Medical cyclotron automatic control system and control method thereof
CN121262715A