Mercurial > repos > public > sbplib
comparison stencilEquation.m @ 797:5cf9fdf4c98f feature/poroelastic
Merge with feature/grids and bugfix bcSetup
author | Martin Almquist <malmquist@stanford.edu> |
---|---|
date | Thu, 26 Jul 2018 10:53:05 -0700 |
parents | 184833fe4c0e |
children |
comparison
equal
deleted
inserted
replaced
796:aa1ed37a1b56 | 797:5cf9fdf4c98f |
---|---|
1 % Find the equation for the stencil for d^k/dx^k | |
2 function [A,b] = stencilEquation(k, offsets, order) | |
3 q = sym('q', [1, length(offsets)]); | |
4 | |
5 p = 0:(order-1+k); | |
6 | |
7 v = vandermonde(offsets, p); | |
8 vdiff = vandermonde( 0, p-k); | |
9 | |
10 eq = q*v == vdiff; | |
11 | |
12 [A,b] = equationsToMatrix(eq, q); | |
13 end |