I'm trying to fit formula:
modelx[d1_?NumberQ, dyf1_?NumberQ, f_] := 6.62*10^-21 (NIntegrate[72/d1^3 (u^2/(81 + 9 u^2 - 2 u^4 + u^6))*((u^2 (d1^2/dyf1))/(u^4 + (2*Pi*f*(d1^2/dyf1))^2)) + 288/d1^3 (u^2/(81 + 9 u^2 - 2 u^4 + u^6))*((u^2 (d1^2/dyf1))/(u^4 + (4*Pi*f*(d1^2/dyf1))^2)), {u, 0, \[Infinity]}])
to experimentral data:
data={{19998000, 13.068}, {17123000, 13.62}, {14666000, 14.265},
{12556000,14.887}, {10756000, 15.245}, {9206200, 16.122}, {7883900,
17.043}, {7883900, 16.644}, {6750700, 16.843}, {5781800,
17.551}, {4951600, 17.722}, {4241300, 18.256}, {3631400,
18.826}, {3108000, 19.284}, {2661600, 19.299}, {2278600,
19.923}, {1952000, 20.209}, {1671100, 20.375}, {1431100,
20.604}, {1225500, 21.004}, {1048900, 21.313}, {899510,
21.358}, {769990, 21.644}, {659570, 22.018}, {564850,
22.265}, {483000, 22.34}, {413680, 22.488}, {354450,
22.65}, {303300, 22.701}, {260180, 22.772}, {222610,
22.985}, {190750, 23.041}, {163280, 23.228}, {139720,
23.202}, {119640, 23.453}, {102650, 23.539}, {87900,
23.537}, {75165, 23.584}, {64234, 23.753}, {54904, 23.607}, {47340,
23.842}, {40338, 24.074}, {34484, 23.853}, {29634, 23.833}, {25406,
23.931}, {21739, 23.896}, {18573, 23.842}, {15857, 24.066}, {13725,
24.008}, {11746, 23.97}, {9924.4, 24.282}}
to estimate the values of the parameter d1 and dyf1. For this purpose, I've been trying to use NonlinearModelFit:
nlm = NonlinearModelFit[data, modelx[d1, dyf1, f] , {{d1, 10^-10}, {dyf1, 10^-10}}, f, Method -> "LevenbergMarquardt", MaxIterations -> 300]
The problem: I cannot get a good fit to the experimental data. It's not even close fit - from the parameter table it may be seen, that standard errors of estimated values are grater that the estimates. Also, visually the fit seems to be poor in the log-log scale:
Show[ListLogLogPlot[data], LogLogPlot[nlm[f], {f, 5000, 50000000}]]
I know that the function may be well fitted to experimental data; the "good" values for parameters are:
d1=2.33*10^-10; dyf1=1.08*10^-11;
As you may see, in the nlm formula I used rather nice initial conditions for the fitting procedure, but no luck. Any help appreciated!
Edit
After suggestions (thanks Jim and Michael!) I tried new code to find an impact of factor "6.62*10^-21" on values of d1 and dyf1, that is
model = Integrate[#, {u, 0, \[Infinity]},
Assumptions -> a > 0 && t > 0 && f > 0] & /@
Apart[a*(u^2/(81 + 9 u^2 - 2 u^4 +
u^6))*((u^2 )/(u^4 + (2*Pi*f*(t))^2)) +
4 a (u^2/(81 + 9 u^2 - 2 u^4 +
u^6))*((u^2 )/(u^4 + (4*Pi*f*(t))^2))];
where a==72(6.62*10^-21*b/d1^3) and b==d1^2/dyf1. Now, when I'm trying to run NonlinearModelFit, I get "The function value is not a list of real numbers [...]". Any help appreciated!
modelx
. Did you get such errors/warnings? $\endgroup$