You are on page 1of 4

Université Echahid Hamma Lakhdar El‐Oued Année universitaire 2018/2017

Faculté de Technologie Matière : Méthodes Numériques Appliquées


Département de Génie Mécanique Spécialité : ……………………………………………..
Nom et prénom : ……………………………………………

TP4 LAPLACE N° 1

Problème :

On veut étudier la répartition bidimensionnelle de la température

d’une plaque métallique. On suppose qu’en régime permanent,

la température T(x, y) en un point P(x, y) de la plaque vérifie

l’équation de Laplace.

P1(L/3 ,L/3) ; P2(2L/3 ,L/3) ; P3(L/3 ,2L/3) ; P4(2L/3 ,2L/3) ;

N= 1 Méthode Pas Conditions aux limites Valeur initial


Tab=Tbd=20+N °C
Cas 01 Gauss-Seidel ∆x=∆y=L/3 T 0P1= T 0P2= T 0P3= T 0P4= 0 °C
Tac=Tcd=20-N °C
Tab=Tbd=20+N °C
Cas 02 Gauss-Seidel ∆x=∆y=L/6 T 0P1= T 0P2= T 0P3= T 0P4= 0 °C
Tac=Tcd=20-N °C
∆x= L/3 Tab=Tbd=20+N °C
Cas 03 Gauss-Seidel T 0P1= T 0P2= T 0P3= T 0P4= 0 °C
∆y=L/6 Tac=Tcd=20-N °C
Tab=Tbd=20+N °C
Cas 04 Gauss-Seidel ∆x=∆y=L/3 Tac= 20-N °C T 0P1= T 0P2= T 0P3= T 0P4= 0 °C
∂Tcd/∂y= 0

Compléter le tableau 2 pour les cas ci-dessus.

Nombre d’itérations maximales est : 10.

1/2
clear all; for j=20:-1:2

T=zeros(21,41); for i=2:40

To=zeros(21,41); p(i)=1/(4-p(i-1));

T(1,:)=T(1,:)+100; q(i)=(q(i-1)+To(j-1,i)+T(j+1,i))/(4-p(i-1));

n=0; end

k=0;

m=-1; for i=40:-1:2

q=zeros(1,41); T(j,i)=p(i)*T(j,i+1)+q(i);

p=zeros(1,41); T(j,i)=w*T(j,i)+(1-w)*To(j,i);

w=1.43; if abs((T(j,i)-To(j,i)))>(10^-5)

while k==0 k=0;

To=T; end

k=1; end

m=1; end

if m>0 end

for j=2:20 n=n+1;

for i=2:40 end

p(i)=1/(4-p(i-1)); n

q(i)=(q(i-1)+T(j-1,i)+To(j+1,i))/(4-p(i-1)); x=0:0.05:2;

end y=0:0.05:1;

for i=40:-1:2 surface(x,y,T);

T(j,i)=p(i)*T(j,i+1)+q(i);

T(j,i)=w*T(j,i)+(1-w)*To(j,i);

if abs((T(j,i)-To(j,i)))>(10^-5)

k=0;

end

end

end

else
% Solving the 2-D Laplace's equation by the Finite %Explicit iterative scheme with C.D in space (5-point
Difference difference)

...Method j=2:nx-1;

% Numerical scheme used is a second order central i=2:ny-1;


difference in space
for it=1:niter
...(5-point difference)
pn=p;

p(i,j)=((dy^2*(pn(i+1,j)+pn(i-
%% 1,j)))+(dx^2*(pn(i,j+1)+pn(i,j-1))))/(2*(dx^2+dy^2));

%Specifying parameters %Boundary conditions (Neumann conditions)

nx=60; %Number of steps in space(x) p(:,1)=0;

ny=60; %Number of steps in space(y) p(:,nx)=y;

niter=10000; %Number of iterations p(1,:)=p(2,:);

dx=2/(nx-1); %Width of space step(x) p(ny,:)=p(ny-1,:);

dy=2/(ny-1); %Width of space step(y) end

x=0:dx:2; %Range of x(0,2) and specifying


the grid points

y=0:dy:2; %Range of y(0,2) and specifying


the grid points

%%

%Initial Conditions

p=zeros(ny,nx); %Preallocating p

pn=zeros(ny,nx); %Preallocating pn

%%

%Boundary conditions

p(:,1)=0;

p(:,nx)=y;

p(1,:)=p(2,:); %Neumann conditions

p(ny,:)=p(ny-1,:); ...same as above

%%
Spécialité : ……………………………………………..

Nom et prénom : ……………………………………………

N= 1 P1(L/3 ,L/3) P2(2L/3 ,L/3) P3(L/3 ,2L/3) P4(2L/3 ,2L/3)

(i,j) T (°C) ɛr (i,j) T (°C) ɛr (i,j) T (°C) ɛr (i,j) T (°C) ɛr

Cas 01

Cas 02

Cas 03

Cas 04

2/2

You might also like