shallow_water_1d_test, a MATLAB program which calls shallow_water_1d to simulate a system governed by the shallow water equations in 1D.
The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.
shallow_water_1d, a MATLAB program which simulates the evolution of a 1D fluid governed by the time-dependent shallow water equations.
A simple dataset was created by the command
[ h_array, uh_array, x, t ] = shallow_water_1d ( 41, 100, 1.0, 0.2, 9.8 )This was then animated by the command
shallow_water_1d_animation ( h_array, uh_array, x, t )and the resulting JPG files were turned into QuickTime movies.
An internal switch was modified so that the code used periodic boundary conditions. In this case, we can expect momentum conservation. The dataset was created by the command
[ h_array, uh_array, x, t ] = shallow_water_1d ( 41, 100, 1.0, 0.2, 9.8 )This was then animated by the command
shallow_water_1d_animation ( h_array, uh_array, x, t )and the resulting JPG files were turned into QuickTime movies.