Clear Filters
Clear Filters

Finding the resultant of 3 perpendicular complex vectors

2 views (last 30 days)
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

Accepted Answer

Aakash
Aakash on 23 Jun 2023
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

More Answers (0)

Categories

Find more on Antennas and Electromagnetic Propagation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!