plot eff vs F for lucky drift
Show older comments
clc;
W1 = 0.5;
e = 1.6*10^-19;
Ea = 2.3;
Er = 0.04;
Eg = 2;
Ei = 0.55;
F = 0:150;
lambda_el = 0.6;
lambda_ie = 6 * lambda_el;
theta_c = pi/2;
alpha = 0;
for m=0:5000
for ku=0:5000
Ea = (kl*e*F*lambda_el*cos_theta)+(ku*e*F*lambda_el*cos_theta_star)-(m*Er);
cos_theta = (1 + cos(theta_c))/2;
cos_theta_star = (cos(theta_c)-1)/2;
x = ((k*(1-W1))^ku)* exp(-k*(1-W1))/ factorial(ku);
y = ((k*lambda_el/lambda_ie)^m)*exp(-k*lambda_el/lambda_ie)/factorial(m);
k = kl + ku;
l_k = lambda_el*(kl*cos_theta) + (ku*cos_theta_star);
alpha = alpha + ((x*y)/l_k);
end
end
disp("Alpha")
disp(alpha)
d = 10;
eff = exp(d*alpha);
disp("Efficiency")
disp(eff)
disp("F")
disp(F)
disp("kl")
disp(kl)
figure
plot(F,eff)
2 Comments
Jan
on 9 Jul 2022
This is the code. What is your question?
the cyclist
on 9 Jul 2022
The variable kl is not defined before it is used. Is that the problem?
Answers (0)
Categories
Find more on 2-D and 3-D Plots 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!