import numpy as np
import matplotlib.pyplot as plt
# données du pb
Lambda = 0.037
cp = 1500
rho = 1.325
L = 1  # épaisseur isolant
t_max = 20000  # temps de fin d'intégration en secondes
N_t = 100 # nombres d'intervalles ds le tps
N_x = 10 # nombres d'intervalles ds l'espace
T_int = 20
T_ext = 5
K = Lambda/cp/rho # diffusivité th

# discrétisation de  l'espace et du tps
dx = L/N_x
dt = t_max /N_t
Temp = np.zeros((N_t + 1, N_x + 1))

# initialisation de la température
# conditions initiales
Temp[0,0] = T_int

for i in range (1,N_x + 1):
    Temp[0,i]=T_ext

# conditions aux limites
for n in range (1,N_t + 1):
    Temp[n,0]=T_int
    Temp[n,N_x]=T_ext
# calcul des températures aux différents instants





plt.figure(figsize=(8,8))
for n in [0, 30, 60, 90] :
    plt.plot(list(range(N_x+1)), Temp[n, :], label=str(n))
plt.legend()
plt.show()
