[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] integration

From: John A. Crow
Subject: Re: [Help-gsl] integration
Date: Sat, 6 Dec 2008 12:32:49 -0700

Looks like you're trying to integrate over a ball of radius sqrt(2). If that's the case, switch to spherical coordinates and you'll have the fixed limits Brian mentioned. Also double check your limits of integration on x; probably should be [-sqrt(2), sqrt(2)].

At Thu, 4 Dec 2008 08:16:38 -0800 (PST),
ghadir mohammadkhani wrote:
I want to integrate with Monte-Carlo method, but the limits of
integration aren't independent, for example in integral \int
f(x,y,z)dx dy dz, x goes from -2 to 2 , y varies from -(2-x*x)^(0.5)
until (2-x*x)^(0.5), the lower and upper limits in z are,
respectively -(2-x*x-y*y)^(0.5) and (2-x*x-y*y)^(0.5). I don't know
that how must change my program, i.e in the main of the example
program with the Monte-Carlo routine, double xl[3] = { , , } and
double xu[3] = { , , } how must be modified?


Where possible, make a change of variables (analytically) so that the
limits of the new coordinates are independent.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]