P. 1
Metode Liebmann

Metode Liebmann

|Views: 5|Likes:
Published by Haaqym Soochee
Mtlab Code
Mtlab Code

More info:

Categories:Types, School Work
Published by: Haaqym Soochee on Jun 10, 2014
Copyright:Traditional Copyright: All rights reserved

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/10/2014

pdf

text

original

%metode liebmann

%dibuat suci hakiman
%5 April 2013


close all, clear,clc;
for i=1:5
for j=1:5
T(i,j)=0;
end
end

%temperature Boundary
T(:,1)=0; %temperatur bawah
T(:,5)=100; %temperatur atas
T(1,:)=75; %temperature kiri
T(5,:)=50; %temperature kanan
lambda=1.5

while(1)
for j=2:4
for i=2:4
T_old(i,j)=T(i,j);
T(i,j)=(T(i+1,j)+T(i-1,j)+T(i,j+1)+T(i,j-1))/4;
T(i,j)=lambda*T(i,j)+(1-lambda)*T_old(i,j)
end
end

error=dot(((T(i,j)-T_old(i,j))/T(i,j)),(T(i,j)-T_old(i,j))/T(i,j))
if error<=0.01
break;
end
end
i
figure
contourf(T)
colorbar

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->