0
$\begingroup$

I have the following nasty function:

sbbf[ω,κ2,g2]:=(38.4 g1^2 g2^2 Sqrt[κ2^2])/(16 g2^4 (1/10000 + 
   4 ω^2) + (κ2^2 + 4 ω^2) (16 g1^4 + 
   8 g1^2 (1/100 - 4 ω^2) + (1/10000 + 4 ω^2) (1 + 
      4 ω^2)) + 
8 g2^2 ((κ2 - 4 ω^2) (1/10000 + 4 ω^2) + 
   4 g1^2 (κ2/100 + 
      4 ω^2))) + (9.6 g1^2 (κ2^2 + 
  4 ω^2))/(16 g2^4 (1/10000 + 
   4 ω^2) + (κ2^2 + 4 ω^2) (16 g1^4 + 
   8 g1^2 (1/100 - 4 ω^2) + (1/10000 + 4 ω^2) (1 + 
      4 ω^2)) + 
8 g2^2 ((κ2 - 4 ω^2) (1/10000 + 4 ω^2) + 
   4 g1^2 (κ2/100 + 4 ω^2))) + ((0.5 + 
  nm) (16 g2^4 + 
  8 g2^2 (κ2 - 4 ω^2) + (1 + 
     4 ω^2) (κ2^2 + 4 ω^2)))/(25 (16 g2^4 (1/
     10000 + 4 ω^2) + (κ2^2 + 
     4 ω^2) (16 g1^4 + 
     8 g1^2 (1/100 - 4 ω^2) + (1/10000 + 
        4 ω^2) (1 + 4 ω^2)) + 
  8 g2^2 ((κ2 - 4 ω^2) (1/10000 + 4 ω^2) + 
     4 g1^2 (κ2/100 + 4 ω^2))))

And I wish to construct ListDensityPlot of the Integral of sbbf:

popsurf = 
Table[{i, j/5, 
1/(2 π)*
 NIntegrate[
  Evaluate[(sbbf[ω, i, j]) /. {g1 -> 5, 
     nm -> 300}], {ω, -50, 50}]}, {i, 0, 50, 1}, {j, 0, 
250, 1}];

When I do, say

popsurf[[1]]

I get

{{0, 0, 3.57973}, {0, 1/5, 14.8892}, {0, 2/5, 44.1781}, {0, 3/5, 
81.5918}, {0, 4/5, 118.734}, {0, 1, 151.284}, {0, 6/5, 178.078}, {0,
7/5, 199.508},...

Which is fine, each list tells me the coordinates $(x, y ,z)$ that I will use in my ListDensityPlot, which matches the syntax for it. However, when I try to plot it:

ListDensityPlot[popsurf]

I get a blank density plot. I thought initially I had to Flatten popsurf but that didn't work as well.

$\endgroup$
  • $\begingroup$ You probably need ListDensityPlot3D $\endgroup$ – swish Apr 10 '18 at 19:11
  • $\begingroup$ That works but i'd like a cross-sectional cut view the way ListDensityPlot presents. Is there a way to make it do that from ListDensityPlot3D ? $\endgroup$ – kowalski Apr 10 '18 at 19:48
  • 2
    $\begingroup$ Oh, I misunderstood. Seems like you just need to flatten only to the first level Flatten[popsurf, 1]. $\endgroup$ – swish Apr 10 '18 at 20:07
  • $\begingroup$ That works! Thanks! $\endgroup$ – kowalski Apr 10 '18 at 21:06
  • $\begingroup$ @kowalski Probably you can post your solution as an answer to it helps future visitors with the same question. $\endgroup$ – rhermans Jul 9 '18 at 22:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.