Skip to main content

pio_calc_sensitivities

Function pio_calc_sensitivities 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pio_calc_sensitivities( network: *const PioBalancedNetwork, formula: *const c_char, formula_len: usize, solver: *const c_char, solver_len: usize, error: *mut *mut PioError, ) -> *mut PioSensitivities
Expand description

DC power transfer and line outage distribution factors of a balanced network, through the same Rust routine the Python binding calls (calc_ptdf_lodf_with_options). formula selects the branch susceptance as in pio_calc_incidence_matrix; NULL means series_susceptance. solver is auto, dense, or sparse; NULL means auto, which takes the dense factorization on small cases and the sparse one on large cases.

The DC bus susceptance matrix is grounded at every reference bus, one row and column each, so a network needs one reference per island; a network that leaves an island without one fails with the matrix crate’s finding. Every reference bus column of the PTDF is zero. The bus axis is the bus table in order, followed by one star bus per in service three winding transformer; the branch axis is every in service, non self loop branch in table order, followed by the three winding transformer windings. Entries at or below 1e-12 in magnitude read as zero. Release with pio_sensitivities_release.

§Safety

Pointers and handles must satisfy the crate-level safety requirements.