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$
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

| improve this answer | |
$\endgroup$
  • $\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$ – Alejandro Marcos Aragon Oct 3 '13 at 10:53
  • $\begingroup$ Use the option: RegionFunction -> Function[{xi, eta}, xi > eta] $\endgroup$ – Timothy Wofford Oct 3 '13 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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