This script computes the (x,y,z) Gauss quadrature nodes and weights for a tetrahedron with user-specied vertices.
Work wonderfully. One question. Not quite understand the Gauss Quadrature, but I noticed that the code by default outputs 64 note points. Can I increase the number of note points in order to improve the integration results?
Its fixed. Thanks Greg.
Wait until Greg fixes this. The following code fragment should compute the volume of a simple tetrahedron.
At the very least, since the function is constant over the
simplex domain, its integral should be positive.
V = [0 0 0;0 0 1;0 1 0;1 0 0];
F = ones(size(X));
Q = W'*F
The magnitude is correct, just the sign is wrong. Q should be 1/6.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.