Getting the area of a surface integral from Matlab

34 ビュー (過去 30 日間)
Niklas Kurz
Niklas Kurz 2021 年 5 月 5 日
コメント済み: Star Strider 2021 年 5 月 5 日
I'd like to approve my solution of where is the unit sphere
Therefore I want to calculate where is the parametrization of the unit sphere:
syms phi the
x = cos(phi).*sin(the);
y = sin(phi).*sin(the);
z = cos(the);
density = x.^2;
para = [x;y;z];
dphi = diff(para,phi);
dthe = diff(para,the);
c = cross(dphi,dthe);
int(int(density*norm(c),phi,0,2*pi),the,0,pi)
Like in my previous quesion I get a cryptic answere, not really any helpfull probably because norm(c) is overcomplicated
Also is there another way to approve the solution. e.g. with trapz?

採用された回答

Star Strider
Star Strider 2021 年 5 月 5 日
See if simplifying it does what you want —
syms phi the
x = cos(phi).*sin(the);
y = sin(phi).*sin(the);
z = cos(the);
density = x.^2;
para = [x;y;z];
dphi = diff(para,phi);
dthe = diff(para,the);
c = cross(dphi,dthe);
Int2 = int(int(density*norm(c),phi,0,2*pi),the,0,pi)
Int2 = 
Int2 = simplify(Int2, 500)
Int2 = 
.
  2 件のコメント
Niklas Kurz
Niklas Kurz 2021 年 5 月 5 日
That second entry in simplify was unexpected. I should look at the documentation more extensively...
Star Strider
Star Strider 2021 年 5 月 5 日
No worries!
The full documentation would likely suggest —
Int2 = simplify(Int2, 'Steps',500)
Leaving out the 'Steps' name in the name-value pair is a shortened way of specifying it. Other name-value pairs require the name to be specified as well, also if more than one are specified.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by