Reasons for overestimation of magnetic field energy in PDE Toolbox

6 次查看(过去 30 天)
Using the MATLAB PDE Toolbox, we are applying a current of 1 A to a rectangular model that reproduces a single circular coil with five turns in an axisymmetric model, and calculating the magnetic field energy within the simulation domain from the magnetic flux density B and magnetic field H.
  • The coil has an axisymmetric 2D geometry, and a volume current density is applied to the coil region. N is the number of turns, I is the current, and S is the total cross-sectional area of the coil.
  • The simulation domain is sufficiently large, and the boundary condition of magnetic potential = 0 is set around the outer circumference except for the symmetry axis.
  • The mesh is also sufficiently fine.
Other software such as FFEM calculates correctly under similar conditions, but MATLAB PDE Toolbox always overestimates the magnetic field energy.
The following is a program that calculates the magnetic field energy within the program.
R is a structure obtained by solve.
The center of gravity of each element is obtained, B and H are supplemented at that point, and the magnetic field energy density is calculated using the formula
for magnetic field energy density. dV is integrated by area and radius to obtain the volume.
When this program is executed, it should produce a value of , but the actual value obtained is .
If anyone knows the cause of this, I would appreciate it if you could let me know.
Thank you in advance.
function W = totalMagEnergy(R)
load('coil_parameter.mat');
nodes = R.Mesh.Nodes; % 2 x Nn
elements = R.Mesh.Elements; % 3 or 6 x Ne
node1 = nodes(:, elements(1,:)); % 各三角形の1番目のノード座標
node2 = nodes(:, elements(2,:)); % 各三角形の2番目のノード座標
node3 = nodes(:, elements(3,:)); % 各三角形の3番目のノード座標
centroids = (node1 + node2 + node3) / 3;
r_cent = centroids(1,:);
z_cent = centroids(2,:);
isCoil = (r_cent >= coil_inner_r) & (r_cent <= coil_inner_r + coil_W) & ...
(z_cent >= -coil_L) & (z_cent <= 0);
Hintrp = interpolateMagneticField(R,r_cent, z_cent);
Bintrp = interpolateMagneticFlux(R,r_cent, z_cent);
[~, Ae] = area(R.Mesh);
dV = 2*pi .* r_cent .* Ae;
w = zeros(size(r_cent));
w(~isCoil) = 0.5 .* (Hintrp.Hr(~isCoil) .* Bintrp.Br(~isCoil) + ...
Hintrp.Hz(~isCoil) .* Bintrp.Bz(~isCoil));
W = sum(dV.* w);
end

回答(1 个)

Satwik
Satwik 2025-7-14
Hello @yuuya,
A possible reason for the overestimation could be double counting the number of turns of the coil (N). In the PDE Toolbox, when you set the current density in the coil region as 'J = N*I/S', the effect of the number of turns (N) is already included by the axisymmetric formulation, which integrates this around the '2*pi' rotation. If 'N' is also multiplied elsewhere, such as in the energy calculation or when defining the current density, the field and thus the energy will be overestimated by a factor of 'N^2'.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by