Skip to main content

wave_equation_step

Function wave_equation_step 

Source
pub fn wave_equation_step(
    u: &[f64],
    u_prev: &[f64],
    dx: f64,
    dt: f64,
    c: f64,
) -> Vec<f64>
Expand description

One explicit time step for the 1D wave equation ∂²u/∂t² = c² ∂²u/∂x².

Requires the solution at times t (u) and t-dt (u_prev).