Constrained curve fitting with the parameters bound in a specific domain

3 ビュー (過去 30 日間)
dEEPAK MAT
dEEPAK MAT 2014 年 7 月 13 日
回答済み: Star Strider 2014 年 7 月 13 日
I want to fit a set of data to a damped tri exponential function.I can do the same using CFtool but i want to put some the parameters of the triexponential function namely a1,a2,t1,t2and t3 to be bounded with a given defined range for each.I am not sure if it can be done by Optimiziation toolbox.
f(x) = a1*exp(-t/t1)*cos(w*t)+ a2*exp(-t/t2)+(1-a1-a2)*exp(-t/t3)
Any Suggestion?

回答 (1 件)

Star Strider
Star Strider 2014 年 7 月 13 日
Whether it can be done depends more on your model, your data, and your constraints than on the lsqcurvefit function, which is the one most suited to your problem. Choosing the most appropriate initial parameter estimates is also extremely important.
I would use this objective function to fit your data:
% Argument: Matrix ‘tw’ of [t w] (assuming t, w are both COLUMN vectors)
% Parameters: b(1) = a1; b(2) = a2; b(3) = t1; b(4) = t2; b(5) = t3
% Original function:
% f(x) = a1*exp(-t/t1)*cos(w*t)+ a2*exp(-t/t2)+(1-a1-a2)*exp(-t/t3)
f = @(b,tw) b(1).*exp(-tw(:,1)./b(3)).*cos(tw(:,1).*tw(:,2)) + b(2).*exp(-tw(:,1)./b(4)) + (1-b(1)-b(2)).*exp(-tw(:,1)./b(5));
I did my best to be certain it matches your original function. You should proofread it to be sure. Note also that there have to be equal numbers of ‘t’ and ‘w’ data in order to form the ‘[t w]’ matrix.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by