Constrained curve fitting with the parameters bound in a specific domain

3 visualizaciones (últimos 30 días)
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?

Respuestas (1)

Star Strider
Star Strider el 13 de Jul. de 2014
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.

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by