Problem in boundary condition
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (2)
george veropoulos
am 4 Jan. 2025
Bearbeitet: george veropoulos
am 4 Jan. 2025
0 Stimmen
3 Kommentare
Mr. Pavl M.
am 4 Jan. 2025
Bearbeitet: Mr. Pavl M.
am 7 Jan. 2025
Would mind to keep and keep on going objectives, objections, - real, legitimate, good job.
- For you to study and understand better the theory behind the fields, current and EM distributions around and inside natural figures... +
- Where was abs(Etotl) very small? In my answer Es_surf =sumEs_surf is not very small, min = 0, max = 2, see plot Berror vs phi.Where to trans-script/transform the double for loop to loopless matrix based operations, maybe can do. Can you click on my the an answer accepted?
- I don't know many distributions. Let who others else skillfull to solve it let's see..
For 2D or 3D field plot?
What is other, there, is it so simple? Here it is not rudimentary. Gamble not. Bet not of course. Kindly see the recent my update to the answer here - magnitude improved, not small contribution. Is it elementry there? On it quiver built-in command execution will be better than on my so far answer of course. (so far the quiver results of the filed of course yet are very not satisfiable.)
So far in code there were xs, ys, xx, yy. What are the xa, xc, ya, yc? - Found, clarified.
george veropoulos
am 4 Jan. 2025
Bearbeitet: Walter Roberson
am 5 Jan. 2025
george veropoulos
am 4 Jan. 2025
george veropoulos
am 7 Jan. 2025
0 Stimmen
Kategorien
Mehr zu Variables finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!













