Guest User

Untitled

a guest
May 26th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. nlm = NonlinearModelFit[data,...]
  2.  
  3. Clear[n, m, u, w, bint, beta, g, dg, bb, dbb, gama, dgama, fvc, defvc]
  4. {beta[0.] = 2, beta[Infinity] = 1}
  5.  
  6. beta
  7.  
  8. bint[u_?NumericQ] := If[u != 0,
  9. NIntegrate[BesselJ[0, x] BesselJ[1, x]/(x + x Exp[u
  10. x/2]), {x, 0, Infinity}]]
  11. beta[u_?NumericQ] := x /. FindRoot[(x/Pi) Sin[Pi/x] == 2 bint[u], {x, 1, 0, 2}]
  12.  
  13. efvc
  14.  
  15. bb[n_, m_, u_] := beta[u]^alpha[n, m, u]
  16.  
  17. alpha[n_, m_, u_] := ((n^2 - m^2)/n^(15/8))^CubeRoot[u]
  18.  
  19. gamma[n_, m_, u_] := 2 Exp[(Sqrt[u])/(1 - (m/n)^(3/2))]
  20.  
  21. efvc[n_, m_, u_] /; n == 0 := 0
  22. efvc[n_, m_, u_] /; n == m := -(2/Pi)*Sin[Pi*n]
  23. efvc[n_, m_, u_] := -(((2 bb[n, m, u])/Pi)) (Sin[(Pi*n)/(bb[n, m, u])]) (Cos[(Pi*m)/gamma[n, m, u]])
  24.  
  25. {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.}}
  26.  
  27. In[137]:= data = Import["C:\Users\caioa\Documents\Pasta1.xls"]
  28.  
  29. Out[137]= {{{0.508224, 4.52*10^-7, 0.2}, {0.500808, 7.99*10^-6,
  30. 0.5}, {0.502848, 0.000143831, 1.}, {0.50025, 0.000845692,
  31. 1.5}, {0.504386, 0.000448702, 2.}, {0.512548, 0.000124658,
  32. 2.5}, {0.509866, 0.0000426, 3.}, {0.509804, 0.000045,
  33. 3.5}, {0.511647, 0.000148473, 4.}, {0.50246, 0.000047,
  34. 4.5}, {0.507061, 0.0030538, 5.}, {0.500444, 0.0000483,
  35. 5.5}, {0.506678, 0.0000495, 6.}, {0.501696, 0.000669212,
  36. 6.5}, {0.508953, 0.0000503, 7.}, {0.505067, 0.0000501,
  37. 7.5}, {0.501641, 0.000498973, 8.}, {0.509878, 0.00529143,
  38. 8.5}, {0.507094, 0.0000507, 9.}, {0.504594, 0.00433331,
  39. 9.5}, {0.502338, 0.0000504, 10.}}}
  40.  
  41. In[139]:= NonlinearModelFit[data, (efvc), {A}, {n, m, u}]
  42.  
  43. During evaluation of In[139]:= 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.
Add Comment
Please, Sign In to add comment