In case there is no friction and the channel has a rectangular prismatic cross section, the Saint-Venant equations have a Hamiltonian structure. The Hamiltonian H is equal to the energy of the free-surface flow: H = ρ ρ ∫ ∫ ( 1 2 A u 2 + 1 2 g B ζ ζ 2 ) d x , with constant B the channel width and ρ the constant fluid density. Hamilton's equations then are: ρ ρ B ∂ ∂ ζ ζ ∂ ∂ t + ∂ ∂ ∂ ∂ x ( ∂ ∂ H ∂ ∂ u ) = ρ ρ ( B ∂ ∂ ζ ζ ∂ ∂ t + ∂ ∂ ( A u ) ∂ ∂ x ) = ρ ρ ( ∂ ∂ A ∂ ∂ t + ∂ ∂ ( A u ) ∂ ∂ x ) = 0 , ρ ρ B ∂ ∂ u ∂ ∂ t + ∂ ∂ ∂ ∂ x ( ∂ ∂ H ∂ ∂ ζ ζ ) = ρ ρ B ( ∂ ∂ u ∂ ∂ t + u ∂ ∂ u ∂ ∂ x + g ∂ ∂ ζ ζ ∂ ∂ x ) = 0 , since ∂ A /∂ ζ = B).