Fit model to experimental data

조회 수: 13 (최근 30일)
Stephane Roche
Stephane Roche 2017년 7월 3일
댓글: Torsten 2017년 7월 4일
Hi,
I have experimental data as X is a vector of angles and Y is the resisting moment. So for experiments I have a serie of coordinates X_exp,Y_exp.
I have a model which is theoritically described by a serie of nested formulas. I cannot really write a formula in a short and easy way and directly introduce in a matlab fit function.
As output of may model I have X_mod as a vector of angles and Y_mod as a vector of resisting moments. If necessary, I can produce vector size of model indentically to experimental vectors.
I have four parameters of my model that I would like to optimize simultenaously and minimize to 5% error the distance between the experiment data points and the model points.
I use nested loops to do that but it's not efficient and I have to choose an order for my parameters.
Do you have a solution which like a fit could propose the best compromise of the four parameters which are part of a complex model ?
Kind regards.
Steph.

답변 (2개)

John D'Errico
John D'Errico 2017년 7월 3일
편집: John D'Errico 2017년 7월 3일
"which like a fit"? This IS a curve fit.
Just use a curve fitting tool. So the curve fitting toolbox, or nlinfit, lsqnonlin, or lsqcurvefit. Just because it takes some effort to write down does not mean you cannot write a function that embodies your model.
This will work as long as the model does not use anything that rounds numbers internally, uses floor, or ceil, or anything like that, or is discontinuous in anyway.

Stephane Roche
Stephane Roche 2017년 7월 3일
Thanks for the quick answer.
I suppose that it's possible but I don't know how to implement when my parameters are embedded in several nested functions.
Do you have any example or link to an example? It could help me a lot and save time.
Steph.
  댓글 수: 1
Torsten
Torsten 2017년 7월 4일
You can define your model in a function instead of writing the model equation in one (short) function handle. This way, the parameters can be used in as many nested functions as necessary.
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by