Working code for OPF problem

networks with 9,14,30 and 39 buses are functional
Working Code

bus numbers which are not in order are fine now