Skip to main content

second_derivative

Function second_derivative 

Source
pub fn second_derivative(u: &[f64], dx: f64) -> Vec<f64>
Expand description

Computes the second derivative of u with the standard 3-point Laplacian stencil.

Interior: (u[i-1] - 2 u[i] + u[i+1]) / dx². Boundaries are set to zero.