Guest User

Untitled

a guest
Dec 1st, 2017
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. In[171]:= Needs["ErrorBarPlots`"];
  2.  
  3. data = Import[
  4. "C:\\Users\\User\\Documents\\DELETE\\Coil_DataWU.csv", "CSV"];
  5. data = data /. s_String :> ToExpression[s]
  6.  
  7. values = ImportString["0 0.37 0.04444 0.002
  8. 0.014 0.36 0.04432 0.002
  9. 0.023 0.35 0.0442 0.002
  10. 0.031 0.32 0.04384 0.002
  11. 0.0343 0.3 0.0436 0.002
  12. 0.0395 0.28 0.04336 0.002
  13. 0.0436 0.27 0.04324 0.002
  14. 0.0469 0.25 0.043 0.002
  15. 0.0501 0.24 0.04288 0.002
  16. 0.0549 0.21 0.04252 0.002
  17. 0.0599 0.19 0.04228 0.002
  18. 0.0667 0.14 0.04168 0.002
  19. 0.0735 0.12 0.04144 0.002
  20. 0.0808 0.11 0.04132 0.002
  21. 0.086 0.09 0.04108 0.002
  22. 0.0912 0.08 0.04096 0.002
  23. 0.097 0.06 0.04072 0.002
  24. 0.1041 0.05 0.0406 0.002
  25. 0.1123 0.04 0.04048 0.002
  26. 0.1203 0.03 0.04036 0.002
  27. 0.1289 0.03 0.04036 0.002
  28. 0.1365 0.02 0.04024 0.002
  29. 0.1408 0.01 0.04012 0.002
  30. 0.156 0.0048 0.0004576 0.002
  31. 0.1625 0.0038 0.0004456 0.002
  32. 0.1716 0.0031 0.0004372 0.002
  33. 0.1783 0.0024 0.0004288 0.002
  34. 0.1878 0.0018 0.0004216 0.002
  35. 0.1975 0.0015 0.000418 0.002
  36. 0.2052 0.0013 0.0004156 0.002
  37. 0.2104 0.0011 0.0004132 0.002
  38. 0.2183 0.0009 0.0004108 0.002
  39. 0.2262 0.0007 0.0004084 0.002
  40. 0.2336 0.0006 0.0004072 0.002
  41. 0.2412 0.0005 0.000406 0.002
  42. 0.2479 0.0004 0.0004048 0.002
  43. 0.254 0.0004 0.0004048 0.002
  44. 0.261 0.0003 0.0004036 0.002
  45. 0.2659 0.0003 0.0004036 0.002
  46. 0.2709 0.0003 0.0004036 0.002
  47. 0.2776 0.0002 0.0004024 0.002
  48. 0.2812 0.0002 0.0004024 0.002
  49. 0.295 0.0002 0.0004024 0.002
  50. 0.3015 0.0001 0.0004012 0.002
  51. 0.3073 0.0001 0.0004012 0.002
  52. 0.3125 0.0001 0.0004012 0.002
  53. 0.3185 0.0001 0.0004012 0.002
  54. 0.3229 0.0001 0.0004012 0.002
  55. 0.3322 0.0001 0.0004012 0.002
  56. 0.341 0 0.0004 0.002"];
  57. mu = 4 e - 7*Pi;
  58. Radius = 0.149;
  59. radius = 0.0582;
  60. frequency = 8313;
  61. field [r_?NumericQ, x_?NumericQ, mu_?NumericQ, Radius_?NumericQ,
  62. frequency_?NumericQ] :=
  63. mu*frequency*
  64. Sqrt[2]/(2*Pi*
  65. Sqrt[x^2 + (Radius + r)^2])*((Radius^2 - x^2 -
  66. r^2)/(x^2 + (r - Radius)^2)*
  67. EllipticE[Sqrt[4*r*Radius*(x^2 + (Radius + r)^2)^(-1)]] +
  68. EllipticK[Sqrt[4*r*Radius*(x^2 + (Radius + r)^2)^(-1)]]);
  69. solution =
  70. FindFit[data,
  71. 2*i*Pi*Integrate[{field[r, x, mu, Radius, frequency]}, {r, 0,
  72. radius}], {{i, .7}}, x];
  73.  
  74. Out[173]= {{0, 0.37}, {0.014, 0.36}, {0.023, 0.35}, {0.031,
  75. 0.32}, {0.0343, 0.3}, {0.0395, 0.28}, {0.0436, 0.27}, {0.0469,
  76. 0.25}, {0.0501, 0.24}, {0.0549, 0.21}, {0.0599, 0.19}, {0.0667,
  77. 0.14}, {0.0735, 0.12}, {0.0808, 0.11}, {0.086, 0.09}, {0.0912,
  78. 0.08}, {0.097, 0.06}, {0.1041, 0.05}, {0.1123, 0.04}, {0.1203,
  79. 0.03}, {0.1289, 0.03}, {0.1365, 0.02}, {0.1408, 0.01}, {0.156,
  80. 0.0048}, {0.1625, 0.0038}, {0.1716, 0.0031}, {0.1783,
  81. 0.0024}, {0.1878, 0.0018}, {0.1975, 0.0015}, {0.2052,
  82. 0.0013}, {0.2104, 0.0011}, {0.2183, 0.0009}, {0.2262,
  83. 0.0007}, {0.2336, 0.0006}, {0.2412, 0.0005}, {0.2479,
  84. 0.0004}, {0.254, 0.0004}, {0.261, 0.0003}, {0.2659,
  85. 0.0003}, {0.2709, 0.0003}, {0.2776, 0.0002}, {0.2812,
  86. 0.0002}, {0.295, 0.0002}, {0.3015, 0.0001}, {0.3073,
  87. 0.0001}, {0.3125, 0.0001}, {0.3185, 0.0001}, {0.3229,
  88. 0.0001}, {0.3322, 0.0001}, {0.341, 0}}
  89.  
  90. During evaluation of In[171]:= FindFit::fitm: Unable to solve for the fit parameters; the design matrix is nonrectangular, non-numerical, or could not be inverted.
  91.  
  92. During evaluation of In[171]:= FindFit::fitm: Unable to solve for the fit parameters; the design matrix is nonrectangular, non-numerical, or could not be inverted.
RAW Paste Data Copied