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 CenterFile Exchange에서 Vector Volume Data에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by