Fit theoretical x-y data set to experimental data set
9 ビュー (過去 30 日間)
古いコメントを表示
I have a function to model the force-displacement relation between an interface and a probe. The function outputs two data sets (the probe movement and corresponding force) based on three inputs. I have experimental data and essentially want to find what value for the inputs results in the closest fit according to my model. The problem looks like this,
function [f,d] = myFunc(x)
where, f and d are arrays of data points that I want to fit as closely as possible to the experimental data i have, [f_exp, d_exp].
The crux of the problem to me is I am not sure how to constrain my outputs in order to data mine the inputs. I have so far been trying to use the genetic algorithm function in the optimisation tool box but am not sure if this is the correct approach.
Thanks for any help.
Cheers,
Will
4 件のコメント
Image Analyst
2019 年 7 月 6 日
Will, where are the screenshots? Where did you attach the data? Why not make it easy for people to answer you, not hard?
If you want it to fit your experimental data perfectly, then use spline interpolation. If you want a regression, then there are several ways but you might have to pick a model equation (which we have no guesses at since you didn't attach a screenshot).
回答 (1 件)
Star Strider
2019 年 7 月 6 日
編集済み: Star Strider
2019 年 7 月 8 日
I have no idea what your actual function is, or what you are doing.
I would do something like this:
function fd = myFunc(x)
fd(:,1) = ...; % Approximate ‘f_exp’
fd(:,2) = ...; % Approximate ‘d_exp’
end
fitnessfcn = @(x) norm([f_exp(:), d_exp(:)] - myFunc(x));
Ideally, if you are fitting data, ‘myFunc’ should be a function of your independent variable and the parameter vector. I have no idea how ‘f_exp’ relates to ‘d_exp’, or to your parameters, so this is illustrative only.
EDIT —
Since you’re fitting differential equations to data, see:
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!