Optimal power-flow: a knowledge based approach