       Re: hi, how can i accomplish this densityplot?

• To: mathgroup at smc.vnet.net
• Subject: [mg107441] Re: hi, how can i accomplish this densityplot?
• From: "Kevin J. McCann" <kjm at KevinMcCann.com>
• Date: Fri, 12 Feb 2010 04:45:36 -0500 (EST)
• References: <hl0r1r\$u4\$1@smc.vnet.net>

```Your code will work if you leave off the underscores in the Density
plot call:

DensitPlot[f[x,y],...

The underscores are only necessary in the function definition to tell
Mathematica that they are variables.

Kevin

??? wrote:
> f[x_, y_] :=
>  NIntegrate[
>   r0*Exp[-(r0 +
>        2*(x^2 + y^2 + r0^2 +
>            2*r0*((x^2 + y^2)^0.5)*(Cos[theta0]*(y/(x^2 + y^2)^0.5) -
>               Sin[theta0]*(x/(x^2 + y^2)^0.5)))^0.5)], {r0, 0,
> Infinity}, {theta0, 0, Pi}]
>
> DensityPlot[f[x_, y_], {x, -2, 2}, {y, -2, 2}]
>
> i entered the code above but mathematica return the error message:
>
> NIntegrate::inumr: The integrand E^(-r0-2 (r0^2+<<1>>+<<1>>+2 r0
> Power[<<2>>] Plus[<<2>>])^0.5) r0 has evaluated to non-numerical
> values for all sampling points in the region with boundaries {{\
> [Infinity],0.},{0,3.14159}}. >>
>
> General::stop: Further output of NIntegrate::inumr will be suppressed
> during this calculation.
>