Finite Difference Methods
web.mit.edu › course › 16Example 1. Finite Difference Method applied to 1-D Convection In this example, we solve the 1-D convection equation, ∂U ∂t +u ∂U ∂x =0, using a central difference spatial approximation with a forward Euler time integration, Un+1 i −U n i ∆t +un i δ2xU n i =0.
PROGRAMMING OF FINITE DIFFERENCE METHODS IN MATLAB
www.math.uci.edu › ~chenlong › 226PROGRAMMING OF FINITE DIFFERENCE METHODS IN MATLAB 5 to store the function. For the matrix-free implementation, the coordinate consistent system, i.e., ndgrid, is more intuitive since the stencil is realized by subscripts. Let us use a matrix u(1:m,1:n) to store the function. The following double loops will compute Aufor all interior nodes.