Borrar filtros
Borrar filtros

lsqcurvefit for global fitting gives bad parameters

2 visualizaciones (últimos 30 días)
Henrik Schädlich
Henrik Schädlich el 30 de Jun. de 2017
Comentada: Alex Sha el 5 de En. de 2023
Hello Dear Matlab-Community,
I am trying to do a Butterworth-Van Dyke (BVD) siumulation. I calculated my startparameters. Common X-values are between 1 and 3000. Common Y-values are between 1E-2 and 1E-4. I want to optimize 4 parameter (R_m, L_m, C_m, C_0) with TypicalX like [1000, 1, 1e-10, 1e-8].
My Programm is:
if true
% clear all;
% close all;
%
% Folder = 'xxx';
% FileName = [Folder 'Daten_Aktor1.xls'];
% fid = fopen(FileName, 'r');
% if fid == -1
% error('Cannot open file %s', FileName);
% end
% Data = xlsread(FileName);
% fclose(fid);
%
% t=Data(:,1) %x-values
% y=Data(:,2) %y-values
%
% %Calculated startparameters
% % R_m = 7120
% % L_m = 26.60811
% % C_m = 5.94902E-10
% % C_0 = 3.762756E-8
%
% %Borders
% lb = [6500,1,5E-11,5E-009]
% ub = [7800,100,5E-09,5E-007]
%
% x0 = [3.762756E-8,7120,26.6,5.94902E-10]
%
% Fun = @(x,xdata) abs(i*2*pi*x(1)*xdata+1./(x(2)+i*(2*pi*x(3)*xdata-1./(2*pi*x(4)*xdata))))
%
% options = optimset('TolX',1e-10,'TolFun',1e-10, 'TypicalX', [1000, 1, 1e-10, 1e-8]);
% x = lsqcurvefit(Fun,x0,t,y,lb,ub,options)
%
% hold all
% plot(t,Fun(x,t),'r', 'LineWidth',2)
% plot(t, y,'k', 'LineWidth',2)
% xlabel('Frequenz [Hz]')
% ylabel('Amplitude [a.u.]')
end
The main problem is, that the Parameter C_0 and C_m are very small. For the algorithm it seems to be not possible to optimize both parameters. For this purpose I did not optimize the value directly. I defined a the value of C_0 and C_m as fix, and changed a percentage of the calculated value, like C_calculated * x(1) = C_optimized. But still, the steptolerance seems to be to tiny. I can not change that. Do you have an idea for me. I am trying to achieve a global fit.
I hope you can help me. Best regards Henrik

Respuestas (1)

Alex Sha
Alex Sha el 5 de Nov. de 2019
Editada: Alex Sha el 5 de Nov. de 2019
Hi, I have just try to solve this complex fitting problem by using another math package, the result is as following, seems to be prefect:
Fun = @(x,xdata) abs(i*2*pi*x(1)*xdata+1./(x(2)+i*(2*pi*x(3)*xdata-1./(2*pi*x(4)*xdata))))
Root of Mean Square Error (RMSE): 1.55596435380165E-6
Sum of Squared Residual: 9.70831053190858E-10
Correlation Coef. (R): 0.999930645831277
R-Square: 0.999861296472554
Adjusted R-Square: 0.999860599469904
Determination Coef. (DC): 0.999861282770118
F-Statistic: 953637.344478172
Parameter Best Estimate
-------------------- -------------
x1 3.80465879533941E-8
x2 8071.77174563029
x3 15.4842218863772
x4 1.0150335453685E-9
  4 comentarios
Eugênio Sabatini
Eugênio Sabatini el 4 de En. de 2023
Hi! Which package did you use to obtain this solution?
Alex Sha
Alex Sha el 5 de En. de 2023
Hi, it's a package named 1stOpt

Iniciar sesión para comentar.

Categorías

Más información sobre Conditional Mean Models 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