tau = 0.5
dt = 0.01
Nt = int(tau/dt)
grid_size = 100
dx = 1/grid_size
x = np.linspace(0, grid_size, grid_size)
t = np.linspace(dt, tau, Nt+1)
Sw_g = [[0 for x1 in range(grid_size)] for y in range(Nt)]
Sw_g[:Nt][grid_size-1] = 0.2 # Initialization
fw_g = [[1 for x1 in range(grid_size)] for y in range(Nt)]
fw_g[:Nt][grid_size-1] = 0
When I set the grid size to 10, it runs smoothly but when the grid size is 100, it says list assignment index out of range for initialization of Sw_g. I can't seem to rectify this.