Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: surface area of pdedemo3
Replies: 5   Last Post: Jul 2, 2013 4:16 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alan Weiss

Posts: 1,241
Registered: 11/27/08
Re: surface area of pdedemo3
Posted: Jun 25, 2013 11:07 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 6/24/2013 2:25 PM, Steven Finch wrote:
> What is the surface area of the saddle surface in
> http://www.mathworks.com/help/pde/examples/minimal-surface-problem-on-the-unit-disk.html
>
> ? The Matlab code will almost surely contain the line
> [ux,uy]=pdegrad(p,t,u)
> and it will help me to see how ux, uy & mesh are numerically
> integrated to give the answer. Thank you very much!


I am sorry to say that the code I came up with doesn't use pdegrad at
all. But maybe it will satisfy you.

I think the easiest way to estimate the surface area is to add up all
the triangle areas that make up the surface. Each triangle is
represented in the (p,t) data structure that you can find described here:
http://www.mathworks.com/help/pde/ug/mesh-data.html

To find the area of a 3-D triangle whose point coordinates are point =
(px, py, u), make vectors v1 = point2 - point 1, v2 = point3 - point1,
and use the formula

area = 1/2 * sqrt((v1(2)*v2(3) - v1(3)*v2(2))^2 + (v1(3)*v2(1) -
v1(1)*v2(3))^2 + (v1(1)*v2(2) - v1(2)*v2(1))^2)

So here is a function that calculates the area of the surface:

function a = trianglearea(t,p,u)
% Compute the total areas of the 3-D triangles t, whose x and y coordinates
% are in p(t), and whose height is in u(p(t)).

a = 0;
for i = 1:size(t,2)
% two vectors
v1 = [p(:,t(2,i));u(t(2,i))] - [p(:,t(1,i));u(t(1,i))];
v2 = [p(:,t(3,i));u(t(3,i))] - [p(:,t(1,i));u(t(1,i))];
smm = (v1(2)*v2(3) - v1(3)*v2(2))^2 + (v1(3)*v2(1) - v1(1)*v2(3))^2
+ ...
(v1(1)*v2(2) - v1(2)*v2(1))^2;
a = a + sqrt(smm)/2;
end

I ran this and got:
a = trianglearea(t,p,u)

a =

3.8196

This isn't so much bigger than the area of the underlying circle, pi.

Alan Weiss
MATLAB mathematical toolbox documentation



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.