Mercurial > repos > public > sbplib
comparison stencilEquation.m @ 660:184833fe4c0e feature/grids
Add monomial, vandermonde and stencil cretation tools
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 14 Nov 2017 16:46:07 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
659:11a39b274260 | 660:184833fe4c0e |
---|---|
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 |