# Documentation of laplacian

Global Index (all files) (short | long) | Local Index (files in subdir) (short | long)

## Function Synopsis

`lap = laplacian(y, x, order, wrap);`

## Help text

```
lap = laplacian(y, x, order, wrap);

y is a vector containing the y-coordinate (column) values.
If the Laplacian for a uniform grid is desired, just input
y and x as ones (or appropriately scaled) vectors.

x follows the same convention as y, except refers to the
x-coordinate (row) values.

order is not yet supported.  I'll try and figure a way
so that order refers to the order of accuracy for the
second derivatives in the Laplacian.

```

## Listing of function laplacian

```function lap = laplacian(y, x, order, wrap);

if nargin == 2;
order = 2;
wrap = ['f'];
end;
if nargin == 3;
if issrt(order); wrap = order; order = 2;
else; wrap = ['f'];
end

if rem(order, 2) ~= 0;
error('order must be an even number');
end;

[m,n] = size(y);
if (m ~= 1 | n ~= 1);
error('y must be a vector');
end
[m,n] = size(x);
if (m ~= 1 | n ~= 1);
error('x must be a vector');
end
[m, n] = [length(y), length(x)];

%  Determine coefficients for 'order'th order finite difference
%  equation for the second derivative.

n = order;     %  For simplicity of writing

lin_eq = zeros(n+1);
for i = 1:(n+1);
for j = 1:(n+1);
lin_eq(i,j) = (i-(n/2)).^(i-1) /
```