1
$\begingroup$

Density plot roh(x,y,z)=1+x+y+z bounded by x^2+y^2=1 and y=z, x=0, z=0. In the first octant

So far,

roh[x_, y_, z_] := 1 + x + y + z;

DensityPlot3D[roh[x, y, z], {x, 0, 1}, {y, 0, x^2}, {z, 0, 1}]

Then I need a point at the center of mass. I think perhaps my region is wrong but nothing I try seems to work. I have tried {y,0, Sqrt[1-x^2]} and a few others.

For the center of mass I tried

McX = NIntegrate[y*roh[x, y,z], {x, 0, 2}, {y, 0, },{}];
McY = NIntegrate[x*roh[x, y,z], {x, 0, 2}, {y, 0, },{}];
{X, Y} = {McY/M, McX/M};

z is blank because I was just trying different things

then to plot the point Graphics[{PointSize[.04], Black, Point[{X, Y}]}]

$\endgroup$
1
$\begingroup$
Clear["Global`*"]

roh[x_, y_, z_] = 1 + x + y + z;

rgn = ImplicitRegion[
   x^2 + y^2 <= 1 && y > z >= 0 && x >= 0, {x, y, z}];

DensityPlot3D[roh[x, y, z],
 {x, y, z} ∈ rgn,
 PlotPoints -> 100,
 PerformanceGoal -> "Quality",
 AxesLabel -> (Style[#, 12, Bold] & /@ {x, y, z}),
 PlotLegends -> BarLegend[Automatic, LegendLabel -> roh]]

enter image description here

$\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.