FIND AREA SURFACE-PROBLEM IN MY CODE
1 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
采纳的回答
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
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.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!