ACCA-Imperial / SKPrime

A MATLAB implementation of the Schottky-Klein prime function.
GNU General Public License v3.0
10 stars 6 forks source link

Green's function normalisation constant in wrong place #42

Closed ehkropf closed 8 years ago

ehkropf commented 8 years ago

It appears greensC0 (and greensCj) are having the normalisation constant applied only when evaluating the full function, but not the "hat" function. The normalisation should be applied to the hat function always, since this is the BVP solution.

TL;DR: The "hat" function gives the wrong values.

ehkropf commented 8 years ago

This fix breaks skprime as evidenced by running skptests primeBasic/*. It appears this is on points outside unit domain.

Note the commit where the fix lives is not on the master branch. See branch green_normalise.

ehkropf commented 8 years ago

Outer point problem confirmed:

dv = [
  -0.2517+0.3129i
   0.2307-0.4667i];
qv = [
  0.2377
  0.1557];
alpha = -0.31837-0.44082i;

w = skprime(alpha, dv, qv);

% Check against product formula.
L = 6;
wp = skprod(dv, qv, L);
wphat = @(z) wp(z, alpha)./(z - alpha);

zp = 0.4793+0.4828i;
zp = [zp; 1/conj(zp)];

err = wphat(zp) - w.hat(zp);

where

err =

      -1.86885043329532e-06 -  2.52521160475083e-08i
         0.0679702753652227 -      0.47787048749888i

The BVP for 1/conj(alpha) is thus not being formed correctly.

ehkropf commented 8 years ago

Note replacing the parameter in the above example with 1/conj(-0.31837-0.44082i) reinforces this.

ehkropf commented 8 years ago

Fixed with merge commit 903bd65.