MathGroup Archive 2004

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

Search the Archive

Re: newbie problem with NIntegrate

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49805] Re: [mg49791] newbie problem with NIntegrate
  • From: DrBob <drbob at bigfoot.com>
  • Date: Sun, 1 Aug 2004 18:48:37 -0400 (EDT)
  • References: <200408010809.EAA02483@smc.vnet.net>
  • Reply-to: drbob at bigfoot.com
  • Sender: owner-wri-mathgroup at wolfram.com

Try this:

<< "Calculus`Integration`"
geom = 200 >= x >= 100 && 50 >= y >= -50 && -20 <= z <= 20;
Clear[gr]
gr[x_, y_, z_] := 2*Boole[geom];
Integrate[gr[x,y,z],{x,0,300},{y,-100,100},{z,-30,30}]
800000

Integrate[gr[x,y,z],{x,0,600},{y,-100,100},{z,-30,30}]
800000

Integrate[gr[x,y,z],{x,0,900},{y,-100,100},{z,-30,30}]
800000

Integrate[gr[x,y,z],{x,150,175},{y,-100,100},{z,-30,30}]
200000

Bobby

On Sun, 1 Aug 2004 04:09:54 -0400 (EDT), Xiaoxun <dbjunxiao at hotmail.com> wrote:

> Geom = (200 >=x>= 100 && 50 >= y >= -50 && -20 <= z <= 20);
> gr[x_, y_, z_] := 2 /; Geom;
> gr[x_, y_, z_] := 0 /; ! (Geom);
> N[Integrate[gr[x, y, z], {x, 0, 300}, {y, -100, 100}, {z, -30, 30}]



-- 
DrBob at bigfoot.com
www.eclecticdreams.net


  • Prev by Date: Re: Marking a (rectangular) zone in a standard 2D plot using "Rectangle"
  • Next by Date: Re: newbie problem with NIntegrate
  • Previous by thread: newbie problem with NIntegrate
  • Next by thread: Re: newbie problem with NIntegrate