Message Boards Message Boards

Using Series for a function with NIntegrate

Posted 9 years ago
POSTED BY: Ian Berkman
3 Replies

You could differentiate the functions numerically.

In[1]:= mu0 = 4*Pi*10^(-7) (*The magnetic permeability of air*);

i = 1 (*The current in Ampère*);
a = 2*10^-3 (*Distance between origin and ellipse along x in m*);
b = 10^-3 (*Distance between origin and ellipse along y in m*);
d = 10^-3 (*Distance between the origin of the ellipse and z=0 in m*);
n = 255 (*Number of windings*);

In[7]:= bx[x_?NumericQ, y_?NumericQ, z_?NumericQ] := 
 mu0*i*b*n/(4*Pi)*
  NIntegrate[((z + 
         d)/(x^2 + y^2 + (z + d)^2 + a^2*Cos[t]^2 + b^2*Sin[t]^2 - 
          2*a*x*Cos[t] - 2*b*y*Sin[t])^(3/2) - (z - 
         d)/(x^2 + y^2 + (z - d)^2 + a^2*Cos[t]^2 + b^2*Sin[t]^2 - 
          2*a*x*Cos[t] - 2*b*y*Sin[t])^(3/2)) Cos[t], {t, 0, 2 Pi}]

In[8]:= (bx[10^-3, 0, 0] - bx[-10^-3, 0, 0])/(2 10^-3)

Out[8]= 35.7709
POSTED BY: Frank Kampas
Posted 9 years ago

Using Taylor series on the integrand around (0,0,0) does not really help because it is an elliptic integral. In other words: the cosines and sines are the real problems here, and it is not possible to use the series on them because they run from 0 to 2 pi. Therefore, I think the only option is to use the series after the integration, but I could be wrong.

POSTED BY: Ian Berkman

Could you do a Taylor series by differentiating the function inside NIntegrate?

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract