Guest User

Untitled

a guest
Dec 1st, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. Needs["ErrorBarPlots`"];
  2.  
  3. data = Import["C:\\Users\\User\\Documents\\DELETE\\Coil_DataWU.csv",
  4. "CSV"];
  5.  
  6. values = ImportString["0 0.37 0.04444 0.002
  7. 0.014 0.36 0.04432 0.002
  8. 0.341 0 0.0004 0.002"];
  9. mu = 4 e - 7*pi;
  10. Radius = 0.149;
  11. radius = 0.0582;
  12. frequency = 8313;
  13. k = Sqrt (4*r*Radius*(x^2 + (Radius + r)^2)^(-1));
  14. field = mu*frequency*
  15. sqrt (2)/(2*pi*
  16. Sqrt (x^2 + (Radius + r)^2))*((Radius^2 - x^2 -
  17. r^2)/(d^2 + (r - Radius)^2)*EllipticE (k) + EllipticK (k));
  18. solution =
  19. FindFit[data, (2*i*pi*NIntegrate[{field}, {r, 0, radius}]), {i}, x,
  20. Method -> NMinimize, NormFunction -> (Norm[#, Infinity] &)];
  21. Show[
  22. ErrorListPlot[{{#1, #2}, ErrorBarPlots`ErrorBar @@ {#3, #4}} & @@@
  23. values, PlotRangePadding -> {Scaled[0.15], Automatic}],
  24. Plot[Evaluate[func[i, x] /. solution], {x, 0, 0.5},
  25. PlotStyle -> Black]
  26. ]
Add Comment
Please, Sign In to add comment