Nonlinear fit to multiple data sets with shared parameters
1 次查看(过去 30 天)
显示 更早的评论
Hi all, I have eight sets of voltage vs. current data at different temperatures, for example V vs I @20K , V vs I @ 100K. And I want to use this expression to fit all these eight data sets. V=V(I,T;Rs,T0,nf,Is)=I*Rs/(T-T0)+nf*ln(1+I/(Is*(T-T0)) In the expression, V is the depent variable, I and T is the indepent variables, Rs,T0,nf,Is are fitting parameters shared by all eight sets of data. So how can I do the fitting in Matlab?? Thank you all! Your help will be very appreciated !
0 个评论
回答(2 个)
Taniadi
2012-11-9
I think to fit the data set, you can try to use least square method, that is to minimize the error between calculated value and the experimental value. You can use the 'lsqnonlin' or 'fminsearch' command in the optimization toolbox.
0 个评论
Star Strider
2012-11-9
If you want to fit each data set for each temperature independently, this is probably the easiest way:
% Parameters: B(1) = Rs, B(2) = T0, B(3) = nf, B(4) = Is
beta0 = [1E+3; 10; 1; 1E-4].*rand(4,1);
Tv = linspace(20,100,8); % Temperature vector
for k1 = 1:length(Tv)
T = Tv(k1);
Vfcn = @(B,I) I.*B(1)./(T-B(2)) + B(3).*log(1 + I./(B(4).*(T-B(2))));
[Beta,R,J,CovB,MSE] = nlinfit(I, V, Vfcn, beta0);
end
Fitting all T, I and V values at once is possible but a bit more of a challenge.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!