Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Needs["ErrorBarPlots`"];
- data = Import["C:\\Users\\User\\Documents\\DELETE\\Coil_DataWU.csv",
- "CSV"];
- values = ImportString["0 0.37 0.04444 0.002
- 0.014 0.36 0.04432 0.002
- …
- 0.341 0 0.0004 0.002"];
- mu = 4 e - 7*pi;
- Radius = 0.149;
- radius = 0.0582;
- frequency = 8313;
- k = Sqrt (4*r*Radius*(x^2 + (Radius + r)^2)^(-1));
- field = mu*frequency*
- sqrt (2)/(2*pi*
- Sqrt (x^2 + (Radius + r)^2))*((Radius^2 - x^2 -
- r^2)/(d^2 + (r - Radius)^2)*EllipticE (k) + EllipticK (k));
- solution =
- FindFit[data, (2*i*pi*NIntegrate[{field}, {r, 0, radius}]), {i}, x,
- Method -> NMinimize, NormFunction -> (Norm[#, Infinity] &)];
- Show[
- ErrorListPlot[{{#1, #2}, ErrorBarPlots`ErrorBar @@ {#3, #4}} & @@@
- values, PlotRangePadding -> {Scaled[0.15], Automatic}],
- Plot[Evaluate[func[i, x] /. solution], {x, 0, 0.5},
- PlotStyle -> Black]
- ]
Add Comment
Please, Sign In to add comment