summaryrefslogtreecommitdiff
path: root/coursework17
diff options
context:
space:
mode:
authorVasil Zlatanov <v@skozl.com>2017-03-03 15:09:33 +0000
committerVasil Zlatanov <v@skozl.com>2017-03-03 15:09:33 +0000
commita577259f7df8c0578e3e35190eac9c7e84602323 (patch)
tree6a97d7cd210a7d55f79ac53fe92382492e1d8085 /coursework17
parent7e90285b8efe2beb52c43a089c0772389cfde710 (diff)
downloade2-matlab-a577259f7df8c0578e3e35190eac9c7e84602323.tar.gz
e2-matlab-a577259f7df8c0578e3e35190eac9c7e84602323.tar.bz2
e2-matlab-a577259f7df8c0578e3e35190eac9c7e84602323.zip
add time varying boundry conditions
Diffstat (limited to 'coursework17')
-rw-r--r--coursework17/ex4.m4
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)));