Re: vector integration

*To*: mathgroup at smc.vnet.net*Subject*: [mg35074] Re: vector integration*From*: Peter <petsie at arcor.de>*Date*: Mon, 24 Jun 2002 03:20:57 -0400 (EDT)*References*: <aeu8uv$8kd$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

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