How to plot Temperature vs Efficiency curve using For loop and Linspace?

4 ビュー (過去 30 日間)
Sriparna Barui
Sriparna Barui 2022 年 6 月 2 日
コメント済み: Fabio Freschi 2022 年 6 月 3 日
I have written a code for a basic structure of solar cell. I need to plot Temperature vs Efficiency curve. But I am a little confused of how to plot Temperature vs Efficiency curve using For loop and linspace. Providing a snippet of my code below:
K=1.38*10^-23; % Boltezman Constant
T=300; %Temperature
q=1.6*10^(-19); %electron charge
R_s=2;
R_sh=100;
m=R_sh/(R_s+R_sh);
I_l=30*10^-3*156*156;
I_0=10^(-15)*156*156;
b=I_l-I_0;
a=linspace(0,b);
I=b-a;
I_sc=I_l-I_0;
x=I_l-I;
y=x/I_0;
V=((K*T)/q)*log(y);
V_0=m*V;
P=V_0.*I;
V_OC=(K*T/q)*log(I_l/I_0);
P1=V_OC*I_sc;
M=max(P);
ff=M/P1; %Formfactor
Eff=(P1*ff/2333.6)*100;
plot(V_0,I);
hold on
plot(V_0,P);

採用された回答

Fabio Freschi
Fabio Freschi 2022 年 6 月 2 日
I have commented your plots to avoid moltiple figures
% numebr of temperatures
nT = 100;
% temperature vector
T = linspace(273,318,nT).';
% preallocate efficiency vector
Eff = zeros(nT,1);
for i = 1:length(T)
K=1.38*10^-23; % Boltezman Constant
% T=300; %Temperature
q=1.6*10^(-19); %electron charge
R_s=2;
R_sh=100;
m=R_sh/(R_s+R_sh);
I_l=30*10^-3*156*156;
I_0=10^(-15)*156*156;
b=I_l-I_0;
a=linspace(0,b);
I=b-a;
I_sc=I_l-I_0;
x=I_l-I;
y=x/I_0;
V=((K*T(i))/q)*log(y);
V_0=m*V;
P=V_0.*I;
V_OC=(K*T(i)/q)*log(I_l/I_0);
P1=V_OC*I_sc;
M=max(P);
ff=M/P1; %Formfactor
Eff(i)=(P1*ff/2333.6)*100;
%plot(V_0,I);
hold on
%plot(V_0,P);
end
figure,plot(T,Eff);

その他の回答 (2 件)

Sriparna Barui
Sriparna Barui 2022 年 6 月 3 日
And how do I vary this temperature with V_OC and Isc?
  1 件のコメント
Fabio Freschi
Fabio Freschi 2022 年 6 月 3 日
This depends on a thermal model that you have to implement

サインインしてコメントする。


Sriparna Barui
Sriparna Barui 2022 年 6 月 3 日
Actually the project is based on simulation only. So I need to find out how these parameters vary with temperature. I am new to Matlab so I have almost clueless in this.
  1 件のコメント
Fabio Freschi
Fabio Freschi 2022 年 6 月 3 日
The calculation of the dependance of the temperature on Voc and Isc is not a question related to matlab. You must find out the set of equations that link these quantities

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSolar Power についてさらに検索

製品


リリース

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by