Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how to optimize a parameter using optimization tool?
조회 수: 1 (최근 30일)
이전 댓글 표시
clear,clc
t=25; %temperature (C)
T=t+273; %temperature (K)
i_ph=3.113; %phase current [A]
e_g=1.12; %band gap [eV]
m_1=1.00; %diode factor
e=1.6*10^-(19); %electronvolt [j]
k=1.38*10^-(23); %Boltzmann constant [JK^(-1)]
U=(0:0.001:0.6); %voltage [V]
Ut=(k*T)/e;
ut=0.0257;
% underlying equation
Is = @(c_01) c_01 * T^3 * exp((-e_g*e)/(k*T));
I = @(c_01,U) i_ph - (c_01 * T^3 * exp((-e_g*e)/(k*T))).*((c_01) .* (exp(U./(m_1*Ut))-1));
fh = figure;
ah = axes(fh);
hold(ah,'on');
%plot(ah,U,I(170.8,U),'green', 'Linewidth', 1.5, 'DisplayName','real curve');
%plot(ah,U,I(470.80,U),'red','linewidth', 3, 'DisplayName','guessed curve');
legend show
% start value(s) for optimization
c_01_guess = 470.8;
% choose algorithm, and possibly other options for optimization solver
opt = optimoptions('lsqcurvefit');
opt.Algorithm = 'levenberg-marquardt';
% run optimization
c_01_opt = lsqcurvefit(I,c_01_guess,U,I(170.8,U),[],[],opt);
plot(ah,U,I(c_01_opt,U),'cyan','linewidth', 1.5,'DisplayName','optimization result curve');
axis(ah,[0,0.6,0,3.5]);
xlabel('Voltage');
ylabel('Current');
grid on;
댓글 수: 1
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!