Fminsearch results shows shift from measured curve. How should I solve this?

2 次查看(过去 30 天)
I am working with several measurement data which I am reading through matlab and then using Fminsearch to estimate through different model equations to fit with the measurement data. But fminsearch is giving a shift from the measured data as shown in picture. Blue one is the measured curve and orange one is the fminsearch estimation. How should I solve this? I am a beginner so would be helpful with some guidance. Thank you.
My sample of fminsearch:
  4 个评论
Amit Das
Amit Das 2023-1-23
Hi the values needed to run the codes can be found in this excel file. Just run and plot should help.
% Read Measurements
[daten, header]=xlsread("your path");
time =daten(:,1);
position = daten(:,2);
torque = daten(:,3);

请先登录,再进行评论。

回答(1 个)

Matt J
Matt J 2023-1-23
编辑:Matt J 2023-1-23
The x_Start=[1,1] selection looks very arbitrary. If one of the parameters is the oscillation amplitude, it should be closer to 0.4.
Other than that, though, there is too little information to diagnose. We would need to see the full code including the FitnessFunction (and as text, not a screenshot).
  1 个评论
Matt J
Matt J 2023-1-23
编辑:Matt J 2023-1-23
I notice that the least squares prediction F can be written as a linear combination of known things.
Q= abs(v) .* z ./ (Fc + (Fs - Fc) * exp(r));
zdot = v - sigma0*Q;
F = sigma0 * (z+zdot.*ts) + sigma1 * z_dot + sigma2.*v; % eq. 3
= sigma0*(z + v) - sigma0^2.*Q.*ts - sigma0*sigma1.*Q + (sigma1+sigma2)*v
= C1*(z + v) - C2.*Q.*ts - C3.*Q + C4*v
So, you can solve for C1 .. C4 by solving a set of linear equations.
Then, from the C coefficients, you can easily solve for sigma0 and sigma1.
Then, you can use that as an initial guess for the original optimization.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by