I have a T1 equation from which I got two noisy datasets, one for y=0 (datax) and the other for x=0 (datay) (t is always equal to 1):
Dif = 0.00000013; K0 = 0.5; z = 0; linf\[Alpha] = 0.0;
T1[x_, y_, t_, b_, l_, d_, m_, Intens_] /;
NumberQ[x] && NumberQ[y] && NumberQ[b] && NumberQ[l] && NumberQ[d] &&
NumberQ[m] && NumberQ[Intens] :=
Intens/(2*\[Pi]*K0)*
NIntegrate[
Sqrt[1 + m^2]*
Erfc[Sqrt[(x - \[Alpha])^2 + (y - \[Beta])^2 + (z - (m*\[Alpha] -
d))^2]/Sqrt[
Dif*4*t]]/(Sqrt[(x - \[Alpha])^2 + (y - \[Beta])^2 + (z - (m*\
\[Alpha] - d))^2]), {\[Beta], -b/2, b/2}, {\[Alpha], linf\[Alpha],
l*(1/(1 + m^2))}]
Block[{y = 0, t = 1, b = 0.001, l = 0.001, d = 0.0001,
m = -Tan[45*Pi/180], Intens = 25000},
datax = Table[{x,
T1[x, y, t, b, l, d, m, Intens] +
Random[NormalDistribution[0, 0.1]]}, {x, -0.002, 0.002,
0.000015}]];
Block[{x = 0, t = 1, b = 0.001, l = 0.001, d = 0.0001,
m = -Tan[45*Pi/180], Intens = 25000},
datay = Table[{y,
T1[x, y, t, b, l, d, m, Intens] +
Random[NormalDistribution[0, 0.1]]}, {y, -0.002, 0.002,
0.000015}]];
My goal is to find the best fit parameters for both datasets. The parameters are {b,l,d,m,Intens}, and must be the same for the fit of datax and datay. The free variables instead are {x,y}. (t=1)
The main problem is that FindFit has to look for the same optimal values of the parameters {b,l,d,m,Intens} passing from T1 with y=0 for datax, to T1 with x=0 for datay. It would also be useful not to impose initial search values for the parameters, as I should not know them. Always if this is possible
The fit, for example, only for datax is of this type and it works:
fitx = FindFit[datax,
T1[x, 0, 1, b, l, d, m,
Intens], {{b, 0.0015}, {l, 0.0015}, {d, 0.00015}, {m, -1}, {Intens,
20000}}, x, Method -> "LevenbergMarquardt"]
{b -> 0.00120948, l -> 0.000999963, d -> 0.000084307, m -> -1.00055,
Intens -> 22038.8}
Can anyone suggest me a way to solve my problem?
{{x, y, T1}..}
(where either the x or y column is 0) and then specify the fit function asT1[x, y, 1, b, l, d, m, Intens]
. Then you can specify thatx
andy
are independent variables and the rest as fit parameters. $\endgroup$ – Sjoerd Smit Jan 29 '20 at 12:23