How can i find parameter in loops according to calculation result ?

2 次查看(过去 30 天)
Here is my code
syms E Eg V g;
z=[ ];
y=[ ];
c=3 .*(10.^8);
h=4.1361e-015;
k=8.62E-5;
Tc=300;
for Ei=0.5:.05:0.6
z=[ ];
for Eg=1.4:0.01:1.75;
Ec=Eg-Ei;
a = quad( @(E)(E.^2) ./ (exp(E./0.5172)-1), Eg , 100);
aa= quad( @(E)(E.^2) ./ (exp(E./0.5172)-1), Ec , Eg);
for Ucv=Eg-.2:.005:Eg-.01;
b = quad(@(E)(E.^2) ./ (exp(( E-Ucv )./0.0259)-1),Eg,100);
for Uiv=Ei-.1:.005:Ei-.01;
Uci=Ucv-Uiv;
Pin=(2.*pi().^5.*(k.*6000).^4)./(15.*h.^3.*c.^2) ; % SQ_model;
bb= quad(@(E)(E.^2) ./ (exp(( E-Uci )./0.0259)-1),Ec,Eg);
if abs(quad( @(E)(E.^2) ./ (exp(E./0.5172)-1), Ei , Ec)- quad(@(E)(E.^2) ./ (exp(( E-Uiv )./0.0259)-1),Ei,Ec)-...
aa+bb) <= 10^-4
P = ( 2.*pi().*Ucv./6.3682e-027 ) .* ( a + aa - b - bb ) ./ Pin ;
z = [z P]
m = max(z)
end
end
end
end
y=[y m]
end
result is
y =
0.6025 0.6137 0.6241
I want to get Ei,Eg,Ucv and Uiv which parameter in loops calculate result y is 0.6137 .
thank you :)

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by