1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| %%Probleme 10
%Calculer la temperature ambiante du sol
%alpha est la diffusité thermique, alpha = 0.128 * 10^-6;
%t est le temps
%z est la profondeur
%Ti est la temperature ambiante du sol souterrain
%Ts est la temperature a la surface du sol
%Tzt est est la temperature a une profondeur et a un temps donné
%fonctions anonymes
%fonction anonyme Y=erf(x) avec x = z/(2*sqrt(alpha*t))
Y=@(z,t) erf(z./(2*sqrt((0.128 * 10^-6).*t)));
%fonction anonyme pour calculer Tzt avec Tzt = (Ti-Ts) + Ts
Tzt = @(Y,Ti,Ts) (Ti - Ts).*Y + Ts;
%%
%Reponse a
Y1 = Y(1.5,2.592*10^6);
Tzt1 = Tzt(Y1,10,-20);
disp('La réponse a la reponse a est :')
disp(Tzt1)
%%
%Reponse b
temps = 0:3600*24:31*3600*24;
Y2 = Y(1,temps);
Tzt2 = Tzt(Y2,10,-20);
subplot(1,2,1)
plot(temps/(3600*24),Tzt2)
grid off
xlabel('Temps')
ylabel('Temperature')
axis([0,31,0,15])
title('Reponse b')
%%
%Reponse c
format long
z1 = 0:0.1:3;
temps1 = 0:3600*24:30*3600*24;
Y3 = Y(z1,temps1);
Tzt3 = Tzt(Y3,10,-20);
subplot(1,2,2)
plot3(temps1/(3600*24),z1,Tzt3)
grid on
xlabel('Temps')
ylabel('Profondeur')
zlabel('Temperature')
axis([0,30,0,3,0,15])
title('Reponse c') |
Partager