5
$\begingroup$

Is there a way to draw a quadrangular surface in Mathematica so that it shows the bilinear term (not two triangles)? The quadrangular polygon is given by the expression

$$\phi = \sum_i^4 N_i U_i$$

where the $N_i$ are the Lagrangian shape functions (from finite element analysis), and the $U_i$ are the degrees of freedom. The shape functions are given by

N1[xi_, eta_] := (1 - eta) (1 - xi)/4;
N2[xi_, eta_] := (1 + eta) (1 - xi)/4;
N3[xi_, eta_] := (1 + eta) (1 + xi)/4;
N4[xi_, eta_] := (1 - eta) (1 + xi)/4;

So there is a bilinear term xi*eta that gives the curvature to the element.

$\endgroup$

1 Answer 1

8
$\begingroup$

A polygon is a section of a plane, so it has no curvature, and using Polygon in Graphics3D won't work. You need a ParametricPlot3D.

N1[xi_, eta_] := (1 - eta) (1 - xi)/4;
N2[xi_, eta_] := (1 + eta) (1 - xi)/4;
N3[xi_, eta_] := (1 + eta) (1 + xi)/4;
N4[xi_, eta_] := (1 - eta) (1 + xi)/4;
shapeFuncs = {N1[xi, eta], N2[xi, eta], N3[xi, eta], N4[xi, eta]};
U = RandomReal[{0, 1}, 4];
phi[xi_, eta_] = shapeFuncs.U;
ParametricPlot3D[{{xi, eta, phi[xi, eta]}}, {xi, -1, 1}, {eta, -1, 1}]

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ Thanks for you quick answer. Is there a way to show this plot on a portion of the space occupied by [-1,1]x[-1,1], for example the triangular region xi > eta? $\endgroup$ Oct 3, 2013 at 10:53
  • $\begingroup$ Use the option: RegionFunction -> Function[{xi, eta}, xi > eta] $\endgroup$ Oct 3, 2013 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.