Mercurial > repos > public > sbplib
comparison +sbp/+implementations/d2_variable_4.m @ 266:bfa130b7abf6 operator_remake
Added error message for too few grid points to all implementation files.
author | Martin Almquist <martin.almquist@it.uu.se> |
---|---|
date | Fri, 09 Sep 2016 11:03:13 +0200 |
parents | 6009f2712d13 |
children | f7ac3cd6eeaa |
comparison
equal
deleted
inserted
replaced
265:3e0432b3cb68 | 266:bfa130b7abf6 |
---|---|
1 function [H, HI, D1, D2, e_l, e_r, d_l, d_r] = d2_variable_4(m,h) | 1 function [H, HI, D1, D2, e_l, e_r, d_l, d_r] = d2_variable_4(m,h) |
2 | |
3 BP = 4; | |
4 if(m<2*BP) | |
5 error(['Operator requires at least ' num2str(2*BP) ' grid points']); | |
6 end | |
7 | |
2 N = m; | 8 N = m; |
3 | 9 |
4 H = speye(N); | 10 H = speye(N); |
5 H(1,1) = 17/48; H(2,2) = 59/48; H(3,3) = 43/48; H(4,4) = 49/48; | 11 H(1,1) = 17/48; H(2,2) = 59/48; H(3,3) = 43/48; H(4,4) = 49/48; |
6 H(N,N) = 17/48; H(N-1,N-1) = 59/48; H(N-2,N-2) = 43/48; H(N-3,N-3) = 49/48; | 12 H(N,N) = 17/48; H(N-1,N-1) = 59/48; H(N-2,N-2) = 43/48; H(N-3,N-3) = 49/48; |