From 82e6cf7d1046d6cee16f7e8b044ec33e7ec6c4b7 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Sun, 16 Feb 2020 14:26:55 +0700 Subject: [usth] Numerical Method is MATH2.4 --- usth/MATH2.2/project/heatrans.m | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 usth/MATH2.2/project/heatrans.m (limited to 'usth/MATH2.2/project/heatrans.m') diff --git a/usth/MATH2.2/project/heatrans.m b/usth/MATH2.2/project/heatrans.m deleted file mode 100644 index d5d2e04..0000000 --- a/usth/MATH2.2/project/heatrans.m +++ /dev/null @@ -1,15 +0,0 @@ -function T = heatrans (cp, lambda, rho, Tg, Td, T0, L, dx, dt, N) - alpha = lambda / rho / cp; - beta = alpha * dt / dx^2; - M = round (L / dx); - side = repelem (beta, M); - A = diag (side, -1) + diag (repelem (1 - 2*beta, M + 1)) + diag (side, 1); - A(1, :) = A(end, :) = 0; - A(1, 1) = A(end, end) = 1; - - T = repelem (T0, M + 1); - [T(1) T(end)] = deal (Tg, Td); - for k = 2 : N - T(:, k) = A * T(:, k - 1); - end -end -- cgit 1.4.1