x = Pi/2
y = -0.1
z = 1
data = Table[
With[{a =
0.01*(i)}, {{NIntegrate[
a*z*Cos[t]/((t^2 - 2 t x + x^2 + y^2 + z^2)^(3/2) -
3 (y Sqrt[t^2 - 2 t x + x^2 + y^2 + z^2] Sin[
t]) a), {t, -Infinity, Infinity},
Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> 800,
Method -> "GaussKronrodRule"}, AccuracyGoal -> 20,
MaxRecursion -> 30],
NIntegrate[-z/((t^2 - 2 t x + x^2 + y^2 + z^2)^(3/2) -
3 (y Sqrt[t^2 - 2 t x + x^2 + y^2 + z^2] Sin[
t]) a), {t, -Infinity, Infinity},
Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> 800,
Method -> "GaussKronrodRule"}, AccuracyGoal -> 20,
MaxRecursion -> 30]},
NIntegrate[(y +
a*(t*Cos[t] - x*Cos[t] - Sin[t]))/((t^2 - 2 t x + x^2 + y^2 +
z^2)^(3/2) -
3 (y Sqrt[t^2 - 2 t x + x^2 + y^2 + z^2] Sin[
t]) a), {t, -Infinity, Infinity},
Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> 800,
Method -> "GaussKronrodRule"}, AccuracyGoal -> 20,
MaxRecursion -> 40], a}], {i, 1, 5}]
Bx = data[[All, 1, 1]]
By = data[[All, 1, 2]]
Bz = data[[All, 2]]
a= data[[All, 3]]
B = Sqrt[Bx^2 + By^2 + Bz^2]
Transpose[a, B]
Transpose::tperm: "Permutation {1.989,1.98813,1.98748,1.98702,1.98678} is longer
than the dimensions {5} of the array."
Out[]= Transpose[{0.01, 0.02, 0.03, 0.04, 0.05}, {1.989, 1.98813, 1.98748,
1.98702, 1.98678}]
I want to make a ListPlot so I need {a1,B1},{a2,B2},... but Transpose is not working. I've been reading for an hour and a half trying to find a way to do it but I couldn't.
Thanks for help.
Read the FAQs! 3) When you see good Q&A, vote them up byclicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. ALSO, remember to accept the answer, if any, that solves your problem,by clicking the checkmark sign` – Vitaliy Kaurov Sep 26 '12 at 2:47