Mercurial > repos > public > sbplib
comparison stencilEquation.m @ 713:348d5bcf7daf feature/quantumTriangles
Merge with feature/frids
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Tue, 20 Feb 2018 15:00:30 +0100 |
parents | 184833fe4c0e |
children |
comparison
equal
deleted
inserted
replaced
712:c9147e05d228 | 713:348d5bcf7daf |
---|---|
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 |