Calculate the volume of a body
2 ビュー (過去 30 日間)
古いコメントを表示
Calculate the volume of a body whose upper surface is described by the function g, whose lower surface is described by z(x, y) ≡0 and whose floor plan is the union of two rectangles:
[-0.5,3.90] x [-0.5,3.70] U [-3.90,0.5]x[-3.70,0.5]
I tried like this, but is not the correct answer. What I have to change to be correct?
g = @(x, y) 1./((2+1.1.*x.^2+1.1.*y.^2).^(1/2));
a=0.0;
b=4.40;
c=0.0;
d=4.20;
int2 = integral2(g,-0.50,3.90,-0.50,3.70);
int3 = integral2(g,-3.90,0.50,-3.70,0.50);
vol = int2+int3;
0 件のコメント
回答 (1 件)
Jan
2022 年 4 月 29 日
x1 = [-0.5, 3.90];
y1 = [-0.5, 3.70];
x2 = [-3.90, 0.5];
y2 = [-3.70, 0.5];
axes('NextPlot', 'add');
line(x1([1,1,2,2,1]), y1([1,2,2,1,1]))
line(x2([1,1,2,2,1]), y2([1,2,2,1,1]))
The 2 areas overlap, so the volume above the overlapping rectangle is counted twice. Subtract it.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!