function p=psim(m,A,h)

% PSIM        Calculate psi_m by brute force.
%
%             PSIM(M,A,H)
%
%             Christian C. Beardah 1996

n=length(A);

Xi=zeros(n,n);
Xj=Xi;
Yi=Xi;
Yj=Xi;

o=ones(1,n);

Xj=A(:,1)*o;
Xi=Xj';
Yj=A(:,2)*o;
Yi=Yj';

p=sum(sum(deriv2((Xi-Xj)/h,(Yi-Yj)/h,m)))/(h*n^2);