2
$\begingroup$

I have this function

enter image description here

I want to visualize this function,So I use this

data = Table[{b, #, (b + #)/(b^2 + #)}, {b, 1/5, 5*#}] & /@ 
   Range[0.3, 0.8, 0.001];
Flatten[data, 1] // Point // Graphics3D

get this

enter image description here

This image is very strange and it doesn't feel like what I wanted

$\endgroup$

1 Answer 1

5
$\begingroup$

Your approach is alright but you need the ListPlot3D function.You need to check documentation properly 🙂.

data = Table[{b, #, (b + #)/(b^2 + #)}, {b, 1/5, 5*#}]& /@ Range[0.3, 0.8, 0.001];
ListPlot3D[Flatten[data, 1]]

But you can allow mathematica to do the heavy lifting. Let's define your simple and bounded 2D region like this.

reg = ImplicitRegion[1/2 < b <= 5 c && 0.3 < c < 0.8, {b, c}];
RegionPlot[reg, PlotRange -> All]

enter image description here

Now get a continuous 3D plot of the surface of interest.

Plot3D[(b + c)/(b^2 + c), {b, c} \[Element] reg]

enter image description here

It is also possible to get the surface without defining the region but using the RegionFunction option of Plot3D like this.

Plot3D[(b + c)/(b^2 + c), {b, 1/2, 4.5}, {c, 0.25, 0.85}, 
RegionFunction -> Function[{b, c, z}, 1/2 < b <= 5 c && 0.3 < c < 0.8]]
$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.