#include ../data/case14.txt
#include ../lib/idx_gen.txt
#include ../lib/idx_bus.txt
#include ../lib/idx_brch.txt


// constants
nb = size(bus, 1);          // number of buses
nl = size(branch, 1);       // number of lines

stat = slice(branch, [0], BR_STATUS);                    // ones at in-service branches
Ys = stat ./ (slice(branch, [0], BR_R) + c(0,1) * slice(branch, [0], BR_X));  // series admittance

return Ys;