Computational Physics, Python, Math, Physics.
cond #i = N_x u_jp1[N_x] = u_j[N_x-1] + (CFL_2 -1)/(CFL_2 + 1)*(u_jp1[N_x-1] - u_j[N_x]) u_jm1 = u_j.copy() #go to the next step u_j = u_jp1.copy() #go to the next step U[:,1] = u_j.copy() #Process loop (on time mesh) for j in range(1, N_t): #calculation at step j+1 #without boundary cond