Fitting data to integral function

조회 수: 2 (최근 30일)
Sergio Quesada
Sergio Quesada 2018년 6월 4일
댓글: Sergio Quesada 2018년 6월 4일
Hi everybody. I'm trying to fit an essemble of data ("r" as x and "texp" as y) by a function defined by an integral:
FC*integral(@(x)exp(-a./x.*log(x)),1,texp)
, were both "FC" and "a" are the parameters to fit, while "texp" are the upper integration limits, which must be equal to the "y" parameters at each point.
Thank you so much !
  댓글 수: 2
Torsten
Torsten 2018년 6월 4일
So you have data (xi,yi) that should be representable by
(texp(i),FC*integral(@(x)exp(-a./x.*log(x)),1,texp(i)))
?
Walter Roberson
Walter Roberson 2018년 6월 4일
What should the expression equal?? Is it
texp = FC*integral(@(x)exp(-a./x.*log(x)),1,texp)
?
Where is your independent variable?

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

답변 (2개)

Sergio Quesada
Sergio Quesada 2018년 6월 4일
Exactly, i hace a collection of data (xi,yi) called (r,texp), and the fitting equation must be
texp(r)=FC*integral(@(x)exp(-a./x.*log(x)),1,texp)
thanks!
  댓글 수: 1
Walter Roberson
Walter Roberson 2018년 6월 4일
Where is your independent variable appearing in the model? Is texp(r) intended to convey "the texp that corresponds to r", or is texp somehow intended to be both a function to be applied to r on the left side, but a particular numeric value on the right hand side where it is acting as the upper bounds of the integral ?
Or is texp(r) intended to be multiplication, as in
texp(K) * r(K) == FC * integral(@(x)exp(-a./x.*log(x), 1, texp(K))
and thus
texp(K) == FC / r(K) * integral(@(x)exp(-a./x.*log(x), 1, texp(K))

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


Sergio Quesada
Sergio Quesada 2018년 6월 4일
편집: Sergio Quesada 2018년 6월 4일
"texp" is my independent variable.
I have a collection of (r,texp) data. I have evaluated
FC*integral(@(x) -a./(x*log(x)),1,texp)
for each texp as upper integration limit with arbitrary values of "a" and "FC". Now i need to find the values of " a" and "FC" that best fits the experimental data
  댓글 수: 12
Walter Roberson
Walter Roberson 2018년 6월 4일
fun = @(FCa, r) arrayfun(@(R) FCa(1) * integral(@(x) exp(-FCa(2)./(x.*log(x))), 1, R), r);
FCa = lsqcurvefit(fun, x0, r, texp);
FC = FCa(1); a = FCa(2);
Sergio Quesada
Sergio Quesada 2018년 6월 4일
success! i am so grateful Walter! This works thanks to people like you!
best regards

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

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by