np.set_printoptions(linewidth=2000, suppress=True) pd.set_option('display.max_rows', 500) pd.set_option('display.max_columns', 500) pd.set_option('display.width', 1000) # fname = '/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/IEEE39_1W.gridcal' fname = '/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/IEEE 14.xlsx' # fname = '/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/lynn5buspv.xlsx' # fname = '/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/IEEE 118.xlsx' # fname = '/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/1354 Pegase.xlsx' # fname = 'helm_data1.gridcal' grid = FileOpen(fname).open() nc = grid.compile_snapshot() inputs = nc.compute()[0] # pick the first island V, converged_, error, Scalc_, iter_, elapsed_ = helm_josep(Ybus=inputs.Ybus, Yseries=inputs.Yseries, V0=inputs.Vbus, S0=inputs.Sbus, Ysh0=inputs.Ysh, pq=inputs.pq, pv=inputs.pv, sl=inputs.ref, pqpv=inputs.pqpv, tolerance=1e-6, max_coeff=10, use_pade=False, verbose=False)
# grid.load_file('lynn5buspq.xlsx') # grid.load_file('lynn5buspv.xlsx') # grid.load_file('IEEE30.xlsx') # grid.load_file('/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/IEEE 14.xlsx') # grid.load_file('/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/IEEE39.xlsx') # grid.load_file('/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/1354 Pegase.xlsx') # fname = '/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/IEEE 14.xlsx' fname = '/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/IEEE39_1W.gridcal' # fname = '/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/1354 Pegase.xlsx' grid = FileOpen(fname).open() numerical_circuit = grid.compile_snapshot() circuits = numerical_circuit.compute() circuit = circuits[0] print('\nYbus:\n', circuit.Ybus.todense()) print('\nSbus:\n', circuit.Sbus) print('\nIbus:\n', circuit.Ibus) print('\nVbus:\n', circuit.Vbus) print('\ntypes:\n', circuit.types) print('\npq:\n', circuit.pq) print('\npv:\n', circuit.pv) print('\nvd:\n', circuit.ref) start_time = time.time()
normF = norm(F, Inf) end = time.time() elapsed = end - start return voltage, converged, normF, Scalc, iter_, elapsed if __name__ == '__main__': fname = r'/home/santi/Documentos/GitHub/GridCal/Grids_and_profiles/grids/IEEE 9 Bus.gridcal' from GridCal.Engine import FileOpen circuit = FileOpen(fname).open() nc = circuit.compile_snapshot() islands = nc.compute() island = islands[0] voltage, converged, normF, Scalc, iter_, elapsed = FDPF(Vbus=island.Vbus, Sbus=island.Sbus, Ibus=island.Ibus, Ybus=island.Ybus, B1=island.B1, B2=island.B2, pq=island.pq, pv=island.pv, pqpv=island.pqpv, tol=1e-9, max_it=100)