Skip to main content

compact_first_derivative

Function compact_first_derivative 

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

Compact (Padé) 4th-order first derivative.

Solves the tridiagonal system (1/4) f'[i-1] + f'[i] + (1/4) f'[i+1] = (3/2)(u[i+1]-u[i-1])/(2dx). Interior only; boundary nodes use standard second-order differences.