fit with integral function involved

조회 수: 1 (최근 30일)
Daniele Sonaglioni
Daniele Sonaglioni 2021년 3월 3일
Hello everybody,
i have a problem with mi code. I need to fit this function to my experimental data:
where
and
in which E_1,E_2,T^* and T^' are my fitting parameters and T is my abscissa.
I have a subroutine previously written but i have some problem in insterting the T variable in my script.
Below I show the subroutine i have previosly written (the shape of the function is a bit different):
function y = integralfit(b,Tv,R,nu,T0)
% % % MAPPING: b(1) = E1, b(2) = E2, b(3) = Tstar, b(4) = Tdot
for k = 1:numel(Tv)
k3 = @(T) exp(-b(2).*(1./T - 1./b(3))./R);
K = @(T) exp(-b(1).*(1./T - 1./b(4))./R);
y(k) = (b(1)/nu) .* k3(Tv(k)).* K(Tv(k)) .* exp(-(1./nu).*integral(@(T) k3(T).*K(T), T0, Tv(k), 'ArrayValued',1));
end
end
Here i show my attemp to modify the subroutine:
function y = integralfit(b,Tv,R,nu,T0)
for k = 1:numel(Tv)
k3 = @(T) exp(-b(1).*(1./T - 1./b(2))./R);
K = @(T) exp(-b(3).*(1./T - 1./b(4))./R);
y(k) =@(T) ((b(1)*K(Tv(k)))./(K(Tv(k))+1).^2).*(K(Tv(k))./nu+b(1)./(R*T.^2)).* exp(-(1./nu).*integral( (k3.*K)./(1+K), T0, Tv(k), 'ArrayValued',1));
end
end
Do you have any suggestion?
It seems that the the problem is in the definition of y(k).

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by