Uçmak Ya Da Uçmamak

Numerical Solution of Laplace Equation by using Finite Difference Method

sd

Ty = 300; % Upper temperature of plate
T0 = 0; % Other edge temperature of plate
a = 1; % The length of edges of plate on X-axis
b = 1; % The length of edges of plate on Y-axis
N = 42; % The node number
LoopNumber = 10000; % Number of iteration

T = zeros(N, N, LoopNumber);
p = N-1;
q = N-1;

w = 4/(2+(4 – (cos(pi/p)+cos(pi/q))^2)^(1/2)); %relaxation factor

 

T(1:N, 1:N, 1)= 0;

T(N, :, : ) = T0;
T(:, 1, : ) = T0;
T(1, :, : ) = Ty;
T(:, N, : ) = T0;

for k = 1:LoopNumber-1
for j = 2:(N-1)
for i = 2:(N-1)
T(i,j,k+1) = T(i,j,k) + w*((T(i-1,j,k+1) + T(i,j-1,k+1) – 4*T(i,j,k) + T(i+1,j,k) + T(i,j+1,k))/4);
end
end
end

for j = 1:N
for i = 1:N
K(i,j) = T(i,j,LoopNumber);
end
end

x = [0 a];
y = [b 0];
image(x,y,K);
colorbar

Next Post

Previous Post

Leave a Reply

© 2022 Uçmak Ya Da Uçmamak

Theme by Anders Norén