Finding the resultant of 3 perpendicular complex vectors

조회 수: 4 (최근 30일)
Biplob
Biplob 2023년 6월 23일
댓글: Biplob 2023년 6월 26일
Hi,
I want to find the resultant vector of 3 perpendicular complex vectors in x-, y-, and z-direction.
Please see the code below:
MATLAB CODE:
%% Define parameters
N = 8;
r = 0.075;
l = 2;
%% Feed Locations OR Element Position
for n = 1: N
pos(n,:) = [r*cos(2*pi*(n-1)/N) r*sin(2*pi*(n-1)/N) 0];
end
%% Phase Shift assigned on each element (depends on l)
phs_element = NaN(N,1);
for n = 1 : N
phs_element(n,:) = (2*pi*n*l/N)*(180/pi);
end
%% Define array
arr = conformalArray;
dip = dipole;
dip.Length = 0.058709;
dip.Width = 0.0012491;
arr.Element = dip;
arr.ElementPosition = pos;
arr.PhaseShift = phs_element;
%% Calculate Fields on x-y plane
x = [0.5:0.5:1];
y = [0.5:0.5:1];
[X,Y] = meshgrid(x,y);
p = [X(:)';Y(:)';1*ones(1,prod(size(X)))];
[E,H] = EHfields(arr,2.4e9,p);
p
p = 3×4
0.5000 0.5000 1.0000 1.0000 0.5000 1.0000 0.5000 1.0000 1.0000 1.0000 1.0000 1.0000
E
E =
-0.4004 + 0.0972i -0.1881 + 0.2145i 0.2803 + 0.4538i -0.3156 + 0.2068i -0.3306 + 0.0795i -0.3316 + 0.3810i 0.1221 + 0.2002i -0.2966 + 0.1952i 0.3819 - 0.0301i 0.4552 - 0.4620i -0.3063 - 0.5734i 0.6283 - 0.3766i
The E field vector is a 3x4 matrix, where 1st column of E represents the x-, y-, and z- component respectively at position given by the 1st column of the "p" matrix.(NOTE: The column of matrix "p" represent the x-, y-, and z- coordinates)
How do I find the resultant of E field at those points on p?
Thank You.
Biplob Biswas
Research Scholar

채택된 답변

Aakash
Aakash 2023년 6월 23일
To calculate the magnitude of the resultant E field at each point in p, sum up the components and divide by magnitude at each point.
You can try the code below:
E_mag = vecnorm(E); % Calculates the magnitude of each E field vector
E_res = sum(E)./E_mag; % Sums up the x-, y-, and z- components and divides by the magnitude

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Inertias and Loads에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by