MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: vector integration


Michael Bechmann wrote:
 > hello everybody,
 > i am facing a problem in the numerical integration of a vector-valued
 > function using Mathematica.
 > as the result of some operation on the variable x  defined by  f[x_]=...
 > i get a list of numbers {f1,f2,f3,...,fn} each of which depends on the
 > variable x.
 > the bad point is that the fi can not be evaluated one by one. for some
 > chosen value of x i can only calculate the whole list of the fis.
 > now i need to integrate each of the fis over x. of course i could
 > intgrate each list element separately using NIntegrate:
 >
 > Fi=NIntegrate[f[x][[i]],{x,x1,x2}]
 >
 > but since the evaluation of the list f[x] is very time consuming i would
 > like to somehow integrate the whole list at once which is not possible
 > with NIntegrate.
 >
 > did anybody encounter this problem, too? does anybody know a useful
 > package  or any solution?
 >
 > thanks.
 >
 >

Hi Michael,

   F = NIntegrate[#, {x, x1, x2}]& /@ f[x]

or equiv.

   F = Map[ NIntegrate[#, {x, x1, x2}]&, f[x] ]

should do what you want.

Peter




  • Prev by Date: Re: Varying color in ParametricPlot
  • Next by Date: Re: Random bits (generation)
  • Previous by thread: vector integration
  • Next by thread: Re: vector integration