Computational Physics, Physics, Heat Equation, Python, Math.
fourier*dx**2/alpha # time step nt = int((tf-ti) / dt) # number of time steps # Initial condition T0 = np.sin(2*np.pi*x) # initial condition source = 2*np.sin(np.pi*x) # heat source term In the function below we discretize the right-hand side of the heat equation using the centered finite