New answers tagged advection
0
Some remarks about the code, perhaps cleaning these up already solves the question, especially the initialization error:
Floating point errors are a thing, so if you want to get the expected results, give some wiggle room (0.01 is arbitrary, I would not expect defects above 1e-12 in this place)
N = int((x1 - x0) / h + 0.01)
M = int((t1 - t0) / tau + 0.01)...
Top 50 recent answers are included
Related Tags
advection × 75finite-difference × 31
pde × 27
hyperbolic-pde × 13
fluid-dynamics × 12
boundary-conditions × 12
stability × 9
numerics × 8
python × 5
advection-diffusion × 5
diffusion × 5
crank-nicolson × 5
navier-stokes × 4
finite-element × 3
matlab × 3
finite-volume × 3
implicit-methods × 3
conservation × 3
eigenvalues × 2
convergence × 2
discretization × 2
discontinuous-galerkin × 2
spectral-method × 2
optimization × 1
computational-physics × 1