diff options
Diffstat (limited to 'coursework17')
-rw-r--r-- | coursework17/ex4.m | 4 |
1 files 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))); |