I am trying to make a Nonlinear fit of the following efvc
functional, where I want to vary parameters from alpha
and gamma
equations. I kept trying the way I thought it would work, but I always get an the error FindFit::fitd: "First argument in FindFit is not a list or a rectangular array"
.
Clear[n, m, u, w, bint, beta, g, dg, bb, dbb, gama, dgama, fvc, defvc]
{beta[0.] = 2, beta[Infinity] = 1}
{2, 1}
beta
bint[u_?NumericQ] := If[u != 0,
NIntegrate[BesselJ[0, x] BesselJ[1, x]/(x + x Exp[u
x/2]), {x, 0, Infinity}]]
beta[u_?NumericQ] := x /. FindRoot[(x/Pi) Sin[Pi/x] == 2 bint[u], {x, 1, 0, 2}]
efvc
bb[n_, m_, u_] := beta[u]^alpha[n, m, u]
alpha[n_, m_, u_] := ((n^2 - m^2)/n^(A))^CubeRoot[u]
gamma[n_, m_, u_] := 2 Exp[(Sqrt[u])/(1 - (m/n)^(3/2))]
ClearAll[efvc]
efvc[n_, m_, u_] /; n == 0 := 0
efvc[n_, m_, u_] /; n == m := -(2/Pi)*Sin[Pi*n]
efvc[n_, m_,
u_] := -(((2 bb[n, m, u])/Pi)) (Sin[(Pi*n)/(bb[n, m, u])]) (Cos[(Pi*m)/
gamma[n, m, u]])
data = Import["C:\\Users\\caioa\\Documents\\Pasta1.xls"]
{{{0.508224, 4.52*10^-7, 0.2}, {0.500808, 7.99*10^-6, 0.5}, {0.502848,
0.000143831, 1.}, {0.50025, 0.000845692, 1.5}, {0.504386, 0.000448702,
2.}, {0.512548, 0.000124658, 2.5}, {0.509866, 0.0000426, 3.}, {0.509804,
0.000045, 3.5}, {0.511647, 0.000148473, 4.}, {0.50246, 0.000047,
4.5}, {0.507061, 0.0030538, 5.}, {0.500444, 0.0000483, 5.5}, {0.506678,
0.0000495, 6.}, {0.501696, 0.000669212, 6.5}, {0.508953, 0.0000503,
7.}, {0.505067, 0.0000501, 7.5}, {0.501641, 0.000498973, 8.}, {0.509878,
0.00529143, 8.5}, {0.507094, 0.0000507, 9.}, {0.504594, 0.00433331,
9.5}, {0.502338, 0.0000504, 10.}}}
NonlinearModelFit[data, (efvc), {A}, {n, m, u}]
NonlinearModelFit::fitd: First argument {{{0.508224,4.52*10^-7,0.2},{0.500808,7.99*10^-6,0.5},{0.502848,0.000143831,1.},{0.50025,0.000845692,1.5},{0.504386,0.000448702,2.},{0.512548,0.000124658,2.5},<<9>>,{0.505067,0.0000501,7.5},{0.501641,0.000498973,8.},{0.509878,0.00529143,8.5},{0.507094,0.0000507,9.},{0.504594,0.00433331,9.5},{0.502338,0.0000504,10.}}} in NonlinearModelFit is not a list or a rectangular array.
Attachments: