Clear Filters
Clear Filters

hello, I am trying to evaluate a summation series from n=1:1:400. The expression inside the summation needs to be evaluated for various inputs L=0.5:0.1:3 and alpha=0:0.1:1. can any one help?thank you.

1 view (last 30 days)
the summation is (sum of all terms from n=1 to n=4000): q_loss(L,alpha)=-2∑Real((Q_n/2.π.n.j)*(1- .e^(2.π.n.j.alpha)) in which Q-n is given by: Q_n=(P_H (1-e^(-2.j.π.n.alpha) )+P_L (e^(-2.j.π.n.alpha)-e^(-2.j.π.n) ))/(2.π.n.j(j.Z_o.Zi.tan(w.L.zi/c)+R_v )). I would be grateful for any help. Thank you

Accepted Answer

Abraham Boayue
Abraham Boayue on 14 Mar 2018
clear varianles;
close all;
n = 1:400;
L = 0.5:0.04:3;
alpha = 0:0.04:1;
N = length(n);
M = length(L);
C = length(alpha);
% Define constants (Just my test values)
w = 0.45;
c = 2.8;
Rv = 3.5;
Zo = 2;
Zi = 4;
Ph = 4.5;
Pl = 6.3;
[alpha,L] = meshgrid(alpha,L);
Q = zeros(M,C);
% code seem to be wirking well,but since
% I have no idea what your function represents,
% I dont know what to expect. check it yourself
% and see. I may have defined some variables
% wrongly, varify the equations for the qs.
for i = 1:N
phi = i*2*pi*n(i);
q1 = Ph*(1-exp(-phi*alpha));
q2 = Pl*(exp(-phi*alpha)-exp(-phi));
q3 = phi*(i*Zo*Zi*tan(w*Zi*L)/c)+Rv;
Qn = (q1+q2)./q3;
qn = 1-exp(-phi*alpha);
Q = Q + real(Qn.*qn/phi);
end
figure(1)
surf(alpha,L,Q)
figure(2)
plot(Q,'linewidth',2)
grid
a = title('qloss(alpha,L)');
set(a,'fontsize',14);
a = ylabel('q');
set(a,'Fontsize',14);
a = xlabel('alpha,L');
set(a,'Fontsize',14);

More Answers (0)

Categories

Find more on Programming 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!