fd1d_advection_ftcs_test, a C code which calls fd1d_advection_ftcs() to apply the finite difference method to solve the time-dependent advection equation ut = - c * ux in one spatial dimension, with a constant velocity, using the FTCS method, forward time difference, centered space difference, writing graphics files for processing by gnuplot.
The computer code and data files described and made available on this web page are distributed under the MIT license
FD1D_ADVECTION_FTCS is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version.
fd1d_advection_ftcs, a C code which applies the finite difference method (FDM) to solve the time-dependent advection equation ut = - c * ux in one spatial dimension, with a constant velocity, using the forward time, centered space (FTCS) difference method, writing graphics files for processing by gnuplot.
Graphical output for this program was created using GNUPLOT. Data at selected time steps was written to a "data" file, and the appropriate GNUPLOT commands were written to a "command" file. The plot can be created by the command
gnuplot < advection_commands.txt