1function [b, bxx, byy, bxy] = plate_rr_basis(x, y, order, width, height)
2% PLATE_RR_BASIS The tensor-Legendre basis and its curvatures at points of the plate.
3%
4% [b, bxx, byy, bxy] = plate_rr_basis(x, y, order, width, height) evaluates
5% the (order + 1)^2 products P_i(2 x / W) P_j(2 y / H), i, j = 0..order, at
6% the paired points (x, y) (any common shape, in metres from the plate's
7% centre), as rows of b, together with the physical second derivatives
8% w_xx, w_yy and w_xy of each basis function. The index k of the function
9% (i, j) runs with j fastest: k = i (order + 1) + j + 1.
10%
11% Legendre products are a complete, well-conditioned basis for a free
12% rectangle: no boundary condition is built in, which is right for free
13% edges, and the natural conditions follow from minimizing the energy.
15xi = 2 * x(:)' / width;
16eta = 2 * y(:)' / height;
17[px, dx, dxx] = plate_rr_legendre(order, xi);
18[py, dy, dyy] = plate_rr_legendre(order, eta);
19n = (order + 1)^2;
20pts = numel(xi);
21b = zeros(n, pts);
22bxx = zeros(n, pts);
23byy = zeros(n, pts);
24bxy = zeros(n, pts);
25sx = 2 / width;
26sy = 2 / height;
27k = 0;
28for i = 1:order + 1
29 for j = 1:order + 1
30 k = k + 1;
31 b(k, :) = px(i, :) .* py(j, :);
32 bxx(k, :) = dxx(i, :) .* py(j, :) * sx^2;
33 byy(k, :) = px(i, :) .* dyy(j, :) * sy^2;
34 bxy(k, :) = dx(i, :) .* dy(j, :) * sx * sy;
35 end
36end
37end