Bonjour,

Avec le code ci dessous qui fonctionne bien vous pourrez voir l evolution de la temperature en fonction du temps. (2D)
j'aimerais rajouter une dimension en faisant varier x (profondeur du materiau) de 0 a 1*10^-9...pour obtenir un graphe en 3D.


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 
 
clear all;
close all;
Q=188.64;
K=0.802;
w=0.0227861753262656;
tp=300;
Y0=20;
x=0;
t= 1 : 1 : 300;
A=(x./(2*sqrt(w*t)));
z= Y0 + (2*Q./K)'*sqrt(w*t)'*[exp(-A.^2)./sqrt(pi)' - A*erfc(A)'];
t1= 301 : 1 : 600;
   A=(x./(2*sqrt(w*t1)));
   B=(x./(2*sqrt(w*(t1-tp))));
   z1= Y0 + (2*Q./K)'*sqrt(w*t1)'*[exp(-A.^2)./sqrt(pi)' - A*erfc(A)'] - (2*Q./K)'*sqrt(w*(t1-tp))'*[exp(-B.^2)./sqrt(pi)' - B*erfc(B)'];
plot(t,z,t1,z1);
xlabel('temps');
ylabel('temperature');
mais quand je tape ce code

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
 clear all;
close all;
Q=188.64;
K=0.802;
w=0.0227861753262656;
tp=300;
Y0=20;
 
x= 0 : 0.001 : 0.299;
t= 1 : 1 : 300;
A=(x./(2*sqrt(w*t)));
z= Y0 + (2*Q./K)'*sqrt(w*t)'*[exp(-A.^2)./sqrt(pi)' - A*erfc(A)'];
 
t1= 301 : 1 : 600;
   A=(x./(2*sqrt(w*t1)));
   B=(x./(2*sqrt(w*(t1-tp))));
   z1= Y0 + (2*Q./K)'*sqrt(w*t1)'*[exp(-A.^2)./sqrt(pi)' - A*erfc(A)'] - (2*Q./K)'*sqrt(w*(t1-tp))'*[exp(-B.^2)./sqrt(pi)' - B*erfc(B)'];
 
subplot(2,1,1); 
mesh(x,t,z);
xlabel('x');
ylabel('t');
zlabel('z');
title('evolution temperature 3D');
 
subplot(2,1,2); 
mesh(x,t1,z1);
xlabel('x');
ylabel('t');
zlabel('z');
title('evolution temperature 3D');
Ca ne me donne pas les memes graphiques ....je ne comprend pas....