Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15991

Re: variable dimension of domain of integration

From Ray Koopman <koopman@sfu.ca>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: variable dimension of domain of integration
Date 2011-01-28 11:15 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ihu8ge$1mp$1@smc.vnet.net> (permalink)
References <ihrb36$8qe$1@smc.vnet.net>

Show all headers | View raw


On Jan 27, 12:41 am, Ulvi Yurtsever <a...@b.c> wrote:
> Consider the function $f(n) = \int_{{0,1}^n}
> \sqrt{\sum_{i=1}^{n} {x_i}^2} dx_1 ... dx_n$.
> How would you define a mathematica function
> F[n_] (using NIntegrate) that computes this
> integral over the n-cube? I can think of several
> inelegant solutions; but surely there are neat
> ways of doing things of this sort...
>
> thanks

F[n_] := NIntegrate[Sqrt@Sum[x[i]^2,{i,n}], Evaluate[
                    Sequence@@Table[{x[i],0,1},{i,n}]]]

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: variable dimension of domain of integration Ray Koopman <koopman@sfu.ca> - 2011-01-28 11:15 +0000

csiph-web