我有一组参数,我希望通过函数 lsqnonlin 将它们作为非线性优化的结果返回。该代码用于反问题,其根据金属条的位移给出一组ThermoMechanical参数。问题是,优化返回给我一个近似值或几乎与起点(X0)相同。当它应该使结果与变量的结果相等或近似时。为此,我尝试了输入参数'options',试图改变MaxIter,MaxFunEval和函数容差的数量。作为该程序的结果,它的alxays给出了相同的anszer:“优化已完成,因为渐变的大小小于 最优容差的默认值。“我该怎么做才能改进优化?感谢您的帮助。 tf = 20; t = 0时:0.1:TF;
Texcel = xlsread ('Classeur(19_04).xls',1,'L2:L202');
ResSpline = spline (t,Texcel);
plot(t,ppval(mkpp(ResSpline.breaks,ResSpline.coefs),t));
ParamThermMec; %Thermo-mechanical parameters defined by the array X0=[coeff_dilat G Cp lanbda Rho]
nu = 0.3; %Poisson's coefficient
Ucomsol = xlsread ('Classeur(19_04).xls',2,'L2:L202'); %displacement from Classeur(19_04).xls
figure (1)
hold on
yyaxis left
plot (t,Ucomsol)
yyaxis right
plot (t,Texcel)
xlim([0 20])
fun = @(X)(deplacement_lsq(0,ResSpline,X)-Ucomsol); %function to minimize
[temps,Umatlab_bauzin] = DeplacementSpline(0,ResSpline,1);
plot(t,Umatlab_bauzin,'b',t,Ucomsol,'g');
X0 = X/2; %initial value or starting point
options.TolFun=0.0000000000000000000000000000000000000001;
[ParametresTM,resnorm,residual,exitflag,output]=lsqnonlin(fun,X0,[0 0 0 0 0],[10 999999999999 2500 500 4000],options); %nonlinear minimisation
DiffXP=X-ParametresTM;
EX=[DiffXP(1)/X(1) DiffXP(2)/X(2) DiffXP(3)/X(3) DiffXP(4)/X(4) DiffXP(5)/X(5)]*100; %Percentage difference