Skip to content

Commit

Permalink
resolve MATLAB version compatibility #1
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbielf2 committed Nov 29, 2020
1 parent 5722893 commit cab7a5b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Author: Bowei Wu, 2020/6/28

Also contain supporting functions modified from Alex Barnett's [BIE3D](https://github.com/ahbarnett/BIE3D) package

### Note on MATLAB version

- If you are using a MATLAB version before R2017b, please rename the `Vecnorm.m` function to lower case `vecnorm.m` to use this code.
- In case you would like to use the Epstein zeta function `epstein_zeta(s,...)` with a complex `s` (which is not needed for the purpose of quadrature correction), the `igamma` function from the Symbolic Math Toolbox is required.

### Example

![](convergence_on_patch.png)
Expand Down
4 changes: 4 additions & 0 deletions Vecnorm.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function vn = vecnorm(A)
% Alternative vecnorm function (in case MATLAB version earlier than R2017b)
% return column-wise 2-norm for the matrix A.
vn = sqrt(sum(A.^2));
2 changes: 1 addition & 1 deletion epstein_zeta.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
QB = @(i,j) L*i^2+2*M*i*j+N*j^2;

% Determine summation cutoffs based on decay of incomplete gamma func
lambda = min((E+G)/2 - sqrt((E-G).^2+4*F.^2)/2,[],'all'); % min eigenvalue of Q
lambda = min(min((E+G)/2 - sqrt((E-G).^2+4*F.^2)/2)); % min eigenvalue of Q
n = floor(sqrt(33/pi./lambda))+3;

% summation, exclude origin
Expand Down

0 comments on commit cab7a5b

Please sign in to comment.