What are the signs that my parameter estimator is on the right track before convergence?

3 次查看(过去 30 天)
I am doing parameter estimation using parameter estimator app
and the optimization is taking hours
but i have noticed as shown in photo attached that EXP (Minimize ) is not converging and Shows NAN , and i gues this is a bad sign
So How to evaluate parameter estimator performance mid-optimization?
  7 个评论
YASSER
YASSER 2025-5-13
And why do you get NaN for experimental data ? Do the data you want to fit contain NaN values ?
-------------------------------------------------------------------
Dear Torsten : the Exp (Minimize) your asking about is the name Experiment (see photo)
because when openning the paramter estimator app you name your eperiment using your data and parameters to be estimated
The data is numbers for sure
I guess the problem is more deep and it depends on something like optimization or configuration
To conclude : i have tried the same experiment but with same reduced data and i havent face this issue

请先登录,再进行评论。

回答(1 个)

Sam Chak
Sam Chak 2025-5-13
编辑:Sam Chak 2025-5-13
In MATLAB, a 'NaN' result is primarily produced when there are indeterminate operations, such as Inf/Inf or 0/0. A secondary occurrence of NaN can result from operations involving NaN, such as 2*NaN or NaN^2. However, even if the data contain 'NaN', we can still plot the data. See the demo below.
Since you are certain that the data contains only numerical values, the third explanation for this occurrence is that extracting measured data from a spreadsheet with unmatched dimensions can also lead to 'NaN', specifically if empty cells are present. The time data comes from internal clock, and the measured data comes from the sensor.
If you have studied instrumentation and control before, you will know that 'no data' can sometimes happen due to malfunctioning sensors, momentary power outages, during hotline maintenance, or human error in data management. Typically, the device should indicate 'no data' at this timestamp.
Data in 'Book1' spreadsheet
Data loaded onto MATLAB
Plotting the data contain 'NaN'.
% time data
t = linspace(0, 4000, 4001);
% artificially inject a NaN at a specific indexed location
t(2001) = NaN;
% output data
y = 2300*exp(- ((t - 2000)/800).^2);
disp('Output y(t) at time, t = 2000'), disp(y(2001))
Output y(t) at time, t = 2000 NaN
% plot
plot(t, y), grid on
ylim([0, 2500])
xlabel('Time (seconds)'), ylabel('Amplitude')
  9 个评论
Torsten
Torsten 2025-5-14
编辑:Torsten 2025-5-14
Getting NaN values in the course of your computation can have many reasons. Maybe your Simulink model gives back model values that are NaN for the parameters supplied by the fitting program. Or the fitting program itself approaches a set of NaN parameters.
I have no experience about coupling Simulink and normal MATLAB, but I guess that there should be a way to survey the parameter values and the model values during the optimization process.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Parameter Estimation 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by