Problem in boundary condition

55 visualizaciones (últimos 30 días)
george veropoulos
george veropoulos el 30 de Dic. de 2024 a las 21:14
Editada: Pavl M. hace alrededor de 20 horas
Hi
im trying to solve a proble in EM with method of MAS ( METHOD OF AUXILARY SOURCE)
I have a infiite cylinder ( PERFECT CONDUCTOR) and in incominf fileld strike the cylinder FROM THE Ein+Escat=0 in the surface of cylinder i solve th system and i fins the current Is ( the function is the currentMAS()) . After i find the Escat field form the epresion of MAS theort. After the i check the sumEs_surf =abs(Etotal(xs,ys)) Etotal= Escat(x,y)+E_in_z(x,y) xs=ra cos(phi) ys=cos(phi) rho = ra;
phi =2*pi*(0:Nc-1)/Nc% Create phi values
% Compute Cartesian coordinates (xa, ya)
xs = rho .* cos(phi); % x-coordinates
ys = rho .* sin(phi); % y-coordinates
the sum is not equal to zero !! the real part is zero but the imaginary not
function [Is] = currentMAS()
%UNTITLED Summary of this function goes here
% Detailed explanation goes her
[~,N,Nc,a,ra,k0,Z0,~] = parameter();
% Preallocate arrays for efficiency
xc = ra * cos(2 * pi * (0:N-1)/N); % Observation points (x-coordinates)
yc = ra* sin(2 * pi*(0:N-1)/N); % Observation points (y-coordinates)
xa = a * cos(2 * pi * (0:Nc-1) / Nc); % Source points (x-coordinates)
ya = a * sin(2 * pi * (0:Nc-1) / Nc); % Source points (y-coordinates)
% Compute distance matrix R between source and observation points
[Xa, XC] = meshgrid(xa, xc); % Observation (columns), Source (rows)
[Ya, YC] = meshgrid(ya, yc);
Ra= sqrt((Xa - XC).^2 + (Ya - YC).^2);
% Compute matrix WI based on the Green's function
WI = (1 / 4) * k0 * Z0 .* besselh(0, 2, k0 .* Ra);
% Compute the source field at each source point
Source = arrayfun(@(xi, yi)E_in_z(xi,yi),xc,yc);
%Source = E_in_z(xc, 0);
%Is = linsolve(WI, Source');
%lambda = 1e-1; % Regularization factor
%Is = (WI' * WI + lambda * eye(size(WI, 2))) \ (WI' * Source');
Is =(pinv(WI)* Source')
end
function z = Escat(x, y)
% Get the current values from the input parameters
[Is] = currentMAS()
[f,N,Nc,a,ra,k0,Z0,lambda] = parameter();
% Precompute coordinates of the points
xx = a * cos(2 * pi * (0:Nc-1) / Nc); % Length Nc
yy = a * sin(2 * pi * (0:Nc-1) / Nc); % Length Nc
% Initialize the S_UM for each (x, y) pair
E_scat = zeros(size(x)); % Result will be the same size as x and y
% Compute the distances and the contributions for each (x, y) pair
for jj = 1:Nc
RR = sqrt((x - xx(jj)).^2 + (y - yy(jj)).^2); % Calculate distance for all (x, y)
% Sum the contributions (note the broadcasting)
E_scat = E_scat - (1/4).*Is(jj) .* k0 * Z0 .* besselh(0, 2, k0 .* RR);
end
% Output the computed value
z = E_scat;
end
function [f,N,Nc,a,ra,k0,Z0,lambda] = parameter()
%UNTITLED Summary of this function goes here
c0=3e8;
Z0=120.*pi;
ra=1;
a=0.85;
N=120;
Nc=120;
f=300e6;
lambda=c0./f;
k0=2*pi./lambda;
end
function y = Etotal(x,y)
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
y=Escat(x,y)+E_in_z(x,y);
end
function z=E_in_z(x,y)
%amplitude
[f,N,Nc,a,ra,k0,Z0] = parameter();
E0=1;
z=E0.*exp(1i.*k0*x);
end
I Atach the mathematical description
tnank you
i wish a happy new year
  1 comentario
george veropoulos
george veropoulos el 30 de Dic. de 2024 a las 21:14
% Define phi and rho
clear all
[f,N,Nc,a,ra,k0,Z0,lambda] = parameter();
rho = ra;
phi =2*pi*(0:Nc-1)/Nc% Create phi values
% Compute Cartesian coordinates (xa, ya)
xs = rho .* cos(phi); % x-coordinates
ys = rho .* sin(phi); % y-coordinates
% Compute Escat for all points (vectorized)
Es_surf =abs(Etotal(xs,ys))
%max(abs(E_in_z(xs,ys))); % Vectorized Escat call
% Plot results
phi_d = phi*(180./pi) % Convert phi to degrees
figure;
plot(phi_d, Es_surf, 'b', 'LineWidth', 2);
set(gca,'FontSize',19,'FontName','Times')
xlabel('$\phi$','Interpreter','latex')
ylabel('$BERROR$','Interpreter','latex' )
%legend('surface point','collocation point')
print('MAS_closed.jpg','-djpeg')

Iniciar sesión para comentar.

Respuestas (2)

Pavl M.
Pavl M. el 31 de Dic. de 2024 a las 4:51
Editada: Pavl M. hace alrededor de 20 horas
%Who are they? What others?
%ver. 04 Jan 2025, To be continued...
clear; close all; clc;
function [f,N,Nc,a,ra,k0,Z0,lambda] = parameter()
%
c0=3e8; %not to change, constant of light
Z0=120.*pi;
ra=1;
a=0.85;
N=120;
Nc=120;
f=100e6; %initially was 300e6
lambda=c0./f; %not to alter
k0=2*pi./lambda; %not to modify
end
function [Is] = currentMAS()
%
[~,N,Nc,a,ra,k0,Z0,~] = parameter();
% Preallocate arrays for efficiency
xc = ra * cos(2 * pi * (0:N-1)/N); % Observation points (x-coordinates)
yc = ra* sin(2 * pi*(0:N-1)/N); % Observation points (y-coordinates)
xa = a * cos(2 * pi * (0:Nc-1) / Nc); % Source points (x-coordinates)
ya = a * sin(2 * pi * (0:Nc-1) / Nc); % Source points (y-coordinates)
% Compute distance matrix R between source and observation points
[Xa, XC] = meshgrid(xa, xc); % Observation (columns), Source (rows)
[Ya, YC] = meshgrid(ya, yc);
Ra= sqrt((Xa - XC).^2 + (Ya - YC).^2);
% Compute matrix WI based on the Green's function
WI1 = (1 / 4) * k0 * Z0 .* besselh(0, 2, k0 .* Ra);
% Compute the source field at each source point
Source1 = arrayfun(@(xi, yi)E_in_z(xi,yi),xc,yc);
%Source = E_in_z(xc, 0);
%Is = linsolve(WI, Source');
%lambda = 1e-1; % Regularization factor
%Is = (WI' * WI + lambda * eye(size(WI, 2))) \ (WI' * Source');
Is1 =(pinv(WI1)* Source1') %current
% Initialize the Green's function matrix WI
WI2 = zeros(N, Nc);
% Compute WI matrix without meshgrid
for i = 1:N
%for j = 1:Nc
% Compute the distance between observation point i and source point j
R = sqrt((xa(i) - xc).^2 + (ya(i) - yc).^2);
% Fill the Green's function matrix
WI2(i, :) = (1/4) * k0 * Z0 .* besselh(0, 2, k0 * R);
%end
end
% Compute the source field at each observation point
Source2 = zeros(N, 1);
for i = 1:N
Source2(i) = E_in_z(xc(i), yc(i));
end
% Solve the system of equations to find the current
Is2 = linsolve(WI2, Source2)
figure
plot(abs(Is1))
title('abs(Is1)')
figure
plot(abs(Is2))
title('abs(Is2)')
figure
plot(phase(Is1))
title('phase(Is1)')
figure
plot(phase(Is2))
title('phase(Is2)')
Is = (Is1+Is2)/2
%ToDo:
%Ra
%Source1
%figure
%quiver(Xa,Ya,Ra,4)
%figure
%quiver(Ya,YC,Source1,3,"x")
%figure
%quiver(Xa,XC,Source2,0,"x")
%figure
%quiver(Ya,YC,Source2,3,"x")
%figure
%contour(Xa,XC,abs(Source1))
%figure
%contour(Ya,YC,abs(Source1))
%figure
%contour(Xa,XC,abs(Source2))
%figure
%contour(Ya,YC,abs(Source2))
end
function z = Escat(x, y)
% Get the current values from the input parameters
[Is] = currentMAS()
figure
plot(abs(Is))
title('abs(Is)')
figure
plot(phase(Is))
title('phase(Is)')
[f,N,Nc,a,ra,k0,Z0,lambda] = parameter();
% Precompute coordinates of the points
xx = a * cos(2 * pi * (0:Nc-1) / Nc); % Length Nc
yy = a * sin(2 * pi * (0:Nc-1) / Nc); % Length Nc
%[Xa, XC] = meshgrid(xa, xx); % Observation (columns), Source (rows)
%[Ya, YC] = meshgrid(ya, yy);
% Initialize the S_UM for each (x, y) pair
E_scat = zeros(size(x)); % Result will be the same size as x and y
% Compute the distances and the contributions for each (x, y) pair
for jj = 1:Nc
RR = sqrt((x - xx(jj)).^2 + (y - yy(jj)).^2); % Calculate distance for all (x, y)
% Sum the contributions (note the broadcasting)
E_scat = E_scat - (1/4).*Is(jj) .* k0 * Z0 .* besselh(0, 2, k0 .* RR);
end
% Output the computed value
z = E_scat;
end
function y = Etotal(x,y)
%
y=Escat(x,y)+E_in_z(x,y);
end
function z=E_in_z(x,y)
%amplitude
[f,N,Nc,a,ra,k0,Z0] = parameter();
E0=1;
z=E0.*exp(1i.*k0*x);
end
[f,N,Nc,a,ra,k0,Z0,lambda] = parameter();
rho = ra;
phi =2*pi*(0:Nc-1)/Nc% Create phi values
phi = 1×120
0 0.0524 0.1047 0.1571 0.2094 0.2618 0.3142 0.3665 0.4189 0.4712 0.5236 0.5760 0.6283 0.6807 0.7330 0.7854 0.8378 0.8901 0.9425 0.9948 1.0472 1.0996 1.1519 1.2043 1.2566 1.3090 1.3614 1.4137 1.4661 1.5184
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
% Compute Cartesian coordinates (xa, ya)
xs = rho .* cos(phi); % x-coordinates
ys = rho .* sin(phi); % y-coordinates
%[Xa, XC] = meshgrid(xa, xs); % Observation (columns), Source (rows)
%[Ya, YC] = meshgrid(ya, ys);
sumEs_surf = abs(Etotal(xs,ys))
Is1 =
1.0e-03 * 0.0141 - 0.0210i 0.0137 - 0.0206i 0.0127 - 0.0194i 0.0109 - 0.0175i 0.0084 - 0.0150i 0.0050 - 0.0121i 0.0008 - 0.0089i -0.0043 - 0.0057i -0.0103 - 0.0028i -0.0171 - 0.0004i -0.0247 + 0.0010i -0.0330 + 0.0013i -0.0417 + 0.0001i -0.0506 - 0.0029i -0.0594 - 0.0078i -0.0677 - 0.0149i -0.0749 - 0.0241i -0.0807 - 0.0354i -0.0846 - 0.0487i -0.0860 - 0.0636i -0.0846 - 0.0797i -0.0799 - 0.0965i -0.0718 - 0.1133i -0.0602 - 0.1294i -0.0450 - 0.1440i -0.0265 - 0.1564i -0.0050 - 0.1658i 0.0188 - 0.1716i 0.0442 - 0.1732i 0.0705 - 0.1702i 0.0968 - 0.1624i 0.1221 - 0.1499i 0.1455 - 0.1327i 0.1662 - 0.1113i 0.1834 - 0.0862i 0.1965 - 0.0581i 0.2050 - 0.0278i 0.2087 + 0.0038i 0.2075 + 0.0358i 0.2014 + 0.0674i 0.1909 + 0.0979i 0.1763 + 0.1264i 0.1582 + 0.1525i 0.1371 + 0.1757i 0.1138 + 0.1957i 0.0889 + 0.2124i 0.0631 + 0.2259i 0.0370 + 0.2361i 0.0113 + 0.2434i -0.0135 + 0.2480i -0.0371 + 0.2504i -0.0591 + 0.2508i -0.0792 + 0.2499i -0.0972 + 0.2479i -0.1129 + 0.2452i -0.1263 + 0.2423i -0.1373 + 0.2395i -0.1458 + 0.2370i -0.1519 + 0.2350i -0.1556 + 0.2338i -0.1568 + 0.2334i -0.1556 + 0.2338i -0.1519 + 0.2350i -0.1458 + 0.2370i -0.1373 + 0.2395i -0.1263 + 0.2423i -0.1129 + 0.2452i -0.0972 + 0.2479i -0.0792 + 0.2499i -0.0591 + 0.2508i -0.0371 + 0.2504i -0.0135 + 0.2480i 0.0113 + 0.2434i 0.0370 + 0.2361i 0.0631 + 0.2259i 0.0889 + 0.2124i 0.1138 + 0.1957i 0.1371 + 0.1757i 0.1582 + 0.1525i 0.1763 + 0.1264i 0.1909 + 0.0979i 0.2014 + 0.0674i 0.2075 + 0.0358i 0.2087 + 0.0038i 0.2050 - 0.0278i 0.1965 - 0.0581i 0.1834 - 0.0862i 0.1662 - 0.1113i 0.1455 - 0.1327i 0.1221 - 0.1499i 0.0968 - 0.1624i 0.0705 - 0.1702i 0.0442 - 0.1732i 0.0188 - 0.1716i -0.0050 - 0.1658i -0.0265 - 0.1564i -0.0450 - 0.1440i -0.0602 - 0.1294i -0.0718 - 0.1133i -0.0799 - 0.0965i -0.0846 - 0.0797i -0.0860 - 0.0636i -0.0846 - 0.0487i -0.0807 - 0.0354i -0.0749 - 0.0241i -0.0677 - 0.0149i -0.0594 - 0.0078i -0.0506 - 0.0029i -0.0417 + 0.0001i -0.0330 + 0.0013i -0.0247 + 0.0010i -0.0171 - 0.0004i -0.0103 - 0.0028i -0.0043 - 0.0057i 0.0008 - 0.0089i 0.0050 - 0.0121i 0.0084 - 0.0150i 0.0109 - 0.0175i 0.0127 - 0.0194i 0.0137 - 0.0206i
Is2 =
1.0e-03 * -0.1568 + 0.2334i -0.1556 + 0.2338i -0.1519 + 0.2350i -0.1458 + 0.2370i -0.1373 + 0.2395i -0.1263 + 0.2423i -0.1129 + 0.2452i -0.0972 + 0.2479i -0.0792 + 0.2499i -0.0591 + 0.2508i -0.0371 + 0.2504i -0.0135 + 0.2480i 0.0113 + 0.2434i 0.0370 + 0.2361i 0.0631 + 0.2259i 0.0889 + 0.2124i 0.1138 + 0.1957i 0.1371 + 0.1757i 0.1582 + 0.1525i 0.1763 + 0.1264i 0.1909 + 0.0979i 0.2014 + 0.0674i 0.2075 + 0.0358i 0.2087 + 0.0038i 0.2050 - 0.0278i 0.1965 - 0.0581i 0.1834 - 0.0862i 0.1662 - 0.1113i 0.1455 - 0.1327i 0.1221 - 0.1499i 0.0968 - 0.1624i 0.0705 - 0.1702i 0.0442 - 0.1732i 0.0188 - 0.1716i -0.0050 - 0.1658i -0.0265 - 0.1564i -0.0450 - 0.1440i -0.0602 - 0.1294i -0.0718 - 0.1133i -0.0799 - 0.0965i -0.0846 - 0.0797i -0.0860 - 0.0636i -0.0846 - 0.0487i -0.0807 - 0.0354i -0.0749 - 0.0241i -0.0677 - 0.0149i -0.0594 - 0.0078i -0.0506 - 0.0029i -0.0417 + 0.0001i -0.0330 + 0.0013i -0.0247 + 0.0010i -0.0171 - 0.0004i -0.0103 - 0.0028i -0.0043 - 0.0057i 0.0008 - 0.0089i 0.0050 - 0.0121i 0.0084 - 0.0150i 0.0109 - 0.0175i 0.0127 - 0.0194i 0.0137 - 0.0206i 0.0141 - 0.0210i 0.0137 - 0.0206i 0.0127 - 0.0194i 0.0109 - 0.0175i 0.0084 - 0.0150i 0.0050 - 0.0121i 0.0008 - 0.0089i -0.0043 - 0.0057i -0.0103 - 0.0028i -0.0171 - 0.0004i -0.0247 + 0.0010i -0.0330 + 0.0013i -0.0417 + 0.0001i -0.0506 - 0.0029i -0.0594 - 0.0078i -0.0677 - 0.0149i -0.0749 - 0.0241i -0.0807 - 0.0354i -0.0846 - 0.0487i -0.0860 - 0.0636i -0.0846 - 0.0797i -0.0799 - 0.0965i -0.0718 - 0.1133i -0.0602 - 0.1294i -0.0450 - 0.1440i -0.0265 - 0.1564i -0.0050 - 0.1658i 0.0188 - 0.1716i 0.0442 - 0.1732i 0.0705 - 0.1702i 0.0968 - 0.1624i 0.1221 - 0.1499i 0.1455 - 0.1327i 0.1662 - 0.1113i 0.1834 - 0.0862i 0.1965 - 0.0581i 0.2050 - 0.0278i 0.2087 + 0.0038i 0.2075 + 0.0358i 0.2014 + 0.0674i 0.1909 + 0.0979i 0.1763 + 0.1264i 0.1582 + 0.1525i 0.1371 + 0.1757i 0.1138 + 0.1957i 0.0889 + 0.2124i 0.0631 + 0.2259i 0.0370 + 0.2361i 0.0113 + 0.2434i -0.0135 + 0.2480i -0.0371 + 0.2504i -0.0591 + 0.2508i -0.0792 + 0.2499i -0.0972 + 0.2479i -0.1129 + 0.2452i -0.1263 + 0.2423i -0.1373 + 0.2395i -0.1458 + 0.2370i -0.1519 + 0.2350i -0.1556 + 0.2338i
Is =
1.0e-03 * -0.0714 + 0.1062i -0.0709 + 0.1066i -0.0696 + 0.1078i -0.0675 + 0.1097i -0.0645 + 0.1122i -0.0606 + 0.1151i -0.0560 + 0.1182i -0.0507 + 0.1211i -0.0447 + 0.1236i -0.0381 + 0.1252i -0.0309 + 0.1257i -0.0233 + 0.1247i -0.0152 + 0.1217i -0.0068 + 0.1166i 0.0018 + 0.1090i 0.0106 + 0.0988i 0.0194 + 0.0858i 0.0282 + 0.0701i 0.0368 + 0.0519i 0.0451 + 0.0314i 0.0532 + 0.0091i 0.0608 - 0.0145i 0.0678 - 0.0387i 0.0743 - 0.0628i 0.0800 - 0.0859i 0.0850 - 0.1073i 0.0892 - 0.1260i 0.0925 - 0.1414i 0.0949 - 0.1529i 0.0963 - 0.1600i 0.0968 - 0.1624i 0.0963 - 0.1600i 0.0949 - 0.1529i 0.0925 - 0.1414i 0.0892 - 0.1260i 0.0850 - 0.1073i 0.0800 - 0.0859i 0.0743 - 0.0628i 0.0678 - 0.0387i 0.0608 - 0.0145i 0.0532 + 0.0091i 0.0451 + 0.0314i 0.0368 + 0.0519i 0.0282 + 0.0701i 0.0194 + 0.0858i 0.0106 + 0.0988i 0.0018 + 0.1090i -0.0068 + 0.1166i -0.0152 + 0.1217i -0.0233 + 0.1247i -0.0309 + 0.1257i -0.0381 + 0.1252i -0.0447 + 0.1236i -0.0507 + 0.1211i -0.0560 + 0.1182i -0.0606 + 0.1151i -0.0645 + 0.1122i -0.0675 + 0.1097i -0.0696 + 0.1078i -0.0709 + 0.1066i -0.0714 + 0.1062i -0.0709 + 0.1066i -0.0696 + 0.1078i -0.0675 + 0.1097i -0.0645 + 0.1122i -0.0606 + 0.1151i -0.0560 + 0.1182i -0.0507 + 0.1211i -0.0447 + 0.1236i -0.0381 + 0.1252i -0.0309 + 0.1257i -0.0233 + 0.1247i -0.0152 + 0.1217i -0.0068 + 0.1166i 0.0018 + 0.1090i 0.0106 + 0.0988i 0.0194 + 0.0858i 0.0282 + 0.0701i 0.0368 + 0.0519i 0.0451 + 0.0314i 0.0532 + 0.0091i 0.0608 - 0.0145i 0.0678 - 0.0387i 0.0743 - 0.0628i 0.0800 - 0.0859i 0.0850 - 0.1073i 0.0892 - 0.1260i 0.0925 - 0.1414i 0.0949 - 0.1529i 0.0963 - 0.1600i 0.0968 - 0.1624i 0.0963 - 0.1600i 0.0949 - 0.1529i 0.0925 - 0.1414i 0.0892 - 0.1260i 0.0850 - 0.1073i 0.0800 - 0.0859i 0.0743 - 0.0628i 0.0678 - 0.0387i 0.0608 - 0.0145i 0.0532 + 0.0091i 0.0451 + 0.0314i 0.0368 + 0.0519i 0.0282 + 0.0701i 0.0194 + 0.0858i 0.0106 + 0.0988i 0.0018 + 0.1090i -0.0068 + 0.1166i -0.0152 + 0.1217i -0.0233 + 0.1247i -0.0309 + 0.1257i -0.0381 + 0.1252i -0.0447 + 0.1236i -0.0507 + 0.1211i -0.0560 + 0.1182i -0.0606 + 0.1151i -0.0645 + 0.1122i -0.0675 + 0.1097i -0.0696 + 0.1078i -0.0709 + 0.1066i
Is =
1.0e-03 * -0.0714 + 0.1062i -0.0709 + 0.1066i -0.0696 + 0.1078i -0.0675 + 0.1097i -0.0645 + 0.1122i -0.0606 + 0.1151i -0.0560 + 0.1182i -0.0507 + 0.1211i -0.0447 + 0.1236i -0.0381 + 0.1252i -0.0309 + 0.1257i -0.0233 + 0.1247i -0.0152 + 0.1217i -0.0068 + 0.1166i 0.0018 + 0.1090i 0.0106 + 0.0988i 0.0194 + 0.0858i 0.0282 + 0.0701i 0.0368 + 0.0519i 0.0451 + 0.0314i 0.0532 + 0.0091i 0.0608 - 0.0145i 0.0678 - 0.0387i 0.0743 - 0.0628i 0.0800 - 0.0859i 0.0850 - 0.1073i 0.0892 - 0.1260i 0.0925 - 0.1414i 0.0949 - 0.1529i 0.0963 - 0.1600i 0.0968 - 0.1624i 0.0963 - 0.1600i 0.0949 - 0.1529i 0.0925 - 0.1414i 0.0892 - 0.1260i 0.0850 - 0.1073i 0.0800 - 0.0859i 0.0743 - 0.0628i 0.0678 - 0.0387i 0.0608 - 0.0145i 0.0532 + 0.0091i 0.0451 + 0.0314i 0.0368 + 0.0519i 0.0282 + 0.0701i 0.0194 + 0.0858i 0.0106 + 0.0988i 0.0018 + 0.1090i -0.0068 + 0.1166i -0.0152 + 0.1217i -0.0233 + 0.1247i -0.0309 + 0.1257i -0.0381 + 0.1252i -0.0447 + 0.1236i -0.0507 + 0.1211i -0.0560 + 0.1182i -0.0606 + 0.1151i -0.0645 + 0.1122i -0.0675 + 0.1097i -0.0696 + 0.1078i -0.0709 + 0.1066i -0.0714 + 0.1062i -0.0709 + 0.1066i -0.0696 + 0.1078i -0.0675 + 0.1097i -0.0645 + 0.1122i -0.0606 + 0.1151i -0.0560 + 0.1182i -0.0507 + 0.1211i -0.0447 + 0.1236i -0.0381 + 0.1252i -0.0309 + 0.1257i -0.0233 + 0.1247i -0.0152 + 0.1217i -0.0068 + 0.1166i 0.0018 + 0.1090i 0.0106 + 0.0988i 0.0194 + 0.0858i 0.0282 + 0.0701i 0.0368 + 0.0519i 0.0451 + 0.0314i 0.0532 + 0.0091i 0.0608 - 0.0145i 0.0678 - 0.0387i 0.0743 - 0.0628i 0.0800 - 0.0859i 0.0850 - 0.1073i 0.0892 - 0.1260i 0.0925 - 0.1414i 0.0949 - 0.1529i 0.0963 - 0.1600i 0.0968 - 0.1624i 0.0963 - 0.1600i 0.0949 - 0.1529i 0.0925 - 0.1414i 0.0892 - 0.1260i 0.0850 - 0.1073i 0.0800 - 0.0859i 0.0743 - 0.0628i 0.0678 - 0.0387i 0.0608 - 0.0145i 0.0532 + 0.0091i 0.0451 + 0.0314i 0.0368 + 0.0519i 0.0282 + 0.0701i 0.0194 + 0.0858i 0.0106 + 0.0988i 0.0018 + 0.1090i -0.0068 + 0.1166i -0.0152 + 0.1217i -0.0233 + 0.1247i -0.0309 + 0.1257i -0.0381 + 0.1252i -0.0447 + 0.1236i -0.0507 + 0.1211i -0.0560 + 0.1182i -0.0606 + 0.1151i -0.0645 + 0.1122i -0.0675 + 0.1097i -0.0696 + 0.1078i -0.0709 + 0.1066i
sumEs_surf = 1×120
0.8660 0.8675 0.8717 0.8786 0.8880 0.8995 0.9126 0.9270 0.9419 0.9567 0.9706 0.9828 0.9924 0.9984 0.9999 0.9960 0.9857 0.9682 0.9428 0.9089 0.8660 0.8139 0.7525 0.6821 0.6030 0.5159 0.4218 0.3218 0.2172 0.1094
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
% Compute Escat for all points (vectorized)
Es_surf =sumEs_surf
Es_surf = 1×120
0.8660 0.8675 0.8717 0.8786 0.8880 0.8995 0.9126 0.9270 0.9419 0.9567 0.9706 0.9828 0.9924 0.9984 0.9999 0.9960 0.9857 0.9682 0.9428 0.9089 0.8660 0.8139 0.7525 0.6821 0.6030 0.5159 0.4218 0.3218 0.2172 0.1094
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
m1 = max(abs(E_in_z(xs,ys))); % Vectorized Escat call
% Plot results
phi_d = phi*(180./pi) % Convert phi to degrees
phi_d = 1×120
0 3.0000 6.0000 9.0000 12.0000 15.0000 18.0000 21.0000 24.0000 27.0000 30.0000 33.0000 36.0000 39.0000 42.0000 45.0000 48.0000 51.0000 54.0000 57.0000 60.0000 63.0000 66.0000 69.0000 72.0000 75.0000 78.0000 81.0000 84.0000 87.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
E1 = Escat(xs,ys);
Is1 =
1.0e-03 * 0.0141 - 0.0210i 0.0137 - 0.0206i 0.0127 - 0.0194i 0.0109 - 0.0175i 0.0084 - 0.0150i 0.0050 - 0.0121i 0.0008 - 0.0089i -0.0043 - 0.0057i -0.0103 - 0.0028i -0.0171 - 0.0004i -0.0247 + 0.0010i -0.0330 + 0.0013i -0.0417 + 0.0001i -0.0506 - 0.0029i -0.0594 - 0.0078i -0.0677 - 0.0149i -0.0749 - 0.0241i -0.0807 - 0.0354i -0.0846 - 0.0487i -0.0860 - 0.0636i -0.0846 - 0.0797i -0.0799 - 0.0965i -0.0718 - 0.1133i -0.0602 - 0.1294i -0.0450 - 0.1440i -0.0265 - 0.1564i -0.0050 - 0.1658i 0.0188 - 0.1716i 0.0442 - 0.1732i 0.0705 - 0.1702i 0.0968 - 0.1624i 0.1221 - 0.1499i 0.1455 - 0.1327i 0.1662 - 0.1113i 0.1834 - 0.0862i 0.1965 - 0.0581i 0.2050 - 0.0278i 0.2087 + 0.0038i 0.2075 + 0.0358i 0.2014 + 0.0674i 0.1909 + 0.0979i 0.1763 + 0.1264i 0.1582 + 0.1525i 0.1371 + 0.1757i 0.1138 + 0.1957i 0.0889 + 0.2124i 0.0631 + 0.2259i 0.0370 + 0.2361i 0.0113 + 0.2434i -0.0135 + 0.2480i -0.0371 + 0.2504i -0.0591 + 0.2508i -0.0792 + 0.2499i -0.0972 + 0.2479i -0.1129 + 0.2452i -0.1263 + 0.2423i -0.1373 + 0.2395i -0.1458 + 0.2370i -0.1519 + 0.2350i -0.1556 + 0.2338i -0.1568 + 0.2334i -0.1556 + 0.2338i -0.1519 + 0.2350i -0.1458 + 0.2370i -0.1373 + 0.2395i -0.1263 + 0.2423i -0.1129 + 0.2452i -0.0972 + 0.2479i -0.0792 + 0.2499i -0.0591 + 0.2508i -0.0371 + 0.2504i -0.0135 + 0.2480i 0.0113 + 0.2434i 0.0370 + 0.2361i 0.0631 + 0.2259i 0.0889 + 0.2124i 0.1138 + 0.1957i 0.1371 + 0.1757i 0.1582 + 0.1525i 0.1763 + 0.1264i 0.1909 + 0.0979i 0.2014 + 0.0674i 0.2075 + 0.0358i 0.2087 + 0.0038i 0.2050 - 0.0278i 0.1965 - 0.0581i 0.1834 - 0.0862i 0.1662 - 0.1113i 0.1455 - 0.1327i 0.1221 - 0.1499i 0.0968 - 0.1624i 0.0705 - 0.1702i 0.0442 - 0.1732i 0.0188 - 0.1716i -0.0050 - 0.1658i -0.0265 - 0.1564i -0.0450 - 0.1440i -0.0602 - 0.1294i -0.0718 - 0.1133i -0.0799 - 0.0965i -0.0846 - 0.0797i -0.0860 - 0.0636i -0.0846 - 0.0487i -0.0807 - 0.0354i -0.0749 - 0.0241i -0.0677 - 0.0149i -0.0594 - 0.0078i -0.0506 - 0.0029i -0.0417 + 0.0001i -0.0330 + 0.0013i -0.0247 + 0.0010i -0.0171 - 0.0004i -0.0103 - 0.0028i -0.0043 - 0.0057i 0.0008 - 0.0089i 0.0050 - 0.0121i 0.0084 - 0.0150i 0.0109 - 0.0175i 0.0127 - 0.0194i 0.0137 - 0.0206i
Is2 =
1.0e-03 * -0.1568 + 0.2334i -0.1556 + 0.2338i -0.1519 + 0.2350i -0.1458 + 0.2370i -0.1373 + 0.2395i -0.1263 + 0.2423i -0.1129 + 0.2452i -0.0972 + 0.2479i -0.0792 + 0.2499i -0.0591 + 0.2508i -0.0371 + 0.2504i -0.0135 + 0.2480i 0.0113 + 0.2434i 0.0370 + 0.2361i 0.0631 + 0.2259i 0.0889 + 0.2124i 0.1138 + 0.1957i 0.1371 + 0.1757i 0.1582 + 0.1525i 0.1763 + 0.1264i 0.1909 + 0.0979i 0.2014 + 0.0674i 0.2075 + 0.0358i 0.2087 + 0.0038i 0.2050 - 0.0278i 0.1965 - 0.0581i 0.1834 - 0.0862i 0.1662 - 0.1113i 0.1455 - 0.1327i 0.1221 - 0.1499i 0.0968 - 0.1624i 0.0705 - 0.1702i 0.0442 - 0.1732i 0.0188 - 0.1716i -0.0050 - 0.1658i -0.0265 - 0.1564i -0.0450 - 0.1440i -0.0602 - 0.1294i -0.0718 - 0.1133i -0.0799 - 0.0965i -0.0846 - 0.0797i -0.0860 - 0.0636i -0.0846 - 0.0487i -0.0807 - 0.0354i -0.0749 - 0.0241i -0.0677 - 0.0149i -0.0594 - 0.0078i -0.0506 - 0.0029i -0.0417 + 0.0001i -0.0330 + 0.0013i -0.0247 + 0.0010i -0.0171 - 0.0004i -0.0103 - 0.0028i -0.0043 - 0.0057i 0.0008 - 0.0089i 0.0050 - 0.0121i 0.0084 - 0.0150i 0.0109 - 0.0175i 0.0127 - 0.0194i 0.0137 - 0.0206i 0.0141 - 0.0210i 0.0137 - 0.0206i 0.0127 - 0.0194i 0.0109 - 0.0175i 0.0084 - 0.0150i 0.0050 - 0.0121i 0.0008 - 0.0089i -0.0043 - 0.0057i -0.0103 - 0.0028i -0.0171 - 0.0004i -0.0247 + 0.0010i -0.0330 + 0.0013i -0.0417 + 0.0001i -0.0506 - 0.0029i -0.0594 - 0.0078i -0.0677 - 0.0149i -0.0749 - 0.0241i -0.0807 - 0.0354i -0.0846 - 0.0487i -0.0860 - 0.0636i -0.0846 - 0.0797i -0.0799 - 0.0965i -0.0718 - 0.1133i -0.0602 - 0.1294i -0.0450 - 0.1440i -0.0265 - 0.1564i -0.0050 - 0.1658i 0.0188 - 0.1716i 0.0442 - 0.1732i 0.0705 - 0.1702i 0.0968 - 0.1624i 0.1221 - 0.1499i 0.1455 - 0.1327i 0.1662 - 0.1113i 0.1834 - 0.0862i 0.1965 - 0.0581i 0.2050 - 0.0278i 0.2087 + 0.0038i 0.2075 + 0.0358i 0.2014 + 0.0674i 0.1909 + 0.0979i 0.1763 + 0.1264i 0.1582 + 0.1525i 0.1371 + 0.1757i 0.1138 + 0.1957i 0.0889 + 0.2124i 0.0631 + 0.2259i 0.0370 + 0.2361i 0.0113 + 0.2434i -0.0135 + 0.2480i -0.0371 + 0.2504i -0.0591 + 0.2508i -0.0792 + 0.2499i -0.0972 + 0.2479i -0.1129 + 0.2452i -0.1263 + 0.2423i -0.1373 + 0.2395i -0.1458 + 0.2370i -0.1519 + 0.2350i -0.1556 + 0.2338i
Is =
1.0e-03 * -0.0714 + 0.1062i -0.0709 + 0.1066i -0.0696 + 0.1078i -0.0675 + 0.1097i -0.0645 + 0.1122i -0.0606 + 0.1151i -0.0560 + 0.1182i -0.0507 + 0.1211i -0.0447 + 0.1236i -0.0381 + 0.1252i -0.0309 + 0.1257i -0.0233 + 0.1247i -0.0152 + 0.1217i -0.0068 + 0.1166i 0.0018 + 0.1090i 0.0106 + 0.0988i 0.0194 + 0.0858i 0.0282 + 0.0701i 0.0368 + 0.0519i 0.0451 + 0.0314i 0.0532 + 0.0091i 0.0608 - 0.0145i 0.0678 - 0.0387i 0.0743 - 0.0628i 0.0800 - 0.0859i 0.0850 - 0.1073i 0.0892 - 0.1260i 0.0925 - 0.1414i 0.0949 - 0.1529i 0.0963 - 0.1600i 0.0968 - 0.1624i 0.0963 - 0.1600i 0.0949 - 0.1529i 0.0925 - 0.1414i 0.0892 - 0.1260i 0.0850 - 0.1073i 0.0800 - 0.0859i 0.0743 - 0.0628i 0.0678 - 0.0387i 0.0608 - 0.0145i 0.0532 + 0.0091i 0.0451 + 0.0314i 0.0368 + 0.0519i 0.0282 + 0.0701i 0.0194 + 0.0858i 0.0106 + 0.0988i 0.0018 + 0.1090i -0.0068 + 0.1166i -0.0152 + 0.1217i -0.0233 + 0.1247i -0.0309 + 0.1257i -0.0381 + 0.1252i -0.0447 + 0.1236i -0.0507 + 0.1211i -0.0560 + 0.1182i -0.0606 + 0.1151i -0.0645 + 0.1122i -0.0675 + 0.1097i -0.0696 + 0.1078i -0.0709 + 0.1066i -0.0714 + 0.1062i -0.0709 + 0.1066i -0.0696 + 0.1078i -0.0675 + 0.1097i -0.0645 + 0.1122i -0.0606 + 0.1151i -0.0560 + 0.1182i -0.0507 + 0.1211i -0.0447 + 0.1236i -0.0381 + 0.1252i -0.0309 + 0.1257i -0.0233 + 0.1247i -0.0152 + 0.1217i -0.0068 + 0.1166i 0.0018 + 0.1090i 0.0106 + 0.0988i 0.0194 + 0.0858i 0.0282 + 0.0701i 0.0368 + 0.0519i 0.0451 + 0.0314i 0.0532 + 0.0091i 0.0608 - 0.0145i 0.0678 - 0.0387i 0.0743 - 0.0628i 0.0800 - 0.0859i 0.0850 - 0.1073i 0.0892 - 0.1260i 0.0925 - 0.1414i 0.0949 - 0.1529i 0.0963 - 0.1600i 0.0968 - 0.1624i 0.0963 - 0.1600i 0.0949 - 0.1529i 0.0925 - 0.1414i 0.0892 - 0.1260i 0.0850 - 0.1073i 0.0800 - 0.0859i 0.0743 - 0.0628i 0.0678 - 0.0387i 0.0608 - 0.0145i 0.0532 + 0.0091i 0.0451 + 0.0314i 0.0368 + 0.0519i 0.0282 + 0.0701i 0.0194 + 0.0858i 0.0106 + 0.0988i 0.0018 + 0.1090i -0.0068 + 0.1166i -0.0152 + 0.1217i -0.0233 + 0.1247i -0.0309 + 0.1257i -0.0381 + 0.1252i -0.0447 + 0.1236i -0.0507 + 0.1211i -0.0560 + 0.1182i -0.0606 + 0.1151i -0.0645 + 0.1122i -0.0675 + 0.1097i -0.0696 + 0.1078i -0.0709 + 0.1066i
Is =
1.0e-03 * -0.0714 + 0.1062i -0.0709 + 0.1066i -0.0696 + 0.1078i -0.0675 + 0.1097i -0.0645 + 0.1122i -0.0606 + 0.1151i -0.0560 + 0.1182i -0.0507 + 0.1211i -0.0447 + 0.1236i -0.0381 + 0.1252i -0.0309 + 0.1257i -0.0233 + 0.1247i -0.0152 + 0.1217i -0.0068 + 0.1166i 0.0018 + 0.1090i 0.0106 + 0.0988i 0.0194 + 0.0858i 0.0282 + 0.0701i 0.0368 + 0.0519i 0.0451 + 0.0314i 0.0532 + 0.0091i 0.0608 - 0.0145i 0.0678 - 0.0387i 0.0743 - 0.0628i 0.0800 - 0.0859i 0.0850 - 0.1073i 0.0892 - 0.1260i 0.0925 - 0.1414i 0.0949 - 0.1529i 0.0963 - 0.1600i 0.0968 - 0.1624i 0.0963 - 0.1600i 0.0949 - 0.1529i 0.0925 - 0.1414i 0.0892 - 0.1260i 0.0850 - 0.1073i 0.0800 - 0.0859i 0.0743 - 0.0628i 0.0678 - 0.0387i 0.0608 - 0.0145i 0.0532 + 0.0091i 0.0451 + 0.0314i 0.0368 + 0.0519i 0.0282 + 0.0701i 0.0194 + 0.0858i 0.0106 + 0.0988i 0.0018 + 0.1090i -0.0068 + 0.1166i -0.0152 + 0.1217i -0.0233 + 0.1247i -0.0309 + 0.1257i -0.0381 + 0.1252i -0.0447 + 0.1236i -0.0507 + 0.1211i -0.0560 + 0.1182i -0.0606 + 0.1151i -0.0645 + 0.1122i -0.0675 + 0.1097i -0.0696 + 0.1078i -0.0709 + 0.1066i -0.0714 + 0.1062i -0.0709 + 0.1066i -0.0696 + 0.1078i -0.0675 + 0.1097i -0.0645 + 0.1122i -0.0606 + 0.1151i -0.0560 + 0.1182i -0.0507 + 0.1211i -0.0447 + 0.1236i -0.0381 + 0.1252i -0.0309 + 0.1257i -0.0233 + 0.1247i -0.0152 + 0.1217i -0.0068 + 0.1166i 0.0018 + 0.1090i 0.0106 + 0.0988i 0.0194 + 0.0858i 0.0282 + 0.0701i 0.0368 + 0.0519i 0.0451 + 0.0314i 0.0532 + 0.0091i 0.0608 - 0.0145i 0.0678 - 0.0387i 0.0743 - 0.0628i 0.0800 - 0.0859i 0.0850 - 0.1073i 0.0892 - 0.1260i 0.0925 - 0.1414i 0.0949 - 0.1529i 0.0963 - 0.1600i 0.0968 - 0.1624i 0.0963 - 0.1600i 0.0949 - 0.1529i 0.0925 - 0.1414i 0.0892 - 0.1260i 0.0850 - 0.1073i 0.0800 - 0.0859i 0.0743 - 0.0628i 0.0678 - 0.0387i 0.0608 - 0.0145i 0.0532 + 0.0091i 0.0451 + 0.0314i 0.0368 + 0.0519i 0.0282 + 0.0701i 0.0194 + 0.0858i 0.0106 + 0.0988i 0.0018 + 0.1090i -0.0068 + 0.1166i -0.0152 + 0.1217i -0.0233 + 0.1247i -0.0309 + 0.1257i -0.0381 + 0.1252i -0.0447 + 0.1236i -0.0507 + 0.1211i -0.0560 + 0.1182i -0.0606 + 0.1151i -0.0645 + 0.1122i -0.0675 + 0.1097i -0.0696 + 0.1078i -0.0709 + 0.1066i
E2 = E_in_z(xs,ys);
figure
plot(phi_d,abs(E1))
title('Absolute Scat. Field')
figure
plot(phi_d,phase(E1))
title('Phase Scat. Field')
figure
quiver(real(E1),imag(E1),3)
title('Directions Scat. Field')
figure
plot(phi_d,abs(E2))
title('Absolute Vertical Field')
figure
plot(phi_d,phase(E2))
title('Phase Vertical. Field')
figure
quiver(real(E2),imag(E2),3)
title('Directions vertical field')
figure;
plot(phi_d, Es_surf, 'b', 'LineWidth', 2);
hold on
plot(m1)
set(gca,'FontSize',19,'FontName','Times')
xlabel('$\phi$','Interpreter','latex')
ylabel('$BERROR$','Interpreter','latex' )
%legend('surface point','collocation point')
print('MAS_closed.jpg','-djpeg')
  3 comentarios
Pavl M.
Pavl M. el 2 de En. de 2025 a las 7:37
Editada: Pavl M. el 2 de En. de 2025 a las 7:43
Dear George Veropoulos,
OK. What is sure, there are many healthy points and flows (see phase plot) and a little bit of ill, sick with due,(E1,E2, quiver usage to amend).
You wrote: "The problem is that the total field I. Thdkthis. Point are not equal to zero"
To continue more clear, what do you mean by total field this Es_surf = Etotal(xs,ys) ?
What do you mean by I, which current?
What do you mean by Thd?
Who, why, for what wants to suppress the field around that figure(cyllinder)? What is more correct is to amplify better to amplify good, not parazitic, make stronger and more beutiful shaped utile field and so associated with EM field E current ->.
What do you mean by point are not equal to zero?
george veropoulos
george veropoulos hace alrededor de 21 horas
Dear Pavl
yes this i mean Es_surf =abs(Etotal(xs, ys)) because the cylinder is perfect conductor this sum must ne equal to zero.
rho = ra;
%phi = 2*pi*(0:Nc-1)/Nc; % Create phi values
phi =0:2*pi/(2*N):2*pi
% Compute Cartesian coordinates (xs, ys)
xs = rho .* cos(phi); % x-coordinates
ys = rho .* sin(phi); % y-coordinates
When i change the msgrid with double for loop this quantity goes to zero!
George

Iniciar sesión para comentar.


george veropoulos
george veropoulos el 4 de En. de 2025 a las 6:13
Editada: george veropoulos hace alrededor de 23 horas
the problem was in [Xa, XC] = meshgrid(xa, xc); % Observation (columns), Source (rows)
[Ya, YC] = meshgrid(ya, yc);
may be give wrong results I use a double For loop and the abs( Etotl) is very smail
  3 comentarios
george veropoulos
george veropoulos hace alrededor de 22 horas
function [Is] = currentMAS()
% Load parameters
[~, N, Nc, a, ra, k0, Z0, ~] = parameter();
% Preallocate arrays for observation and source points
xc = ra * cos(2*pi*(0:N-1)/N);
yc = ra * sin(2*pi*(0:N-1)/N);
xa =a * cos(2*pi*(0:Nc-1)/Nc);
ya =a * sin(2*pi*(0:Nc-1)/Nc);
% Initialize the Green's function matrix WI
WI = zeros(N, Nc);
% Compute WI matrix without meshgrid
for i = 1:N
for j = 1:Nc
% Compute the distance between observation point i and source point j
R = sqrt((xa(i) - xc(j))^2 + (ya(i) - yc(j))^2);
% Fill the Green's function matrix
WI(i, j) = (1/4) * k0 * Z0 * besselh(0, 2, k0 * R);
end
end
% Compute the source field at each observation point
Source = zeros(N, 1);
for i = 1:N
Source(i) = E_in_z(xc(i), yc(i));
end
% Solve the system of equations to find the current
Is = linsolve(WI, Source);
end
george veropoulos
george veropoulos hace alrededor de 22 horas
the sum Einc(xs,ys)+Escat(xs,ys)=0 overt the cylinder surface must be equal to zero xs=ra*co(phi) ys=ra*sin(phi) ra is the radius of cylinder the Einc is the incoming EM field and Escat is the scattering EM field

Iniciar sesión para comentar.

Categorías

Más información sobre Interpolation of 2-D Selections in 3-D Grids en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by