changeset 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 819345fe7ff1
children cf313abea04b
files +time/CdiffImplicit.m
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/+time/CdiffImplicit.m	Thu May 11 10:09:52 2017 +0200
+++ b/+time/CdiffImplicit.m	Thu May 11 14:20:42 2017 +0200
@@ -63,7 +63,9 @@
 
             v_prev = f1;
             I = speye(m);
-            v = (1/k^2*A)\((1/k^2*A - 1/2*B)*f1 + (1/k*I - 1/2*C)*f2 + 1/2*G(0));
+            % v = (1/k^2*A)\((1/k^2*A - 1/2*B)*f1 + (1/k*I - 1/2*C)*f2 + 1/2*G(0));
+            v = f1 + k*f2;
+
 
             if ~issparse(A) || ~issparse(B) || ~issparse(C)
                 error('LU factorization with full pivoting only works for sparse matrices.')