import numpy as np from utils import runAnimation #from compute_temperature import rod l_rod = 20. t_f = 100. nb_x = 50 nb_t = 200 D = 1. def initial_T(x): return x*(x[-1]-x) x = np.linspace(0., l_rod, nb_x) t = np.linspace(0., t_f , nb_t) T = np.zeros( [nb_t, nb_x] ) T[0,:] = initial_T(x) for it in range(1,t.size): T[it,:] = (1-it/t.size)*T[0,:] #T = rod(x, t, initial_T, D) runAnimation(x, t, T, 'x', 'T', f"Diffusion coef = {D}", True)