FIND AREA SURFACE-PROBLEM IN MY CODE

1 回表示 (過去 30 日間)
justin  Taylor
justin Taylor 2011 年 12 月 26 日
syms u v;
x = (1-u).*(3+cos(v)).*cos(pi*u);
y = (1-u).*(3+cos(v)).*sin(pi*u);
z = 8*u+( 1-u ).*sin(v);
% Find Area Surface
F=[x,y,z];
F=[x,y,z];
ru=diff(F,u);
rv=diff(F,v);
ruxrv=[ru(2).*rv(3)-ru(3).*rv(2),ru(3).*rv(1)-ru(1).*rv(3),ru(1).*rv(2)-ru(2).*rv(1)];
Mruxrv=sqrt(ruxrv(1).^2+ruxrv(2).^2+ruxrv(3).^2)
Aresurface=quad2d(Mruxrv,0,1,0,2*pi)

採用された回答

bym
bym 2011 年 12 月 26 日
the function is called
dblquad()
and requires a function to be passed to it like:
f = matlabFunction(Mruxrv);
Aresurface=dblquad(f,0,1,0,2*pi)
Aresurface =
27.5280
  3 件のコメント
Walter Roberson
Walter Roberson 2011 年 12 月 26 日
quad2d is also a function to consider.
http://www.mathworks.com/help/techdoc/ref/quad2d.html
dblquad() offers a choice of quadrature methods, and expects that the function be vectorized in x and scalar in y
quad2d() does not offer flexibility. It expects that the function accepts 2D arrays for x and y.
For both integrators, there is a potential vulnerability in the matter of whether matlabFunction returns a vectorized function or not. It is documented that if matlabFunction is used to write to a file, that the file it produces will be optimized code that can accept scalar or matrix arguments, but it is not made explicit as to what arguments are accepted if writing to a file is not done, and it is not made explicit that the matrix arguments will be processed element-wise.
justin  Taylor
justin Taylor 2011 年 12 月 26 日
Oh ! thanhks I already understand ! ...

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

その他の回答 (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