Graphics Programs Reference
In-Depth Information
functionI=triangleQuad(func,x,y)
% Cubic quadrature over a triangle.
%USAGE:I=triangleQuad(func,x,y)
% INPUT:
%func=handleoffunctiontobeintegrated.
% x = [x1;x2;x3] x-coordinates of corners.
% y = [y1;y2;y3] y-coordinates of corners.
% OUTPUT:
% I
= integral
alpha = [1/3 1/3 1/3; 1/5 1/5 3/5;...
3/5 1/5 1/5; 1/5 3/5 1/5];
W = [-27/48; 25/48; 25/48; 25/48];
xNode = alpha*x; yNode = alpha*y;
A = (x(2)*y(3) - x(3)*y(2)...
- x(1)*y(3) + x(3)*y(1)...
+ x(1)*y(2) - x(2)*y(1))/2;
sum=0;
fori=1:4
z = feval(func,xNode(i),yNode(i));
sum = sum + W(i)*z;
end
I = A*sum
EXAMPLE 6.16
y
1
1
3
x
3
2
=
A
y
)
dx dy
over the equilateraltriangle shown, where
16
Evaluate
I
f
(
x
,
2
3
Use the quadratureformulasfor (1) a quadrilateral and (2) a triangle.
1
2
(
x
2
1
6
(
x
3
y
2
)
3
xy
2
)
f
(
x
,
y
)
=
+
−
−
−
16
Thisfunctionis identical to the Prandtl stress function for torsion of a bar with the cross section
shown; the integral is related to the torsionalstiffness of the bar. See, for example, S.P. Timoshenko
and J.N. Goodier,
Theory of Elasticity
, 3rd ed.,McGraw-Hill (1970).
Search WWH ::
Custom Search