aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2017-02-09 11:08:00 +0000
committerYann Herklotz <ymherklotz@gmail.com>2017-02-09 11:08:00 +0000
commit6479c2f9d2238ea3ea464265aa644049d45f840d (patch)
tree597585d8525a5232e6781ed05461be73c91f5ee9
parentdfb39419fcc36003395c807ea01db40650a7de4b (diff)
downloadNumericalAnalysis-6479c2f9d2238ea3ea464265aa644049d45f840d.tar.gz
NumericalAnalysis-6479c2f9d2238ea3ea464265aa644049d45f840d.zip
Added more plots
-rw-r--r--Part 3/figures/abs_sin3D_150_5000_bc1.pngbin0 -> 124691 bytes
-rw-r--r--Part 3/figures/abs_sin3D_150_5000_tvbcsin.pngbin162074 -> 155063 bytes
-rw-r--r--Part 3/figures/abs_sin_150_5000_bc1.pngbin0 -> 106847 bytes
-rw-r--r--Part 3/figures/abs_sin_150_5000_tvbcsin.pngbin152399 -> 153758 bytes
-rw-r--r--Part 3/figures/sin3D_150_5000_bc1.pngbin0 -> 135538 bytes
-rw-r--r--Part 3/figures/sin3D_150_5000_tvbcsin.pngbin138469 -> 140044 bytes
-rw-r--r--Part 3/figures/sin_150_5000_bc1.pngbin0 -> 120805 bytes
-rw-r--r--Part 3/figures/sin_150_5000_tvbcsin.pngbin150619 -> 151955 bytes
-rw-r--r--Part 3/figures/triang3D_150_5000_bc1.pngbin0 -> 145114 bytes
-rw-r--r--Part 3/figures/triang3D_150_5000_tvbcsin.pngbin151454 -> 154511 bytes
-rw-r--r--Part 3/figures/triang_150_5000_bc1.pngbin0 -> 108334 bytes
-rw-r--r--Part 3/figures/triang_150_5000_tvbcsin.pngbin167005 -> 168232 bytes
-rw-r--r--Part 3/scripts/finite_script.m8
-rw-r--r--Part 3/scripts/finite_script.m~67
14 files changed, 4 insertions, 71 deletions
diff --git a/Part 3/figures/abs_sin3D_150_5000_bc1.png b/Part 3/figures/abs_sin3D_150_5000_bc1.png
new file mode 100644
index 0000000..a16b107
--- /dev/null
+++ b/Part 3/figures/abs_sin3D_150_5000_bc1.png
Binary files differ
diff --git a/Part 3/figures/abs_sin3D_150_5000_tvbcsin.png b/Part 3/figures/abs_sin3D_150_5000_tvbcsin.png
index e9089cc..fdb4df3 100644
--- a/Part 3/figures/abs_sin3D_150_5000_tvbcsin.png
+++ b/Part 3/figures/abs_sin3D_150_5000_tvbcsin.png
Binary files differ
diff --git a/Part 3/figures/abs_sin_150_5000_bc1.png b/Part 3/figures/abs_sin_150_5000_bc1.png
new file mode 100644
index 0000000..8344470
--- /dev/null
+++ b/Part 3/figures/abs_sin_150_5000_bc1.png
Binary files differ
diff --git a/Part 3/figures/abs_sin_150_5000_tvbcsin.png b/Part 3/figures/abs_sin_150_5000_tvbcsin.png
index 4b09a9a..113b1db 100644
--- a/Part 3/figures/abs_sin_150_5000_tvbcsin.png
+++ b/Part 3/figures/abs_sin_150_5000_tvbcsin.png
Binary files differ
diff --git a/Part 3/figures/sin3D_150_5000_bc1.png b/Part 3/figures/sin3D_150_5000_bc1.png
new file mode 100644
index 0000000..b847302
--- /dev/null
+++ b/Part 3/figures/sin3D_150_5000_bc1.png
Binary files differ
diff --git a/Part 3/figures/sin3D_150_5000_tvbcsin.png b/Part 3/figures/sin3D_150_5000_tvbcsin.png
index 773dfce..e401c58 100644
--- a/Part 3/figures/sin3D_150_5000_tvbcsin.png
+++ b/Part 3/figures/sin3D_150_5000_tvbcsin.png
Binary files differ
diff --git a/Part 3/figures/sin_150_5000_bc1.png b/Part 3/figures/sin_150_5000_bc1.png
new file mode 100644
index 0000000..5328533
--- /dev/null
+++ b/Part 3/figures/sin_150_5000_bc1.png
Binary files differ
diff --git a/Part 3/figures/sin_150_5000_tvbcsin.png b/Part 3/figures/sin_150_5000_tvbcsin.png
index a083f6d..922271e 100644
--- a/Part 3/figures/sin_150_5000_tvbcsin.png
+++ b/Part 3/figures/sin_150_5000_tvbcsin.png
Binary files differ
diff --git a/Part 3/figures/triang3D_150_5000_bc1.png b/Part 3/figures/triang3D_150_5000_bc1.png
new file mode 100644
index 0000000..9da5072
--- /dev/null
+++ b/Part 3/figures/triang3D_150_5000_bc1.png
Binary files differ
diff --git a/Part 3/figures/triang3D_150_5000_tvbcsin.png b/Part 3/figures/triang3D_150_5000_tvbcsin.png
index a4814db..a08309b 100644
--- a/Part 3/figures/triang3D_150_5000_tvbcsin.png
+++ b/Part 3/figures/triang3D_150_5000_tvbcsin.png
Binary files differ
diff --git a/Part 3/figures/triang_150_5000_bc1.png b/Part 3/figures/triang_150_5000_bc1.png
new file mode 100644
index 0000000..494722a
--- /dev/null
+++ b/Part 3/figures/triang_150_5000_bc1.png
Binary files differ
diff --git a/Part 3/figures/triang_150_5000_tvbcsin.png b/Part 3/figures/triang_150_5000_tvbcsin.png
index 831cd51..554752e 100644
--- a/Part 3/figures/triang_150_5000_tvbcsin.png
+++ b/Part 3/figures/triang_150_5000_tvbcsin.png
Binary files differ
diff --git a/Part 3/scripts/finite_script.m b/Part 3/scripts/finite_script.m
index e10f509..4812535 100644
--- a/Part 3/scripts/finite_script.m
+++ b/Part 3/scripts/finite_script.m
@@ -23,8 +23,8 @@ k = h^2 * v;
res(:, 1) = get_function(N, h, 1)';
% Set boundary conditions
-res(1, :) = sin(2*pi*(0:m)/m)/2+0.5;
-res(N+1, :) = sin(2*pi*(0:m)/m)/2+0.5;
+res(1, :) = ones(1, m+1);
+res(N+1, :) = ones(1, m+1);
% Calculate M+1 and plot it continuously
for c = 1:m
@@ -49,7 +49,7 @@ hold off;
xlabel('x');
ylabel('y');
-title('Plots of 1D Heat equation over time, bc = 0');
+title('Plots of 1D Heat equation over time, bc = 1');
legend('m = 0', 'm = 100', 'm = 200', 'm = ...', 'm = 5000');
% Plot 3D
@@ -62,6 +62,6 @@ surf(X, Y, Z);
xlabel('time / t');
ylabel('x');
zlabel('y');
-title('3D plot of 1D Heat equation over time, bc = 0');
+title('3D plot of 1D Heat equation over time, bc = 1');
diff --git a/Part 3/scripts/finite_script.m~ b/Part 3/scripts/finite_script.m~
deleted file mode 100644
index 7d91875..0000000
--- a/Part 3/scripts/finite_script.m~
+++ /dev/null
@@ -1,67 +0,0 @@
-% This script implements the finite difference method to solve the heat
-% equation
-
-clear;
-
-% Set the number of samples to take
-N = 150;
-
-% Set the total time to run
-m = 5000;
-
-% Declare final size of matrix for speed
-res = zeros(N+1, m+1);
-
-% Set v
-v = 0.25;
-
-% Get h and k
-h = 1/N;
-k = h^2 * v;
-
-% Set Initial condition
-res(:, 1) = get_function(N, h, 3)';
-
-% Set boundary conditions
-res(1, :) = sin(2*pi*(0:k:1))/2+1;
-res(N+1, :) = zeros(1, m+1);
-
-% Calculate M+1 and plot it continuously
-for c = 1:m
- for i = 2:N
- res(i, c+1) = v * res(i-1, c) + (1-2*v) * res(i, c) + v * res(i+1, c);
- end
-end
-
-% Plot 2D
-figure;
-Z = zeros(N+1, m/50+1);
-count = 1;
-for i = 1:m+1
- if rem(i, 50) == 1
- plot(0:h:1, res(:, i));
- Z(:, count) = res(:, i);
- hold on;
- count = count + 1;
- end
-end
-hold off;
-
-xlabel('x');
-ylabel('y');
-title('Plots of 1D Heat equation over time, bc = 0');
-legend('m = 0', 'm = 100', 'm = 200', 'm = ...', 'm = 5000');
-
-% Plot 3D
-figure;
-x = (0:m/50) / (m/50);
-y = (0:N) / N;
-[X,Y] = meshgrid(x, y);
-surf(X, Y, Z);
-
-xlabel('time / t');
-ylabel('x');
-zlabel('y');
-title('3D plot of 1D Heat equation over time, bc = 0');
-
-