# Limiting value not machine-sized real number

How can I force an initial numeric calculation of plotting boundaries?

DP[L_, x_] := 2 π x (L - 20 Log10[x/10] - 45)
cp[Le_?NumericQ, Lc_?NumericQ] := N[10*(10^((Le - Lc)/20))]
Plot3D[DP[L, x], {L, 45, 85}, {x, cp[L, 65], cp[L, 45]}]


Plot3D::plln: Limiting value cp[L,65] in {x,cp[L,65],cp[L,45]} is not a machine-sized real number.

• {L, 45, 85}, {x, cp[L, 65], cp[L, 45]} does not represent a rectangular region, which I believe that Plot3D requires. You could try specifying a rectangular region that entirely enclosed the non-rectangular one that you have here. Jun 9 '17 at 10:52
• Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. Jun 10 '17 at 13:28

As noted in my earlier comment, the plotting region passed to Plot3D is not a rectangular region. Instead, it is

DiscretizeRegion[ImplicitRegion[cp[L, 65] < x < cp[L, 45] && 45 < L < 85, {L, x}],
{{45, 85}, {cp[45, 65], cp[85, 45]}}, AspectRatio -> 1, Axes -> True,
AxesOrigin -> {40, 0}]


To obtain a 3D plot over this region, call Plot3D with a rectangular region enclosing the actual region to be plotted, and use the RegionFunction option to specify that DP is to be evaluated only in the desired region.

Plot3D[DP[L, x], {L, 45, 85}, {x, cp[45, 65], cp[85, 45]}, AxesLabel -> {L, x, "DP"},
RegionFunction -> Function[{L, x, z}, cp[L, 65] < x < cp[L, 45]], PlotPoints -> 50]


• + just to be clear - I am very glad for the help. The RegionFunction is better, and nice to get to know. Jun 10 '17 at 13:12
• My alternative was to set the function =0 when outside region I wanted: DP[L_, x_] /; x <= cp[L, 65] || x >= cp[L, 45] := 0 + Plot second function with fixed value zero to show the excluded area. Jun 10 '17 at 14:35