From a577259f7df8c0578e3e35190eac9c7e84602323 Mon Sep 17 00:00:00 2001 From: Vasil Zlatanov Date: Fri, 3 Mar 2017 15:09:33 +0000 Subject: add time varying boundry conditions --- coursework17/ex4.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coursework17/ex4.m b/coursework17/ex4.m index c3ec32d..b82b60b 100644 --- a/coursework17/ex4.m +++ b/coursework17/ex4.m @@ -35,8 +35,8 @@ end for m = 1:length(t) % Set boundaries - u(m+1,1) = 0; - u(m+1,length(x)) = 0; + u(m+1,1) = 0.5 * m /length(t); + u(m+1,length(x)) = 0.5 * m /length(t); for j = 2:(length(x)-1) % multiply out (1-2v) and factorise out v u(m+1,j) = u(m,j) + ((dt/(dx^2))*(u(m,j+1) - 2*u(m,j) + u(m,j-1))); -- cgit v1.2.3-54-g00ecf