Mercurial > repos > public > sbplib
comparison +time/CdiffImplicit.m @ 454:d5bce13ece23 feature/grids
Switch to first order start in CdiffImplicit to make the scheme more robust.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 11 May 2017 14:20:42 +0200 |
parents | 67ca8964f03c |
children | d6ede7f5cbf9 |
comparison
equal
deleted
inserted
replaced
453:819345fe7ff1 | 454:d5bce13ece23 |
---|---|
61 obj.BB = BB; | 61 obj.BB = BB; |
62 obj.CC = CC; | 62 obj.CC = CC; |
63 | 63 |
64 v_prev = f1; | 64 v_prev = f1; |
65 I = speye(m); | 65 I = speye(m); |
66 v = (1/k^2*A)\((1/k^2*A - 1/2*B)*f1 + (1/k*I - 1/2*C)*f2 + 1/2*G(0)); | 66 % v = (1/k^2*A)\((1/k^2*A - 1/2*B)*f1 + (1/k*I - 1/2*C)*f2 + 1/2*G(0)); |
67 v = f1 + k*f2; | |
68 | |
67 | 69 |
68 if ~issparse(A) || ~issparse(B) || ~issparse(C) | 70 if ~issparse(A) || ~issparse(B) || ~issparse(C) |
69 error('LU factorization with full pivoting only works for sparse matrices.') | 71 error('LU factorization with full pivoting only works for sparse matrices.') |
70 end | 72 end |
71 | 73 |