Computational Physics, Physics, Heat Equation, Python, Math.
= u_left u[:, :1, 1:] = u_bottom u[:, :, (plate_length-1):] = u_right We’ve set up the initial and boundary conditions, let’s write the calculation function based on finite-difference method: def calculate(u): for k in range(0, max_iter_time-1, 1): for i in range(1, plate_length-1, delta_x): for j