_________________________________________________________________________________________________
+
Ce document liste les commandes à entrer dans l'interface GIT afin de Push ou de Pull un dossier.
+
_________________________________________________________________________________________________
+
Pull
----
+
1- git -c http.sslVerify=false clone https://git.forge.pleiade.edf.fr/git/eficas.git # Cette commande se connecte au serveur GIT puis clone le répertoire DER sur notre ordinateur
+
2- cd eficas # Cette commande permet de se place dans le dossier eficas
+
3- Supprimer manuellement le fichier Efi2Xsd/README.txt
+
4- git checkout DER # Cette commande nous place sur la branche dédiée au DER
+
+
Push
----
+
1- git add nom_du_fichier
+
2- git commit -m 'Commentaires'
+
3- git config --global http.sslVerify false # Cette commande nous donne les droits pour push nos modifications sur la branche dédiée
+
4- git push
+
5- Renseigner ces identifiants SESAME
+
+IMPORTANT
+_________
+Il est nécessaire d'effectuer un pull avant de faire un push. L'action de pull va nous placer dans la branche dédiée au DER.
+
+
+
+Présentation d'un cas de figure pouvant poser problème
+______________________________________________________
+L'utilisateur effecte un pull puis ferme l'application Git Bash. Il travaille sur ce dossier pendant plusieurs jours sans effectuer de push.
+
+Lorsqu'il va vouloir finalement push ce nouveau dossier modifié, il sera obligé d'effectuer un pull au préalable ce qui risque d'écraser son dossier actuel.
+
+Il faut alors renommer son dossier modifié avant d'effectuer ce pull. Ensuite, il peut transférer les fichiers modifiés dans le dossier qu'il vient de pull.
+
+Il effectue ensute son push selon les modalités ci-dessus.
+
+
+
+
+
+
+
+
Ce répertoire est également accesible en ligne en suivant ce lien :
+
___________________________________________________________________
+
+
https://forge.pleiade.edf.fr/projects/eficas/repository?utf8=%E2%9C%93&rev=DER
\ No newline at end of file
self.vm = vm
self.fichier = fichier
self.jdc = jdc
- self.first = True
+ self.first = True
self.QWParent = QWParent
self.couleur = Qt.black
self.nodeEnCours=None
f = open( str(fileDico), 'wb')
f.write("Dico =" + str(dico) )
f.close()
- print(dico)
+ # print(dico)
if 'PSSE_path' in dico['CASE_SELECTION']:
from Run import run
- # self.appliEficas.close()
-
- # import cProfile, pstats, StringIO
- # pr = cProfile.Profile()
- # pr.enable()
- # run(dico)
- # pr.disable()
- # s = StringIO.StringIO()
- # sortby = 'cumulative'
- # ps = pstats.Stats(pr, stream=s).sort_stats(sortby)
- # ps.print_stats()
- # print(s.getvalue())
-
run(dico)
elif 'PF_path' in dico['CASE_SELECTION']:
print('in runPSEN_N1 else')
def _newPSEN_N1(self):
#---------------------------#
texte=""
+
+ # if 'PF_PARAMETERS' in self.Ordre_Des_Commandes:
# texte="CASE_SELECTION();CONTINGENCY_OPTIONS();CONTINGENCY_SELECTION();\nCONTINGENCY_PROCESSING(); "
- #texte="CONTINGENCY_SELECTION();\nCONTINGENCY_PROCESSING(); "
+ # texte="CONTINGENCY_SELECTION();\nCONTINGENCY_PROCESSING(); "
return texte
#---------------------------#
import os,pickle
import sys, subprocess
import numpy as np
+
path1=os.getcwd()
- # path_temp=os.path.dirname(NetworkFile)
filew=open('temp.txt','w')
filew.write(NetworkFile+'\n')
filew.write(PF_PATH + '\n')
filew.write(Python3_path + '\n')
filew.close()
print('changer le chemin de Python3 executable')
+
lancer = [Python3_path+'/python.exe', path1+'/com.py']# changer le chemin de Python3 executable
proc = subprocess.Popen(lancer)
proc.wait()
+
with open('Data_for_interface', 'rb') as fichier:
mon_depickler = pickle.Unpickler(fichier)
- data_file = mon_depickler.load()
+ data_file = mon_depickler.load()
+
import collections
def convert(data):
if isinstance(data, basestring):
MotorDico = data['MotorDico']
os.remove('Data_for_interface')
- # return MachineDico, LoadDico, LineDico, TfoDico, MotorDico
- return MachineDico, LoadDico, LineDico, TfoDico, MotorDico
-
-
-#NetworkFile=r"C:\Users\j15773\Documents\Projects\DEWA\Task 4\FEWA_GCCIA_SUMMAX2018_OPF_EQ2.sav"
-
-#PSSE_PATH=r"C:\Program Files (x86)\PTI\PSSE34\PSSBIN"
-#PSSPY_PATH=r"C:\Program Files (x86)\PTI\PSSE34\PSSPY27"
-
-#PSSE_PATH=r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN"
-#PSSPY_PATH=r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN"
-
-#MachineDico, LoadDico, LineDico, TfoDico, MotorDico = ExtractGeneratorLoadLineandTransfoDico(NetworkFile,PSSE_PATH,PSSPY_PATH)
+
+ return MachineDico, LoadDico, LineDico, TfoDico, MotorDico
\ No newline at end of file
# -*- coding: cp1252 -*-
#===============================================================================
-# PSEN SCRIPT FOR PROBABILISTIC STUDIES OF ELECTICAL NETWORKS
+# PSEN SCRIPT FOR PROBABILISTIC STUDIES OF ELECTRICAL NETWORKS
#===============================================================================
from pylab import *
-from math import*
+from math import *
import os, random, sys,copy,multiprocessing
import numpy as np
import time #import gmtime, strftime, sleep
except NameError :
print ('Probabilistic')
-
+
dico['doc_base'] = os.path.join(pathBigFolder, 'package0' + "_N" + folderN_1 + day + "_" + hour)
liste_dico = []
Ind1, Ind2, output, inputSamp, Pmachine=Calculation(liste_dico[0].copy(),nb_fix,cmd_Path)# lancer les calculs OPF
-# try :
-# time_serie
-# except NameError :
-# print ('Probabilistic')
-# dico['doc_base'] = os.path.join(pathBigFolder, 'package0' + "_N" + folderN_1 + day + "_" + hour)
-#
-# liste_dico = []
-# liste_dico.append(dico.copy())
-# os.environ['PATH'] += ';' + dico['doc_base'] # add the path of each directory
-# Ind1, Ind2, output, inputSamp, Pmachine=Calculation(liste_dico[0].copy(),nb_fix,cmd_Path)# lancer les calculs OPF
-#
-#
-# else:
-# print('Time series')
-# dico['TStest']=1
-# Xt=[]
-# for i in range (len(time_serie_mat)) : #as many as there are points in the time serie
-#
-# Xt0=[]
-# n=0
-# for j in range (len(time_serie_flag)) : #for each variable
-#
-# if time_serie_flag[j] == -1 : #if not a time series
-# Xt0.append(-1)
-# n+=1
-# else :
-# Xt0.append(time_serie_mat[i][j-n]) #append the element
-#
-# Xt.append(Xt0)
-#
-# liste_dico=[]
-# ipos=0
-#
-# RandomGenerator.SetSeed(os.getpid())
-# inputDistribution=create_dist(dico)
-# samples=[]
-#
-# dico['doc_base'] = os.path.join(pathBigFolder, 'package0' + "_N" + folderN_1 + day + "_" + hour)
-#
-# dico['Xt']=Xt
-# dico['timeVect']=timeVect[0:len(Xt)]
-## dico['Xt']=Xt[ipos:int(((i+1)*round(float(len(Xt))/float(num_cores))))]
-## dico['timeVect']=timeVect[ipos:int(((i+1)*round(float(len(Xt))/float(num_cores))))]
-## ipos=int(((i+1)*round(float(len(Xt))/float(num_cores))))
-#
-# myMCE = MonteCarloExperiment(inputDistribution,len(dico['Xt']))
-# Samp = myMCE.generate()
-# samples.append(Samp)
-#
-# liste_dico.append(dico.copy()) #append a new dico to the list
-# os.environ['PATH'] += ';' + dico['doc_base'] #add the path of each directory
-#
-# inputSamp, output, Pmachine, LS, FS, LStable, FStable, Output_beforeUC, Pmachine_beforeUC, LS_beforeUC, FS_beforeUC, LStable_beforeUC, FStable_beforeUC = PFFunct(liste_dico[0].copy(),np.array(samples[0]))
-#
-## for l in range(num_cores):
-## print "launching PACKAGE "+str(l)
-## p= po.apply_async(PSSEFunct,args=(liste_dico[l].copy(),np.array(samples[l]),),\
-## callback=function_callback_psse) #callback function
# liste_dico2.append(dico)
# else:
# shutil.rmtree(dico['doc_base'])
-
+
if dico['TStest']==1: #if Time series, different output file format
for k,dico in enumerate(liste_dico):
package_folder = dico['doc_base']
-MachineDico = {'Champagne_G1_Ugen_genstat_Gr_HighDam_Champagne_G1': {'Q': 0.0, 'EXNAME': 'Champagne_G1_Ugen_66.0KV', 'NAME': 'HighDam_Champagne_G1', 'NUMBER': 26, 'QMAX': 10.200000762939453, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -7.309999942779541, 'ID': 'HighDam_Champagne_G1', 'PMAX': 13.600000381469727}, 'StLouis_Ugen_9_syn_Gr_SLPS_G9': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_9_66.0KV', 'NAME': 'SLPS_G9', 'NUMBER': 105, 'QMAX': 6.578999996185303, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -6.578999996185303, 'ID': 'SLPS_G9', 'PMAX': 13.770000457763672}, 'Sarako_22kV_genstat_Gr_PV_Sarako': {'Q': 0.0, 'EXNAME': 'Sarako_22kV_66.0KV', 'NAME': 'PV_Sarako', 'NUMBER': 91, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Sarako', 'PMAX': 15.0}, 'Ebene_22kV_1_genstat_Gr_PV_Ebene_1': {'Q': 0.0, 'EXNAME': 'Ebene_22kV_1_66.0KV', 'NAME': 'PV_Ebene_1', 'NUMBER': 33, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Ebene_1', 'PMAX': 0.5}, 'FVPS_22kV_3_genstat_Gr_PV_FVPS_3': {'Q': 0.0, 'EXNAME': 'FVPS_22kV_3_66.0KV', 'NAME': 'PV_FVPS_3', 'NUMBER': 44, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FVPS_3', 'PMAX': 0.5}, 'Henrietta_22kV_2_genstat_Gr_PV_Henrietta_2': {'Q': 0.0, 'EXNAME': 'Henrietta_22kV_2_66.0KV', 'NAME': 'PV_Henrietta_2', 'NUMBER': 63, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Henrietta_2', 'PMAX': 0.5}, 'Terminal_1__syn_Gr_FVPS_G5': {'Q': 0.0, 'EXNAME': 'Terminal_1__66.0KV', 'NAME': 'FVPS_G5', 'NUMBER': 108, 'QMAX': 9.894586563110352, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -8.088730812072754, 'ID': 'FVPS_G5', 'PMAX': 15.979999542236328}, 'CaseNoyale_22kV_1_genstat_Gr_PV_CaseNoyale_1': {'Q': 0.0, 'EXNAME': 'CaseNoyale_22kV_1_66.0KV', 'NAME': 'PV_CaseNoyale_1', 'NUMBER': 19, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_CaseNoyale_1', 'PMAX': 0.5}, 'Sottise_22kV_2_genstat_Gr_PV_MonChoisy': {'Q': 0.0, 'EXNAME': 'Sottise_22kV_2_66.0KV', 'NAME': 'PV_MonChoisy', 'NUMBER': 94, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_MonChoisy', 'PMAX': 2.0}, 'Sottise_22kV_1_genstat_Gr_PV_Sottise_1': {'Q': 0.0, 'EXNAME': 'Sottise_22kV_1_66.0KV', 'NAME': 'PV_Sottise_1', 'NUMBER': 93, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Sottise_1', 'PMAX': 0.5}, 'LaFerme_G1_Ugen_genstat_Gr_RoR_LaFerme': {'Q': 0.0, 'EXNAME': 'LaFerme_G1_Ugen_66.0KV', 'NAME': 'RoR_LaFerme', 'NUMBER': 75, 'QMAX': 0.9000000357627869, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.6449999809265137, 'ID': 'RoR_LaFerme', 'PMAX': 1.2000000476837158}, 'Amaury_22kV_2_genstat_Gr_PV_Amaury_2': {'Q': 0.0, 'EXNAME': 'Amaury_22kV_2_66.0KV', 'NAME': 'PV_Amaury_2', 'NUMBER': 1, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Amaury_2', 'PMAX': 0.5}, 'Magenta_G1_Ugen_genstat_Gr_RoR_Magenta': {'Q': 0.0, 'EXNAME': 'Magenta_G1_Ugen_66.0KV', 'NAME': 'RoR_Magenta', 'NUMBER': 79, 'QMAX': 0.6000000238418579, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.4300000071525574, 'ID': 'RoR_Magenta', 'PMAX': 0.800000011920929}, 'StLouis_Ugen_11_syn_Gr_SLPS_G11': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_11_66.0KV', 'NAME': 'SLPS_G11', 'NUMBER': 100, 'QMAX': 12.898200035095215, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -9.2437105178833, 'ID': 'SLPS_G11', 'PMAX': 17.197599411010742}, 'Bellevue_G2_Ugen_syn_Gr_IPP_Bellevue_G2': {'Q': 0.0, 'EXNAME': 'Bellevue_G2_Ugen_66.0KV', 'NAME': 'IPP_Bellevue_G2', 'NUMBER': 12, 'QMAX': 26.700000762939453, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -20.91499900817871, 'ID': 'IPP_Bellevue_G2', 'PMAX': 31.0}, 'Fuel_22kV_2_genstat_Gr_PV_Fuel_2': {'Q': 0.0, 'EXNAME': 'Fuel_22kV_2_66.0KV', 'NAME': 'PV_Fuel_2', 'NUMBER': 57, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Fuel_2', 'PMAX': 0.5}, 'TourKoening_22kV_2_genstat_Gr_PV_TourKoening_2': {'Q': 0.0, 'EXNAME': 'TourKoening_22kV_2_66.0KV', 'NAME': 'PV_TourKoening_2', 'NUMBER': 116, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_TourKoening_2', 'PMAX': 0.5}, 'Fuel_G2_Ugen_syn_Gr_IPP_Fuel_G2': {'Q': 0.0, 'EXNAME': 'Fuel_G2_Ugen_66.0KV', 'NAME': 'IPP_Fuel_G2', 'NUMBER': 60, 'QMAX': 14.100000381469727, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -11.045000076293945, 'ID': 'IPP_Fuel_G2', 'PMAX': 13.5}, 'Bellevue_22kV_1_genstat_Gr_PV_Bellevue_1': {'Q': 0.0, 'EXNAME': 'Bellevue_22kV_1_66.0KV', 'NAME': 'PV_Bellevue_1', 'NUMBER': 8, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Bellevue_1', 'PMAX': 0.5}, 'LeVal_G2_Ugen_genstat_Gr_RoR_LeVal_G2': {'Q': 0.0, 'EXNAME': 'LeVal_G2_Ugen_66.0KV', 'NAME': 'RoR_LeVal_G2', 'NUMBER': 78, 'QMAX': 1.5, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -1.0750000476837158, 'ID': 'RoR_LeVal_G2', 'PMAX': 2.0}, 'NIPS_G3_Ugen_syn_Gr_NIPS_G3': {'Q': 0.0, 'EXNAME': 'NIPS_G3_Ugen_66.0KV', 'NAME': 'NIPS_G3', 'NUMBER': 87, 'QMAX': 28.260000228881836, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -20.253000259399414, 'ID': 'NIPS_G3', 'PMAX': 37.68000030517578}, 'FGPS_Ugen2_syn_Gr_FGPS_G2': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen2_66.0KV', 'NAME': 'FGPS_G2', 'NUMBER': 38, 'QMAX': 17.56800079345703, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -14.640000343322754, 'ID': 'FGPS_G2', 'PMAX': 15.399999618530273}, 'FGPS_Ugen1_syn_Gr_FGPS_G1': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen1_66.0KV', 'NAME': 'FGPS_G1', 'NUMBER': 37, 'QMAX': 17.56800079345703, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -14.640000343322754, 'ID': 'FGPS_G1', 'PMAX': 15.399999618530273}, 'UnionVale_22kV_1_genstat_Gr_PV_UnionVale_1': {'Q': 0.0, 'EXNAME': 'UnionVale_22kV_1_66.0KV', 'NAME': 'PV_UnionVale_1', 'NUMBER': 118, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_UnionVale_1', 'PMAX': 0.5}, 'FortGeorge_22kV_1_genstat_Gr_PV_FortGeorge_1': {'Q': 0.0, 'EXNAME': 'FortGeorge_22kV_1_66.0KV', 'NAME': 'PV_FortGeorge_1', 'NUMBER': 53, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FortGeorge_1', 'PMAX': 0.5}, 'Wooton_22kV_1_genstat_Gr_PV_Esperance': {'Q': 0.0, 'EXNAME': 'Wooton_22kV_1_66.0KV', 'NAME': 'PV_Esperance', 'NUMBER': 121, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Esperance', 'PMAX': 2.0}, 'StLouis_22kV_1_genstat_Gr_PV_StLouis_1': {'Q': 0.0, 'EXNAME': 'StLouis_22kV_1_66.0KV', 'NAME': 'PV_StLouis_1', 'NUMBER': 96, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_StLouis_1', 'PMAX': 0.5}, 'Cecile_G1_Ugen_genstat_Gr_RoR_Cecile': {'Q': 0.0, 'EXNAME': 'Cecile_G1_Ugen_66.0KV', 'NAME': 'RoR_Cecile', 'NUMBER': 23, 'QMAX': 0.75, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.5375000238418579, 'ID': 'RoR_Cecile', 'PMAX': 1.0}, 'Combo_22kV_1_genstat_Gr_PV_Combo_1': {'Q': 0.0, 'EXNAME': 'Combo_22kV_1_66.0KV', 'NAME': 'PV_Combo_1', 'NUMBER': 28, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Combo_1', 'PMAX': 0.5}, 'CTDS_G1_Ugen_syn_Gr_IPP_CTDS_G1': {'Q': 0.0, 'EXNAME': 'CTDS_G1_Ugen_66.0KV', 'NAME': 'IPP_CTDS_G1', 'NUMBER': 14, 'QMAX': 29.439998626708984, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -21.6200008392334, 'ID': 'IPP_CTDS_G1', 'PMAX': 30.0}, 'Terminal_7__syn_Gr_FVPS_G12_MAN': {'Q': 0.0, 'EXNAME': 'Terminal_7__66.0KV', 'NAME': 'FVPS_G12_MAN', 'NUMBER': 114, 'QMAX': 7.390200614929199, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -5.2963104248046875, 'ID': 'FVPS_G12_MAN', 'PMAX': 8.0}, 'FVPS_22kV_1_genstat_Gr_PV_FVPS_1': {'Q': 0.0, 'EXNAME': 'FVPS_22kV_1_66.0KV', 'NAME': 'PV_FVPS_1', 'NUMBER': 42, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FVPS_1', 'PMAX': 0.5}, 'FGPS_Ugen3_syn_Gr_FGPS_G3': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen3_66.0KV', 'NAME': 'FGPS_G3', 'NUMBER': 39, 'QMAX': 22.374000549316406, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -16.780500411987305, 'ID': 'FGPS_G3', 'PMAX': 21.0}, 'Combo_22kV_2_genstat_Gr_PV_Combo_2': {'Q': 0.0, 'EXNAME': 'Combo_22kV_2_66.0KV', 'NAME': 'PV_Combo_2', 'NUMBER': 29, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Combo_2', 'PMAX': 0.5}, 'Ebene_22kV_3_genstat_Gr_PV_Ebene_3': {'Q': 0.0, 'EXNAME': 'Ebene_22kV_3_66.0KV', 'NAME': 'PV_Ebene_3', 'NUMBER': 35, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Ebene_3', 'PMAX': 0.5}, 'FGPS_Ugen4_syn_Gr_FGPS_G4': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen4_66.0KV', 'NAME': 'FGPS_G4', 'NUMBER': 40, 'QMAX': 22.44000244140625, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -18.700000762939453, 'ID': 'FGPS_G4', 'PMAX': 21.0}, 'Jin_Fei_22kV_2_genstat_Gr_PV_Jin_Fei_1': {'Q': 0.0, 'EXNAME': 'Jin_Fei_22kV_2_66.0KV', 'NAME': 'PV_Jin_Fei_1', 'NUMBER': 70, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Jin_Fei_1', 'PMAX': 0.5}, 'NIPS_G2_Ugen_syn_Gr_NIPS_G2': {'Q': 0.0, 'EXNAME': 'NIPS_G2_Ugen_66.0KV', 'NAME': 'NIPS_G2', 'NUMBER': 86, 'QMAX': 17.025001525878906, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -12.201250076293945, 'ID': 'NIPS_G2', 'PMAX': 22.700000762939453}, 'Nicolay_22kV_2_genstat_Gr_PV_Nicolay_2': {'Q': 0.0, 'EXNAME': 'Nicolay_22kV_2_66.0KV', 'NAME': 'PV_Nicolay_2', 'NUMBER': 89, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Nicolay_2', 'PMAX': 0.5}, 'Wooton_22kV_1_genstat_Gr_PV_Wooton_2': {'Q': 0.0, 'EXNAME': 'Wooton_22kV_1_66.0KV', 'NAME': 'PV_Wooton_2', 'NUMBER': 121, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Wooton_2', 'PMAX': 0.5}, 'Jin_Fei_22kV_1_genstat_Gr_PV_Jin_Fei_2': {'Q': 0.0, 'EXNAME': 'Jin_Fei_22kV_1_66.0KV', 'NAME': 'PV_Jin_Fei_2', 'NUMBER': 69, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Jin_Fei_2', 'PMAX': 0.5}, 'Fuel_G1_Ugen_syn_Gr_IPP_Fuel_G1': {'Q': 0.0, 'EXNAME': 'Fuel_G1_Ugen_66.0KV', 'NAME': 'IPP_Fuel_G1', 'NUMBER': 59, 'QMAX': 16.275001525878906, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -12.748749732971191, 'ID': 'IPP_Fuel_G1', 'PMAX': 13.5}, 'LeVal_G1_Ugen_genstat_Gr_RoR_LeVal_G1': {'Q': 0.0, 'EXNAME': 'LeVal_G1_Ugen_66.0KV', 'NAME': 'RoR_LeVal_G1', 'NUMBER': 77, 'QMAX': 1.5, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -1.0750000476837158, 'ID': 'RoR_LeVal_G1', 'PMAX': 2.0}, 'StLouis_22kV_2_genstat_Gr_PV_StLouis_2': {'Q': 0.0, 'EXNAME': 'StLouis_22kV_2_66.0KV', 'NAME': 'PV_StLouis_2', 'NUMBER': 97, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_StLouis_2', 'PMAX': 0.5}, 'TourKoening_22kV_1_genstat_Gr_PV_TourKoening_1': {'Q': 0.0, 'EXNAME': 'TourKoening_22kV_1_66.0KV', 'NAME': 'PV_TourKoening_1', 'NUMBER': 115, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_TourKoening_1', 'PMAX': 0.5}, 'StLouis_Ugen_10_syn_Gr_SLPS_G10': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_10_66.0KV', 'NAME': 'SLPS_G10', 'NUMBER': 99, 'QMAX': 12.898200035095215, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -9.2437105178833, 'ID': 'SLPS_G10', 'PMAX': 17.197599411010742}, 'LaChaumiere_22kV_2_genstat_Gr_PV_LaChaumiere_2': {'Q': 0.0, 'EXNAME': 'LaChaumiere_22kV_2_66.0KV', 'NAME': 'PV_LaChaumiere_2', 'NUMBER': 73, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_LaChaumiere_2', 'PMAX': 0.5}, 'FGPS_Ugen5_syn_Gr_FGPS_G5': {'Q': 0.0, 'EXNAME': 'FGPS_Ugen5_66.0KV', 'NAME': 'FGPS_G5', 'NUMBER': 41, 'QMAX': 22.44000244140625, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -18.700000762939453, 'ID': 'FGPS_G5', 'PMAX': 21.0}, 'Bellevue_22kV_2_genstat_Gr_PV_Bellevue_2': {'Q': 0.0, 'EXNAME': 'Bellevue_22kV_2_66.0KV', 'NAME': 'PV_Bellevue_2', 'NUMBER': 9, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Bellevue_2', 'PMAX': 0.5}, 'StLouis_Ugen_13_syn_Gr_SLPS_G13': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_13_66.0KV', 'NAME': 'SLPS_G13', 'NUMBER': 102, 'QMAX': 12.898200035095215, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -9.2437105178833, 'ID': 'SLPS_G13', 'PMAX': 17.197599411010742}, 'Wooton_22kV_2_genstat_Gr_PV_Wooton_1': {'Q': 0.0, 'EXNAME': 'Wooton_22kV_2_66.0KV', 'NAME': 'PV_Wooton_1', 'NUMBER': 122, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Wooton_1', 'PMAX': 0.5}, 'Sottise_22kV_2_genstat_Gr_PV_Sottise_2': {'Q': 0.0, 'EXNAME': 'Sottise_22kV_2_66.0KV', 'NAME': 'PV_Sottise_2', 'NUMBER': 94, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Sottise_2', 'PMAX': 0.5}, 'Nicolay_22kV_1_genstat_Gr_PV_Nicolay_1': {'Q': 0.0, 'EXNAME': 'Nicolay_22kV_1_66.0KV', 'NAME': 'PV_Nicolay_1', 'NUMBER': 88, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Nicolay_1', 'PMAX': 0.5}, 'StLouis_Ugen_8_syn_Gr_SLPS_G8': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_8_66.0KV', 'NAME': 'SLPS_G8', 'NUMBER': 104, 'QMAX': 6.578999996185303, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -6.578999996185303, 'ID': 'SLPS_G8', 'PMAX': 13.770000457763672}, 'Ferney_G2_Ugen_genstat_Gr_HighDam_Ferney_G2': {'Q': 0.0, 'EXNAME': 'Ferney_G2_Ugen_66.0KV', 'NAME': 'HighDam_Ferney_G2', 'NUMBER': 52, 'QMAX': 3.2875001430511475, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -2.6875, 'ID': 'HighDam_Ferney_G2', 'PMAX': 5.3125}, 'Ferney_G1_Ugen_genstat_Gr_HighDam_Ferney_G1': {'Q': 0.0, 'EXNAME': 'Ferney_G1_Ugen_66.0KV', 'NAME': 'HighDam_Ferney_G1', 'NUMBER': 51, 'QMAX': 3.2875001430511475, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -2.6875, 'ID': 'HighDam_Ferney_G1', 'PMAX': 5.3125}, 'Champagne_G2_Ugen_genstat_Gr_HighDam_Champagne_G2': {'Q': 0.0, 'EXNAME': 'Champagne_G2_Ugen_66.0KV', 'NAME': 'HighDam_Champagne_G2', 'NUMBER': 27, 'QMAX': 10.200000762939453, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -7.309999942779541, 'ID': 'HighDam_Champagne_G2', 'PMAX': 13.600000381469727}, 'PlaineDesRochesPowerStation_22kV_genstat_Gr_EOL_PlaindesRoches': {'Q': 0.0, 'EXNAME': 'PlaineDesRochesPowerStation_22kV_66.0KV', 'NAME': 'EOL_PlaindesRoches', 'NUMBER': 90, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'EOL_PlaindesRoches', 'PMAX': 9.399999618530273}, 'FVPS_22kV_2_genstat_Gr_PV_FVPS_2': {'Q': 0.0, 'EXNAME': 'FVPS_22kV_2_66.0KV', 'NAME': 'PV_FVPS_2', 'NUMBER': 43, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FVPS_2', 'PMAX': 0.5}, 'Terminal_6__syn_Gr_FVPS_G6': {'Q': 0.0, 'EXNAME': 'Terminal_6__66.0KV', 'NAME': 'FVPS_G6', 'NUMBER': 113, 'QMAX': 9.894586563110352, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -8.088730812072754, 'ID': 'FVPS_G6', 'PMAX': 15.989350318908691}, 'Ebene_22kV_2_genstat_Gr_PV_Ebene_2': {'Q': 0.0, 'EXNAME': 'Ebene_22kV_2_66.0KV', 'NAME': 'PV_Ebene_2', 'NUMBER': 34, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Ebene_2', 'PMAX': 0.5}, 'LaChaumiere_22kV_1_genstat_Gr_PV_LaChaumiere_1': {'Q': 0.0, 'EXNAME': 'LaChaumiere_22kV_1_66.0KV', 'NAME': 'PV_LaChaumiere_1', 'NUMBER': 72, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_LaChaumiere_1', 'PMAX': 0.5}, 'Amaury_22kV_2_genstat_Gr_PV_PetiteRetraite': {'Q': 0.0, 'EXNAME': 'Amaury_22kV_2_66.0KV', 'NAME': 'PV_PetiteRetraite', 'NUMBER': 1, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_PetiteRetraite', 'PMAX': 2.0}, 'Terminal_2__syn_Gr_FVPS_G1': {'Q': 0.0, 'EXNAME': 'Terminal_2__66.0KV', 'NAME': 'FVPS_G1', 'NUMBER': 109, 'QMAX': 9.460636138916016, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -7.733980178833008, 'ID': 'FVPS_G1', 'PMAX': 15.288100242614746}, 'StLouis_Ugen_7_syn_Gr_SLPS_G7': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_7_66.0KV', 'NAME': 'SLPS_G7', 'NUMBER': 103, 'QMAX': 6.578999996185303, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -6.578999996185303, 'ID': 'SLPS_G7', 'PMAX': 13.770000457763672}, 'Beauchamp_G1_Ugen_syn_Gr_IPP_Beauchamp_G1': {'Q': 0.0, 'EXNAME': 'Beauchamp_G1_Ugen_66.0KV', 'NAME': 'IPP_Beauchamp_G1', 'NUMBER': 7, 'QMAX': 18.479999542236328, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -13.243999481201172, 'ID': 'IPP_Beauchamp_G1', 'PMAX': 22.0}, 'Terminal_3__syn_Gr_FVPS_G3': {'Q': 0.0, 'EXNAME': 'Terminal_3__66.0KV', 'NAME': 'FVPS_G3', 'NUMBER': 110, 'QMAX': 9.894586563110352, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -8.088730812072754, 'ID': 'FVPS_G3', 'PMAX': 15.989350318908691}, 'Tamarind_G1_Ugen_genstat_Gr_RoR_Tamarind': {'Q': 0.0, 'EXNAME': 'Tamarind_G1_Ugen_66.0KV', 'NAME': 'RoR_Tamarind', 'NUMBER': 106, 'QMAX': 3.2160003185272217, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -2.304800033569336, 'ID': 'RoR_Tamarind', 'PMAX': 4.288000106811523}, 'Terminal_4__syn_Gr_FVPS_G4': {'Q': 0.0, 'EXNAME': 'Terminal_4__66.0KV', 'NAME': 'FVPS_G4', 'NUMBER': 111, 'QMAX': 9.894586563110352, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -8.088730812072754, 'ID': 'FVPS_G4', 'PMAX': 15.989350318908691}, 'Amaury_22kV_1_genstat_Gr_PV_Amaury_1': {'Q': 0.0, 'EXNAME': 'Amaury_22kV_1_66.0KV', 'NAME': 'PV_Amaury_1', 'NUMBER': 0, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Amaury_1', 'PMAX': 0.5}, 'UnionVale_22kV_2_genstat_Gr_PV_UnionVale_2': {'Q': 0.0, 'EXNAME': 'UnionVale_22kV_2_66.0KV', 'NAME': 'PV_UnionVale_2', 'NUMBER': 119, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_UnionVale_2', 'PMAX': 0.5}, 'FortGeorge_22kV_2_genstat_Gr_PV_FortGeorge_2': {'Q': 0.0, 'EXNAME': 'FortGeorge_22kV_2_66.0KV', 'NAME': 'PV_FortGeorge_2', 'NUMBER': 54, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_FortGeorge_2', 'PMAX': 0.5}, 'Terminal_5__syn_Gr_FVPS_G2': {'Q': 0.0, 'EXNAME': 'Terminal_5__66.0KV', 'NAME': 'FVPS_G2', 'NUMBER': 112, 'QMAX': 9.460636138916016, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -7.733980178833008, 'ID': 'FVPS_G2', 'PMAX': 15.288100242614746}, 'Henrietta_22kV_1_genstat_Gr_PV_Henrietta_1': {'Q': 0.0, 'EXNAME': 'Henrietta_22kV_1_66.0KV', 'NAME': 'PV_Henrietta_1', 'NUMBER': 62, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Henrietta_1', 'PMAX': 0.5}, 'StLouis_Ugen_12_syn_Gr_SLPS_G12': {'Q': 0.0, 'EXNAME': 'StLouis_Ugen_12_66.0KV', 'NAME': 'SLPS_G12', 'NUMBER': 101, 'QMAX': 12.898200035095215, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -9.2437105178833, 'ID': 'SLPS_G12', 'PMAX': 17.197599411010742}, 'Curepipe_22kV_genstat_Gr_EOL_PlaineSophie': {'Q': 0.0, 'EXNAME': 'Curepipe_22kV_66.0KV', 'NAME': 'EOL_PlaineSophie', 'NUMBER': 31, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'EOL_PlaineSophie', 'PMAX': 30.0}, 'Medine_G2_Ugen_syn_Gr_IPP_Medine_G2': {'Q': 0.0, 'EXNAME': 'Medine_G2_Ugen_66.0KV', 'NAME': 'IPP_Medine_G2', 'NUMBER': 83, 'QMAX': 9.15000057220459, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -6.557499885559082, 'ID': 'IPP_Medine_G2', 'PMAX': 11.0}, 'Fuel_22kV_1_genstat_Gr_PV_Fuel_1': {'Q': 0.0, 'EXNAME': 'Fuel_22kV_1_66.0KV', 'NAME': 'PV_Fuel_1', 'NUMBER': 56, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Fuel_1', 'PMAX': 0.5}, 'CTSAV_G1_Ugen_syn_Gr_IPP_CTSAV_G1': {'Q': 0.0, 'EXNAME': 'CTSAV_G1_Ugen_66.0KV', 'NAME': 'IPP_CTSAV_G1', 'NUMBER': 16, 'QMAX': 39.60000228881836, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -25.80000114440918, 'ID': 'IPP_CTSAV_G1', 'PMAX': 37.0}, 'Terminal_syn_Gr_FVPS_G11_MAN': {'Q': 0.0, 'EXNAME': 'Terminal_66.0KV', 'NAME': 'FVPS_G11_MAN', 'NUMBER': 107, 'QMAX': 7.390200614929199, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -5.2963104248046875, 'ID': 'FVPS_G11_MAN', 'PMAX': 8.0}, 'Bellevue_G1_Ugen_syn_Gr_IPP_Bellevue_G1': {'Q': 0.0, 'EXNAME': 'Bellevue_G1_Ugen_66.0KV', 'NAME': 'IPP_Bellevue_G1', 'NUMBER': 11, 'QMAX': 26.700000762939453, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -20.91499900817871, 'ID': 'IPP_Bellevue_G1', 'PMAX': 31.0}, 'Ferney_22kV_genstat_Gr_PV_Ferney_1': {'Q': 0.0, 'EXNAME': 'Ferney_22kV_66.0KV', 'NAME': 'PV_Ferney_1', 'NUMBER': 50, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Ferney_1', 'PMAX': 0.5}, 'Anahita_22kV_1_genstat_Gr_PV_Anahita_1': {'Q': 0.0, 'EXNAME': 'Anahita_22kV_1_66.0KV', 'NAME': 'PV_Anahita_1', 'NUMBER': 3, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Anahita_1', 'PMAX': 0.5}, 'Medine_G1_Ugen_syn_Gr_IPP_Medine_G1': {'Q': 0.0, 'EXNAME': 'Medine_G1_Ugen_66.0KV', 'NAME': 'IPP_Medine_G1', 'NUMBER': 82, 'QMAX': 12.5, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -12.5, 'ID': 'IPP_Medine_G1', 'PMAX': 10.0}, 'CaseNoyale_22kV_2_genstat_Gr_PV_CaseNoyale_2': {'Q': 0.0, 'EXNAME': 'CaseNoyale_22kV_2_66.0KV', 'NAME': 'PV_CaseNoyale_2', 'NUMBER': 20, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_CaseNoyale_2', 'PMAX': 0.5}, 'NIPS_G1_Ugen_syn_Gr_NIPS_G1': {'Q': 0.0, 'EXNAME': 'NIPS_G1_Ugen_66.0KV', 'NAME': 'NIPS_G1', 'NUMBER': 85, 'QMAX': 16.356000900268555, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -11.721799850463867, 'ID': 'NIPS_G1', 'PMAX': 21.808000564575195}, 'Anahita_22kV_2_genstat_Gr_PV_Anahita_2': {'Q': 0.0, 'EXNAME': 'Anahita_22kV_2_66.0KV', 'NAME': 'PV_Anahita_2', 'NUMBER': 4, 'QMAX': 0.0, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -0.0, 'ID': 'PV_Anahita_2', 'PMAX': 0.5}, 'CTSAV_G2_Ugen_syn_Gr_IPP_CTSAV_G2': {'Q': 0.0, 'EXNAME': 'CTSAV_G2_Ugen_66.0KV', 'NAME': 'IPP_CTSAV_G2', 'NUMBER': 18, 'QMAX': 39.60000228881836, 'PMIN': 0.0, 'P': 0.0, 'QMIN': -25.80000114440918, 'ID': 'IPP_CTSAV_G2', 'PMAX': 37.0}}
-LoadDico = {'Combo_22kV_2_Lo1': {'EXNAME': 'Combo_22kV_2_22.0KV', 'NAME': 'Combo_Load_2', 'NUMBER': 29, 'Q': 2.3155798440790565, 'P': 7.045000076293945, 'ID': 1}, 'CaseNoyale_22kV_2_Lo1': {'EXNAME': 'CaseNoyale_22kV_2_22.0KV', 'NAME': 'CaseNoyale_Load_2', 'NUMBER': 20, 'Q': 2.3155798440790565, 'P': 7.045000076293945, 'ID': 1}, 'FVPS_22kV_1_Lo1': {'EXNAME': 'FVPS_22kV_1_22.0KV', 'NAME': 'FortVictoria_Load_1', 'NUMBER': 42, 'Q': 4.999285895721721, 'P': 15.210000038146973, 'ID': 1}, 'Nicolay_22kV_1_Lo1': {'EXNAME': 'Nicolay_22kV_1_22.0KV', 'NAME': 'Nicolay_Load_1', 'NUMBER': 88, 'Q': 4.830013446924353, 'P': 14.694999694824219, 'ID': 1}, 'FVPS_22kV_2_Lo1': {'EXNAME': 'FVPS_22kV_2_22.0KV', 'NAME': 'FortVictoria_Load_2', 'NUMBER': 43, 'Q': 4.999285895721721, 'P': 15.210000038146973, 'ID': 1}, 'Anahita_22kV_1_Lo1': {'EXNAME': 'Anahita_22kV_1_22.0KV', 'NAME': 'Anahita_Load_1', 'NUMBER': 3, 'Q': 1.7370967871121035, 'P': 5.284999847412109, 'ID': 1}, 'Amaury_22kV_2_Lo1': {'EXNAME': 'Amaury_22kV_2_22.0KV', 'NAME': 'Amaury_Load_2', 'NUMBER': 1, 'Q': 2.4815653761717926, 'P': 7.550000190734863, 'ID': 1}, 'StLouis_22kV_2_Lo1': {'EXNAME': 'StLouis_22kV_2_22.0KV', 'NAME': 'StLouis_Load_2', 'NUMBER': 97, 'Q': 4.432305615934249, 'P': 13.484999656677246, 'ID': 1}, 'Nicolay_22kV_2_Lo1': {'EXNAME': 'Nicolay_22kV_2_22.0KV', 'NAME': 'Nicolay_Load_2', 'NUMBER': 89, 'Q': 4.830013446924353, 'P': 14.694999694824219, 'ID': 1}, 'Sottise_22kV_1_Lo1': {'EXNAME': 'Sottise_22kV_1_22.0KV', 'NAME': 'Sottise_Load_1', 'NUMBER': 93, 'Q': 4.217017587102438, 'P': 12.829999923706055, 'ID': 1}, 'Fuel_22kV_2_Lo1': {'EXNAME': 'Fuel_22kV_2_22.0KV', 'NAME': 'Fuel_Load_2', 'NUMBER': 57, 'Q': 3.6845493057984093, 'P': 11.210000038146973, 'ID': 1}, 'StLouis_22kV_1_Lo1': {'EXNAME': 'StLouis_22kV_1_22.0KV', 'NAME': 'StLouis_Load_1', 'NUMBER': 96, 'Q': 4.432305615934249, 'P': 13.484999656677246, 'ID': 1}, 'Jin_Fei_22kV_2_Lo1': {'EXNAME': 'Jin_Fei_22kV_2_22.0KV', 'NAME': 'Jin_Fei_Load_2', 'NUMBER': 70, 'Q': 2.0838575451816834, 'P': 6.340000152587891, 'ID': 1}, 'FortGeorge_22kV_2_Lo1': {'EXNAME': 'FortGeorge_22kV_2_22.0KV', 'NAME': 'FortGeorge_Load_2', 'NUMBER': 54, 'Q': 4.41587165932631, 'P': 13.4350004196167, 'ID': 1}, 'UnionVale_22kV_1_Lo1': {'EXNAME': 'UnionVale_22kV_1_22.0KV', 'NAME': 'UnionVale_Load_1', 'NUMBER': 118, 'Q': 3.83081365112094, 'P': 11.654999732971191, 'ID': 1}, 'Bellevue_22kV_1_Lo1': {'EXNAME': 'Bellevue_22kV_1_22.0KV', 'NAME': 'Bellevue_Load_1', 'NUMBER': 8, 'Q': 4.631159688158113, 'P': 14.09000015258789, 'ID': 1}, 'FVPS_22kV_3_Lo1': {'EXNAME': 'FVPS_22kV_3_22.0KV', 'NAME': 'FortVictoria_Load_3', 'NUMBER': 44, 'Q': 4.999285895721721, 'P': 15.210000038146973, 'ID': 1}, 'Henrietta_22kV_1_Lo1': {'EXNAME': 'Henrietta_22kV_1_22.0KV', 'NAME': 'Henrietta_Load_1', 'NUMBER': 62, 'Q': 3.972147934844134, 'P': 12.085000038146973, 'ID': 1}, 'FortGeorge_22kV_1_Lo1': {'EXNAME': 'FortGeorge_22kV_1_22.0KV', 'NAME': 'FortGeorge_Load_1', 'NUMBER': 53, 'Q': 4.41587165932631, 'P': 13.4350004196167, 'ID': 1}, 'Wooton_22kV_2_Lo1': {'EXNAME': 'Wooton_22kV_2_22.0KV', 'NAME': 'Wooton_Load_2', 'NUMBER': 122, 'Q': 6.701869566521236, 'P': 20.389999389648438, 'ID': 1}, 'Ebene_22kV_2_Lo1': {'EXNAME': 'Ebene_22kV_2_22.0KV', 'NAME': 'Ebene_Load_2', 'NUMBER': 34, 'Q': 6.284437131607226, 'P': 19.1200008392334, 'ID': 1}, 'LaChaumiere_22kV_2_Lo1': {'EXNAME': 'LaChaumiere_22kV_2_22.0KV', 'NAME': 'LaChaumiere_Load_2', 'NUMBER': 73, 'Q': 5.355908208276737, 'P': 16.295000076293945, 'ID': 1}, 'Sottise_22kV_2_Lo1': {'EXNAME': 'Sottise_22kV_2_22.0KV', 'NAME': 'Sottise_Load_2', 'NUMBER': 94, 'Q': 4.217017587102438, 'P': 12.829999923706055, 'ID': 1}, 'Fuel_22kV_1_Lo1': {'EXNAME': 'Fuel_22kV_1_22.0KV', 'NAME': 'Fuel_Load_1', 'NUMBER': 56, 'Q': 3.6845493057984093, 'P': 11.210000038146973, 'ID': 1}, 'TourKoening_22kV_2_Lo1': {'EXNAME': 'TourKoening_22kV_2_22.0KV', 'NAME': 'TourKoening_Load_2', 'NUMBER': 116, 'Q': 2.976233140523389, 'P': 9.055000305175781, 'ID': 1}, 'Amaury_22kV_1_Lo1': {'EXNAME': 'Amaury_22kV_1_22.0KV', 'NAME': 'Amaury_Load_1', 'NUMBER': 0, 'Q': 2.4815653761717926, 'P': 7.550000190734863, 'ID': 1}, 'Anahita_22kV_2_Lo1': {'EXNAME': 'Anahita_22kV_2_22.0KV', 'NAME': 'Anahita_Load_2', 'NUMBER': 4, 'Q': 1.7370967871121035, 'P': 5.284999847412109, 'ID': 1}, 'TourKoening_22kV_1_Lo1': {'EXNAME': 'TourKoening_22kV_1_22.0KV', 'NAME': 'TourKoening_Load_1', 'NUMBER': 115, 'Q': 2.976233140523389, 'P': 9.055000305175781, 'ID': 1}, 'UnionVale_22kV_2_Lo1': {'EXNAME': 'UnionVale_22kV_2_22.0KV', 'NAME': 'UnionVale_Load_2', 'NUMBER': 119, 'Q': 3.83081365112094, 'P': 11.654999732971191, 'ID': 1}, 'Bellevue_22kV_2_Lo1': {'EXNAME': 'Bellevue_22kV_2_22.0KV', 'NAME': 'Bellevue_Load_2', 'NUMBER': 9, 'Q': 4.631159688158113, 'P': 14.09000015258789, 'ID': 1}, 'Ebene_22kV_3_Lo1': {'EXNAME': 'Ebene_22kV_3_22.0KV', 'NAME': 'Ebene_Load_3', 'NUMBER': 35, 'Q': 6.284437131607226, 'P': 19.1200008392334, 'ID': 1}, 'Henrietta_22kV_2_Lo1': {'EXNAME': 'Henrietta_22kV_2_22.0KV', 'NAME': 'Henrietta_Load_2', 'NUMBER': 63, 'Q': 3.972147934844134, 'P': 12.085000038146973, 'ID': 1}, 'Jin_Fei_22kV_1_Lo1': {'EXNAME': 'Jin_Fei_22kV_1_22.0KV', 'NAME': 'Jin_Fei_Load_1', 'NUMBER': 69, 'Q': 2.0838575451816834, 'P': 6.340000152587891, 'ID': 1}, 'Ferney_22kV_Lo1': {'EXNAME': 'Ferney_22kV_22.0KV', 'NAME': 'Ferney_Load_1', 'NUMBER': 50, 'Q': 1.4462093496179527, 'P': 4.400000095367432, 'ID': 1}, 'LaChaumiere_22kV_1_Lo1': {'EXNAME': 'LaChaumiere_22kV_1_22.0KV', 'NAME': 'LaChaumiere_Load_1', 'NUMBER': 72, 'Q': 5.355908208276737, 'P': 16.295000076293945, 'ID': 1}, 'Ebene_22kV_1_Lo1': {'EXNAME': 'Ebene_22kV_1_22.0KV', 'NAME': 'Ebene_Load_1', 'NUMBER': 33, 'Q': 6.284437131607226, 'P': 19.1200008392334, 'ID': 1}, 'CaseNoyale_22kV_1_Lo1': {'EXNAME': 'CaseNoyale_22kV_1_22.0KV', 'NAME': 'CaseNoyale_Load_1', 'NUMBER': 19, 'Q': 2.3155798440790565, 'P': 7.045000076293945, 'ID': 1}, 'Combo_22kV_1_Lo1': {'EXNAME': 'Combo_22kV_1_22.0KV', 'NAME': 'Combo_Load_1', 'NUMBER': 28, 'Q': 2.3155798440790565, 'P': 7.045000076293945, 'ID': 1}, 'Wooton_22kV_1_Lo1': {'EXNAME': 'Wooton_22kV_1_22.0KV', 'NAME': 'Wooton_Load_1', 'NUMBER': 121, 'Q': 6.701869566521236, 'P': 20.389999389648438, 'ID': 1}}
-LineDico = {'Medine_22kV_2_Henrietta_22kV_1_22kV_Henrietta_Medine_22kV_Li': {'TONAME': 'Henrietta_22kV_1', 'FROMNUMBER': 81, 'FROMEXNAME': 'Medine_22kV_2_22.0', 'FROMNAME': 'Medine_22kV_2', 'ID': '22kV_Henrietta_Medine_22kV', 'TONUMBER': 62, 'TOEXNAME': 'Henrietta_22kV_1_22.0'}, 'Terminal_1__FVPS_Ugen_1_Line11kV_1__Li': {'TONAME': 'FVPS_Ugen_1', 'FROMNUMBER': 108, 'FROMEXNAME': 'Terminal_1__11.0', 'FROMNAME': 'Terminal_1_', 'ID': 'Line11kV(1)', 'TONUMBER': 46, 'TOEXNAME': 'FVPS_Ugen_1_11.0'}, 'Amaury_66kV_Fuel_66kV_66kV_Amaury_Fuel_1_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'ID': '66kV_Amaury_Fuel_1', 'TONUMBER': 58, 'TOEXNAME': 'Fuel_66kV_66.0'}, 'Henrietta_66kV_LaChaumiere_66kV_66kV_LaChaumiere_Henrietta_1_Li': {'TONAME': 'LaChaumiere_66kV', 'FROMNUMBER': 64, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'ID': '66kV_LaChaumiere_Henrietta_1', 'TONUMBER': 74, 'TOEXNAME': 'LaChaumiere_66kV_66.0'}, 'Cecile_22kV_Combo_22kV_2_22kV_Combo_Cecile_Li': {'TONAME': 'Combo_22kV_2', 'FROMNUMBER': 22, 'FROMEXNAME': 'Cecile_22kV_22.0', 'FROMNAME': 'Cecile_22kV', 'ID': '22kV_Combo_Cecile', 'TONUMBER': 29, 'TOEXNAME': 'Combo_22kV_2_22.0'}, 'Henrietta_66kV_Combo_66kV_66kV_Combo_Henrietta_Li': {'TONAME': 'Combo_66kV', 'FROMNUMBER': 64, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'ID': '66kV_Combo_Henrietta', 'TONUMBER': 30, 'TOEXNAME': 'Combo_66kV_66.0'}, 'StLouis_66kV_Dumas_66kV_66kV_Dumas_StLouis_2_Li': {'TONAME': 'Dumas_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': '66kV_Dumas_StLouis_2', 'TONUMBER': 32, 'TOEXNAME': 'Dumas_66kV_66.0'}, 'Terminal_6__FVPS_Ugen_4_Line11kV_6__Li': {'TONAME': 'FVPS_Ugen_4', 'FROMNUMBER': 113, 'FROMEXNAME': 'Terminal_6__11.0', 'FROMNAME': 'Terminal_6_', 'ID': 'Line11kV(6)', 'TONUMBER': 49, 'TOEXNAME': 'FVPS_Ugen_4_11.0'}, 'Amaury_66kV_Bellevue_66kV_66kV_Amaury_Bellevue_1_Li': {'TONAME': 'Bellevue_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'ID': '66kV_Amaury_Bellevue_1', 'TONUMBER': 10, 'TOEXNAME': 'Bellevue_66kV_66.0'}, 'Dumas_66kV_FortGeorge_66kV_66kV_FortGeorge_Dumas_1_Li': {'TONAME': 'FortGeorge_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'ID': '66kV_FortGeorge_Dumas_1', 'TONUMBER': 55, 'TOEXNAME': 'FortGeorge_66kV_66.0'}, 'Champagne_66kV_Wooton_66kV_66kV_Champagne_Wooton_2_Li': {'TONAME': 'Wooton_66kV', 'FROMNUMBER': 25, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'ID': '66kV_Champagne_Wooton_2', 'TONUMBER': 123, 'TOEXNAME': 'Wooton_66kV_66.0'}, 'Amaury_66kV_Wooton_66kV_66kV_Wooton_Amaury_Li': {'TONAME': 'Wooton_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'ID': '66kV_Wooton_Amaury', 'TONUMBER': 123, 'TOEXNAME': 'Wooton_66kV_66.0'}, 'Wooton_66kV_Ebene_66kV_66kV_Ebene_Wooton_2_Li': {'TONAME': 'Ebene_66kV', 'FROMNUMBER': 123, 'FROMEXNAME': 'Wooton_66kV_66.0', 'FROMNAME': 'Wooton_66kV', 'ID': '66kV_Ebene_Wooton_2', 'TONUMBER': 36, 'TOEXNAME': 'Ebene_66kV_66.0'}, 'UnionVale_66kV_CTSAV_G1_66kV_66kV_CTSAVG1_UnionVale_Li': {'TONAME': 'CTSAV_G1_66kV', 'FROMNUMBER': 120, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'ID': '66kV_CTSAVG1_UnionVale', 'TONUMBER': 15, 'TOEXNAME': 'CTSAV_G1_66kV_66.0'}, 'Combo_66kV_Inter_CN_CO_66kV_66kV_Combo_CaseNoyale_PartOHL_Li': {'TONAME': 'Inter_CN_CO_66kV', 'FROMNUMBER': 30, 'FROMEXNAME': 'Combo_66kV_66.0', 'FROMNAME': 'Combo_66kV', 'ID': '66kV_Combo_CaseNoyale_PartOHL', 'TONUMBER': 66, 'TOEXNAME': 'Inter_CN_CO_66kV_66.0'}, 'Ebene_66kV_StLouis_66kV_66kV_StLouis_Ebene_1_Li': {'TONAME': 'StLouis_66kV', 'FROMNUMBER': 36, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'ID': '66kV_StLouis_Ebene_1', 'TONUMBER': 98, 'TOEXNAME': 'StLouis_66kV_66.0'}, 'StLouis_66kV_Dumas_66kV_66kV_Dumas_StLouis_1_Li': {'TONAME': 'Dumas_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': '66kV_Dumas_StLouis_1', 'TONUMBER': 32, 'TOEXNAME': 'Dumas_66kV_66.0'}, 'CTDS_G1_66kV_Combo_66kV_66kV_CTDS_Combo_Li': {'TONAME': 'Combo_66kV', 'FROMNUMBER': 13, 'FROMEXNAME': 'CTDS_G1_66kV_66.0', 'FROMNAME': 'CTDS_G1_66kV', 'ID': '66kV_CTDS_Combo', 'TONUMBER': 30, 'TOEXNAME': 'Combo_66kV_66.0'}, 'CaseNoyale_66kV_Henrietta_66kV_66kV_Henrietta_CaseNoyale_Li': {'TONAME': 'Henrietta_66kV', 'FROMNUMBER': 21, 'FROMEXNAME': 'CaseNoyale_66kV_66.0', 'FROMNAME': 'CaseNoyale_66kV', 'ID': '66kV_Henrietta_CaseNoyale', 'TONUMBER': 64, 'TOEXNAME': 'Henrietta_66kV_66.0'}, 'Dumas_66kV_Jin_Fei_66kV_66kV_Dumas_Jin_Fei_Li': {'TONAME': 'Jin_Fei_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'ID': '66kV_Dumas_Jin_Fei', 'TONUMBER': 71, 'TOEXNAME': 'Jin_Fei_66kV_66.0'}, 'Inter_NI_DU_2_66kV_NIPS_66kV_66kV_Nicolay_Dumas_2_Li': {'TONAME': 'NIPS_66kV', 'FROMNUMBER': 68, 'FROMEXNAME': 'Inter_NI_DU_2_66kV_66.0', 'FROMNAME': 'Inter_NI_DU_2_66kV', 'ID': '66kV_Nicolay_Dumas_2', 'TONUMBER': 84, 'TOEXNAME': 'NIPS_66kV_66.0'}, 'Ferney_22kV_Champagne_22kV_22kV_Champagne_Ferney_Li': {'TONAME': 'Champagne_22kV', 'FROMNUMBER': 50, 'FROMEXNAME': 'Ferney_22kV_22.0', 'FROMNAME': 'Ferney_22kV', 'ID': '22kV_Champagne_Ferney', 'TONUMBER': 24, 'TOEXNAME': 'Champagne_22kV_22.0'}, 'Amaury_66kV_Bellevue_66kV_66kV_Amaury_Bellevue_2_Li': {'TONAME': 'Bellevue_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'ID': '66kV_Amaury_Bellevue_2', 'TONUMBER': 10, 'TOEXNAME': 'Bellevue_66kV_66.0'}, 'Dumas_66kV_Wooton_66kV_66kV_Dumas_Wooton_Li': {'TONAME': 'Wooton_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'ID': '66kV_Dumas_Wooton', 'TONUMBER': 123, 'TOEXNAME': 'Wooton_66kV_66.0'}, 'Bellevue_66kV_Sottise_66kV_66kV_Bellevue_Sottise_2_Li': {'TONAME': 'Sottise_66kV', 'FROMNUMBER': 10, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'ID': '66kV_Bellevue_Sottise_2', 'TONUMBER': 95, 'TOEXNAME': 'Sottise_66kV_66.0'}, 'Terminal_FVPS_Ugen_1_Line11kV_Li': {'TONAME': 'FVPS_Ugen_1', 'FROMNUMBER': 107, 'FROMEXNAME': 'Terminal_11.0', 'FROMNAME': 'Terminal', 'ID': 'Line11kV', 'TONUMBER': 46, 'TOEXNAME': 'FVPS_Ugen_1_11.0'}, 'Wooton_66kV_Ebene_66kV_66kV_Ebene_Wooton_1_Li': {'TONAME': 'Ebene_66kV', 'FROMNUMBER': 123, 'FROMEXNAME': 'Wooton_66kV_66.0', 'FROMNAME': 'Wooton_66kV', 'ID': '66kV_Ebene_Wooton_1', 'TONUMBER': 36, 'TOEXNAME': 'Ebene_66kV_66.0'}, 'Terminal_5__FVPS_Ugen_3_Line11kV_5__Li': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 112, 'FROMEXNAME': 'Terminal_5__11.0', 'FROMNAME': 'Terminal_5_', 'ID': 'Line11kV(5)', 'TONUMBER': 48, 'TOEXNAME': 'FVPS_Ugen_3_11.0'}, 'StLouis_66kV_FVPS_66kV_66kV_SL_FVPS_Cable2_Li': {'TONAME': 'FVPS_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': '66kV_SL_FVPS_Cable2', 'TONUMBER': 45, 'TOEXNAME': 'FVPS_66kV_66.0'}, 'Medine_22kV_1_LaChaumiere_22kV_1_22kV_LaChaumiere_Medine_22kV_Li': {'TONAME': 'LaChaumiere_22kV_1', 'FROMNUMBER': 80, 'FROMEXNAME': 'Medine_22kV_1_22.0', 'FROMNAME': 'Medine_22kV_1', 'ID': '22kV_LaChaumiere_Medine_22kV', 'TONUMBER': 72, 'TOEXNAME': 'LaChaumiere_22kV_1_22.0'}, 'Terminal_2__FVPS_Ugen_2_Line11kV_2__Li': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 109, 'FROMEXNAME': 'Terminal_2__11.0', 'FROMNAME': 'Terminal_2_', 'ID': 'Line11kV(2)', 'TONUMBER': 47, 'TOEXNAME': 'FVPS_Ugen_2_11.0'}, 'LaChaumiere_66kV_StLouis_66kV_66kV_StLouis_LaChaumiere_Li': {'TONAME': 'StLouis_66kV', 'FROMNUMBER': 74, 'FROMEXNAME': 'LaChaumiere_66kV_66.0', 'FROMNAME': 'LaChaumiere_66kV', 'ID': '66kV_StLouis_LaChaumiere', 'TONUMBER': 98, 'TOEXNAME': 'StLouis_66kV_66.0'}, 'Dumas_66kV_Bellevue_66kV_66kV_Dumas_Bellevue_Li': {'TONAME': 'Bellevue_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'ID': '66kV_Dumas_Bellevue', 'TONUMBER': 10, 'TOEXNAME': 'Bellevue_66kV_66.0'}, 'Henrietta_66kV_LaChaumiere_66kV_66kV_LaChaumiere_Henrietta_2_Li': {'TONAME': 'LaChaumiere_66kV', 'FROMNUMBER': 64, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'ID': '66kV_LaChaumiere_Henrietta_2', 'TONUMBER': 74, 'TOEXNAME': 'LaChaumiere_66kV_66.0'}, 'StLouis_66kV_FVPS_66kV_66kV_SL_FVPS_Cable3_Li': {'TONAME': 'FVPS_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': '66kV_SL_FVPS_Cable3', 'TONUMBER': 45, 'TOEXNAME': 'FVPS_66kV_66.0'}, 'LeVal_22kV_Wooton_22kV_2_22kV_Wooton_LeVal_Li': {'TONAME': 'Wooton_22kV_2', 'FROMNUMBER': 76, 'FROMEXNAME': 'LeVal_22kV_22.0', 'FROMNAME': 'LeVal_22kV', 'ID': '22kV_Wooton_LeVal', 'TONUMBER': 122, 'TOEXNAME': 'Wooton_22kV_2_22.0'}, 'Inter_NI_DU_1_66kV_NIPS_66kV_66kV_Nicolay_Dumas_1_Li': {'TONAME': 'NIPS_66kV', 'FROMNUMBER': 67, 'FROMEXNAME': 'Inter_NI_DU_1_66kV_66.0', 'FROMNAME': 'Inter_NI_DU_1_66kV', 'ID': '66kV_Nicolay_Dumas_1', 'TONUMBER': 84, 'TOEXNAME': 'NIPS_66kV_66.0'}, 'Inter_Anahita_Fuel_66kV_Anahita_66kV_66kV_Anahita_Fuel_OHL_Li': {'TONAME': 'Anahita_66kV', 'FROMNUMBER': 65, 'FROMEXNAME': 'Inter_Anahita_Fuel_66kV_66.0', 'FROMNAME': 'Inter_Anahita_Fuel_66kV', 'ID': '66kV_Anahita_Fuel_OHL', 'TONUMBER': 5, 'TOEXNAME': 'Anahita_66kV_66.0'}, 'Terminal_7__FVPS_Ugen_4_Line11kV_7__Li': {'TONAME': 'FVPS_Ugen_4', 'FROMNUMBER': 114, 'FROMEXNAME': 'Terminal_7__11.0', 'FROMNAME': 'Terminal_7_', 'ID': 'Line11kV(7)', 'TONUMBER': 49, 'TOEXNAME': 'FVPS_Ugen_4_11.0'}, 'Dumas_66kV_FortGeorge_66kV_66kV_FortGeorge_Dumas_2_Li': {'TONAME': 'FortGeorge_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'ID': '66kV_FortGeorge_Dumas_2', 'TONUMBER': 55, 'TOEXNAME': 'FortGeorge_66kV_66.0'}, 'UnionVale_66kV_Champagne_66kV_66kV_UnionVale_Champagne_Li': {'TONAME': 'Champagne_66kV', 'FROMNUMBER': 120, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'ID': '66kV_UnionVale_Champagne', 'TONUMBER': 25, 'TOEXNAME': 'Champagne_66kV_66.0'}, 'Terminal_3__FVPS_Ugen_2_Line11kV_3__Li': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 110, 'FROMEXNAME': 'Terminal_3__11.0', 'FROMNAME': 'Terminal_3_', 'ID': 'Line11kV(3)', 'TONUMBER': 47, 'TOEXNAME': 'FVPS_Ugen_2_11.0'}, 'Terminal_4__FVPS_Ugen_3_Line11kV_4__Li': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 111, 'FROMEXNAME': 'Terminal_4__11.0', 'FROMNAME': 'Terminal_4_', 'ID': 'Line11kV(4)', 'TONUMBER': 48, 'TOEXNAME': 'FVPS_Ugen_3_11.0'}, 'Amaury_66kV_Fuel_66kV_66kV_Amaury_Fuel_2_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'ID': '66kV_Amaury_Fuel_2', 'TONUMBER': 58, 'TOEXNAME': 'Fuel_66kV_66.0'}, 'Curepipe_22kV_Henrietta_22kV_1_22kV_PlaineSophie_Henrietta_Li': {'TONAME': 'Henrietta_22kV_1', 'FROMNUMBER': 31, 'FROMEXNAME': 'Curepipe_22kV_22.0', 'FROMNAME': 'Curepipe_22kV', 'ID': '22kV_PlaineSophie_Henrietta', 'TONUMBER': 62, 'TOEXNAME': 'Henrietta_22kV_1_22.0'}, 'Ebene_66kV_StLouis_66kV_66kV_StLouis_Ebene_2_Li': {'TONAME': 'StLouis_66kV', 'FROMNUMBER': 36, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'ID': '66kV_StLouis_Ebene_2', 'TONUMBER': 98, 'TOEXNAME': 'StLouis_66kV_66.0'}, 'Fuel_PowerStation_66kV_Fuel_66kV_66kV_FuelPowerStation_Fuel_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 61, 'FROMEXNAME': 'Fuel_PowerStation_66kV_66.0', 'FROMNAME': 'Fuel_PowerStation_66kV', 'ID': '66kV_FuelPowerStation_Fuel', 'TONUMBER': 58, 'TOEXNAME': 'Fuel_66kV_66.0'}, 'Dumas_66kV_Amaury_66kV_66kV_Dumas_Amaury_Li': {'TONAME': 'Amaury_66kV', 'FROMNUMBER': 32, 'FROMEXNAME': 'Dumas_66kV_66.0', 'FROMNAME': 'Dumas_66kV', 'ID': '66kV_Dumas_Amaury', 'TONUMBER': 2, 'TOEXNAME': 'Amaury_66kV_66.0'}, 'StLouis_66kV_FVPS_66kV_66kV_SL_FVPS_Cable4_Li': {'TONAME': 'FVPS_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': '66kV_SL_FVPS_Cable4', 'TONUMBER': 45, 'TOEXNAME': 'FVPS_66kV_66.0'}, 'Champagne_66kV_Wooton_66kV_66kV_Champagne_Wooton_1_Li': {'TONAME': 'Wooton_66kV', 'FROMNUMBER': 25, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'ID': '66kV_Champagne_Wooton_1', 'TONUMBER': 123, 'TOEXNAME': 'Wooton_66kV_66.0'}, 'TourKoening_66kV_StLouis_66kV_66kV_StLouis_TourKoening_Li': {'TONAME': 'StLouis_66kV', 'FROMNUMBER': 117, 'FROMEXNAME': 'TourKoening_66kV_66.0', 'FROMNAME': 'TourKoening_66kV', 'ID': '66kV_StLouis_TourKoening', 'TONUMBER': 98, 'TOEXNAME': 'StLouis_66kV_66.0'}, 'StLouis_66kV_FVPS_66kV_66kV_SL_FVPS_Cable1_Li': {'TONAME': 'FVPS_66kV', 'FROMNUMBER': 98, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': '66kV_SL_FVPS_Cable1', 'TONUMBER': 45, 'TOEXNAME': 'FVPS_66kV_66.0'}, 'UnionVale_66kV_CTSAV_G2_66kV_66kV_CTSAVG2_UnionVale_Li': {'TONAME': 'CTSAV_G2_66kV', 'FROMNUMBER': 120, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'ID': '66kV_CTSAVG2_UnionVale', 'TONUMBER': 17, 'TOEXNAME': 'CTSAV_G2_66kV_66.0'}, 'TourKoening_66kV_LaChaumiere_66kV_66kV_LaChaumiere_TourKoening_Li': {'TONAME': 'LaChaumiere_66kV', 'FROMNUMBER': 117, 'FROMEXNAME': 'TourKoening_66kV_66.0', 'FROMNAME': 'TourKoening_66kV', 'ID': '66kV_LaChaumiere_TourKoening', 'TONUMBER': 74, 'TOEXNAME': 'LaChaumiere_66kV_66.0'}, 'Sarako_66kV_LaChaumiere_66kV_66kV_Sarako_LaChaumiere_Li': {'TONAME': 'LaChaumiere_66kV', 'FROMNUMBER': 92, 'FROMEXNAME': 'Sarako_66kV_66.0', 'FROMNAME': 'Sarako_66kV', 'ID': '66kV_Sarako_LaChaumiere', 'TONUMBER': 74, 'TOEXNAME': 'LaChaumiere_66kV_66.0'}, 'Combo_66kV_UnionVale_66kV_66kV_UnionVale_Combo_Li': {'TONAME': 'UnionVale_66kV', 'FROMNUMBER': 30, 'FROMEXNAME': 'Combo_66kV_66.0', 'FROMNAME': 'Combo_66kV', 'ID': '66kV_UnionVale_Combo', 'TONUMBER': 120, 'TOEXNAME': 'UnionVale_66kV_66.0'}, 'BeauchampPowerStation_66kV_Anahita_66kV_66kV_Anahita_Beauchamp_Li': {'TONAME': 'Anahita_66kV', 'FROMNUMBER': 6, 'FROMEXNAME': 'BeauchampPowerStation_66kV_66.0', 'FROMNAME': 'BeauchampPowerStation_66kV', 'ID': '66kV_Anahita_Beauchamp', 'TONUMBER': 5, 'TOEXNAME': 'Anahita_66kV_66.0'}, 'Bellevue_66kV_Sottise_66kV_66kV_Bellevue_Sottise_1_Li': {'TONAME': 'Sottise_66kV', 'FROMNUMBER': 10, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'ID': '66kV_Bellevue_Sottise_1', 'TONUMBER': 95, 'TOEXNAME': 'Sottise_66kV_66.0'}, 'Amaury_22kV_1_PlaineDesRochesPowerStation_22kV_22kV_PlaineDesRochesPowerStation_Li': {'TONAME': 'PlaineDesRochesPowerStation_22kV', 'FROMNUMBER': 0, 'FROMEXNAME': 'Amaury_22kV_1_22.0', 'FROMNAME': 'Amaury_22kV_1', 'ID': '22kV_PlaineDesRochesPowerStation', 'TONUMBER': 90, 'TOEXNAME': 'PlaineDesRochesPowerStation_22kV_22.0'}, 'Jin_Fei_66kV_Bellevue_66kV_66kV_Bellevue_Jin_Fei_Li': {'TONAME': 'Bellevue_66kV', 'FROMNUMBER': 71, 'FROMEXNAME': 'Jin_Fei_66kV_66.0', 'FROMNAME': 'Jin_Fei_66kV', 'ID': '66kV_Bellevue_Jin_Fei', 'TONUMBER': 10, 'TOEXNAME': 'Bellevue_66kV_66.0'}, 'Inter_CN_CO_66kV_CaseNoyale_66kV_66kV_Combo_CaseNoyale_PartUGC_Li': {'TONAME': 'CaseNoyale_66kV', 'FROMNUMBER': 66, 'FROMEXNAME': 'Inter_CN_CO_66kV_66.0', 'FROMNAME': 'Inter_CN_CO_66kV', 'ID': '66kV_Combo_CaseNoyale_PartUGC', 'TONUMBER': 21, 'TOEXNAME': 'CaseNoyale_66kV_66.0'}, 'Champagne_66kV_Fuel_66kV_66kV_Champagne_Fuel_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 25, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'ID': '66kV_Champagne_Fuel', 'TONUMBER': 58, 'TOEXNAME': 'Fuel_66kV_66.0'}, 'Inter_Anahita_Fuel_66kV_Fuel_66kV_66kV_Anahita_Fuel_UGC_Li': {'TONAME': 'Fuel_66kV', 'FROMNUMBER': 65, 'FROMEXNAME': 'Inter_Anahita_Fuel_66kV_66.0', 'FROMNAME': 'Inter_Anahita_Fuel_66kV', 'ID': '66kV_Anahita_Fuel_UGC', 'TONUMBER': 58, 'TOEXNAME': 'Fuel_66kV_66.0'}}
-TransfoDico = {'Anahita_66kV_Anahita_22kV_1_Anahita_TS1_Tr': {'TONAME': 'Anahita_22kV_1', 'FROMNUMBER': 5, '#WIND': 2, 'FROMEXNAME': 'Anahita_66kV_66.0', 'FROMNAME': 'Anahita_66kV', 'ID': 'Anahita_TS1', 'TONUMBER': 3, 'TOEXNAME': 'Anahita_22kV_122.0'}, 'FVPS_66kV_FVPS_Ugen_3_FVPS_TP_2_Tr': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 45, '#WIND': 2, 'FROMEXNAME': 'FVPS_66kV_66.0', 'FROMNAME': 'FVPS_66kV', 'ID': 'FVPS_TP_2', 'TONUMBER': 48, 'TOEXNAME': 'FVPS_Ugen_311.0'}, 'NIPS_66kV_NIPS_G1_Ugen_NIPS_TP1_Tr': {'TONAME': 'NIPS_G1_Ugen', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'ID': 'NIPS_TP1', 'TONUMBER': 85, 'TOEXNAME': 'NIPS_G1_Ugen11.0'}, 'CTSAV_G1_66kV_CTSAV_G1_Ugen_CTSAV_G1_TP_Tr': {'TONAME': 'CTSAV_G1_Ugen', 'FROMNUMBER': 15, '#WIND': 2, 'FROMEXNAME': 'CTSAV_G1_66kV_66.0', 'FROMNAME': 'CTSAV_G1_66kV', 'ID': 'CTSAV_G1_TP', 'TONUMBER': 16, 'TOEXNAME': 'CTSAV_G1_Ugen11.0'}, 'FortGeorge_66kV_FGPS_Ugen1_FGPS_TP1_Tr': {'TONAME': 'FGPS_Ugen1', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'ID': 'FGPS_TP1', 'TONUMBER': 37, 'TOEXNAME': 'FGPS_Ugen111.0'}, 'StLouis_66kV_StLouis_Ugen_12_StLouisG12_TP_Tr': {'TONAME': 'StLouis_Ugen_12', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': 'StLouisG12_TP', 'TONUMBER': 101, 'TOEXNAME': 'StLouis_Ugen_1211.0'}, 'Henrietta_22kV_1_Tamarind_G1_Ugen_Tamarind_G1_TP_Tr': {'TONAME': 'Tamarind_G1_Ugen', 'FROMNUMBER': 62, '#WIND': 2, 'FROMEXNAME': 'Henrietta_22kV_1_22.0', 'FROMNAME': 'Henrietta_22kV_1', 'ID': 'Tamarind_G1_TP', 'TONUMBER': 106, 'TOEXNAME': 'Tamarind_G1_Ugen6.599999904632568'}, 'FortGeorge_66kV_FGPS_Ugen5_FGPS_TP5_Tr': {'TONAME': 'FGPS_Ugen5', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'ID': 'FGPS_TP5', 'TONUMBER': 41, 'TOEXNAME': 'FGPS_Ugen511.0'}, 'Sarako_66kV_Sarako_22kV_Sarako_TP_Tr': {'TONAME': 'Sarako_22kV', 'FROMNUMBER': 92, '#WIND': 2, 'FROMEXNAME': 'Sarako_66kV_66.0', 'FROMNAME': 'Sarako_66kV', 'ID': 'Sarako_TP', 'TONUMBER': 91, 'TOEXNAME': 'Sarako_22kV22.0'}, 'Sottise_66kV_Sottise_22kV_1_Sottise_TS1_Tr': {'TONAME': 'Sottise_22kV_1', 'FROMNUMBER': 95, '#WIND': 2, 'FROMEXNAME': 'Sottise_66kV_66.0', 'FROMNAME': 'Sottise_66kV', 'ID': 'Sottise_TS1', 'TONUMBER': 93, 'TOEXNAME': 'Sottise_22kV_122.0'}, 'FortGeorge_66kV_FortGeorge_22kV_1_FortGeorge_TS3_Tr': {'TONAME': 'FortGeorge_22kV_1', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'ID': 'FortGeorge_TS3', 'TONUMBER': 53, 'TOEXNAME': 'FortGeorge_22kV_122.0'}, 'CTDS_G1_66kV_CTDS_G1_Ugen_CTDS_G1_TP_Tr': {'TONAME': 'CTDS_G1_Ugen', 'FROMNUMBER': 13, '#WIND': 2, 'FROMEXNAME': 'CTDS_G1_66kV_66.0', 'FROMNAME': 'CTDS_G1_66kV', 'ID': 'CTDS_G1_TP', 'TONUMBER': 14, 'TOEXNAME': 'CTDS_G1_Ugen11.0'}, 'BeauchampPowerStation_66kV_Beauchamp_G1_Ugen_Beauchamp_G1_TP_Tr': {'TONAME': 'Beauchamp_G1_Ugen', 'FROMNUMBER': 6, '#WIND': 2, 'FROMEXNAME': 'BeauchampPowerStation_66kV_66.0', 'FROMNAME': 'BeauchampPowerStation_66kV', 'ID': 'Beauchamp_G1_TP', 'TONUMBER': 7, 'TOEXNAME': 'Beauchamp_G1_Ugen15.0'}, 'CTSAV_G2_66kV_CTSAV_G2_Ugen_CTSAV_G2_TP_Tr': {'TONAME': 'CTSAV_G2_Ugen', 'FROMNUMBER': 17, '#WIND': 2, 'FROMEXNAME': 'CTSAV_G2_66kV_66.0', 'FROMNAME': 'CTSAV_G2_66kV', 'ID': 'CTSAV_G2_TP', 'TONUMBER': 18, 'TOEXNAME': 'CTSAV_G2_Ugen11.0'}, 'FVPS_22kV_3_FVPS_Ugen_3_FVPS_TS3_Tr': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 44, '#WIND': 2, 'FROMEXNAME': 'FVPS_22kV_3_22.0', 'FROMNAME': 'FVPS_22kV_3', 'ID': 'FVPS_TS3', 'TONUMBER': 48, 'TOEXNAME': 'FVPS_Ugen_311.0'}, 'Cecile_22kV_Cecile_G1_Ugen_Cecile_G2_TP2_Tr': {'TONAME': 'Cecile_G1_Ugen', 'FROMNUMBER': 22, '#WIND': 2, 'FROMEXNAME': 'Cecile_22kV_22.0', 'FROMNAME': 'Cecile_22kV', 'ID': 'Cecile_G2_TP2', 'TONUMBER': 23, 'TOEXNAME': 'Cecile_G1_Ugen6.599999904632568'}, 'Medine_22kV_1_Medine_G1_Ugen_Medine_G1_TP_Tr': {'TONAME': 'Medine_G1_Ugen', 'FROMNUMBER': 80, '#WIND': 2, 'FROMEXNAME': 'Medine_22kV_1_22.0', 'FROMNAME': 'Medine_22kV_1', 'ID': 'Medine_G1_TP', 'TONUMBER': 82, 'TOEXNAME': 'Medine_G1_Ugen6.599999904632568'}, 'Champagne_66kV_Champagne_22kV_Champagne_TS1_Tr': {'TONAME': 'Champagne_22kV', 'FROMNUMBER': 25, '#WIND': 2, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'ID': 'Champagne_TS1', 'TONUMBER': 24, 'TOEXNAME': 'Champagne_22kV22.0'}, 'Henrietta_22kV_2_Magenta_G1_Ugen_Magenta_G1_TP_Tr': {'TONAME': 'Magenta_G1_Ugen', 'FROMNUMBER': 63, '#WIND': 2, 'FROMEXNAME': 'Henrietta_22kV_2_22.0', 'FROMNAME': 'Henrietta_22kV_2', 'ID': 'Magenta_G1_TP', 'TONUMBER': 79, 'TOEXNAME': 'Magenta_G1_Ugen6.599999904632568'}, 'UnionVale_66kV_UnionVale_22kV_2_UnionVale_TS2_Tr': {'TONAME': 'UnionVale_22kV_2', 'FROMNUMBER': 120, '#WIND': 2, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'ID': 'UnionVale_TS2', 'TONUMBER': 119, 'TOEXNAME': 'UnionVale_22kV_222.0'}, 'StLouis_66kV_StLouis_Ugen_10_StLouisG10_TP_Tr': {'TONAME': 'StLouis_Ugen_10', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': 'StLouisG10_TP', 'TONUMBER': 99, 'TOEXNAME': 'StLouis_Ugen_1011.0'}, 'Amaury_66kV_Amaury_22kV_2_Amaury_TS2_Tr': {'TONAME': 'Amaury_22kV_2', 'FROMNUMBER': 2, '#WIND': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'ID': 'Amaury_TS2', 'TONUMBER': 1, 'TOEXNAME': 'Amaury_22kV_222.0'}, 'Bellevue_66kV_Bellevue_22kV_1_Bellevue_TS1_Tr': {'TONAME': 'Bellevue_22kV_1', 'FROMNUMBER': 10, '#WIND': 2, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'ID': 'Bellevue_TS1', 'TONUMBER': 8, 'TOEXNAME': 'Bellevue_22kV_122.0'}, 'Medine_22kV_2_Medine_G2_Ugen_Medine_G2_TP_Tr': {'TONAME': 'Medine_G2_Ugen', 'FROMNUMBER': 81, '#WIND': 2, 'FROMEXNAME': 'Medine_22kV_2_22.0', 'FROMNAME': 'Medine_22kV_2', 'ID': 'Medine_G2_TP', 'TONUMBER': 83, 'TOEXNAME': 'Medine_G2_Ugen6.599999904632568'}, 'NIPS_66kV_Nicolay_22kV_1_Nicolay_TS1_Tr': {'TONAME': 'Nicolay_22kV_1', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'ID': 'Nicolay_TS1', 'TONUMBER': 88, 'TOEXNAME': 'Nicolay_22kV_122.0'}, 'Fuel_66kV_Fuel_22kV_2_Fuel_TS2_Tr': {'TONAME': 'Fuel_22kV_2', 'FROMNUMBER': 58, '#WIND': 2, 'FROMEXNAME': 'Fuel_66kV_66.0', 'FROMNAME': 'Fuel_66kV', 'ID': 'Fuel_TS2', 'TONUMBER': 57, 'TOEXNAME': 'Fuel_22kV_222.0'}, 'FVPS_66kV_FVPS_Ugen_3_FVPS_TP_4_Tr': {'TONAME': 'FVPS_Ugen_3', 'FROMNUMBER': 45, '#WIND': 2, 'FROMEXNAME': 'FVPS_66kV_66.0', 'FROMNAME': 'FVPS_66kV', 'ID': 'FVPS_TP_4', 'TONUMBER': 48, 'TOEXNAME': 'FVPS_Ugen_311.0'}, 'StLouis_66kV_StLouis_22kV_1_StLouis_TS1_Tr': {'TONAME': 'StLouis_22kV_1', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': 'StLouis_TS1', 'TONUMBER': 96, 'TOEXNAME': 'StLouis_22kV_122.0'}, 'StLouis_66kV_StLouis_Ugen_7_StLouisG7_TP_Tr': {'TONAME': 'StLouis_Ugen_7', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': 'StLouisG7_TP', 'TONUMBER': 103, 'TOEXNAME': 'StLouis_Ugen_711.0'}, 'UnionVale_66kV_UnionVale_22kV_1_UnionVale_TS1_Tr': {'TONAME': 'UnionVale_22kV_1', 'FROMNUMBER': 120, '#WIND': 2, 'FROMEXNAME': 'UnionVale_66kV_66.0', 'FROMNAME': 'UnionVale_66kV', 'ID': 'UnionVale_TS1', 'TONUMBER': 118, 'TOEXNAME': 'UnionVale_22kV_122.0'}, 'Bellevue_66kV_Bellevue_G1_Ugen_Bellevue_G1_TP_Tr': {'TONAME': 'Bellevue_G1_Ugen', 'FROMNUMBER': 10, '#WIND': 2, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'ID': 'Bellevue_G1_TP', 'TONUMBER': 11, 'TOEXNAME': 'Bellevue_G1_Ugen11.0'}, 'Bellevue_66kV_Bellevue_G2_Ugen_Bellevue_G2_TP_Tr': {'TONAME': 'Bellevue_G2_Ugen', 'FROMNUMBER': 10, '#WIND': 2, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'ID': 'Bellevue_G2_TP', 'TONUMBER': 12, 'TOEXNAME': 'Bellevue_G2_Ugen11.0'}, 'Fuel_PowerStation_66kV_Fuel_G1_Ugen_Fuel_G1_TP_Tr': {'TONAME': 'Fuel_G1_Ugen', 'FROMNUMBER': 61, '#WIND': 2, 'FROMEXNAME': 'Fuel_PowerStation_66kV_66.0', 'FROMNAME': 'Fuel_PowerStation_66kV', 'ID': 'Fuel_G1_TP', 'TONUMBER': 59, 'TOEXNAME': 'Fuel_G1_Ugen6.599999904632568'}, 'LeVal_22kV_LeVal_G1_Ugen_LeVal_TP1_Tr': {'TONAME': 'LeVal_G1_Ugen', 'FROMNUMBER': 76, '#WIND': 2, 'FROMEXNAME': 'LeVal_22kV_22.0', 'FROMNAME': 'LeVal_22kV', 'ID': 'LeVal_TP1', 'TONUMBER': 77, 'TOEXNAME': 'LeVal_G1_Ugen6.599999904632568'}, 'StLouis_66kV_StLouis_22kV_2_StLouis_TS2_Tr': {'TONAME': 'StLouis_22kV_2', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': 'StLouis_TS2', 'TONUMBER': 97, 'TOEXNAME': 'StLouis_22kV_222.0'}, 'Ebene_66kV_Ebene_22kV_3_Ebene_TS3_Tr': {'TONAME': 'Ebene_22kV_3', 'FROMNUMBER': 36, '#WIND': 2, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'ID': 'Ebene_TS3', 'TONUMBER': 35, 'TOEXNAME': 'Ebene_22kV_322.0'}, 'StLouis_66kV_StLouis_Ugen_9_StLouisG9_TP_Tr': {'TONAME': 'StLouis_Ugen_9', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': 'StLouisG9_TP', 'TONUMBER': 105, 'TOEXNAME': 'StLouis_Ugen_911.0'}, 'LaChaumiere_66kV_LaChaumiere_22kV_2_LaChaumiere_TS2_Tr': {'TONAME': 'LaChaumiere_22kV_2', 'FROMNUMBER': 74, '#WIND': 2, 'FROMEXNAME': 'LaChaumiere_66kV_66.0', 'FROMNAME': 'LaChaumiere_66kV', 'ID': 'LaChaumiere_TS2', 'TONUMBER': 73, 'TOEXNAME': 'LaChaumiere_22kV_222.0'}, 'StLouis_66kV_StLouis_Ugen_8_StLouisG8_TP_Tr': {'TONAME': 'StLouis_Ugen_8', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': 'StLouisG8_TP', 'TONUMBER': 104, 'TOEXNAME': 'StLouis_Ugen_811.0'}, 'Ferney_22kV_Ferney_G2_Ugen_Ferney_G2_TP_Tr': {'TONAME': 'Ferney_G2_Ugen', 'FROMNUMBER': 50, '#WIND': 2, 'FROMEXNAME': 'Ferney_22kV_22.0', 'FROMNAME': 'Ferney_22kV', 'ID': 'Ferney_G2_TP', 'TONUMBER': 52, 'TOEXNAME': 'Ferney_G2_Ugen6.599999904632568'}, 'Ebene_66kV_Ebene_22kV_2_Ebene_TS2_Tr': {'TONAME': 'Ebene_22kV_2', 'FROMNUMBER': 36, '#WIND': 2, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'ID': 'Ebene_TS2', 'TONUMBER': 34, 'TOEXNAME': 'Ebene_22kV_222.0'}, 'Combo_66kV_Combo_22kV_1_Combo_TS1_Tr': {'TONAME': 'Combo_22kV_1', 'FROMNUMBER': 30, '#WIND': 2, 'FROMEXNAME': 'Combo_66kV_66.0', 'FROMNAME': 'Combo_66kV', 'ID': 'Combo_TS1', 'TONUMBER': 28, 'TOEXNAME': 'Combo_22kV_122.0'}, 'Anahita_66kV_Anahita_22kV_2_Anahita_TS2_Tr': {'TONAME': 'Anahita_22kV_2', 'FROMNUMBER': 5, '#WIND': 2, 'FROMEXNAME': 'Anahita_66kV_66.0', 'FROMNAME': 'Anahita_66kV', 'ID': 'Anahita_TS2', 'TONUMBER': 4, 'TOEXNAME': 'Anahita_22kV_222.0'}, 'FortGeorge_66kV_FGPS_Ugen4_FGPS_TP4_Tr': {'TONAME': 'FGPS_Ugen4', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'ID': 'FGPS_TP4', 'TONUMBER': 40, 'TOEXNAME': 'FGPS_Ugen411.0'}, 'CaseNoyale_66kV_CaseNoyale_22kV_1_CaseNoyale_TS1_Tr': {'TONAME': 'CaseNoyale_22kV_1', 'FROMNUMBER': 21, '#WIND': 2, 'FROMEXNAME': 'CaseNoyale_66kV_66.0', 'FROMNAME': 'CaseNoyale_66kV', 'ID': 'CaseNoyale_TS1', 'TONUMBER': 19, 'TOEXNAME': 'CaseNoyale_22kV_122.0'}, 'Sottise_66kV_Sottise_22kV_2_Sottise_TS2_Tr': {'TONAME': 'Sottise_22kV_2', 'FROMNUMBER': 95, '#WIND': 2, 'FROMEXNAME': 'Sottise_66kV_66.0', 'FROMNAME': 'Sottise_66kV', 'ID': 'Sottise_TS2', 'TONUMBER': 94, 'TOEXNAME': 'Sottise_22kV_222.0'}, 'Jin_Fei_66kV_Jin_Fei_22kV_1_Jin_Fei_TS1_Tr': {'TONAME': 'Jin_Fei_22kV_1', 'FROMNUMBER': 71, '#WIND': 2, 'FROMEXNAME': 'Jin_Fei_66kV_66.0', 'FROMNAME': 'Jin_Fei_66kV', 'ID': 'Jin_Fei_TS1', 'TONUMBER': 69, 'TOEXNAME': 'Jin_Fei_22kV_122.0'}, 'TourKoening_66kV_TourKoening_22kV_2_TourKoening_TS2_Tr': {'TONAME': 'TourKoening_22kV_2', 'FROMNUMBER': 117, '#WIND': 2, 'FROMEXNAME': 'TourKoening_66kV_66.0', 'FROMNAME': 'TourKoening_66kV', 'ID': 'TourKoening_TS2', 'TONUMBER': 116, 'TOEXNAME': 'TourKoening_22kV_222.0'}, 'FortGeorge_66kV_FGPS_Ugen3_FGPS_TP3_Tr': {'TONAME': 'FGPS_Ugen3', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'ID': 'FGPS_TP3', 'TONUMBER': 39, 'TOEXNAME': 'FGPS_Ugen311.0'}, 'CaseNoyale_66kV_CaseNoyale_22kV_2_CaseNoyale_TS2_Tr': {'TONAME': 'CaseNoyale_22kV_2', 'FROMNUMBER': 21, '#WIND': 2, 'FROMEXNAME': 'CaseNoyale_66kV_66.0', 'FROMNAME': 'CaseNoyale_66kV', 'ID': 'CaseNoyale_TS2', 'TONUMBER': 20, 'TOEXNAME': 'CaseNoyale_22kV_222.0'}, 'FVPS_22kV_1_FVPS_Ugen_2_FVPS_TS1_Tr': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 42, '#WIND': 2, 'FROMEXNAME': 'FVPS_22kV_1_22.0', 'FROMNAME': 'FVPS_22kV_1', 'ID': 'FVPS_TS1', 'TONUMBER': 47, 'TOEXNAME': 'FVPS_Ugen_211.0'}, 'NIPS_66kV_NIPS_G3_Ugen_NIPS_TP3_Tr': {'TONAME': 'NIPS_G3_Ugen', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'ID': 'NIPS_TP3', 'TONUMBER': 87, 'TOEXNAME': 'NIPS_G3_Ugen11.0'}, 'Fuel_66kV_Fuel_22kV_1_Fuel_TS1_Tr': {'TONAME': 'Fuel_22kV_1', 'FROMNUMBER': 58, '#WIND': 2, 'FROMEXNAME': 'Fuel_66kV_66.0', 'FROMNAME': 'Fuel_66kV', 'ID': 'Fuel_TS1', 'TONUMBER': 56, 'TOEXNAME': 'Fuel_22kV_122.0'}, 'Amaury_66kV_Amaury_22kV_1_Amaury_TS1_Tr': {'TONAME': 'Amaury_22kV_1', 'FROMNUMBER': 2, '#WIND': 2, 'FROMEXNAME': 'Amaury_66kV_66.0', 'FROMNAME': 'Amaury_66kV', 'ID': 'Amaury_TS1', 'TONUMBER': 0, 'TOEXNAME': 'Amaury_22kV_122.0'}, 'TourKoening_66kV_TourKoening_22kV_1_TourKoening_TS1_Tr': {'TONAME': 'TourKoening_22kV_1', 'FROMNUMBER': 117, '#WIND': 2, 'FROMEXNAME': 'TourKoening_66kV_66.0', 'FROMNAME': 'TourKoening_66kV', 'ID': 'TourKoening_TS1', 'TONUMBER': 115, 'TOEXNAME': 'TourKoening_22kV_122.0'}, 'Wooton_66kV_Wooton_22kV_2_Wooton_TS2_Tr': {'TONAME': 'Wooton_22kV_2', 'FROMNUMBER': 123, '#WIND': 2, 'FROMEXNAME': 'Wooton_66kV_66.0', 'FROMNAME': 'Wooton_66kV', 'ID': 'Wooton_TS2', 'TONUMBER': 122, 'TOEXNAME': 'Wooton_22kV_222.0'}, 'Ebene_66kV_Ebene_22kV_1_Ebene_TS1_Tr': {'TONAME': 'Ebene_22kV_1', 'FROMNUMBER': 36, '#WIND': 2, 'FROMEXNAME': 'Ebene_66kV_66.0', 'FROMNAME': 'Ebene_66kV', 'ID': 'Ebene_TS1', 'TONUMBER': 33, 'TOEXNAME': 'Ebene_22kV_122.0'}, 'Jin_Fei_66kV_Jin_Fei_22kV_2_Jin_Fei_TS2_Tr': {'TONAME': 'Jin_Fei_22kV_2', 'FROMNUMBER': 71, '#WIND': 2, 'FROMEXNAME': 'Jin_Fei_66kV_66.0', 'FROMNAME': 'Jin_Fei_66kV', 'ID': 'Jin_Fei_TS2', 'TONUMBER': 70, 'TOEXNAME': 'Jin_Fei_22kV_222.0'}, 'Fuel_PowerStation_66kV_Fuel_G2_Ugen_Fuel_G2_TP_Tr': {'TONAME': 'Fuel_G2_Ugen', 'FROMNUMBER': 61, '#WIND': 2, 'FROMEXNAME': 'Fuel_PowerStation_66kV_66.0', 'FROMNAME': 'Fuel_PowerStation_66kV', 'ID': 'Fuel_G2_TP', 'TONUMBER': 60, 'TOEXNAME': 'Fuel_G2_Ugen6.599999904632568'}, 'NIPS_66kV_Nicolay_22kV_2_Nicolay_TS2_Tr': {'TONAME': 'Nicolay_22kV_2', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'ID': 'Nicolay_TS2', 'TONUMBER': 89, 'TOEXNAME': 'Nicolay_22kV_222.0'}, 'FVPS_66kV_FVPS_Ugen_2_FVPS_TP_1_Tr': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 45, '#WIND': 2, 'FROMEXNAME': 'FVPS_66kV_66.0', 'FROMNAME': 'FVPS_66kV', 'ID': 'FVPS_TP_1', 'TONUMBER': 47, 'TOEXNAME': 'FVPS_Ugen_211.0'}, 'FortGeorge_66kV_FortGeorge_22kV_1_FortGeorge_TS1_Tr': {'TONAME': 'FortGeorge_22kV_1', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'ID': 'FortGeorge_TS1', 'TONUMBER': 53, 'TOEXNAME': 'FortGeorge_22kV_122.0'}, 'Henrietta_66kV_Henrietta_22kV_2_Henrietta_TS2_Tr': {'TONAME': 'Henrietta_22kV_2', 'FROMNUMBER': 64, '#WIND': 2, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'ID': 'Henrietta_TS2', 'TONUMBER': 63, 'TOEXNAME': 'Henrietta_22kV_222.0'}, 'Wooton_66kV_Wooton_22kV_1_Wooton_TS1_Tr': {'TONAME': 'Wooton_22kV_1', 'FROMNUMBER': 123, '#WIND': 2, 'FROMEXNAME': 'Wooton_66kV_66.0', 'FROMNAME': 'Wooton_66kV', 'ID': 'Wooton_TS1', 'TONUMBER': 121, 'TOEXNAME': 'Wooton_22kV_122.0'}, 'NIPS_66kV_NIPS_G2_Ugen_NIPS_TP2_Tr': {'TONAME': 'NIPS_G2_Ugen', 'FROMNUMBER': 84, '#WIND': 2, 'FROMEXNAME': 'NIPS_66kV_66.0', 'FROMNAME': 'NIPS_66kV', 'ID': 'NIPS_TP2', 'TONUMBER': 86, 'TOEXNAME': 'NIPS_G2_Ugen11.0'}, 'FortGeorge_66kV_FortGeorge_22kV_2_FortGeorge_TS2_Tr': {'TONAME': 'FortGeorge_22kV_2', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'ID': 'FortGeorge_TS2', 'TONUMBER': 54, 'TOEXNAME': 'FortGeorge_22kV_222.0'}, 'StLouis_66kV_StLouis_Ugen_11_StLouisG11_TP_Tr': {'TONAME': 'StLouis_Ugen_11', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': 'StLouisG11_TP', 'TONUMBER': 100, 'TOEXNAME': 'StLouis_Ugen_1111.0'}, 'Combo_66kV_Combo_22kV_2_Combo_TS2_Tr': {'TONAME': 'Combo_22kV_2', 'FROMNUMBER': 30, '#WIND': 2, 'FROMEXNAME': 'Combo_66kV_66.0', 'FROMNAME': 'Combo_66kV', 'ID': 'Combo_TS2', 'TONUMBER': 29, 'TOEXNAME': 'Combo_22kV_222.0'}, 'Ferney_22kV_Ferney_G1_Ugen_Ferney_G1_TP_Tr': {'TONAME': 'Ferney_G1_Ugen', 'FROMNUMBER': 50, '#WIND': 2, 'FROMEXNAME': 'Ferney_22kV_22.0', 'FROMNAME': 'Ferney_22kV', 'ID': 'Ferney_G1_TP', 'TONUMBER': 51, 'TOEXNAME': 'Ferney_G1_Ugen6.599999904632568'}, 'Henrietta_66kV_Henrietta_22kV_1_Henrietta_TS1_Tr': {'TONAME': 'Henrietta_22kV_1', 'FROMNUMBER': 64, '#WIND': 2, 'FROMEXNAME': 'Henrietta_66kV_66.0', 'FROMNAME': 'Henrietta_66kV', 'ID': 'Henrietta_TS1', 'TONUMBER': 62, 'TOEXNAME': 'Henrietta_22kV_122.0'}, 'Cecile_22kV_Cecile_G1_Ugen_Cecile_G1_TP1_Tr': {'TONAME': 'Cecile_G1_Ugen', 'FROMNUMBER': 22, '#WIND': 2, 'FROMEXNAME': 'Cecile_22kV_22.0', 'FROMNAME': 'Cecile_22kV', 'ID': 'Cecile_G1_TP1', 'TONUMBER': 23, 'TOEXNAME': 'Cecile_G1_Ugen6.599999904632568'}, 'Champagne_66kV_Champagne_G1_Ugen_Champagne_G1_TP_Tr': {'TONAME': 'Champagne_G1_Ugen', 'FROMNUMBER': 25, '#WIND': 2, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'ID': 'Champagne_G1_TP', 'TONUMBER': 26, 'TOEXNAME': 'Champagne_G1_Ugen6.599999904632568'}, 'FVPS_66kV_FVPS_Ugen_2_FVPS_TP_3_Tr': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 45, '#WIND': 2, 'FROMEXNAME': 'FVPS_66kV_66.0', 'FROMNAME': 'FVPS_66kV', 'ID': 'FVPS_TP_3', 'TONUMBER': 47, 'TOEXNAME': 'FVPS_Ugen_211.0'}, 'LeVal_22kV_LeVal_G2_Ugen_LeVal_TP2_Tr': {'TONAME': 'LeVal_G2_Ugen', 'FROMNUMBER': 76, '#WIND': 2, 'FROMEXNAME': 'LeVal_22kV_22.0', 'FROMNAME': 'LeVal_22kV', 'ID': 'LeVal_TP2', 'TONUMBER': 78, 'TOEXNAME': 'LeVal_G2_Ugen6.599999904632568'}, 'FortGeorge_66kV_FGPS_Ugen2_FGPS_TP2_Tr': {'TONAME': 'FGPS_Ugen2', 'FROMNUMBER': 55, '#WIND': 2, 'FROMEXNAME': 'FortGeorge_66kV_66.0', 'FROMNAME': 'FortGeorge_66kV', 'ID': 'FGPS_TP2', 'TONUMBER': 38, 'TOEXNAME': 'FGPS_Ugen211.0'}, 'Champagne_66kV_Champagne_G2_Ugen_Champagne_G2_TP_Tr': {'TONAME': 'Champagne_G2_Ugen', 'FROMNUMBER': 25, '#WIND': 2, 'FROMEXNAME': 'Champagne_66kV_66.0', 'FROMNAME': 'Champagne_66kV', 'ID': 'Champagne_G2_TP', 'TONUMBER': 27, 'TOEXNAME': 'Champagne_G2_Ugen6.599999904632568'}, 'LaChaumiere_22kV_2_LaFerme_G1_Ugen_LaFerme_TP_Tr': {'TONAME': 'LaFerme_G1_Ugen', 'FROMNUMBER': 73, '#WIND': 2, 'FROMEXNAME': 'LaChaumiere_22kV_2_22.0', 'FROMNAME': 'LaChaumiere_22kV_2', 'ID': 'LaFerme_TP', 'TONUMBER': 75, 'TOEXNAME': 'LaFerme_G1_Ugen6.599999904632568'}, 'FVPS_22kV_2_FVPS_Ugen_2_FVPS_TS2_Tr': {'TONAME': 'FVPS_Ugen_2', 'FROMNUMBER': 43, '#WIND': 2, 'FROMEXNAME': 'FVPS_22kV_2_22.0', 'FROMNAME': 'FVPS_22kV_2', 'ID': 'FVPS_TS2', 'TONUMBER': 47, 'TOEXNAME': 'FVPS_Ugen_211.0'}, 'LaChaumiere_66kV_LaChaumiere_22kV_1_LaChaumiere_TS1_Tr': {'TONAME': 'LaChaumiere_22kV_1', 'FROMNUMBER': 74, '#WIND': 2, 'FROMEXNAME': 'LaChaumiere_66kV_66.0', 'FROMNAME': 'LaChaumiere_66kV', 'ID': 'LaChaumiere_TS1', 'TONUMBER': 72, 'TOEXNAME': 'LaChaumiere_22kV_122.0'}, 'Bellevue_66kV_Bellevue_22kV_2_Bellevue_TS2_Tr': {'TONAME': 'Bellevue_22kV_2', 'FROMNUMBER': 10, '#WIND': 2, 'FROMEXNAME': 'Bellevue_66kV_66.0', 'FROMNAME': 'Bellevue_66kV', 'ID': 'Bellevue_TS2', 'TONUMBER': 9, 'TOEXNAME': 'Bellevue_22kV_222.0'}, 'StLouis_66kV_StLouis_Ugen_13_StLouisG13_TP_Tr': {'TONAME': 'StLouis_Ugen_13', 'FROMNUMBER': 98, '#WIND': 2, 'FROMEXNAME': 'StLouis_66kV_66.0', 'FROMNAME': 'StLouis_66kV', 'ID': 'StLouisG13_TP', 'TONUMBER': 102, 'TOEXNAME': 'StLouis_Ugen_1311.0'}}
+MachineDico = {'Bastia_Bastia_syn_Gr_HVDC_SACOI_50MW': {'PMIN': -50.0, 'EXNAME': 'Bastia_Bastia_90.0KV', 'NAME': 'HVDC_SACOI_50MW', 'NUMBER': 151, 'QMAX': 48.0, 'Q': 4.0, 'P': 50.0, 'QMIN': -48.0, 'ID': 'HVDC_SACOI_50MW', 'PMAX': 50.0}, 'Caldanicci_Caldanicci_genstat_Gr_Caldanicci_PV': {'PMIN': 0.0, 'EXNAME': 'Caldanicci_Caldanicci_90.0KV', 'NAME': 'Caldanicci_PV', 'NUMBER': 153, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Caldanicci_PV', 'PMAX': 10.0}, 'Ocana_Ocana_syn_Gr_PONT_VANNA': {'PMIN': 0.0, 'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'PONT_VANNA', 'NUMBER': 165, 'QMAX': 0.0, 'Q': 4.988999843597412, 'P': 8.0, 'QMIN': 0.0, 'ID': 'PONT_VANNA', 'PMAX': 8.0}, 'IleRousse_IleRousse_genstat_Gr_IleRousse_PV': {'PMIN': 0.0, 'EXNAME': 'IleRousse_IleRousse_90.0KV', 'NAME': 'IleRousse_PV', 'NUMBER': 161, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'IleRousse_PV', 'PMAX': 5.0}, 'Cervione_Cervione_genstat_Gr_CERVIONE_BT_PV': {'PMIN': 0.0, 'EXNAME': 'Cervione_Cervione_90.0KV', 'NAME': 'CERVIONE_BT_PV', 'NUMBER': 156, 'QMAX': 0.0, 'Q': 0.0, 'P': 0.6000000238418579, 'QMIN': 0.0, 'ID': 'CERVIONE_BT_PV', 'PMAX': 2.0}, 'Vazzio_Vazzio_syn_Gr_Vazzio_TAC': {'PMIN': 0.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'Vazzio_TAC', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 0.0, 'QMIN': -10.24000072479248, 'ID': 'Vazzio_TAC', 'PMAX': 20.0}, 'Sovenzia_Sovenzia_syn_Gr_SOVENZ_G': {'PMIN': 0.0, 'EXNAME': 'Sovenzia_Sovenzia_90.0KV', 'NAME': 'SOVENZ_G', 'NUMBER': 175, 'QMAX': 0.0, 'Q': 4.163000106811523, 'P': 15.0, 'QMIN': 0.0, 'ID': 'SOVENZ_G', 'PMAX': 15.0}, 'Lucciana_Lucciana_syn_Gr_LUCCIANA_HTB': {'PMIN': 10.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'LUCCIANA_HTB', 'NUMBER': 163, 'QMAX': 0.0, 'Q': 0.0, 'P': 0.0, 'QMIN': 0.0, 'ID': 'LUCCIANA_HTB', 'PMAX': 50.0}, 'Lucciana_Lucciana_syn_Gr_CASA1': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA1', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA1', 'PMAX': 17.100000381469727}, 'Calvi_Calvi_genstat_Gr_Calvi_EOL': {'PMIN': 0.0, 'EXNAME': 'Calvi_Calvi_90.0KV', 'NAME': 'Calvi_EOL', 'NUMBER': 154, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Calvi_EOL', 'PMAX': 5.0}, 'Corsica_Corsica_syn_Gr_CORSICA_G': {'PMIN': 0.0, 'EXNAME': 'Corsica_Corsica_90.0KV', 'NAME': 'CORSICA_G', 'NUMBER': 157, 'QMAX': 0.0, 'Q': 3.0360000133514404, 'P': 8.0, 'QMIN': 0.0, 'ID': 'CORSICA_G', 'PMAX': 13.0}, 'Lucciana_Lucciana_syn_Gr_CASA2': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA2', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA2', 'PMAX': 17.100000381469727}, 'Ocana_Ocana_syn_Gr_OCA_G3': {'PMIN': 0.0, 'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'OCA_G3', 'NUMBER': 165, 'QMAX': 0.0, 'Q': 2.7890000343322754, 'P': 4.0, 'QMIN': 0.0, 'ID': 'OCA_G3', 'PMAX': 4.0}, 'Ocana_Ocana_syn_Gr_OCA_G2': {'PMIN': 0.0, 'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'OCA_G2', 'NUMBER': 165, 'QMAX': 0.0, 'Q': 2.7890000343322754, 'P': 5.25, 'QMIN': 0.0, 'ID': 'OCA_G2', 'PMAX': 5.25}, 'Ocana_Ocana_syn_Gr_OCA_G1': {'PMIN': 0.0, 'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'OCA_G1', 'NUMBER': 165, 'QMAX': 0.0, 'Q': 2.7909998893737793, 'P': 2.0, 'QMIN': 0.0, 'ID': 'OCA_G1', 'PMAX': 8.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G1': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G1', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G1', 'PMAX': 17.100000381469727}, 'SainteLucie_SainteLucie_genstat_Gr_SaintLucie_PV': {'PMIN': 0.0, 'EXNAME': 'SainteLucie_SainteLucie_90.0KV', 'NAME': 'SaintLucie_PV', 'NUMBER': 171, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'SaintLucie_PV', 'PMAX': 10.0}, 'Lucciana_Lucciana_syn_Gr_LUCCIANA_HTB_2': {'PMIN': 10.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'LUCCIANA_HTB_2', 'NUMBER': 163, 'QMAX': 0.0, 'Q': 0.0, 'P': 0.0, 'QMIN': 0.0, 'ID': 'LUCCIANA_HTB_2', 'PMAX': 50.0}, 'Loretto_Loretto_genstat_Gr_Loretto_PV': {'PMIN': 0.0, 'EXNAME': 'Loretto_Loretto_90.0KV', 'NAME': 'Loretto_PV', 'NUMBER': 162, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Loretto_PV', 'PMAX': 5.0}, 'Vazzio_Vazzio_syn_Gr_VAZ_G5': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G5', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G5', 'PMAX': 17.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G4': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G4', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G4', 'PMAX': 17.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G6': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G6', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G6', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA7': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA7', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA7', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA6': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA6', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA6', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA5': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA5', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA5', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA4': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA4', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA4', 'PMAX': 17.100000381469727}, 'Lucciana_Lucciana_syn_Gr_CASA3': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'CASA3', 'NUMBER': 163, 'QMAX': 12.369999885559082, 'Q': 3.0380001068115234, 'P': 17.100000381469727, 'QMIN': -10.24000072479248, 'ID': 'CASA3', 'PMAX': 17.100000381469727}, 'Castirla_Castirla_syn_Gr_CASTI_G1': {'PMIN': 0.0, 'EXNAME': 'Castirla_Castirla_90.0KV', 'NAME': 'CASTI_G1', 'NUMBER': 155, 'QMAX': 0.0, 'Q': 5.25, 'P': 5.0, 'QMIN': 0.0, 'ID': 'CASTI_G1', 'PMAX': 14.5}, 'Castirla_Castirla_syn_Gr_CASTI_G2': {'PMIN': 0.0, 'EXNAME': 'Castirla_Castirla_90.0KV', 'NAME': 'CASTI_G2', 'NUMBER': 155, 'QMAX': 0.0, 'Q': 5.25, 'P': 5.0, 'QMIN': 0.0, 'ID': 'CASTI_G2', 'PMAX': 14.5}, 'Bonifacio_Bonifacio_genstat_Gr_Bonifaccio_PV': {'PMIN': 0.0, 'EXNAME': 'Bonifacio_Bonifacio_90.0KV', 'NAME': 'Bonifaccio_PV', 'NUMBER': 152, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Bonifaccio_PV', 'PMAX': 10.0}, 'Propriano_Propriano_syn_Gr_RIZZANESE1': {'PMIN': 0.0, 'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'RIZZANESE1', 'NUMBER': 169, 'QMAX': 0.0, 'Q': 2.811000108718872, 'P': 10.0, 'QMIN': 0.0, 'ID': 'RIZZANESE1', 'PMAX': 27.5}, 'Sisco_Sisco_genstat_Gr_Sisco_1_EOL': {'PMIN': 0.0, 'EXNAME': 'Sisco_Sisco_90.0KV', 'NAME': 'Sisco_1_EOL', 'NUMBER': 174, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.9500000476837158, 'QMIN': 0.0, 'ID': 'Sisco_1_EOL', 'PMAX': 6.5}, 'Taglio_Taglio_genstat_Gr_Taglio_PV': {'PMIN': 0.0, 'EXNAME': 'Taglio_Taglio_90.0KV', 'NAME': 'Taglio_PV', 'NUMBER': 476, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Taglio_PV', 'PMAX': 10.0}, 'Propriano_Propriano_syn_Gr_RIZZANESE2': {'PMIN': 0.0, 'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'RIZZANESE2', 'NUMBER': 169, 'QMAX': 0.0, 'Q': 2.811000108718872, 'P': 10.0, 'QMIN': 0.0, 'ID': 'RIZZANESE2', 'PMAX': 27.5}, 'Sampolo_Sampolo_syn_Gr_SAMPO_G2': {'PMIN': 0.0, 'EXNAME': 'Sampolo_Sampolo_90.0KV', 'NAME': 'SAMPO_G2', 'NUMBER': 173, 'QMAX': 0.0, 'Q': 8.279000282287598, 'P': 10.0, 'QMIN': 0.0, 'ID': 'SAMPO_G2', 'PMAX': 21.5}, 'Bonifacio_Bonifacio_syn_Gr_HVAC_SARCO_100MW': {'PMIN': -50.0, 'EXNAME': 'Bonifacio_Bonifacio_90.0KV', 'NAME': 'HVAC_SARCO_100MW', 'NUMBER': 152, 'QMAX': 48.0, 'Q': 4.0, 'P': 50.0, 'QMIN': -48.0, 'ID': 'HVAC_SARCO_100MW', 'PMAX': 50.0}, 'Lucciana_Lucciana_syn_Gr_LUCCIANA_BT': {'PMIN': 5.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'LUCCIANA_BT', 'NUMBER': 163, 'QMAX': 0.0, 'Q': 0.5260000228881836, 'P': 12.0, 'QMIN': 0.0, 'ID': 'LUCCIANA_BT', 'PMAX': 12.0}, 'Sampolo_Sampolo_syn_Gr_SAMPO_G1': {'PMIN': 0.0, 'EXNAME': 'Sampolo_Sampolo_90.0KV', 'NAME': 'SAMPO_G1', 'NUMBER': 173, 'QMAX': 0.0, 'Q': 8.279000282287598, 'P': 10.0, 'QMIN': 0.0, 'ID': 'SAMPO_G1', 'PMAX': 21.5}, 'Vazzio_Vazzio_syn_Gr_VAZ_G3': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G3', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G3', 'PMAX': 17.100000381469727}, 'Propriano_Propriano_syn_Gr_PROPRIA_BT': {'PMIN': 0.0, 'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'PROPRIA_BT', 'NUMBER': 169, 'QMAX': 0.0, 'Q': 0.6240000128746033, 'P': 1.899999976158142, 'QMIN': 0.0, 'ID': 'PROPRIA_BT', 'PMAX': 1.899999976158142}, 'Corte_Corte_genstat_Gr_Corte_PV': {'PMIN': 0.0, 'EXNAME': 'Corte_Corte_90.0KV', 'NAME': 'Corte_PV', 'NUMBER': 158, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Corte_PV', 'PMAX': 10.0}, 'Oletta_Oletta_genstat_Gr_Oletta_PV': {'PMIN': 0.0, 'EXNAME': 'Oletta_Oletta_90.0KV', 'NAME': 'Oletta_PV', 'NUMBER': 166, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Oletta_PV', 'PMAX': 5.0}, 'Morosaglia_Morosaglia_genstat_Gr_Morosoglia_PV': {'PMIN': 0.0, 'EXNAME': 'Morosaglia_Morosaglia_90.0KV', 'NAME': 'Morosoglia_PV', 'NUMBER': 164, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Morosoglia_PV', 'PMAX': 5.0}, 'Tolla_Tolla_syn_Gr_TOLLA_G1': {'PMIN': 0.0, 'EXNAME': 'Tolla_Tolla_90.0KV', 'NAME': 'TOLLA_G1', 'NUMBER': 477, 'QMAX': 7.0, 'Q': 2.180000066757202, 'P': 4.5, 'QMIN': -7.0, 'ID': 'TOLLA_G1', 'PMAX': 4.5}, 'Tolla_Tolla_syn_Gr_TOLLA_G2': {'PMIN': 0.0, 'EXNAME': 'Tolla_Tolla_90.0KV', 'NAME': 'TOLLA_G2', 'NUMBER': 477, 'QMAX': 10.0, 'Q': 2.180000066757202, 'P': 4.5, 'QMIN': -10.0, 'ID': 'TOLLA_G2', 'PMAX': 4.5}, 'Tolla_Tolla_syn_Gr_TOLLA_G3': {'PMIN': 0.0, 'EXNAME': 'Tolla_Tolla_90.0KV', 'NAME': 'TOLLA_G3', 'NUMBER': 477, 'QMAX': 0.0, 'Q': 3.7799999713897705, 'P': 7.0, 'QMIN': 0.0, 'ID': 'TOLLA_G3', 'PMAX': 7.0}, 'Vazzio_Vazzio_syn_Gr_VAZ_G11': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G11', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 0.0, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G11', 'PMAX': 17.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G10': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G10', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 0.0, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G10', 'PMAX': 17.100000381469727}, 'Vazzio_Vazzio_syn_Gr_VAZ_G12': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G12', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 0.0, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G12', 'PMAX': 17.100000381469727}, 'Sisco_Sisco_genstat_Gr_Sisco_2_EOL': {'PMIN': 0.0, 'EXNAME': 'Sisco_Sisco_90.0KV', 'NAME': 'Sisco_2_EOL', 'NUMBER': 174, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.9500000476837158, 'QMIN': 0.0, 'ID': 'Sisco_2_EOL', 'PMAX': 6.5}, 'Furiani_Furiani_genstat_Gr_Furiani_PV': {'PMIN': 0.0, 'EXNAME': 'Furiani_Furiani_90.0KV', 'NAME': 'Furiani_PV', 'NUMBER': 159, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Furiani_PV', 'PMAX': 5.0}, 'Lucciana_Lucciana_genstat_Gr_Lucciana_PV': {'PMIN': 0.0, 'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'Lucciana_PV', 'NUMBER': 163, 'QMAX': 0.0, 'Q': 0.0, 'P': 0.6000000238418579, 'QMIN': 0.0, 'ID': 'Lucciana_PV', 'PMAX': 2.0}, 'Propriano_Propriano_genstat_Gr_Propriano_PV': {'PMIN': 0.0, 'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'Propriano_PV', 'NUMBER': 169, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Propriano_PV', 'PMAX': 5.0}, 'Vazzio_Vazzio_syn_Gr_VAZ_G2': {'PMIN': 5.0, 'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'VAZ_G2', 'NUMBER': 478, 'QMAX': 12.369999885559082, 'Q': 3.622999906539917, 'P': 10.0, 'QMIN': -10.24000072479248, 'ID': 'VAZ_G2', 'PMAX': 17.100000381469727}, 'Sisco_Sisco_genstat_Gr_Sisco_PV': {'PMIN': 0.0, 'EXNAME': 'Sisco_Sisco_90.0KV', 'NAME': 'Sisco_PV', 'NUMBER': 174, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Sisco_PV', 'PMAX': 10.0}, 'Calvi_Calvi_genstat_Gr_Calvi_PV': {'PMIN': 0.0, 'EXNAME': 'Calvi_Calvi_90.0KV', 'NAME': 'Calvi_PV', 'NUMBER': 154, 'QMAX': 0.0, 'Q': 0.0, 'P': 1.5, 'QMIN': 0.0, 'ID': 'Calvi_PV', 'PMAX': 5.0}, 'Ghisonaccia_Ghisonaccia_genstat_Gr_Gisonaccia_PV': {'PMIN': 0.0, 'EXNAME': 'Ghisonaccia_Ghisonaccia_90.0KV', 'NAME': 'Gisonaccia_PV', 'NUMBER': 160, 'QMAX': 0.0, 'Q': 0.0, 'P': 3.0, 'QMIN': 0.0, 'ID': 'Gisonaccia_PV', 'PMAX': 10.0}}
+LoadDico = {'IleRousse_IleRousse_Lo1': {'EXNAME': 'IleRousse_IleRousse_90.0KV', 'NAME': 'Load 7', 'NUMBER': 161, 'Q': 6.5, 'P': 26.0, 'ID': 1}, 'Calvi_Calvi_Lo1': {'EXNAME': 'Calvi_Calvi_90.0KV', 'NAME': 'Load 11', 'NUMBER': 154, 'Q': 5.0, 'P': 20.0, 'ID': 1}, 'Caldanicci_Caldanicci_Lo1': {'EXNAME': 'Caldanicci_Caldanicci_90.0KV', 'NAME': 'Load 4', 'NUMBER': 153, 'Q': 9.25, 'P': 37.0, 'ID': 1}, 'Corte_Corte_Lo1': {'EXNAME': 'Corte_Corte_90.0KV', 'NAME': 'Load 5', 'NUMBER': 158, 'Q': 4.949999809265137, 'P': 19.799999237060547, 'ID': 1}, 'Bastia_Bastia_Lo1': {'EXNAME': 'Bastia_Bastia_90.0KV', 'NAME': 'Load 2', 'NUMBER': 151, 'Q': 11.800000190734863, 'P': 47.20000076293945, 'ID': 1}, 'Sisco_Sisco_Lo1': {'EXNAME': 'Sisco_Sisco_90.0KV', 'NAME': 'Load 20', 'NUMBER': 174, 'Q': 2.5, 'P': 10.0, 'ID': 1}, 'Propriano_Propriano_Lo1': {'EXNAME': 'Propriano_Propriano_90.0KV', 'NAME': 'Load 17', 'NUMBER': 169, 'Q': 4.849999904632568, 'P': 19.399999618530273, 'ID': 1}, 'Ghisonaccia_Ghisonaccia_Lo1': {'EXNAME': 'Ghisonaccia_Ghisonaccia_90.0KV', 'NAME': 'Load 6', 'NUMBER': 160, 'Q': 7.900000095367432, 'P': 31.799999237060547, 'ID': 1}, 'Aspretto_Aspretto_Lo2': {'EXNAME': 'Aspretto_Aspretto_90.0KV', 'NAME': 'LOAD_for_cong', 'NUMBER': 150, 'Q': 0.0, 'P': 20.0, 'ID': 2}, 'Aspretto_Aspretto_Lo1': {'EXNAME': 'Aspretto_Aspretto_90.0KV', 'NAME': 'Load 1', 'NUMBER': 150, 'Q': 11.850000381469727, 'P': 47.400001525878906, 'ID': 1}, 'PorteVecchio_PorteVecchio_Lo1': {'EXNAME': 'PorteVecchio_PorteVecchio_90.0KV', 'NAME': 'Load 16', 'NUMBER': 168, 'Q': 10.0, 'P': 40.0, 'ID': 1}, 'Sagone_Sagone_Lo1': {'EXNAME': 'Sagone_Sagone_90.0KV', 'NAME': 'Load 18', 'NUMBER': 170, 'Q': 4.400000095367432, 'P': 17.0, 'ID': 1}, 'Pietrosella_Pietrosella_Lo1': {'EXNAME': 'Pietrosella_Pietrosella_90.0KV', 'NAME': 'Load 15', 'NUMBER': 167, 'Q': 2.799999952316284, 'P': 11.199999809265137, 'ID': 1}, 'Vazzio_Vazzio_Lo1': {'EXNAME': 'Vazzio_Vazzio_90.0KV', 'NAME': 'BATTERY_Load', 'NUMBER': 478, 'Q': 0.0, 'P': 20.0, 'ID': 1}, 'SainteMarieSicche_SainteMarieSicche_Lo1': {'EXNAME': 'SainteMarieSicche_SainteMarieSicche_90.0KV', 'NAME': 'Load 19', 'NUMBER': 172, 'Q': 1.649999976158142, 'P': 6.599999904632568, 'ID': 1}, 'Ocana_Ocana_Lo1': {'EXNAME': 'Ocana_Ocana_90.0KV', 'NAME': 'Load 13', 'NUMBER': 165, 'Q': 2.6500000953674316, 'P': 10.600000381469727, 'ID': 1}, 'Morosaglia_Morosaglia_Lo1': {'EXNAME': 'Morosaglia_Morosaglia_90.0KV', 'NAME': 'Load 12', 'NUMBER': 164, 'Q': 1.600000023841858, 'P': 6.400000095367432, 'ID': 1}, 'Lucciana_Lucciana_Lo2': {'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'Load 9', 'NUMBER': 163, 'Q': 7.28000020980835, 'P': 29.100000381469727, 'ID': 2}, 'Lucciana_Lucciana_Lo1': {'EXNAME': 'Lucciana_Lucciana_90.0KV', 'NAME': 'Load 10', 'NUMBER': 163, 'Q': 0.0, 'P': 0.0, 'ID': 1}, 'Loretto_Loretto_Lo1': {'EXNAME': 'Loretto_Loretto_90.0KV', 'NAME': 'Load 8', 'NUMBER': 162, 'Q': 10.0, 'P': 41.0, 'ID': 1}, 'Oletta_Oletta_Lo1': {'EXNAME': 'Oletta_Oletta_90.0KV', 'NAME': 'Load 14', 'NUMBER': 166, 'Q': 2.200000047683716, 'P': 8.899999618530273, 'ID': 1}, 'Bonifacio_Bonifacio_Lo1': {'EXNAME': 'Bonifacio_Bonifacio_90.0KV', 'NAME': 'Load 3', 'NUMBER': 152, 'Q': 4.0, 'P': 16.0, 'ID': 1}}
+LineDico = {'Taglio_Taglio_Cervione_Cervione_CERVIONE_TAGLIO_Li': {'TONAME': 'Cervione_Cervione', 'FROMNUMBER': 476, 'FROMEXNAME': 'Taglio_Taglio_90.0', 'FROMNAME': 'Taglio_Taglio', 'TOEXNAME': 'Cervione_Cervione_90.0', 'TONUMBER': 156, 'ID': 'CERVIONE_TAGLIO'}, 'Lucciana_Lucciana_Taglio_Taglio_CASAMOZZA_TAGLIO_Li': {'TONAME': 'Taglio_Taglio', 'FROMNUMBER': 163, 'FROMEXNAME': 'Lucciana_Lucciana_90.0', 'FROMNAME': 'Lucciana_Lucciana', 'TOEXNAME': 'Taglio_Taglio_90.0', 'TONUMBER': 476, 'ID': 'CASAMOZZA_TAGLIO'}, 'Calvi_Calvi_IleRousse_IleRousse_CALVI_ILE_ROUSSE_Li': {'TONAME': 'IleRousse_IleRousse', 'FROMNUMBER': 154, 'FROMEXNAME': 'Calvi_Calvi_90.0', 'FROMNAME': 'Calvi_Calvi', 'TOEXNAME': 'IleRousse_IleRousse_90.0', 'TONUMBER': 161, 'ID': 'CALVI_ILE_ROUSSE'}, 'Sampolo_Sampolo_Corte_Corte_CORTE_SAMPOLO_Li': {'TONAME': 'Corte_Corte', 'FROMNUMBER': 173, 'FROMEXNAME': 'Sampolo_Sampolo_90.0', 'FROMNAME': 'Sampolo_Sampolo', 'TOEXNAME': 'Corte_Corte_90.0', 'TONUMBER': 158, 'ID': 'CORTE_SAMPOLO'}, 'Loretto_Loretto_Aspretto_Aspretto_ASPRETTO_LORETTO_Li': {'TONAME': 'Aspretto_Aspretto', 'FROMNUMBER': 162, 'FROMEXNAME': 'Loretto_Loretto_90.0', 'FROMNAME': 'Loretto_Loretto', 'TOEXNAME': 'Aspretto_Aspretto_90.0', 'TONUMBER': 150, 'ID': 'ASPRETTO_LORETTO'}, 'Caldanicci_Caldanicci_Vazzio_Vazzio_CALDANICCIA_VAZZIO_Li': {'TONAME': 'Vazzio_Vazzio', 'FROMNUMBER': 153, 'FROMEXNAME': 'Caldanicci_Caldanicci_90.0', 'FROMNAME': 'Caldanicci_Caldanicci', 'TOEXNAME': 'Vazzio_Vazzio_90.0', 'TONUMBER': 478, 'ID': 'CALDANICCIA_VAZZIO'}, 'PorteVecchio_PorteVecchio_Bonifacio_Bonifacio_BONIFACCIO_PO_VO1_Li': {'TONAME': 'Bonifacio_Bonifacio', 'FROMNUMBER': 168, 'FROMEXNAME': 'PorteVecchio_PorteVecchio_90.0', 'FROMNAME': 'PorteVecchio_PorteVecchio', 'TOEXNAME': 'Bonifacio_Bonifacio_90.0', 'TONUMBER': 152, 'ID': 'BONIFACCIO_PO_VO1'}, 'Ocana_Ocana_SainteMarieSicche_SainteMarieSicche_OCANA_ZSSS6_Li': {'TONAME': 'SainteMarieSicche_SainteMarieSicche', 'FROMNUMBER': 165, 'FROMEXNAME': 'Ocana_Ocana_90.0', 'FROMNAME': 'Ocana_Ocana', 'TOEXNAME': 'SainteMarieSicche_SainteMarieSicche_90.0', 'TONUMBER': 172, 'ID': 'OCANA_ZSSS6'}, 'Tolla_Tolla_Ocana_Ocana_OCANA_TOLLA2_Li': {'TONAME': 'Ocana_Ocana', 'FROMNUMBER': 477, 'FROMEXNAME': 'Tolla_Tolla_90.0', 'FROMNAME': 'Tolla_Tolla', 'TOEXNAME': 'Ocana_Ocana_90.0', 'TONUMBER': 165, 'ID': 'OCANA_TOLLA2'}, 'Corte_Corte_Morosaglia_Morosaglia_CORTE_MOROSAGLIA_Li': {'TONAME': 'Morosaglia_Morosaglia', 'FROMNUMBER': 158, 'FROMEXNAME': 'Corte_Corte_90.0', 'FROMNAME': 'Corte_Corte', 'TOEXNAME': 'Morosaglia_Morosaglia_90.0', 'TONUMBER': 164, 'ID': 'CORTE_MOROSAGLIA'}, 'IleRousse_IleRousse_Castirla_Castirla_CASTIRLA_ILE_ROUSSE_Li': {'TONAME': 'Castirla_Castirla', 'FROMNUMBER': 161, 'FROMEXNAME': 'IleRousse_IleRousse_90.0', 'FROMNAME': 'IleRousse_IleRousse', 'TOEXNAME': 'Castirla_Castirla_90.0', 'TONUMBER': 155, 'ID': 'CASTIRLA_ILE_ROUSSE'}, 'Lucciana_Lucciana_Furiani_Furiani_FURIANI_LUCCIANA1_Li': {'TONAME': 'Furiani_Furiani', 'FROMNUMBER': 163, 'FROMEXNAME': 'Lucciana_Lucciana_90.0', 'FROMNAME': 'Lucciana_Lucciana', 'TOEXNAME': 'Furiani_Furiani_90.0', 'TONUMBER': 159, 'ID': 'FURIANI_LUCCIANA1'}, 'Bonifacio_Bonifacio_PorteVecchio_PorteVecchio_BONIFACCIO_PO_VO2_Li': {'TONAME': 'PorteVecchio_PorteVecchio', 'FROMNUMBER': 152, 'FROMEXNAME': 'Bonifacio_Bonifacio_90.0', 'FROMNAME': 'Bonifacio_Bonifacio', 'TOEXNAME': 'PorteVecchio_PorteVecchio_90.0', 'TONUMBER': 168, 'ID': 'BONIFACCIO_PO_VO2'}, 'Ocana_Ocana_Caldanicci_Caldanicci_CALDANICCIA_OCANA_Li': {'TONAME': 'Caldanicci_Caldanicci', 'FROMNUMBER': 165, 'FROMEXNAME': 'Ocana_Ocana_90.0', 'FROMNAME': 'Ocana_Ocana', 'TOEXNAME': 'Caldanicci_Caldanicci_90.0', 'TONUMBER': 153, 'ID': 'CALDANICCIA_OCANA'}, 'Castirla_Castirla_Corte_Corte_CASTIRLA_CORTE_Li': {'TONAME': 'Corte_Corte', 'FROMNUMBER': 155, 'FROMEXNAME': 'Castirla_Castirla_90.0', 'FROMNAME': 'Castirla_Castirla', 'TOEXNAME': 'Corte_Corte_90.0', 'TONUMBER': 158, 'ID': 'CASTIRLA_CORTE'}, 'Vazzio_Vazzio_Loretto_Loretto_LORETO_VAZZIO_Li': {'TONAME': 'Loretto_Loretto', 'FROMNUMBER': 478, 'FROMEXNAME': 'Vazzio_Vazzio_90.0', 'FROMNAME': 'Vazzio_Vazzio', 'TOEXNAME': 'Loretto_Loretto_90.0', 'TONUMBER': 162, 'ID': 'LORETO_VAZZIO'}, 'Bastia_Bastia_Furiani_Furiani_BASTIA_FURIANI1_Li': {'TONAME': 'Furiani_Furiani', 'FROMNUMBER': 151, 'FROMEXNAME': 'Bastia_Bastia_90.0', 'FROMNAME': 'Bastia_Bastia', 'TOEXNAME': 'Furiani_Furiani_90.0', 'TONUMBER': 159, 'ID': 'BASTIA_FURIANI1'}, 'Sagone_Sagone_Sovenzia_Sovenzia_SAGONE_SOVENZIA_Li': {'TONAME': 'Sovenzia_Sovenzia', 'FROMNUMBER': 170, 'FROMEXNAME': 'Sagone_Sagone_90.0', 'FROMNAME': 'Sagone_Sagone', 'TOEXNAME': 'Sovenzia_Sovenzia_90.0', 'TONUMBER': 175, 'ID': 'SAGONE_SOVENZIA'}, 'Ghisonaccia_Ghisonaccia_SainteLucie_SainteLucie_GHISONACCIA_STE_LUCIE_Li': {'TONAME': 'SainteLucie_SainteLucie', 'FROMNUMBER': 160, 'FROMEXNAME': 'Ghisonaccia_Ghisonaccia_90.0', 'FROMNAME': 'Ghisonaccia_Ghisonaccia', 'TOEXNAME': 'SainteLucie_SainteLucie_90.0', 'TONUMBER': 171, 'ID': 'GHISONACCIA_STE_LUCIE'}, 'Furiani_Furiani_Oletta_Oletta_FURIANI_ZI_OLETTA_Li': {'TONAME': 'Oletta_Oletta', 'FROMNUMBER': 159, 'FROMEXNAME': 'Furiani_Furiani_90.0', 'FROMNAME': 'Furiani_Furiani', 'TOEXNAME': 'Oletta_Oletta_90.0', 'TONUMBER': 166, 'ID': 'FURIANI_ZI_OLETTA'}, 'Vazzio_Vazzio_Ocana_Ocana_OCANA_VAZZIO_Li': {'TONAME': 'Ocana_Ocana', 'FROMNUMBER': 478, 'FROMEXNAME': 'Vazzio_Vazzio_90.0', 'FROMNAME': 'Vazzio_Vazzio', 'TOEXNAME': 'Ocana_Ocana_90.0', 'TONUMBER': 165, 'ID': 'OCANA_VAZZIO'}, 'Ocana_Ocana_Corte_Corte_CORTE_OCANA_Li': {'TONAME': 'Corte_Corte', 'FROMNUMBER': 165, 'FROMEXNAME': 'Ocana_Ocana_90.0', 'FROMNAME': 'Ocana_Ocana', 'TOEXNAME': 'Corte_Corte_90.0', 'TONUMBER': 158, 'ID': 'CORTE_OCANA'}, 'IleRousse_IleRousse_Oletta_Oletta_ILE_ROUSSE_ZI_OLETTA_Li': {'TONAME': 'Oletta_Oletta', 'FROMNUMBER': 161, 'FROMEXNAME': 'IleRousse_IleRousse_90.0', 'FROMNAME': 'IleRousse_IleRousse', 'TOEXNAME': 'Oletta_Oletta_90.0', 'TONUMBER': 166, 'ID': 'ILE_ROUSSE_ZI_OLETTA'}, 'Corsica_Corsica_Sovenzia_Sovenzia_CORSCIA_SOVENZIA_Li': {'TONAME': 'Sovenzia_Sovenzia', 'FROMNUMBER': 157, 'FROMEXNAME': 'Corsica_Corsica_90.0', 'FROMNAME': 'Corsica_Corsica', 'TOEXNAME': 'Sovenzia_Sovenzia_90.0', 'TONUMBER': 175, 'ID': 'CORSCIA_SOVENZIA'}, 'Bastia_Bastia_Furiani_Furiani_BASTIA_FURIANI2_Li': {'TONAME': 'Furiani_Furiani', 'FROMNUMBER': 151, 'FROMEXNAME': 'Bastia_Bastia_90.0', 'FROMNAME': 'Bastia_Bastia', 'TOEXNAME': 'Furiani_Furiani_90.0', 'TONUMBER': 159, 'ID': 'BASTIA_FURIANI2'}, 'Furiani_Furiani_Sisco_Sisco_FURIANI_SISCO_Li': {'TONAME': 'Sisco_Sisco', 'FROMNUMBER': 159, 'FROMEXNAME': 'Furiani_Furiani_90.0', 'FROMNAME': 'Furiani_Furiani', 'TOEXNAME': 'Sisco_Sisco_90.0', 'TONUMBER': 174, 'ID': 'FURIANI_SISCO'}, 'Ghisonaccia_Ghisonaccia_Sampolo_Sampolo_GHISONACCIA_SAMPOLO_Li': {'TONAME': 'Sampolo_Sampolo', 'FROMNUMBER': 160, 'FROMEXNAME': 'Ghisonaccia_Ghisonaccia_90.0', 'FROMNAME': 'Ghisonaccia_Ghisonaccia', 'TOEXNAME': 'Sampolo_Sampolo_90.0', 'TONUMBER': 173, 'ID': 'GHISONACCIA_SAMPOLO'}, 'Lucciana_Lucciana_Furiani_Furiani_FURIANI_LUCCIANA2_Li': {'TONAME': 'Furiani_Furiani', 'FROMNUMBER': 163, 'FROMEXNAME': 'Lucciana_Lucciana_90.0', 'FROMNAME': 'Lucciana_Lucciana', 'TOEXNAME': 'Furiani_Furiani_90.0', 'TONUMBER': 159, 'ID': 'FURIANI_LUCCIANA2'}, 'Cervione_Cervione_Ghisonaccia_Ghisonaccia_CERVIONE_GHISONACCIA_Li': {'TONAME': 'Ghisonaccia_Ghisonaccia', 'FROMNUMBER': 156, 'FROMEXNAME': 'Cervione_Cervione_90.0', 'FROMNAME': 'Cervione_Cervione', 'TOEXNAME': 'Ghisonaccia_Ghisonaccia_90.0', 'TONUMBER': 160, 'ID': 'CERVIONE_GHISONACCIA'}, 'Propriano_Propriano_SainteMarieSicche_SainteMarieSicche_PROPRIANO_ZSSS6_Li': {'TONAME': 'SainteMarieSicche_SainteMarieSicche', 'FROMNUMBER': 169, 'FROMEXNAME': 'Propriano_Propriano_90.0', 'FROMNAME': 'Propriano_Propriano', 'TOEXNAME': 'SainteMarieSicche_SainteMarieSicche_90.0', 'TONUMBER': 172, 'ID': 'PROPRIANO_ZSSS6'}, 'Pietrosella_Pietrosella_Ocana_Ocana_OCANA_PIETROSELLA_Li': {'TONAME': 'Ocana_Ocana', 'FROMNUMBER': 167, 'FROMEXNAME': 'Pietrosella_Pietrosella_90.0', 'FROMNAME': 'Pietrosella_Pietrosella', 'TOEXNAME': 'Ocana_Ocana_90.0', 'TONUMBER': 165, 'ID': 'OCANA_PIETROSELLA'}, 'PorteVecchio_PorteVecchio_Propriano_Propriano_PRORIANO_PO_VO_Li': {'TONAME': 'Propriano_Propriano', 'FROMNUMBER': 168, 'FROMEXNAME': 'PorteVecchio_PorteVecchio_90.0', 'FROMNAME': 'PorteVecchio_PorteVecchio', 'TOEXNAME': 'Propriano_Propriano_90.0', 'TONUMBER': 169, 'ID': 'PRORIANO_PO_VO'}, 'SainteLucie_SainteLucie_PorteVecchio_PorteVecchio_PO_VO_STE_LUCIE_Li': {'TONAME': 'PorteVecchio_PorteVecchio', 'FROMNUMBER': 171, 'FROMEXNAME': 'SainteLucie_SainteLucie_90.0', 'FROMNAME': 'SainteLucie_SainteLucie', 'TOEXNAME': 'PorteVecchio_PorteVecchio_90.0', 'TONUMBER': 168, 'ID': 'PO_VO_STE_LUCIE'}, 'Aspretto_Aspretto_Vazzio_Vazzio_ASPRETTO_VAZZIO_Li': {'TONAME': 'Vazzio_Vazzio', 'FROMNUMBER': 150, 'FROMEXNAME': 'Aspretto_Aspretto_90.0', 'FROMNAME': 'Aspretto_Aspretto', 'TOEXNAME': 'Vazzio_Vazzio_90.0', 'TONUMBER': 478, 'ID': 'ASPRETTO_VAZZIO'}, 'Sagone_Sagone_Loretto_Loretto_LORETO_SAGONE_Li': {'TONAME': 'Loretto_Loretto', 'FROMNUMBER': 170, 'FROMEXNAME': 'Sagone_Sagone_90.0', 'FROMNAME': 'Sagone_Sagone', 'TOEXNAME': 'Loretto_Loretto_90.0', 'TONUMBER': 162, 'ID': 'LORETO_SAGONE'}, 'Lucciana_Lucciana_Morosaglia_Morosaglia_CASAMOZZA_MOROSAGLIA_Li': {'TONAME': 'Morosaglia_Morosaglia', 'FROMNUMBER': 163, 'FROMEXNAME': 'Lucciana_Lucciana_90.0', 'FROMNAME': 'Lucciana_Lucciana', 'TOEXNAME': 'Morosaglia_Morosaglia_90.0', 'TONUMBER': 164, 'ID': 'CASAMOZZA_MOROSAGLIA'}, 'Tolla_Tolla_Ocana_Ocana_OCANA_TOLLA1_Li': {'TONAME': 'Ocana_Ocana', 'FROMNUMBER': 477, 'FROMEXNAME': 'Tolla_Tolla_90.0', 'FROMNAME': 'Tolla_Tolla', 'TOEXNAME': 'Ocana_Ocana_90.0', 'TONUMBER': 165, 'ID': 'OCANA_TOLLA1'}, 'Propriano_Propriano_Pietrosella_Pietrosella_PIETROSELLA_PROPRIANO_Li': {'TONAME': 'Pietrosella_Pietrosella', 'FROMNUMBER': 169, 'FROMEXNAME': 'Propriano_Propriano_90.0', 'FROMNAME': 'Propriano_Propriano', 'TOEXNAME': 'Pietrosella_Pietrosella_90.0', 'TONUMBER': 167, 'ID': 'PIETROSELLA_PROPRIANO'}, 'Castirla_Castirla_Corsica_Corsica_CASTIRLA_CORSICA_Li': {'TONAME': 'Corsica_Corsica', 'FROMNUMBER': 155, 'FROMEXNAME': 'Castirla_Castirla_90.0', 'FROMNAME': 'Castirla_Castirla', 'TOEXNAME': 'Corsica_Corsica_90.0', 'TONUMBER': 157, 'ID': 'CASTIRLA_CORSICA'}}
+TransfoDico = {}
MotorDico = {}
-Dico ={'DISTRIBUTIONROR': {'Generator': ['Cecile_G1_Ugen_genstat_Gr_RoR_Cecile', 'LaFerme_G1_Ugen_genstat_Gr_RoR_LaFerme', 'LeVal_G1_Ugen_genstat_Gr_RoR_LeVal_G1', 'LeVal_G2_Ugen_genstat_Gr_RoR_LeVal_G2', 'Magenta_G1_Ugen_genstat_Gr_RoR_Magenta', 'Tamarind_G1_Ugen_genstat_Gr_RoR_Tamarind'], 'FileName': 'C:\\Users\\H92579\\Desktop\\Ile Maurice_bug_nbScenario\\Periode Jour/Jour_RoR.csv', 'Activated': True, 'Sampling': 'Same sample for all generators', 'ComponentType': 'Generator', 'Law': 'PDF_from_file', 'Type': 'Generator Power Level'}, 'DISTRIBUTIONFERNEY': {'Generator': ['Ferney_G1_Ugen_genstat_Gr_HighDam_Ferney_G1', 'Ferney_G2_Ugen_genstat_Gr_HighDam_Ferney_G2'], 'FileName': 'C:\\Users\\H92579\\Desktop\\Ile Maurice_bug_nbScenario\\Periode Jour/Jour_Ferney.csv', 'Activated': True, 'Sampling': 'Same sample for all generators', 'ComponentType': 'Generator', 'Law': 'PDF_from_file', 'Type': 'Generator Power Level'}, 'PF_PARAMETERS': {'UNIT_COMMITMENT': True, 'LS_Q_CONVERGENCE_CRITERIA': False, 'DECIMAL_SEPARATOR': ',', 'ALGORITHM': 'Optimum Power Flow', 'OBJECTIVE_FUNCTION': 'MINIMISATION_OF_COST', 'NON_COST_OPTIMAL_SOLUTION_ALLOWED': True, 'ITERATION_INTERIOR': 700, 'LOCK_TAPS': True, 'LOAD_SHEDDING_ALLOWED': False}, 'DISTRIBUTIONEOL': {'Generator': ['Curepipe_22kV_genstat_Gr_EOL_PlaineSophie', 'PlaineDesRochesPowerStation_22kV_genstat_Gr_EOL_PlaindesRoches'], 'FileName': 'C:\\Users\\H92579\\Desktop\\Ile Maurice_bug_nbScenario\\Periode Jour/Jour_EOL.csv', 'Activated': True, 'Sampling': 'Same sample for all generators', 'ComponentType': 'Generator', 'Law': 'PDF_from_file', 'Type': 'Generator Power Level'}, 'DISTRIBUTIONPV': {'Generator': ['Amaury_22kV_1_genstat_Gr_PV_Amaury_1', 'Amaury_22kV_2_genstat_Gr_PV_Amaury_2', 'Amaury_22kV_2_genstat_Gr_PV_PetiteRetraite', 'Anahita_22kV_1_genstat_Gr_PV_Anahita_1', 'Anahita_22kV_2_genstat_Gr_PV_Anahita_2', 'Bellevue_22kV_1_genstat_Gr_PV_Bellevue_1', 'Bellevue_22kV_2_genstat_Gr_PV_Bellevue_2', 'CaseNoyale_22kV_1_genstat_Gr_PV_CaseNoyale_1', 'CaseNoyale_22kV_2_genstat_Gr_PV_CaseNoyale_2', 'Combo_22kV_1_genstat_Gr_PV_Combo_1', 'Combo_22kV_2_genstat_Gr_PV_Combo_2', 'Ebene_22kV_1_genstat_Gr_PV_Ebene_1', 'Ebene_22kV_2_genstat_Gr_PV_Ebene_2', 'Ebene_22kV_3_genstat_Gr_PV_Ebene_3', 'FVPS_22kV_1_genstat_Gr_PV_FVPS_1', 'FVPS_22kV_2_genstat_Gr_PV_FVPS_2', 'FVPS_22kV_3_genstat_Gr_PV_FVPS_3', 'Ferney_22kV_genstat_Gr_PV_Ferney_1', 'FortGeorge_22kV_1_genstat_Gr_PV_FortGeorge_1', 'FortGeorge_22kV_2_genstat_Gr_PV_FortGeorge_2', 'Fuel_22kV_1_genstat_Gr_PV_Fuel_1', 'Fuel_22kV_2_genstat_Gr_PV_Fuel_2', 'Henrietta_22kV_1_genstat_Gr_PV_Henrietta_1', 'Henrietta_22kV_2_genstat_Gr_PV_Henrietta_2', 'Jin_Fei_22kV_1_genstat_Gr_PV_Jin_Fei_2', 'Jin_Fei_22kV_2_genstat_Gr_PV_Jin_Fei_1', 'LaChaumiere_22kV_1_genstat_Gr_PV_LaChaumiere_1', 'LaChaumiere_22kV_2_genstat_Gr_PV_LaChaumiere_2', 'Nicolay_22kV_1_genstat_Gr_PV_Nicolay_1', 'Nicolay_22kV_2_genstat_Gr_PV_Nicolay_2', 'Sarako_22kV_genstat_Gr_PV_Sarako', 'Sottise_22kV_1_genstat_Gr_PV_Sottise_1', 'Sottise_22kV_2_genstat_Gr_PV_MonChoisy', 'Sottise_22kV_2_genstat_Gr_PV_Sottise_2', 'StLouis_22kV_1_genstat_Gr_PV_StLouis_1', 'StLouis_22kV_2_genstat_Gr_PV_StLouis_2', 'TourKoening_22kV_1_genstat_Gr_PV_TourKoening_1', 'TourKoening_22kV_2_genstat_Gr_PV_TourKoening_2', 'UnionVale_22kV_1_genstat_Gr_PV_UnionVale_1', 'UnionVale_22kV_2_genstat_Gr_PV_UnionVale_2', 'Wooton_22kV_1_genstat_Gr_PV_Esperance', 'Wooton_22kV_1_genstat_Gr_PV_Wooton_2', 'Wooton_22kV_2_genstat_Gr_PV_Wooton_1'], 'FileName': 'C:\\Users\\H92579\\Desktop\\Ile Maurice_bug_nbScenario\\Periode Jour/Jour_PV.csv', 'Activated': True, 'Sampling': 'Same sample for all generators', 'ComponentType': 'Generator', 'Law': 'PDF_from_file', 'Type': 'Generator Power Level'}, 'SIMULATION': {'NUMBER_PACKAGE': 1, 'SIZE_PACKAGE': 20}, 'CORRELATION': {'CorrelationMatrix': ["['EOL', 'CHAMPAGNE', 'FERNEY', 'LOAD', 'PV', 'ROR']", '[1.0, 0.0098, 0.0005, -0.1805, 0.136, -0.033]', '[0.0098, 1.0, 0.5138, 0.2386, -0.0539, -0.0371]', '[0.0005, 0.5138, 1.0, 0.3026, -0.0625, 0.0098]', '[-0.1805, 0.2386, 0.3026, 1.0, 0.1982, 0.0972]', '[0.136, -0.0539, -0.0625, 0.1982, 1.0, 0.0572]', '[-0.033, -0.0371, 0.0098, 0.0972, 0.0572, 1.0]']}, 'DIRECTORY': {'Python3_path': 'C:\\Python35', 'pfd_file': 'C:\\Users\\H92579\\Desktop\\Ile Maurice_bug_nbScenario/Maurice_2017_CoalSeasonJour.pfd', 'results_folder': 'C:\\Users\\H92579\\Desktop\\Ile Maurice_bug_nbScenario', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python/3.5'}, 'DISTRIBUTIONCHAMPAGNE': {'Generator': ['Champagne_G1_Ugen_genstat_Gr_HighDam_Champagne_G1', 'Champagne_G2_Ugen_genstat_Gr_HighDam_Champagne_G2'], 'FileName': 'C:\\Users\\H92579\\Desktop\\Ile Maurice_bug_nbScenario\\Periode Jour/Jour_Champagne.csv', 'Activated': True, 'Sampling': 'Same sample for all generators', 'ComponentType': 'Generator', 'Law': 'PDF_from_file', 'Type': 'Generator Power Level'}, 'DISTRIBUTIONLOAD': {'Load': ['Amaury_22kV_1_Lo1', 'Amaury_22kV_2_Lo1', 'Anahita_22kV_1_Lo1', 'Anahita_22kV_2_Lo1', 'Bellevue_22kV_1_Lo1', 'Bellevue_22kV_2_Lo1', 'CaseNoyale_22kV_1_Lo1', 'CaseNoyale_22kV_2_Lo1', 'Combo_22kV_1_Lo1', 'Combo_22kV_2_Lo1', 'Ebene_22kV_1_Lo1', 'Ebene_22kV_2_Lo1', 'Ebene_22kV_3_Lo1', 'FVPS_22kV_1_Lo1', 'FVPS_22kV_2_Lo1', 'FVPS_22kV_3_Lo1', 'Ferney_22kV_Lo1', 'FortGeorge_22kV_1_Lo1', 'FortGeorge_22kV_2_Lo1', 'Fuel_22kV_1_Lo1', 'Fuel_22kV_2_Lo1', 'Henrietta_22kV_1_Lo1', 'Henrietta_22kV_2_Lo1', 'Jin_Fei_22kV_1_Lo1', 'Jin_Fei_22kV_2_Lo1', 'LaChaumiere_22kV_1_Lo1', 'LaChaumiere_22kV_2_Lo1', 'Nicolay_22kV_1_Lo1', 'Nicolay_22kV_2_Lo1', 'Sottise_22kV_1_Lo1', 'Sottise_22kV_2_Lo1', 'StLouis_22kV_1_Lo1', 'StLouis_22kV_2_Lo1', 'TourKoening_22kV_1_Lo1', 'TourKoening_22kV_2_Lo1', 'UnionVale_22kV_1_Lo1', 'UnionVale_22kV_2_Lo1', 'Wooton_22kV_1_Lo1', 'Wooton_22kV_2_Lo1'], 'FileName': 'C:\\Users\\H92579\\Desktop\\Ile Maurice_bug_nbScenario\\Periode Jour/Jour_Load.csv', 'Activated': True, 'Sampling': 'Same sample for all loads', 'ComponentType': 'Load', 'Law': 'PDF_from_file', 'Type': 'Load Level'}}
\ No newline at end of file
+Dico ={'DISTRIBUTIONCharge': {'Load': ['Aspretto_Aspretto_Lo1', 'Aspretto_Aspretto_Lo2', 'Bastia_Bastia_Lo1', 'Bonifacio_Bonifacio_Lo1', 'Caldanicci_Caldanicci_Lo1', 'Calvi_Calvi_Lo1', 'Corte_Corte_Lo1', 'Ghisonaccia_Ghisonaccia_Lo1', 'IleRousse_IleRousse_Lo1', 'Loretto_Loretto_Lo1', 'Lucciana_Lucciana_Lo1', 'Lucciana_Lucciana_Lo2', 'Morosaglia_Morosaglia_Lo1', 'Ocana_Ocana_Lo1', 'Oletta_Oletta_Lo1', 'Pietrosella_Pietrosella_Lo1', 'PorteVecchio_PorteVecchio_Lo1', 'Propriano_Propriano_Lo1', 'Sagone_Sagone_Lo1', 'SainteMarieSicche_SainteMarieSicche_Lo1', 'Sisco_Sisco_Lo1', 'Vazzio_Vazzio_Lo1'], 'A': 0.9, 'B': 1.0, 'Activated': True, 'Sampling': 'Same sample for all loads', 'ComponentType': 'Load', 'Law': 'Uniform', 'Type': 'Load Level'}, 'PF_PARAMETERS': {'UNIT_COMMITMENT': True, 'LS_Q_CONVERGENCE_CRITERIA': False, 'DECIMAL_SEPARATOR': ',', 'ALGORITHM': 'Optimum Power Flow', 'OBJECTIVE_FUNCTION': 'MINIMISATION_OF_COST', 'NON_COST_OPTIMAL_SOLUTION_ALLOWED': True, 'ITERATION_INTERIOR': 700, 'LOCK_TAPS': True, 'LOAD_SHEDDING_ALLOWED': True}, 'SIMULATION': {'NUMBER_PACKAGE': 1, 'SIZE_PACKAGE': 10}, 'CORRELATION': {'CorrelationMatrix': ["['Charge', 'GEN']", '[1.0, 0.0]', '[0.0, 1.0]']}, 'DIRECTORY': {'Python3_path': 'C:/Python35', 'pfd_file': 'C:/Users/H92579/Documents/Formation_PF/ex_PFD/Modele_Corse_PSEN_peak_good.pfd', 'results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu', 'PF_path': 'C:/Program Files/DIgSILENT/PowerFactory 2017 SP1/Python/3.5'}, 'DISTRIBUTIONGEN': {'A': 0.8, 'B': 0.85, 'Generator': ['Bonifacio_Bonifacio_genstat_Gr_Bonifaccio_PV', 'Caldanicci_Caldanicci_genstat_Gr_Caldanicci_PV', 'Calvi_Calvi_genstat_Gr_Calvi_PV', 'Cervione_Cervione_genstat_Gr_CERVIONE_BT_PV', 'Corte_Corte_genstat_Gr_Corte_PV', 'Furiani_Furiani_genstat_Gr_Furiani_PV', 'Ghisonaccia_Ghisonaccia_genstat_Gr_Gisonaccia_PV', 'IleRousse_IleRousse_genstat_Gr_IleRousse_PV', 'Loretto_Loretto_genstat_Gr_Loretto_PV', 'Lucciana_Lucciana_genstat_Gr_Lucciana_PV', 'Morosaglia_Morosaglia_genstat_Gr_Morosoglia_PV', 'Oletta_Oletta_genstat_Gr_Oletta_PV', 'Propriano_Propriano_genstat_Gr_Propriano_PV'], 'Activated': True, 'Sampling': 'Same sample for all generators', 'ComponentType': 'Generator', 'Law': 'Uniform', 'Type': 'Generator Power Level'}}
\ No newline at end of file
PF_PATH = r'C:\Program Files\DIgSILENT\PowerFactory 2017 SP1\Python\3.5'
-NetworkFile = r'C:\Users\H92579\Documents\Formation_PF\ex_PFD\Modele_Corse_PSEN_peak_good.pfd'
+NetworkFile = r'C:\Users\H92579\Desktop\Ile Maurice_bug_nbScenario/Maurice_2017_CoalSeasonJour.pfd'
(filepath, filename) = os.path.split(NetworkFile)
sys.path.append(PF_PATH)
os.environ['PATH'] += ';' + os.path.dirname(os.path.dirname(PF_PATH)) + ';'
-PFParams = PSENconfig.Dico['PF_PARAMETERS']
import powerfactory
app = powerfactory.GetApplication()
-#app.Show()
user = app.GetCurrentUser()
+
ComImp = user.CreateObject('ComPFDIMPORT')
+app.SetWriteCacheEnabled(1) # Disable consistency check
+ComImp.g_file = NetworkFile
+ComImp.g_target = user # Project is imported under the user account
+err = ComImp.Execute() # Execute command starts the import process
+app.SetWriteCacheEnabled(0) # Enable consistency check
-app.SetWriteCacheEnabled(1) # Disable consistency check
-ComImp.g_file = PSENconfig.Dico['DIRECTORY']['pfd_file']
-ComImp.g_target = user # project is imported under the user account
-err = ComImp.Execute() # Execute command starts the import process
-app.SetWriteCacheEnabled(0) # Enable consistency check
-if err:
- app.PrintError('Project could not be imported...')
- exit()
prjs = user.GetContents('*.IntPrj')
prjs.sort(key=lambda x: x.gnrl_modif, reverse=True)
prj = prjs[0]
-app.ActivateProject(prj.loc_name)
-prj = app.GetActiveProject()
-studycase = app.GetActiveStudyCase()
-studycase.loc_name = 'BaseCase'
-app.PrintPlain('Project %s has been successfully imported.' % prj)
-ComImp.Delete()
-
-all_inputs_init=read_pfd(app,prj.loc_name,recal=1)
-
-all_inputs_base=all_inputs_init
-
-buses_base=[]
-[buses_base.append(bus[0:8]) for bus in all_inputs_base[0]]
-
-lines_base = []
-[lines_base.append(bus[0:11]) for bus in all_inputs_base[1]]
-
-trans_base = []
-[trans_base.append(bus[0:11]) for bus in all_inputs_base[2]]
-
-plants_base = []
-[plants_base.append(bus[0:11]) for bus in all_inputs_base[3]]
-
-loads_base = []
-[loads_base.append(bus[0:6]) for bus in all_inputs_base[4]]
-
-shunt_base = []
-[shunt_base.append(bus[0:6]) for bus in all_inputs_base[5]]
-
-motors_base = []
-[motors_base.append(bus[0:6]) for bus in all_inputs_base[6]]
-
-trans3_base = []
-[trans3_base.append(bus[0:14]) for bus in all_inputs_base[7]]
-
-swshunt_base = []
-[swshunt_base.append(bus[0:6]) for bus in all_inputs_base[8]]
-
-##############################################################################
-
-filer=open('temp1.txt','r')
-_path=[]
-for line in filer:
- _path.append(line)
-filer.close()
-path_save = _path[0].replace('\n','')
-ldf = app.GetFromStudyCase('ComLdf')
-ldf.iopt_net = 0 # AC load flow
-ldf.iopt_at = 1 # automatic tap transfos
-ldf.iopt_asht = 1 # automatic shunt
-ldf.iopt_lim = 1 # reactive power limit
-ldf.iopt_plim = 1 # active power limit
-ldf.iopt_limScale = 1 # scale factor
-ldf.iopt_noinit = 1 # no initialisation load flow
-ldf.iopt_initOPF = 0 # utiliser pour OPF
-ldf.iShowOutLoopMsg = 0 # show off output
-ldf.iopt_show = 0 # show off output
-ldf.iopt_check = 0 # show off output
-ldf.iopt_chctr = 0 # show off output
\ No newline at end of file
+prj.Activate()
+
+#all_inputs = read_pfd(app, prj.loc_name, recal=0)
+#plants = []
+#[plants.append(bus[0:12]) for bus in all_inputs[3]]
+
+"""
+Compteur de scenarios
+"""
+#scen=prj.GetChildren(1,'*.IntScenario',1)
+#compteur=0
+#
+#for nb in scen:
+# compteur = compteur + 1
+#
+#print('Il y a ' + str(compteur) + ' scenarios d operation')
+
+"""
+Automatisation des taches
+"""
+# studycase0 = prj.GetContents('BaseCase.IntCase', 1)[0]
+# studycase0.Activate()
+
+# compython0 = studycase0.CreateObject('ComPython', 'comp0')
+# compython0.filePath = r'C:\Users\H92579\Documents\Gratuiciels\Git.216\eficas\PSSE_PF_Eficas\PSEN' + '/comfile.py'
+# fold = studycase0.fold_id
+# studycase = fold.AddCopy(studycase0, 'Case_'+str(0))
+# compy = studycase.GetContents('*.ComPython', 0)[0]
+# comtask = fold.CreateObject('ComTasks')
+# comtask.AppendStudyCase(studycase)
+# comtask.AppendCommand(compy)
+# comtask.Execute()
--- /dev/null
+"""
+Created on Thu May 2 11:02:21 2019
+
+@author: H92579
+"""
+
+#import pandas as pd
+#
+#path = r'C:\Users\H92579\Desktop\Ile Maurice_bug_nbScenario\N_20190502_08h16m12\package0_N_20190502_08h16m12'
+#
+#data=pd.read_csv(path+'/data_trigger.csv', sep = ';', header = None)
+#
+#del data[0]
+#
+#data.drop(to_delete, inplace=True)
+#data.to_csv(path + '/data_trigger.csv', sep = ';', header = None)
+#print(data)
+
+#import os
+#path = r'C:\Users\H92579\Desktop\Ile Maurice_bug_nbScenario\N_20190502_08h16m12\package0_N_20190502_08h16m12'
+
+
+"""
+On modifie le fichier data_trigger.csv en enlevant les studycases qui n'ont pas pu etre simulé
+"""
+import pandas as pd
+#import powerfactory
+
+
+path = r'C:\Users\H92579\Desktop\Ile Maurice_bug_nbScenario\N_20190503_09h10m02\package0_N_20190503_09h10m02'
+#app = powerfactory.GetApplication()
+#user = app.GetCurrentUser()
+#prjs = user.GetContents('*.IntPrj')
+#prjs.sort(key=lambda x: x.gnrl_modif, reverse=True)
+#prj = prjs[0]
+
+#for case in to_delete:
+# study=prj.GetChildren(1,'Case_'+str(case)+'.IntCase',1)[0]
+# study.Delete()
+
+to_delete = [1]
+data = pd.read_csv(path+'/data_trigger.csv', sep = ';', header = None)
+
+#del data[0]
+#data.drop(to_delete, inplace=True)
+#
+#data.to_csv(path + '/data_trigger.csv', sep = ';', header = None)
\ No newline at end of file
import os,sys,pickle,time
from support_functionsPF import read_pfd,read_pfd_simple,np, config_contingency
-# sys.path.append(PSENconfig.Dico['DIRECTORY']['PF_path'])#Valentin
-# os.environ['PATH'] += ';' + os.path.dirname(os.path.dirname(PSENconfig.Dico['DIRECTORY']['PF_path'])) + ';'#Valentin
import powerfactory
import PSENconfig
import shutil
import pdb
import csv
+
tempdir = r'C:\Logiciels DER\PSEN_PF_V4\Example\Results'
app = powerfactory.GetApplication()
-
-# app.ActivateProject('39 genstatpvmoteur(4)')#Valentin
prj = app.GetActiveProject()
-case = app.GetActiveStudyCase()#prj.GetContents('Case_0.IntCase',1)[0]
-# case = prj.GetContents('Case_46.IntCase',1)[0]#Valentin
-# case.Activate()#Valentin
-#app.Show()#Valentin
+case = app.GetActiveStudyCase()
+
#[busnumber, outserv, idplant, 0, 0, 0, 0, 0, busname, 0, 0,plant, pgini, pgini_a]
def saveOPFresults(plants):
#save OPF results: P, Q of generators, Transfo taps, Switched shunt settings, Load-shedding
- upload = app.GetFromStudyCase('ComDbupd') #Sélection commande de mise à jour BDD
- upload.iopt_lod = 0 # Sélection paramètre MAJ Facteur d'échelle de charge : NON
- upload.iopt_trf = 1 # Sélection paramètre MAJ Prises de transfos : OUI
- upload.iopt_distTrf = 1 # Sélection paramètre MAJ Prises de transfos de distrib : OUI
- upload.iopt_shnt = 1 # Sélection paramètre MAJ pas capacitif shunts/filtres : OUI
- upload.iopt_lodpq = 0 # Sélection paramètre MAJ P,Q charges : OUI ou NON (selon si on veut ou pas prendre en compte le délestage dans l'initialisation)
- upload.iopt_asmpq = 1 # Sélection paramètre MAJ P,Q machines asynchrones : OUI
- #upload.iopt_sympqv = 1 # Sélection paramètre MAJ P,Q,V machines synchrones + statiques : OUI
- upload.iopt_sympqv = 0 # Sélection paramètre MAJ P,Q,V machines synchrones + statiques : NON
- upload.iopt_upd = 0 # Option de ne pas mettre à jour la puissance réactive activée
- upload.iopt_tap = 1 # Option de mettre à jour toutes les prises des transfos
- upload.Execute() # Exécution mise à jour BDD
+ upload = app.GetFromStudyCase('ComDbupd') # Sélection commande de mise à jour BDD
+
+ upload.iopt_lod = 0 # Sélection paramètre MAJ Facteur d'échelle de charge : NON
+ upload.iopt_trf = 1 # Sélection paramètre MAJ Prises de transfos : OUI
+ upload.iopt_distTrf = 1 # Sélection paramètre MAJ Prises de transfos de distrib : OUI
+ upload.iopt_shnt = 1 # Sélection paramètre MAJ pas capacitif shunts/filtres : OUI
+ upload.iopt_lodpq = 0 # Sélection paramètre MAJ P,Q charges : OUI ou NON (selon si on veut ou pas prendre en compte le délestage dans l'initialisation)
+ upload.iopt_asmpq = 1 # Sélection paramètre MAJ P,Q machines asynchrones : OUI
+ upload.iopt_sympqv = 0 # Sélection paramètre MAJ P,Q,V machines synchrones + statiques : NON
+ upload.iopt_upd = 0 # Option de ne pas mettre à jour la puissance réactive activée
+ upload.iopt_tap = 1 # Option de mettre à jour toutes les prises des transfos
+
+ upload.Execute() # Exécution mise à jour BDD
#save P,Q of dispatchable machines (because we dont want to save non-dispatchable machines with triggers (laws)
for plant in plants:
- #if str(plant[11]).endswith('.ElmSym'):
try:
if plant[11].ictpg == 1:
plant[11].pgini = plant[3]
plant[11].qgini = plant[4]
-# else: #non-dispatchable machine
-# triggers = plant[11].GetChildren(1, 'pgini.Charef', 1)
-# if len(triggers) == 0:
-# plant[11].qgini = plant[4]
except:
pass
return
-#def saveOPFresultsLS():
-# #save OPF results: P, Q of generators, Transfo taps, Switched shunt settings, Load-shedding
-# upload = app.GetFromStudyCase('ComDbupd') #Sélection commande de mise à jour BDD
-# upload.iopt_lod = 1 # Sélection paramètre MAJ Facteur d'échelle de charge : NON
-# upload.iopt_trf = 1 # Sélection paramètre MAJ Prises de transfos : OUI
-# upload.iopt_distTrf = 1 # Sélection paramètre MAJ Prises de transfos de distrib : OUI
-# upload.iopt_shnt = 1 # Sélection paramètre MAJ pas capacitif shunts/filtres : OUI
-# upload.iopt_lodpq = 1 # Sélection paramètre MAJ P,Q charges : OUI ou NON (selon si on veut ou pas prendre en compte le délestage dans l'initialisation)
-# upload.iopt_asmpq = 1 # Sélection paramètre MAJ P,Q machines asynchrones : OUI
-# upload.iopt_sympqv = 1 # Sélection paramètre MAJ P,Q,V machines synchrones + statiques : OUI
-# upload.iopt_upd = 0 # Option de ne pas mettre à jour la puissance réactive activée
-# upload.iopt_tap = 1 # Option de mettre à jour toutes les prises des transfos
-# upload.Execute() # Exécution mise à jour BDD
-# return
-
-
-nn = int(''.join(ele for ele in case.loc_name if ele.isdigit()))# case number
+nn = int(''.join(ele for ele in case.loc_name if ele.isdigit())) # case number
cas = int(nn)
+
scenario_temporaire = app.GetActiveScenario()
if scenario_temporaire:
scenario_temporaire.Deactivate()
scenario_temporaire.Delete()
-app.SaveAsScenario('temp0_'+str(nn), 1) # creer scenario pour sauvegarder le cas de base
+app.SaveAsScenario('temp0_'+str(nn), 1) # creer scenario pour sauvegarder le cas de base
scenario_temporaire0 = app.GetActiveScenario()
scenario_temporaire0.Save()
scenario_temporaire0.Deactivate()
for i in range(len(shunt_base)):
init_shunt += float(shunt_base[i][2])
-
+study_case = app.GetActiveStudyCase() # modifie la méthode de résolution des équations (Methode iterative=0/Methode directe=1)
+study_case.iLinSolve = 1
if dico['UnitCommitment']:
-
- app.SaveAsScenario('Case_' + str(nn) + '_beforeUC', 1) # creer scenario pour sauvegarder le cas de base
+
+ app.SaveAsScenario('Case_' + str(nn) + '_beforeUC', 1) # creer scenario pour sauvegarder le cas de base
scenario_beforeUC = app.GetActiveScenario()
opf = app.GetFromStudyCase('ComOpf')
- erropf = opf.Execute()# lancer opf
- # Traitement specifique pour resoudre des cas difficle a converger
+ erropf = opf.Execute() # lancer opf
+
+
+ # Traitements specifiques pour resoudre des cas difficle a converger
+
if (erropf == 1) and (PFParams['OBJECTIVE_FUNCTION'] == 'MINIMISATION_OF_COST') and PFParams['NON_COST_OPTIMAL_SOLUTION_ALLOWED']:
- scenario_temporaire0.Apply(0) # recuperer scenario initiale
+
+ scenario_temporaire0.Apply(0) # recuperer scenario initiale
ldf = app.GetFromStudyCase('ComLdf')
- ldf.iopt_initOPF = 1 # utiliser pour OPF
+ ldf.iopt_initOPF = 1 # utiliser pour OPF
ldf.Execute()
opf.iInit = 1
- erropf = opf.Execute() # lancer opf avec 'cst'
+ erropf = opf.Execute()
+ # lancer opf avec 'cst'
print(' Run LDF for OPF ')
- if erropf == 0: print(' OK grace a LDF initial ')
+
+ if erropf == 0:
+ print(' OK grace a LDF initial ')
else:
- scenario_temporaire0.Apply(0) # recuperer scenario initiale
+ scenario_temporaire0.Apply(0) # recuperer scenario initiale
+
aa = 0
- while erropf == 1: # si cst ne marche pas
- scenario_temporaire0.Apply(0)#recuperer scenario initiale
+
+ while erropf == 1: # si cst ne marche pas
+ scenario_temporaire0.Apply(0) # recuperer scenario initiale
aa += 1
- opf.iopt_obj = 'los' # Fonction objectif = minimisation de la perte totale du reseau
- erropf = opf.Execute() # run opf los
+ opf.iopt_obj = 'los' # Fonction objectif = minimisation de la perte totale du reseau
+ erropf = opf.Execute() # run opf los
if erropf == 1:
- scenario_temporaire0.Apply(0) # recuperer scenario initiale
+ scenario_temporaire0.Apply(0) # recuperer scenario initiale
+
print(' flat-start to OPF loss ! ! ! ')
- opf.iInit = 0 # flatstart opf loss
+
+ opf.iInit = 0 # flatstart opf loss
erropf = opf.Execute()
+
if erropf == 1:
- scenario_temporaire0.Apply(0) # recuperer scenario initiale
+ scenario_temporaire0.Apply(0) # recuperer scenario initiale
break
+
opf.iInit = 1
+
print(' Run OPF loss ')
- if erropf == 0: # si loss marche bien
+
+ if erropf == 0: # si loss marche bien
if (aa == 2)and(LS_allowed):
opf.iopt_obj = 'shd'
opf.Execute()
if aa == 3:
- # print(' ++++++++++++++++++++++++++++prendre le resultat du OPF LOSS')
- # erropf = 1
- # scenario_temporaire0.Apply(0) # recuperer scenario initiale
-
filew = open(os.path.dirname(os.path.realpath(__file__)) + '/Case_' + str(nn) + '_LOSS' + '.shdUC','w')
- #filew = open(tempdir + '/Case_' + str(nn) + '_LOSS' + '.shdUC','w')
filew.write('Case_' + str(nn))
filew.close()
break
+
opf.iopt_obj = 'cst'
- erropf = opf.Execute() # relancer opt cst
+ erropf = opf.Execute() # relancer opt cst
+
if erropf == 0:
+
if (aa == 2)and(LS_allowed):
print(' ==================== basculer los-shd')
else:
print(' OK grace a OPF LOSS =======================LOSS in case aa=' + str(aa))
+
if (erropf==1)and(LS_allowed):
aa = 0
- scenario_temporaire0.Apply(0) # recuperer scenario initiale
- ldf.Execute() # initiale valeur pour opf shd
- # opf.iInit = 1
+ scenario_temporaire0.Apply(0) # recuperer scenario initiale
+ ldf.Execute() # initiale valeur pour opf shd
+
while erropf == 1:
- scenario_temporaire0.Apply(0) # recuperer scenario initiale
+ scenario_temporaire0.Apply(0) # recuperer scenario initiale
aa += 1
- opf.iopt_obj = 'shd' # Fonction objectif = minimisation de la perte totale du reseau
+ opf.iopt_obj = 'shd' # Fonction objectif = minimisation de la perte totale du reseau
erropf = opf.Execute()
if erropf == 1:
- scenario_temporaire0.Apply(0) # recuperer scenario initiale
+ scenario_temporaire0.Apply(0) # recuperer scenario initiale
+
print(' flat-stat to OPF shd ! ! ! 222 ')
+
opf.iInit = 0
erropf = opf.Execute()
+
if erropf == 1:
- scenario_temporaire0.Apply(0) # recuperer scenario initiale
+ scenario_temporaire0.Apply(0) # recuperer scenario initiale
break
+
opf.iInit = 1
+
print(' Run OPF SHD ')
- if erropf == 0: # si shd marche bien
+
+ if erropf == 0: # si shd marche bien
if aa == 2:
opf.iopt_obj = 'los'
opf.Execute()
if aa == 3:
print(' +++++++++++++++++++++++++prendre le resultat du OPF SHD')
filew = open(os.path.dirname(os.path.realpath(__file__)) + '/Case_' + str(nn)+'_SHD' + '.shdUC','w')
- #filew = open(tempdir + '/Case_' + str(nn)+'_SHD' + '.shdUC','w')
filew.write('Case_' + str(nn) )
filew.close()
break
+
opf.iopt_obj = 'cst'
- erropf = opf.Execute() # relancer opt cst
+ erropf = opf.Execute() # relancer opt cst
+
if erropf == 0:
if aa == 2:
print('=== ========== basculer shd-los')
- # filew = open(os.path.dirname(os.path.realpath(__file__)) + '/Case_' + str(nn) + '_shdlosscost' + '.shdUC', 'w')
- # filew.write('Case_' + str(nn))
- # filew.close()
else:
print(' OK grace a OPF SHD -------------------------------Load SHEDDING in case aa=' + str(aa))
- # filew = open(os.path.dirname(os.path.realpath(__file__)) + '/Case_' + str(nn) + '_shdcost' + '.shdUC','w')
- # filew.write('Case_' + str(nn))
- # filew.close()
-
+
loadShed = [[], [], [], [], []]
fxshnt = [[], [], []]
indexLS = []
indicFS = 0
flagLS = 0
flagFS = 0
+
ok = False
if erropf == 0:
if ok == True:
all_inputs = read_pfd(app, prj.loc_name, recal=0)
-
- # start = stop; # ++++++++++++++++
- buses = []
+ buses = []
[buses.append(bus[0:8]) for bus in all_inputs[0]]
- lines = []
+ lines = []
[lines.append(bus[0:11]) for bus in all_inputs[1]]
- transf = []
+ transf = []
[transf.append(bus[0:11]) for bus in all_inputs[2]]
- plants = []
+ plants = []
[plants.append(bus[0:12]) for bus in all_inputs[3]]
- loads = []
+ loads = []
[loads.append(bus[0:7]) for bus in all_inputs[4]]
- shunt = []
+ shunt = []
[shunt.append(bus[0:7]) for bus in all_inputs[5]]
- motors = []
+ motors = []
[motors.append(bus[0:6]) for bus in all_inputs[6]]
transf3 = []
[transf3.append(bus[0:14]) for bus in all_inputs[7]]
swshunt = []
[swshunt.append(bus[0:6]) for bus in all_inputs[8]]
-
+
# Extraction of the load shedding quantities
for ii in range(len(loads)):
- LSscale = loads[ii][6].GetAttribute('s:scale')
+ LSscale = loads[ii][6].GetAttribute('s:scale')
P_setpoint = loads[ii][6].GetAttribute('s:pini_set')
- LS = (1-LSscale) * P_setpoint
+ LS = (1-LSscale) * P_setpoint
+
if abs(LS)>0.1:
indexLS.append(ii)
- flagLS = 1 # raise flag loadshedding
- loadShed[0].append(nn) # Position seems to correspond to the number of the case we are treating
- loadShed[1].append(loads[ii][0]) #busnumber
- loadShed[2].append(loads[ii][4]) #busname
+ flagLS = 1 # Raise flag loadshedding
+ loadShed[0].append(nn) # Position seems to correspond to the number of the case we are treating
+ loadShed[1].append(loads[ii][0]) # busnumber
+ loadShed[2].append(loads[ii][4]) # busname
loadShed[3].append(LS)
- loadShed[4].append(loads[ii][1]) #remaining load (voltage rectified)
-
-
-# if abs(loads[ii][1] - loads_base[ii][1]) > 0.1: # verifiier la puissance active (0.1 pour eliminer l'erreurs de calcul)
-# indexLS.append(ii)
-# flagLS = 1 # raise flag loadshedding
-# loadShed[0].append(nn) # Position seems to correspond to the number of the case we are treating
-# # loadShed[0].extend(['' for i in range(len(indexLS) - 1)])
-# loadShed[1].append(loads[ii][0])
-# loadShed[2].append(loads[ii][4])
-# loadShed[3].append(loads_base[ii][1] - loads[ii][1])
-# loadShed[4].append(loads[ii][1])
-
+ loadShed[4].append(loads[ii][1]) # remaining load (voltage rectified)
- indicLS = sum(loadShed[3]) # sum all Effective MW loads
- loadShed = list(zip(*loadShed)) # transpose the matrix
+ indicLS = sum(loadShed[3]) # sum all Effective MW loads
+ loadShed = list(zip(*loadShed)) # transpose the matrix
for ii in range(len(shunt)):
- if abs(shunt[ii][1] - shunt_base[ii][1]) > 0.1: # verifiier la puissance active (0.1 pour eliminer l'erreurs de calcul)
+ if abs(shunt[ii][1] - shunt_base[ii][1]) > 0.1: # verifiier la puissance active (0.1 pour eliminer l'erreurs de calcul)
indexFS.append(ii)
- flagFS = 1 # raise flag loadshedding
- fxshnt[0].append(nn) # Position seems to correspond to the number of the case we are treating
- # fxshnt[0].extend(['' for i in range(len(indexFS) - 1)])
+ flagFS = 1 # Raise flag loadshedding
+ fxshnt[0].append(nn) # Position seems to correspond to the number of the case we are treating
fxshnt[1].append(shunt[ii][0])
fxshnt[2].append(shunt[ii][2])
- indicFS = sum(fxshnt[2]) # sum all Effective MW loads
- fxshnt = list(zip(*fxshnt)) # transpose the matrix
+ indicFS = sum(fxshnt[2]) # sum all Effective MW loads
+ fxshnt = list(zip(*fxshnt)) # transpose the matrix
#save OPF results in study case before disconnecting gens
saveOPFresults(plants)
-# if opf.iopt_obj=='shd':# and indicLS > 0.1*len(loads_base):
-## for ind in indexLS: # only act on loads that have been shed
-## load = loads_base[ind]
-## #if load[11].iShedding == 1: # if loadshedding allowed on the bus
-# for ind,load in enumerate(loads_base):
-# try: #disactivate triggers, save results
-# loadPscale = load[6].GetChildren(1, 'plini.Charef', 1)
-# loadQscale = load[6].GetChildren(1, 'qlini.Charef', 1)
-# loadPscale[0].outserv = 1
-# loadQscale[0].outserv = 1
-# load[6].plini = loads[ind][1]
-# load[6].qlini = loads[ind][2]
-# except:
-# pass
+
scenario_beforeUC.Save()
- #scenario_beforeUC.Deactivate()
-
- #gen_UC_list = []
for item in plants:
- bus = item[0]
+ bus = item[0]
status = item[1]
- _id = item[2]
- pgen = item[3]
- pmax = item[6]
- try: #will only work for synchronous machines
+ _id = item[2]
+ pgen = item[3]
+ pmax = item[6]
+
+ try: # will only work for synchronous machines
pdispatch = item[11].ictpg
except:
pdispatch=0
- if int(pdispatch)==1 and (abs(pgen) <= pmax * 0.02): # if generates at less than 2% of Pmax
- #if (abs(pgen) <= pmax * 0.02):
+
+ if int(pdispatch)==1 and (abs(pgen) <= pmax * 0.02): # if generates at less than 2% of Pmax
if status == 0:
- if not gen_UC_list: #len(gen_UC_list)==0:
- app.SaveAsScenario('Case_' + str(nn), 1) # creer scenario pour sauvegarder les disponibilites des generateurs
- scenario_UC = app.GetActiveScenario()
+ if not gen_UC_list: # len(gen_UC_list)==0:
+ app.SaveAsScenario('Case_' + str(nn), 1) # creer scenario pour sauvegarder les disponibilites des generateurs
+ scenario_UC = app.GetActiveScenario()
+
# disconnect the plant
- for plant in plants_base: # chercher l'objet represente generateur
- if (plant[0] == bus) and (plant[2] == _id) and (
- plant[11].ip_ctrl != 1): #and plant[11].ictpg==1: # not reference bus
- plant[11].outserv = 1 # desactiver le groupe
+ for plant in plants_base: # chercher l'objet represente generateur
+ if (plant[0] == bus) and (plant[2] == _id) and (plant[11].ip_ctrl != 1):
+ plant[11].outserv = 1 # desactiver le groupe
outs = plant[11].GetChildren(1, 'outserv.Charef', 1)
if outs:
- outs[0].outserv = 1 # desactive Trigger outserv pour etre sure que le groupe va etre desactive
+ outs[0].outserv = 1 # desactive Trigger outserv pour etre sure que le groupe va etre desactive
gen_UC_list.append((bus, _id))
-
- if gen_UC_list: #len(gen_UC_list)!=0:
+
+ if gen_UC_list: # len(gen_UC_list)!=0:
scenario_UC.Save()
- app.SaveAsScenario('tempUC0_'+str(nn), 1) # creer scenario pour sauvegarder le cas de base
+ app.SaveAsScenario('tempUC0_'+str(nn), 1) # creer scenario pour sauvegarder le cas de base
scenario_temporaireUC0=app.GetActiveScenario()
scenario_temporaireUC0.Save()
scenario_temporaireUC0.Deactivate()
-# scenario_temporaireUC0 = scenarioUC
-
- #scenario_temporaireUC0=app.GetActiveScenario()
- #scenario_temporaireUC0.Save()
- #scenario_temporaireUC0.Deactivate()
- #scenario_temporaireUC0=scenario_UC
+
- # 3. Affiche Y
- # sizeY4 = len(shunt)
+
y = np.zeros(2 * sizeY0 + sizeY1 + 3 * sizeY2 + sizeY3 + 2 * sizeY6 + sizeY4 + sizeY8 + 3 * sizeY5 + 3 * sizeY7)
z = [0] * 13
rate_mat_index = Irate_num + 2
rate_mat_index_3w = Irate_num + 4
Ymac = np.zeros(sizeY0)
+
if ok:
# Creates the quantities of interest
for i in range(sizeY2):
if lines[i][rate_mat_index] > 100:
- z[0] += 1 # Number of lines above 100% of their limits
+ z[0] += 1 # Number of lines above 100% of their limits
for i in range(sizeY5):
if transf[i][rate_mat_index] > 100:
- z[1] += 1 # Number of transformers above 100% of their limits
+ z[1] += 1 # Number of transformers above 100% of their limits
for i in range(sizeY7):
if transf3[i][rate_mat_index_3w] > 100:
- z[1] += 1 # Add number of 3w transformers above 100% of their limits
+ z[1] += 1 # Add number of 3w transformers above 100% of their limits
for i in range(sizeY1):
if buses[i][2] > buses[i][5]:
z[2] += 1
if buses[i][2] < buses[i][4]:
- z[2] += 1 # Number of buses outside of their voltage limits
+ z[2] += 1 # Number of buses outside of their voltage limits
for i in range(sizeY0):
- z[3] += float(plants[i][3]) # Total active production
+ z[3] += float(plants[i][3]) # Total active production
for i in range(sizeY3):
- z[4] += float(loads[i][1]) # Total active consumption
+ z[4] += float(loads[i][1]) # Total active consumption
for i in range(sizeY6):
- z[4] += float(motors[i][1]) # add total active consumption from motors
- z[5] = (z[3] - z[4]) / z[3] * 100 # Active power losses
+ z[4] += float(motors[i][1]) # add total active consumption from motors
+ z[5] = (z[3] - z[4]) / z[3] * 100 # Active power losses
for i in range(sizeY2):
if lines[i][rate_mat_index] > z[6]:
- z[6] = lines[i][rate_mat_index] # Max flow in lines
+ z[6] = lines[i][rate_mat_index] # Max flow in lines
for i in range(sizeY5):
if transf[i][rate_mat_index] > z[7]:
- z[7] = transf[i][rate_mat_index] # Max flow in transformers
+ z[7] = transf[i][rate_mat_index] # Max flow in transformers
for i in range(sizeY7):
if transf[i][rate_mat_index] > z[7]:
- z[7] = transf3[i][rate_mat_index_3w] # Max flow in 3w transformers
+ z[7] = transf3[i][rate_mat_index_3w] # Max flow in 3w transformers
for i in range(sizeY2):
if lines[i][rate_mat_index] > 90:
z[8] += 1
- z[8] = z[8] - z[0] # Number of lines between 90% and 100% of their limits
+ z[8] = z[8] - z[0] # Number of lines between 90% and 100% of their limits
for i in range(sizeY5):
if transf[i][rate_mat_index] > 90:
z[9] += 1
for i in range(sizeY7):
if transf3[i][rate_mat_index_3w] > 90:
z[9] += 1
- z[9] = z[9] - z[1] # Number of transformers between 90% and 100% of their limits
+ z[9] = z[9] - z[1] # Number of transformers between 90% and 100% of their limits
z[10] = indicFS
z[11] = indicLS
for Qshunt in range(sizeY8):
y[Qshunt + 2 * sizeY0 + sizeY1 + 3 * sizeY2 + 3 * sizeY5 + 3 * sizeY7 + sizeY3 + 2 * sizeY6 + sizeY4] = float(
swshunt[Qshunt][4])
-
- # nz = len(z)
- #scenario_temporaireUC.Deactivate()
- #scenario_temporaireUC.Delete()
- res_beforeUC = [list(y), list(z), list(Ymac), indicLS, indicFS, list(loadShed),
- list(fxshnt)] # sauvegarder le resultat dans un fichier pickle
+ res_beforeUC = [list(y), list(z), list(Ymac), indicLS, indicFS, list(loadShed),list(fxshnt)] # sauvegarder le resultat dans un fichier pickle
+
with open(dico['doc_base'] + '/' + app.GetActiveStudyCase().loc_name + '.before', 'wb') as fichier:
mon_pickler = pickle.Pickler(fichier, protocol=2)
mon_pickler.dump(res_beforeUC)
del z[-1]
#change scenario name
scenario_beforeUCpost=app.GetActiveScenario()
- app.SaveAsScenario('Case_' + str(nn), 1) # creer scenario pour sauvegarder le cas de base
- #scenario_beforeUCpost.Save()
+ app.SaveAsScenario('Case_' + str(nn), 1) # creer scenario pour sauvegarder le cas de base
scenario_beforeUC.Delete()
#copy No cost OPF convergence cases for post-UC as well, because no additional treatment will be done.
for filename in os.listdir(os.path.dirname(os.path.realpath(__file__))):
- #for filename in os.listdir(tempdir):
if filename.endswith('.shdUC'):
- #filew = open(os.path.dirname(os.path.realpath(__file__)) + filename + 'UC','w')
shutil.copy2(os.path.join(os.path.dirname(os.path.realpath(__file__)), filename), os.path.join(os.path.dirname(os.path.realpath(__file__)),filename[0:-2]))
- #shutil.copy2(os.path.join(tempdir, filename), os.path.join(tempdir,filename[0:-2] ))
- #filew.close()
+
#----------------------------------RE-run after unit commitment step--------------------------------------------------
if len(gen_UC_list)!=0:
scenario_UC.Activate()
-
opf = app.GetFromStudyCase('ComOpf')
-
opf.iInit = 0
erropf = opf.Execute()
+
# Traitement specifique pour resoudre des cas difficle a converger
+
if (erropf == 1) and (PFParams['OBJECTIVE_FUNCTION'] == 'MINIMISATION_OF_COST') and PFParams['NON_COST_OPTIMAL_SOLUTION_ALLOWED']:
- scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
+
+ scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
ldf = app.GetFromStudyCase('ComLdf')
- ldf.iopt_initOPF = 1 # utiliser pour OPF
+ ldf.iopt_initOPF = 1 # utiliser pour OPF
ldf.Execute()
opf.iInit = 1
- erropf = opf.Execute() # lancer opf avec 'cst'
+ erropf = opf.Execute() # lancer opf avec 'cst'
+
print(' Run LDF for OPF ')
- if erropf == 0: print(' OK grace a LDF initial ')
+
+ if erropf == 0:
+ print(' OK grace a LDF initial ')
else:
- scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
+ scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
+
aa = 0
- while erropf == 1: # si cst ne marche pas
- scenario_temporaireUC0.Apply(0)#recuperer scenario initiale
+ while erropf == 1: # si cst ne marche pas
+ scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
aa += 1
- opf.iopt_obj = 'los' # Fonction objectif = minimisation de la perte totale du reseau
- erropf = opf.Execute() # run opf los
+ opf.iopt_obj = 'los' # Fonction objectif = minimisation de la perte totale du reseau
+ erropf = opf.Execute() # run opf loss
+
if erropf == 1:
- scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
+ scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
print(' flat-stat to OPF loss ! ! ! ')
- opf.iInit = 0 # flatstart opf loss
+ opf.iInit = 0 # flatstart opf loss
erropf = opf.Execute()
if erropf == 1:
- scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
+ scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
break
+
opf.iInit = 1
+
print(' Run OPF loss OK ')
- if erropf == 0: # si los marche bien
+ if erropf == 0: # si loss marche bien
if (aa == 2)and(LS_allowed):
opf.iopt_obj = 'shd'
opf.Execute()
- if aa == 3:
- # print(' ++++++++++++++++++++++++++++prendre le resultat du OPF LOSS')
- # erropf = 1
- # scenario_temporaire0.Apply(0) # recuperer scenario initiale
+ if aa == 3:
filew = open(os.path.dirname(os.path.realpath(__file__)) + '/Case_' + str(nn) + '_LOSS' + '.shd', 'w')
- #filew = open(tempdir + '/Case_' + str(nn) + '_LOSS' + '.shd', 'w')
filew.write('Case_' + str(nn))
filew.close()
break
+
opf.iopt_obj = 'cst'
- erropf = opf.Execute() # relancer opt cst
+ erropf = opf.Execute() # relancer opt cst
if erropf == 0:
if (aa == 2)and(LS_allowed):
print(' ==================== basculer los-shd')
else:
print(' OK grace a OPF LOSS =======================LOSS in case aa=' + str(aa))
+
if (erropf==1)and(LS_allowed):
aa = 0
- scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
- ldf.Execute() # initiale valeur pour opf shd
- # opf.iInit = 1
+ scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
+ ldf.Execute() # initiale valeur pour opf shd
+
while erropf == 1:
- scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
+ scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
aa += 1
- opf.iopt_obj = 'shd' # Fonction objectif = minimisation de la perte totale du reseau
+ opf.iopt_obj = 'shd' # Fonction objectif = minimisation de la perte totale du reseau
erropf = opf.Execute()
+
if erropf == 1:
- scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
+ scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
print(' flat-stat to OPF shd ! ! ! 222 ')
opf.iInit = 0
erropf = opf.Execute()
if erropf == 1:
- scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
+ scenario_temporaireUC0.Apply(0) # recuperer scenario initiale
break
+
opf.iInit = 1
+
print(' Run OPF SHD ')
- if erropf == 0: # si shd marche bien
+
+ if erropf == 0: # si shd marche bien
if aa == 2:
opf.iopt_obj = 'los'
opf.Execute()
if aa == 3:
print(' +++++++++++++++++++++++++prendre le resultat du OPF SHD')
filew = open(os.path.dirname(os.path.realpath(__file__)) + '/Case_' + str(nn) + '_SHD' + '.shd', 'w')
- #filew = open(tempdir + '/Case_' + str(nn) + '_SHD' + '.shd', 'w')
filew.write('Case_' + str(nn))
filew.close()
break
+
opf.iopt_obj = 'cst'
- erropf = opf.Execute() # relancer opt cst
+ erropf = opf.Execute() # relancer opt cst
if erropf == 0:
+
if aa == 2:
print('=== ========== basculer shd-los')
- # filew = open(os.path.dirname(os.path.realpath(__file__)) + '/Case_' + str( nn) + '_shdlosscost' + '.shd', 'w')
- # filew.write('Case_' + str(nn))
- # filew.close()
else:
print( ' OK grace a OPF SHD -------------------------------Load SHEDDING in case aa=' + str( aa))
- # filew = open( os.path.dirname(os.path.realpath(__file__)) + '/Case_' + str(nn) + '_shdcost' + '.shd', 'w')
- # filew.write('Case_' + str(nn))
- # filew.close()
- # Fin du traitement specifique pour resoudre des cas difficle a converger
+ # Fin du traitement specifique pour resoudre des cas difficles a converger
loadShed = [[], [], [], [], []]
fxshnt = [[], [], []]
all_inputs = read_pfd(app, prj.loc_name, recal=0)
stop = time.clock();
- start = stop; # ++++++++++++++++
+ start = stop;
buses = []
[buses.append(bus[0:8]) for bus in all_inputs[0]]
lines = []
[swshunt.append(bus[0:6]) for bus in all_inputs[8]]
# Extraction of the load shedding quantities
-
-
for ii in range(len(loads)):
LSscale = loads[ii][6].GetAttribute('s:scale')
P_setpoint = loads[ii][6].GetAttribute('s:pini_set')
LS = (1-LSscale) * P_setpoint
if abs(LS)>0.1:
indexLS.append(ii)
- flagLS = 1 # raise flag loadshedding
- loadShed[0].append(nn) # Position seems to correspond to the number of the case we are treating
- loadShed[1].append(loads[ii][0]) #busnumber
- loadShed[2].append(loads[ii][4]) #busname
+ flagLS = 1 # raise flag loadshedding
+ loadShed[0].append(nn) # Position seems to correspond to the number of the case we are treating
+ loadShed[1].append(loads[ii][0]) # busnumber
+ loadShed[2].append(loads[ii][4]) # busname
loadShed[3].append(LS)
- loadShed[4].append(loads[ii][1]) #remaining load (voltage rectified)
-
-
-# if abs(loads[ii][1] - loads_base[ii][1]) > 0.1: # verifiier la puissance active (0.1 pour eliminer l'erreurs de calcul)
-# indexLS.append(ii)
-# flagLS = 1 # raise flag loadshedding
-#
-# loadShed[0].append( nn) # Position seems to correspond to the number of the case we are treating
-# # loadShed[0].extend(['' for i in range(len(indexLS) - 1)])
-# loadShed[1].append(loads[ii][0])
-# loadShed[2].append(loads[ii][4])
-# loadShed[3].append(loads_base[ii][1] - loads[ii][1])
-# loadShed[4].append(loads[ii][1])
-
+ loadShed[4].append(loads[ii][1]) # remaining load (voltage rectified)
- indicLS = sum(loadShed[3]) # sum all Effective MW loads
- loadShed = list(zip(*loadShed)) # transpose the matrix
+ indicLS = sum(loadShed[3]) # sum all Effective MW loads
+ loadShed = list(zip(*loadShed)) # transpose the matrix
for ii in range(len(shunt)):
- if abs(shunt[ii][1] - shunt_base[ii][1]) > 0.1: # verifiier la puissance active (0.1 pour eliminer l'erreurs de calcul)
+ if abs(shunt[ii][1] - shunt_base[ii][1]) > 0.1: # verifiier la puissance active (0.1 pour eliminer l'erreurs de calcul)
indexFS.append(ii)
- flagFS = 1 # raise flag loadshedding
- fxshnt[0].append(nn) # Position seems to correspond to the number of the case we are treating
- # fxshnt[0].extend(['' for i in range(len(indexFS) - 1)]) # why [0] ? Maybe it would be better to have 2 lists ? Or a dict ?
+ flagFS = 1 # raise flag loadshedding
+ fxshnt[0].append(nn) # Position seems to correspond to the number of the case we are treating
fxshnt[1].append(shunt[ii][0])
fxshnt[2].append(shunt[ii][2])
- indicFS = sum(fxshnt[2]) # sum all Effective MW loads
- fxshnt = list(zip(*fxshnt)) # transpose the matrix
+
+ indicFS = sum(fxshnt[2]) # sum all Effective MW loads
+ fxshnt = list(zip(*fxshnt)) # transpose the matrix
- # 3. Affiche Y
- # sizeY4 = len(shunt)
y = np.zeros(2 * sizeY0 + sizeY1 + 3 * sizeY2 + sizeY3 + 2 * sizeY6 + sizeY4 + sizeY8 + 3 * sizeY5 + 3 * sizeY7)
- z = np.zeros(12) # np.zeros returns a new array of the given shape and type filled with zeros
+ z = np.zeros(12) # np.zeros returns a new array of the given shape and type filled with zeros
rate_mat_index = Irate_num + 2
rate_mat_index_3w = Irate_num + 4
Ymac = np.zeros(sizeY0)
+
if ok:
# Creates the quantities of interest
for i in range(sizeY2):
if lines[i][rate_mat_index] > 100:
- z[0] += 1 # Number of lines above 100% of their limits
+ z[0] += 1 # Number of lines above 100% of their limits
for i in range(sizeY5):
if transf[i][rate_mat_index] > 100:
- z[1] += 1 # Number of transformers above 100% of their limits
+ z[1] += 1 # Number of transformers above 100% of their limits
for i in range(sizeY7):
if transf3[i][rate_mat_index_3w] > 100:
- z[1] += 1 # Add number of 3w transformers above 100% of their limits
+ z[1] += 1 # Add number of 3w transformers above 100% of their limits
for i in range(sizeY1):
if buses[i][2] > buses[i][5]:
z[2] += 1
if buses[i][2] < buses[i][4]:
- z[2] += 1 # Number of buses outside of their voltage limits
+ z[2] += 1 # Number of buses outside of their voltage limits
for i in range(sizeY0):
- z[3] += float(plants[i][3]) # Total active production
+ z[3] += float(plants[i][3]) # Total active production
for i in range(sizeY3):
- z[4] += float(loads[i][1]) # Total active consumption
+ z[4] += float(loads[i][1]) # Total active consumption
for i in range(sizeY6):
- z[4] += float(motors[i][1]) # add total active consumption from motors
- z[5] = (z[3] - z[4]) / z[3] * 100 # Active power losses
+ z[4] += float(motors[i][1]) # add total active consumption from motors
+ z[5] = (z[3] - z[4]) / z[3] * 100 # Active power losses
for i in range(sizeY2):
if lines[i][rate_mat_index] > z[6]:
- z[6] = lines[i][rate_mat_index] # Max flow in lines
+ z[6] = lines[i][rate_mat_index] # Max flow in lines
for i in range(sizeY5):
if transf[i][rate_mat_index] > z[7]:
- z[7] = transf[i][rate_mat_index] # Max flow in transformers
+ z[7] = transf[i][rate_mat_index] # Max flow in transformers
for i in range(sizeY7):
if transf[i][rate_mat_index] > z[7]:
- z[7] = transf3[i][rate_mat_index_3w] # Max flow in 3w transformers
+ z[7] = transf3[i][rate_mat_index_3w] # Max flow in 3w transformers
for i in range(sizeY2):
if lines[i][rate_mat_index] > 90:
z[8] += 1
- z[8] = z[8] - z[0] # Number of lines between 90% and 100% of their limits
+ z[8] = z[8] - z[0] # Number of lines between 90% and 100% of their limits
for i in range(sizeY5):
if transf[i][rate_mat_index] > 90:
z[9] += 1
for i in range(sizeY7):
if transf3[i][rate_mat_index_3w] > 90:
z[9] += 1
- z[9] = z[9] - z[1] # Number of transformers between 90% and 100% of their limits
+ z[9] = z[9] - z[1] # Number of transformers between 90% and 100% of their limits
z[10] = indicFS
z[11] = indicLS
#save OPF results in after UC scenario
saveOPFresults(plants)
-# if opf.iopt_obj=='shd':# and indicLS > 0.1*len(loads_base):
-# # for ind in indexLS: # only act on loads that have been shed
-# # load = loads_base[ind]
-# # #if load[11].iShedding == 1: # if loadshedding allowed on the bus
-# for ind,load in enumerate(loads_base):
-# try: #disactivate triggers, save results
-# loadPscale = load[6].GetChildren(1, 'plini.Charef', 1)
-# loadQscale = load[6].GetChildren(1, 'qlini.Charef', 1)
-# loadPscale[0].outserv = 1
-# loadQscale[0].outserv = 1
-# load[6].plini = loads[ind][1]
-# load[6].qlini = loads[ind][2]
-# except:
-# pass
-# pass
+
scenario_UC.Save()
scenario_temporaireUC0.Delete()
- #scenario_temporaire.Deactivate()
- #scenario_temporaire.Delete()
if aa == 3:
print(' +++++++++++++++++++++++++prendre le resultat du OPF SHD')
filew = open(os.path.dirname(os.path.realpath(__file__)) + '/Case_' + str(nn) + '_SHD' + '.shd', 'w')
- #filew = open(tempdir + '/Case_' + str(nn) + '_SHD' + '.shd', 'w')
filew.write('Case_' + str(nn))
filew.close()
break
swshunt[Qshunt][4])
saveOPFresults(plants)
-# if opf.iopt_obj=='shd': #and indicLS > 0.1*len(loads_base):
-## for ind in indexLS: # only act on loads that have been shed
-## load = loads_base[ind]
-## #if load[11].iShedding == 1: # if loadshedding allowed on the bus
-# for ind,load in enumerate(loads_base):
-# try: #disactivate triggers, save results
-# loadPscale = load[6].GetChildren(1, 'plini.Charef', 1)
-# loadQscale = load[6].GetChildren(1, 'qlini.Charef', 1)
-# loadPscale[0].outserv = 1
-# loadQscale[0].outserv = 1
-# load[6].plini = loads[ind][1]
-# load[6].qlini = loads[ind][2]
-# except:
-# pass
+
scenario.Save()
- #scenario.Deactivate()
scenario_temporaire0.Delete()
-res_final = [list(y), list(z), list(Ymac), indicLS, indicFS, list(loadShed),
- list(fxshnt)] # sauvegarder le resultat dans un fichier pickle
+res_final = [list(y), list(z), list(Ymac), indicLS, indicFS, list(loadShed), list(fxshnt)] # sauvegarder le resultat dans un fichier pickle
+
with open(dico['doc_base'] + '/' + app.GetActiveStudyCase().loc_name + '.final', 'wb') as fichier:
mon_pickler = pickle.Pickler(fichier, protocol=2)
mon_pickler.dump(res_final)
-
-
-#
-#
-#res_final = [list(y), list(z), list(Ymac), indicLS, indicFS, list(loadShed),
-# list(fxshnt)] # sauvegarder le resultat dans un fichier pickle
-#with open(dico['doc_base'] + '/' + app.GetActiveStudyCase().loc_name + '.final', 'wb') as fichier:
-# mon_pickler = pickle.Pickler(fichier, protocol=2)
-# mon_pickler.dump(res_final)
-
stop = time.clock();print(' run study cases'+' in ' + str(round(stop - start, 3)) + ' seconds');start = stop;
-# aa=1
lines_base = all_inputs_init[1]
transf_base = all_inputs_init[2]
transf3_base = all_inputs_init[7]
-motors_base = all_inputs_init[6]
-
-## on ecrit les pgini initiaux (avant trigger) ds un fichier csv
-#initial_pginis = []
-#for plant in plants_base:
-# initial_pginis.append(plant[11].pgini)
-#
-#csvfile = os.path.join(dico['doc_base'], 'initial_pgini.csv')
-#g = open(csvfile,"wb")
-#cwt = csv.writer(g, delimiter=";")
-#for ipgini in initial_pginis:
-# cwt.writerow(ipgini)
-#g.close()
-
+motors_base = all_inputs_init[6]
trifiles = fScale.GetChildren(1, '*.TriFile', 1)
for load in loads_base:
if (load[0] == busNum) and (load[5] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Load_' + LoadName)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 1
chavec_1.datacol = i + 2
chavec_1.scale = tri1
for motor in motors_base:
if (motor[0] == busNum) and (motor[5] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Mo_' + MotorName)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 1
chavec_1.datacol = i + 2
chavec_1.scale = tri1
for plant in plants_base:
if (plant[0] == busNum) and (plant[2] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Gen_' + GenName)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 1
chavec_1.datacol = i + 2
chavec_1.scale = tri1
for line in lines_base:
if (from_bus == line[0]) and (to_bus == line[1]) and (line[10] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Line_' + Name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
chavec_1.datacol = i + 2
chavec_1.scale = tri1
for tranf in transf_base:
if (from_bus == tranf[0]) and (to_bus == tranf[1]) and (tranf[10] == ID):
chavec_1 = fChar.CreateObject('ChaVecFile', 'Transf_' + Name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
chavec_1.datacol = i + 2
chavec_1.scale = tri1
if (from_bus == tranf[0]) and (to_bus == tranf[1]) and (three_bus == tranf[2]) and (
tranf[13] == ID):
chavec_1 = fChar.CreateObject('ChaVecFile', 'Transf3_' + Name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
chavec_1.datacol = i + 2
chavec_1.scale = tri1
for plant in plants_base:
if (plant[0] == busNum) and (plant[2] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Gen_' + Name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
chavec_1.datacol = i + 2
chavec_1.scale = tri1
for load in loads_base:
if (load[0] == busNum) and (load[5] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Load_' + Name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
chavec_1.datacol = i + 2
chavec_1.scale = tri1
for motor in motors_base:
if (motor[0] == busNum) and (motor[5] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Mo_' + Name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
chavec_1.datacol = i + 2
chavec_1.scale = tri1
for line in lines_base:
if (from_bus == line[0]) and (to_bus == line[1]) and (line[10] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Line_' + line_name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
for i, name in enumerate(nameN1):
if line_name == name:
for tranf in transf_base:
if (from_bus == tranf[0]) and (to_bus == tranf[1]) and (tranf[10] == ID):
chavec_1 = fChar.CreateObject('ChaVecFile', 'Transf_' + transfo_name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
for i, name in enumerate(nameN1):
if transfo_name == name:
if (from_bus == tranf[0]) and (to_bus == tranf[1]) and (three_bus == tranf[2]) and (
tranf[13] == ID):
chavec_1 = fChar.CreateObject('ChaVecFile', 'Transf_' + transfo_name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
for i, name in enumerate(nameN1):
if transfo_name == name:
for motor in motors_base:
if (motor[0] == busNum) and (motor[5] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Mo_' + motor_name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
for i, name in enumerate(nameN1):
if motor_name == name:
for load in loads_base:
if (load[0] == busNum) and (load[5] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Load_' + load_name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(),'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
for i, name in enumerate(nameN1):
if load_name == name:
for plant in plants_base:
if (plant[0] == busNum) and (plant[2] == ID): # cree trigger
chavec_1 = fChar.CreateObject('ChaVecFile', 'Gen_' + group_name)
- chavec_1.f_name = os.path.join(os.getcwd(),
- 'data_trigger.csv') # fichier .csv de la caracteristique
+ chavec_1.f_name = os.path.join(os.getcwd(), 'data_trigger.csv') # fichier .csv de la caracteristique
chavec_1.usage = 2
for i,name in enumerate(nameN1):
if group_name == name:
break
- # chemin=os.getcwd()
+
stop = time.clock(); print(' Prepare chavec for N_1_fromfile in run_in_PFfunction.py in ' + str(round(stop - start, 3)) + ' seconds'); start = stop;
print('======= BEGIN copy studycases'+' ==================')
if settrigger0:
settrigger0[0].outserv=0
for ite in range(len(x)):
- # inputSample.append(np.array(x[ite]))
studycase = fold.AddCopy(studycase0, 'Case_'+str(position))
settriger_iter = studycase.GetChildren(1, 'set_iteration.SetTrigger', 1)[0]
settriger_iter.ftrigger = position
stop = time.clock();print(' Copy study case in run_in_PFfunction.py in ' + str(round(stop - start, 3)) + ' seconds');start = stop;
err=comtask.Execute()
-# app.Show()
+
aa=1
\ No newline at end of file
-#def read_change(app,scn,settriger_iter):
-#######################################################################BEGIN RECUPERE
-# prj = app.GetActiveProject()
-# #s'il y a plusieurs grids activés
-# studycase=app.GetActiveStudyCase()
-# grids=studycase.GetChildren(1,'*.ElmNet',1)[0].contents
-#
-# tous=[]
-# for grid in grids:
-# tous.extend(grid.obj_id.GetContents( '*.ElmTerm', 1))
-# bus = []
-# for noeud in tous:
-# bus.append(noeud)
-# noeuds = sorted(bus, key=lambda x: x.cStatName)
-# buses = []
-# for ii in range(len(noeuds)):
-# aa = [ii, noeuds[ii].uknom, noeuds[ii].GetAttribute('m:u'), noeuds[ii].cStatName, noeuds[ii].vmin,
-# noeuds[ii].vmax, noeuds[ii].GetBusType(), noeuds[ii].GetAttribute('m:phiu'),noeuds[ii]]
-# # [numero,nominal KV,magnitude p.u, busname,Vmin,Vmax,type,angle degre,obj]
-# buses.append(aa)
-# # ##== == == == == == == == == == = Line===================== Line===================== Line
-# # # lignes = app.GetCalcRelevantObjects('*.ElmLne', 0)
-# # tous=[]
-# # for grid in grids:
-# # tous.extend(grid.obj_id.GetContents( '*.ElmLne', 1))
-# # lines=[]
-# # for line in tous:
-# # frombus_name=line.bus1.cBusBar.cStatName
-# # for ii in range(len(buses)):
-# # if frombus_name in buses[ii]:
-# # frombus_number=ii
-# # break
-# # tobus_name=line.bus2.cBusBar.cStatName
-# # for ii in range(len(buses)):
-# # if tobus_name in buses[ii]:
-# # tobus_number=ii
-# # break
-# # currentA=line.GetAttribute('m:I:bus1') #courant en A de la ligne
-# # pourcent=line.GetAttribute('c:loading') # taux de charge de la ligne
-# # flowP=line.GetAttribute('m:P:bus1')
-# # flowQ = line.GetAttribute('m:Q:bus1')
-# # idline=line.loc_name#line.nlnum
-# # aa=[frombus_number,tobus_number,currentA,pourcent,pourcent,pourcent,flowP,flowQ,frombus_name,tobus_name,idline,line]
-# # lines.append(aa)
-#
-# # # 2 windings transformers data (from, to, amps, rate%a, ploss, qloss)
-# # tous=[]
-# # for grid in grids:
-# # tous.extend(grid.obj_id.GetContents( '*.ElmTr2', 1))
-# # transf=[]
-# # for trans in tous:
-# # frombus_name=trans.bushv.cBusBar.cStatName
-# # for ii in range(len(buses)):
-# # if frombus_name in buses[ii]:
-# # frombus_number=ii
-# # break
-# # tobus_name=trans.buslv.cBusBar.cStatName
-# # for ii in range(len(buses)):
-# # if tobus_name in buses[ii]:
-# # tobus_number=ii
-# # break
-# # currentA=trans.GetAttribute('m:I:bushv') #courant en A du bus hv
-# # pourcent=trans.GetAttribute('c:loading') # taux de charge
-# # flowP=trans.GetAttribute('m:P:bushv')
-# # flowQ = trans.GetAttribute('m:Q:bushv')
-# # idline=trans.ntnum
-# # aa=[frombus_number,tobus_number,currentA,pourcent,pourcent,pourcent,flowP,flowQ,frombus_name,tobus_name,idline,trans]
-# # transf.append(aa)
-# # #3 windings transformers data (from, to, amps, rate%a, ploss, qloss)
-# # tous=[]
-# # for grid in grids:
-# # tous.extend(grid.obj_id.GetContents( '*.ElmTr3', 1))
-# # transf3 = []
-# # for trans in tous:
-# # wind1name = trans.bushv.cBusBar.cStatName
-# # for ii in range(len(buses)):
-# # if wind1name in buses[ii]:
-# # wind1number = ii
-# # break
-# # wind2name = trans.busmv.cBusBar.cStatName
-# # for ii in range(len(buses)):
-# # if wind2name in buses[ii]:
-# # wind2number = ii
-# # break
-# # wind3name = trans.buslv.cBusBar.cStatName
-# # for ii in range(len(buses)):
-# # if wind3name in buses[ii]:
-# # wind3number = ii
-# # break
-# # if trans.outserv==1:
-# # currentA = 0 # courant en A du bus hv
-# # pourcent = 0 # taux de charge
-# # flowP =0
-# # flowQ = 0
-# # else:
-# # currentA = trans.GetAttribute('m:I:bushv') # courant en A du bus hv
-# # pourcent = trans.GetAttribute('c:loading') # taux de charge
-# # flowP = trans.GetAttribute('m:P:bushv')
-# # flowQ = trans.GetAttribute('m:Q:bushv')
-# # idline = trans.nt3nm
-# # aa = [wind1number, wind2number,wind3number,3, currentA, pourcent, pourcent, pourcent, flowP, flowQ, wind1name,wind2name,wind3name,idline,trans]
-# # transf3.append(aa)
-#
-# #Machines data (bus, inservice, id, pgen, qgen, mvabase, pmax, qmax, name)==============Generator
-# tous=[]
-# for grid in grids:
-# tous.extend(grid.obj_id.GetContents( '*.ElmSym', 1))
-# plants = []
-# for plant in tous:
-# if plant.i_mot==0:
-# busname=plant.bus1.cBusBar.cStatName
-# for ii in range(len(buses)):
-# if busname in buses[ii]:
-# busnumber = ii
-# break
-# idplant = plant.loc_name#plant.ngnum
-# outserv = plant.outserv
-# if outserv == 1:
-# pgen = 0
-# qgen = 0
-# else:
-# pgen = plant.GetAttribute('m:P:bus1')
-# qgen = plant.GetAttribute('m:Q:bus1')
-# sn = plant.GetAttribute('t:sgn')
-# pmax = plant.Pmax_uc
-# pmin = plant.Pmin_uc
-# qmax = plant.cQ_max
-# qmin = plant.cQ_min
-# aa=[busnumber,outserv,idplant,pgen,qgen,sn,pmax,pmin,busname,pmin,qmin,plant]
-# plants.append(aa)
-# tous=[]
-# for grid in grids:
-# tous.extend(grid.obj_id.GetContents( '*.ElmAsm', 1))
-# for plant in tous:
-# if plant.i_mot==0:
-# busname=plant.bus1.cBusBar.cStatName
-# for ii in range(len(buses)):
-# if busname in buses[ii]:
-# busnumber = ii
-# break
-# idplant = plant.loc_name#plant.ngnum
-# outserv=plant.outserv
-# if outserv==1:
-# pgen=0
-# qgen = 0
-# else:
-# pgen = plant.GetAttribute('m:P:bus1')
-# qgen = plant.GetAttribute('m:Q:bus1')
-# sn = plant.GetAttribute('t:sgn')
-# pmax = plant.Pmax_uc
-# pmin = plant.Pmin_uc
-# qmax = plant.cQ_max
-# qmin = plant.cQ_min
-# aa=[busnumber,outserv,idplant,pgen,qgen,sn,pmax,pmin,busname,pmin,qmin,plant]
-# plants.append(aa)
-# # tous = []
-# # for grid in grids:
-# # tous.extend(grid.obj_id.GetContents( '*.ElmGenstat', 1))
-# # for plant in tous:
-# # busname = plant.bus1.cBusBar.cStatName
-# # for ii in range(len(buses)):
-# # if busname in buses[ii]:
-# # busnumber = ii
-# # break
-# # idplant = plant.loc_name # plant.ngnum
-# # outserv = plant.outserv
-# # if outserv == 1:
-# # pgen = 0
-# # qgen = 0
-# # else:
-# # pgen = plant.GetAttribute('m:P:bus1')
-# # qgen = plant.GetAttribute('m:Q:bus1')
-# # sn = plant.GetAttribute('e:sgn')
-# # pmax = plant.Pmax_uc
-# # pmin = plant.Pmin_uc
-# # qmax = plant.cQ_max
-# # qmin = plant.cQ_min
-# # aa = [busnumber, outserv, idplant, pgen, qgen, sn, pmax, pmin, busname, pmin, qmin,plant]
-# # plants.append(aa)
-# # tous = []
-# # for grid in grids:
-# # tous.extend(grid.obj_id.GetContents( '*.ElmPvsys', 1))
-# # for plant in tous:
-# # busname = plant.bus1.cBusBar.cStatName
-# # for ii in range(len(buses)):
-# # if busname in buses[ii]:
-# # busnumber = ii
-# # break
-# # idplant = plant.loc_name # plant.ngnum
-# # outserv = plant.outserv
-# # if outserv == 1:
-# # pgen = 0
-# # qgen = 0
-# # else:
-# # pgen = plant.GetAttribute('m:P:bus1')
-# # qgen = plant.GetAttribute('m:Q:bus1')
-# # sn = plant.GetAttribute('e:sgn')
-# # pmax = plant.Pmax_uc
-# # pmin = plant.Pmin_uc
-# # qmax = plant.cQ_max
-# # qmin = plant.cQ_min
-# # aa = [busnumber, outserv, idplant, pgen, qgen, sn, pmax, pmin, busname, pmin, qmin,plant]
-# # plants.append(aa)
-# tous=[]
-# # Motors data (bus, active, reactive, status, name, id)===================== Motor
-#
-# for grid in grids:
-# tous.extend(grid.obj_id.GetContents( '*.ElmSym', 1))
-# motors = []
-# for motor in tous:
-# if motor.i_mot == 1:
-# busname = motor.bus1.cBusBar.cStatName
-# for ii in range(len(buses)):
-# if busname in buses[ii]:
-# busnumber = ii
-# break
-# idplant = motor.loc_name#motor.ngnum
-# outserv = motor.outserv
-# if outserv == 1:
-# pgen = 0
-# qgen = 0
-# else:
-# pgen = motor.GetAttribute('m:P:bus1')
-# qgen = motor.GetAttribute('m:Q:bus1')
-# aa = [busnumber, pgen, qgen, outserv, busname,idplant,motor]
-# motors.append(aa)
-# tous=[]
-# for grid in grids:
-# tous.extend(grid.obj_id.GetContents( '*.ElmAsm', 1))
-# for motor in tous:
-# if motor.i_mot == 1:
-# busname = motor.bus1.cBusBar.cStatName
-# for ii in range(len(buses)):
-# if busname in buses[ii]:
-# busnumber = ii
-# break
-# idplant = motor.loc_name#motor.ngnum
-# outserv = motor.outserv
-# if outserv == 1:
-# pgen = 0
-# qgen = 0
-# else:
-# pgen = motor.GetAttribute('m:P:bus1')
-# qgen = motor.GetAttribute('m:Q:bus1')
-# aa = [busnumber, pgen, qgen, outserv, busname,idplant]
-# motors.append(aa)
-#
-# # Loads data (bus, active, reactive, status, name, id)===================== Load
-# tous=[]
-# for grid in grids:
-# tous.extend(grid.obj_id.GetContents( '*.ElmLod', 1))
-# tous = sorted(tous, key=lambda x: x.bus1.cBusBar.cStatName)
-# loads = []
-# for bus in buses:
-# idload = 0
-# for load in tous:
-# busname = load.bus1.cBusBar.cStatName
-# if busname == bus[3]:
-# idload += 1# cree id pour load
-# busnumber = bus[0]
-# outserv = load.outserv
-# if outserv == 1:
-# pload = 0
-# qload = 0
-# else:
-# pload = load.GetAttribute('m:P:bus1')
-# qload = load.GetAttribute('m:Q:bus1') # qlini_a
-# aa = [busnumber, pload, qload, outserv, busname, idload,load]
-# loads.append(aa)
-# #Fixed shunt data (number, MVAR, name, ...)========================== Fixed Shunt
-# tous=[]
-# for grid in grids:
-# tous.extend(grid.obj_id.GetContents( '*.ElmShnt', 1))
-# tous = sorted(tous, key=lambda x: x.bus1.cBusBar.cStatName)
-# shunt = []
-# for bus in buses:
-# idshunt = 0
-# for shunt1 in tous:
-# if shunt1.ncapx==1:# nombre de step =1, considerer comme fix shunt pour equivalent a l'ancien programme sous PSSE
-# busname = shunt1.bus1.cBusBar.cStatName
-# if busname == bus[3]:
-# idshunt += 1 # cree id pour load
-# busnumber = bus[0]
-# qnom=shunt1.Qmax
-# outserv = shunt1.outserv
-# if outserv == 1:
-# qshunt = 0
-# else:
-# qshunt = shunt1.GetAttribute('m:Q:bus1') # qlini_a
-# aa = [busnumber, outserv, qshunt, busname,qnom, idshunt,bus,shunt1]
-# shunt.append(aa)
-# # Switched shunt data (number, status,MVAR, name,Qnom,id)================Swiched Shunt
-# swshunt = []
-# for bus in buses:
-# idshunt = 0
-# for shunt1 in tous:
-# if shunt1.ncapx != 1: # nombre de step #1, considerer comme switche shunt pour etre equivalent avec l'ancien programme sous PSSE
-# busname = shunt1.bus1.cBusBar.cStatName
-# if busname == bus[3]:
-# idshunt += 1 # cree id pour load
-# busnumber = bus[0]
-# qnom = shunt1.Qmax
-# outserv = shunt1.outserv
-# if outserv == 1:
-# qshunt = 0
-# else:
-# qshunt = shunt1.GetAttribute('m:Q:bus1') # qlini_a
-# aa = [busnumber, outserv, qshunt, busname, qnom, idshunt,shunt1]
-# swshunt.append(aa)
-#
-#######################################################################END RECUPERE
-# settriger_iter.outserv = 1
-# app.SaveAsScenario(scn, 1)
-# # app.Show()# app.SaveAsScenario(scn)
-# for plant in plants:
-# plant[11].pgini=plant[3]-0.01
-# # plant[11].qgini = plant[4]
-# for load in loads:
-# load[6].plini = load[1]
-# load[6].qlini = load[2]
-# scenario_temporaire = app.GetActiveScenario()
-# scenario_temporaire.Save()
-#
-#
-# # app.SaveAsScenario(scn,1)
-# aa=1
-#
-# # return buses, lines, transf, plants, loads, shunt, motors, transf3, swshunt
-
-
def MyLogger(x,y,z,logCSVfilename,ite):
f=open(logCSVfilename, 'a')
if element.endswith('.final'):
final.append(element)
-
if len(final) >= dico['lenpac'] - 2:# supposons 2 cas ne peut pas se terminer
if len(final) == dico['lenpac']:
comtask_ok = 0 # comtask reussi
var1=subprocess.call(['taskkill', '/F', '/T', '/PID', str(proc1.pid)],stdout=subprocess.PIPE)
# proc.kill()
break
- if (proc1.poll()!=None):
+ if (proc1.poll()!=None): #Cette condition permet de verifier que run_in_PFfunction a bien fini d'etre execute
comtask_ok=0
flag_error=1
filew = open(os.path.dirname(os.path.realpath(__file__)) + '/canotComtast' + str(position) + '.txt', 'w')
print('terminate run_in_PFfunction.py')
- if comtask_ok == 1:# refaire la simulation des studycases manques
-
- final = []
- for element in os.listdir(dico['doc_base']):
- if element.endswith('.final'):
- final.append(element)
- if len(final) != dico['lenpac']:# verifier encore une fois si tous les cas sont simules
- filew = open(os.path.dirname(os.path.realpath(__file__))+'/absence'+str(position)+'.txt', 'w')
- for ite in range(len(x)):
- name = 'Case_' + str(ite + dico['position']) + '.final'
- if name not in final:
- filew.write(str(ite + dico['position']) + '\n')
- filew.close()
- print('Run correct_comtask.py now')
- lancer = [dico['Paths']['Python3_path']+'\python.exe', os.path.dirname(os.path.realpath(__file__)) +'/correct_comtask.py']
- # time.sleep(20)
- proc = subprocess.Popen(lancer,creationflags=subprocess_flags)
- proc.poll()
- proc.wait()
- # print(proc.returncode)
- # print('proc.returncode===============ater correct_comtask')
- print('after correct_comtask.py')
- var3 = subprocess.call(['taskkill', '/F', '/T', '/PID', str(proc.pid)], stdout=subprocess.PIPE)
+
+
+ # if comtask_ok == 1:# refaire la simulation des studycases manques
+
+ # final = []
+ # for element in os.listdir(dico['doc_base']):
+ # if element.endswith('.final'):
+ # final.append(element)
+ # if len(final) != dico['lenpac']:# verifier encore une fois si tous les cas sont simules
+ # filew = open(os.path.dirname(os.path.realpath(__file__))+'/absence'+str(position)+'.txt', 'w')
+ # to_delete = []
+ # for ite in range(len(x)):
+ # name = 'Case_' + str(ite + dico['position']) + '.final'
+ # if name not in final:
+ # filew.write(str(ite + dico['position']) + '\n')
+ # to_delete.append(ite + dico['position'])
+ # filew.close()
+
+ # """
+ # On modifie le fichier data_trigger.csv en enlevant les studycases qui n'ont pas pu etre simulé
+ # """
+ # import pandas as pd
+ # import powerfactory
+
+ # app = powerfactory.GetApplication()
+ # user = app.GetCurrentUser()
+ # prjs = user.GetContents('*.IntPrj')
+ # prjs.sort(key=lambda x: x.gnrl_modif, reverse=True)
+ # prj = prjs[0]
+
+ # for case in to_delete:
+ # study=prj.GetChildren(1,'Case_'+str(case)+'.IntCase',1)[0]
+ # study.Delete()
+
+ # data = pd.read_csv(os.path.abspath(dico['doc_base'])+'/data_trigger.csv', sep = ';', header = None)
+
+ # del data[0]
+ # data.drop(to_delete, inplace=True)
+
+ # data.to_csv(os.path.abspath(dico['doc_base']) + '/data_trigger.csv', sep = ';', header = None)
+
+ # print('Re-Run run_in_PFfunction.py now')
+
+ # lancer = [dico['Paths']['Python3_path']+'/python.exe', os.path.dirname(os.path.realpath(__file__)) +'/run_in_PFfunction.py']
+ # proc1 = subprocess.Popen(lancer,shell=True,creationflags=subprocess_flags)
+
+ # aa=0
+ # while 1:
+ # aa += 1
+ # print('==========time since start of package================' + str(aa*5)) # compter le temps
+
+ # if (proc1.poll()!=None):
+ # comtask_ok=0
+ # flag_error=1
+ # filew = open(os.path.dirname(os.path.realpath(__file__)) + '/canotComtast' + str(position) + '.txt', 'w')
+ # filew.write( 'ignore'+ '\n')
+ # filew.close()
+ # var1 =subprocess.call(['taskkill', '/F', '/T', '/PID', str(proc1.pid)],stdout=subprocess.PIPE)
+ # break
+ # time.sleep(5)
+ # cmd = 'WMIC PROCESS get Caption,Processid'
+ # proc2 = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
+ # task = []
+ # for line in proc2.stdout:
+ # task.append(str(line))
+
+ # for kk in task:
+ # if 'PowerFactory' in kk:
+ # var2 =subprocess.call('tskill PowerFactory',stdout=subprocess.PIPE)
+
+ # print('terminate run_in_PFfunction.py')
+
+
+ # print('Run correct_comtask.py now')
+ # lancer = [dico['Paths']['Python3_path']+'\python.exe', os.path.dirname(os.path.realpath(__file__)) +'/correct_comtask.py']
+ # proc = subprocess.Popen(lancer,creationflags=subprocess_flags)
+ # proc.poll()
+ # proc.wait()
+ # print('after correct_comtask.py')
+ # var3 = subprocess.call(['taskkill', '/F', '/T', '/PID', str(proc.pid)], stdout=subprocess.PIPE)
cmd = 'WMIC PROCESS get Caption,Processid'
proc4 = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
#!/usr/bin/python3
########################################################################################################################
-# ojectif de ce module: extraire des donnes pour afficher dans l'interface Eficas. Subprocess dans la fonction PFExtractGeneratorLoadLineandTransfoDico
+# Ojectif de ce module: extraire des donnes pour afficher dans l'interface Eficas.
+# Subprocess dans la fonction PFExtractGeneratorLoadLineandTransfoDico
########################################################################################################################
import pdb
from math import *
NoBreakersandSwitches = True
+"""
+BLOC 15-16
+Ces deux chemins ci-dessous sont des chemins par défaut. Ils sont remplacés lorsque la fonction PFExtractData est appelée à la ligne 591
+"""
NetworkFile = r'C:\Logiciels DER\PSEN_MERGED_V6\Example\Corse PF\Modele_Corse_PSEN_peak_good.pfd'
-PF_PATH = r'C:\Program Files\DIgSILENT\PowerFactory 2016 SP2\Python\3.5'
+PF_PATH = r'C:\Program Files\DIgSILENT\PowerFactory 2016 SP2\Python\3.5'
def PFExtractData(NetworkFile, PF_PATH):
#PSEN sous PowerFactory, extract data from Gen, Load, Bus, Branch, Transfo, Motor
print (NetworkFile)
print (PF_PATH)
+
+ """
+ BLOC 33-35
+ Permet de séparer le chemin du répertoire et le nom du .pfd
+ Permet également de renseigner le chemin du logiciel PowerFactory et de le stocker dans un dictionnaire sous la key 'Path'
+ """
(filepath, filename) = os.path.split(NetworkFile)
sys.path.append(PF_PATH)
os.environ['PATH'] += ';' + os.path.dirname(os.path.dirname(PF_PATH)) + ';'
-
- import powerfactory
+
import powerfactory as pf
+ """
+ BLOC 43-60
+ Creation d'un objet dans PowerFactory afin d'importer le .pfd puis de l'activer
+ """
app = pf.GetApplication()
user = app.GetCurrentUser()
ComImp = user.CreateObject('ComPFDIMPORT') # Object to import pfd file
ComImp.g_file = NetworkFile
ComImp.g_target = user # Project is imported under the user account
err = ComImp.Execute() # Execute command starts the import process
+
ComImp.Delete()
app.SetWriteCacheEnabled(0) # Enable consistency check
bus = []
for noeud in tous:
- # if ((noeud.iUsage == 0) and (noeud.outserv == 0)): # Eliminer tous les noeuds out-service
- # if ((noeud.iUsage == 0)or(noeud.iUsage == 1)) :
bus.append(noeud)
noeuds = sorted(bus, key=lambda x: x.cStatName)
aa = [ii, noeuds[ii].uknom, busname, noeuds[ii].GetBusType()] # [numero,nominal KV,busname]
buses.append(aa)
+ """
+ BLOC 86-589
+
+ """
+
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Loads data (busname, ID, extended busname, busnumber, P, Q)
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
LoadDico = {}
"""
loadname = "C" + loadname
loadname=loadname+'_Lo'+str(idload)
-
- # p = load.plini #CM
- # q = load.qlini #CM
+
p = load.plini_a
q = load.qlini_a
loadname = "C" + loadname
loadname=loadname+'_Lo'+str(idload)
-
- #p = load.plini #CM
- #q = load.qlini #CM
+
p = load.plini_a
s = load.slini_a
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Generators data (busname, ID, extended busname, busnumber, P, Q, Pmax, Pmin, Qmax, Qmin)
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
MachineDico = {}
"""
break
idplant = plant.loc_name #plant.ngnum
- #p = plant.pgini #CM
- #q = plant.qgini #CM
p = plant.pgini_a
q = plant.qgini_a
pmax = plant.Pmax_uc
qmin = plant.cQ_min
machinename = busname + '_' + 'syn_' + 'Gr_' + str(idplant) # Synchronous generators
- #machinename = machinename.replace("Generator", "gen")
machinename = cleanName(machinename)
- #machinename = machinename + '_' +'syn_' + 'Gr_' + str(idplant) # Synchronous generators
if machinename[0] == "_":
machinename = "G" + machinename
break
idplant = plant.loc_name
- #p = plant.pgini #CM
- #q = plant.qgini #CM
p = plant.pgini_a
q = plant.qgini_a
pmax = plant.Pmax_uc
machinename = busname + '_' + 'asyn_' + 'Gr_' + str(idplant) # Asynchronous generators
machinename = cleanName(machinename)
- # machinename = machinename + '_' +'asyn_' + 'Gr_' + str(idplant) # Asynchronous generators
if machinename[0] == "_":
machinename = "G" + machinename
-
MachineDico[machinename] = {}
MachineDico[machinename]['NAME'] = plant.loc_name
MachineDico[machinename]['ID'] = idplant
break
idplant = plant.loc_name
- #p = plant.pgini #CM
- #q = plant.qgini #CM
p = plant.pgini_a
q = plant.qgini_a
pmax = plant.Pmax_uc
busnumber = ii
break
- idplant = plant.loc_name # plant.ngnum
- #p = plant.pgini #CM
- #q = plant.qgini #CM
+ idplant = plant.loc_name
p = plant.pgini_a
q = plant.qgini_a
pmax = plant.Pmax_uc
qmax = plant.cQ_max
qmin = plant.cQ_min
- machinename = busname + '_' + 'pv_' + 'Gr_' + str(idplant) # PV generators
+ machinename = busname + '_' + 'pv_' + 'Gr_' + str(idplant)
machinename = cleanName(machinename)
if machinename[0] == "_":
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Motors data (busname, ID, extended busname, busnumber, P, Q, Pmax, Pmin, Qmax, Qmin)
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
MotorDico = {} # [Bus name, machine ID, extended bus name, bus number]
"""
busnumber = ii
break
- idplant = plant.loc_name #plant.ngnum
- #p = plant.pgini #CM
- #q = plant.qgini #CM
+ idplant = plant.loc_name
p = plant.pgini_a
q = plant.qgini_a
pmax = plant.Pmax_uc
qmax = plant.cQ_max
qmin = plant.cQ_min
- machinename = busname + '_' + 'syn_' + 'Mo_' + str(idplant) # Synchronous motors
+ machinename = busname + '_' + 'syn_' + 'Mo_' + str(idplant)
machinename = cleanName(machinename)
if machinename[0] == "_":
busnumber = ii
break
- idplant = plant.loc_name #plant.ngnum
- #p = plant.pgini #CM
- #q = plant.qgini #CM
+ idplant = plant.loc_name
p = plant.pgini_a
q = plant.qgini_a
- #pmax = plant.Pmax_uc
pmax = plant.P_max
pmin = plant.Pmin_uc
qmax = plant.cQ_max
qmin = plant.cQ_min
- machinename = busname + '_' + 'asyn_' + 'Mo_' + str(idplant) # Asynchronous motors
+ machinename = busname + '_' + 'asyn_' + 'Mo_' + str(idplant)
machinename = cleanName(machinename)
if machinename[0] == "_":
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Lines data (busname1, busname2, ID, extended bus name 1, extended bus name 2, bus number 1, bus number 2)
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
LineDico = {}
tous = []
tobus_KV = buses[ii][1]
break
- idline = line.loc_name # line.nlnum
+ idline = line.loc_name
linename = frombus_name+'_'+tobus_name+'_'+idline+'_Li'
linename = cleanName(linename)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Transfo data (Bus name 1, Bus name 2, machine ID, extended bus name 1, extended bus name 2, bus number 1, bus number 2)
- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+ """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TfoDico = {} # [tranlinename, Bus name 1, Bus name 2, machine ID, extended bus name 1, extended bus name 2, bus number 1, bus number 2]
"""
tous.extend(grid.obj_id.GetContents( '*.ElmTr2', 1))
for tfo in tous:
- #tfosname = tfo.loc_name
- id_tfo = tfo.loc_name # tfo.ntnum
+ id_tfo = tfo.loc_name
frombus_name = tfo.bushv.cBusBar.cStatName
tobus_name = tfo.buslv.cBusBar.cStatName
tous.extend(grid.obj_id.GetContents( '*.ElmTr3', 1))
for tfo in tous:
- #tfosname = tfo.loc_name
- id_tfo = tfo.loc_name #tfo.nt3nm
+ id_tfo = tfo.loc_name
frombus_name = tfo.bushv.cBusBar.cStatName
tobus_name = tfo.busmv.cBusBar.cStatName
def INCLUDE(self, PF_path, pfd_file,Python3_path, **args):
"""
- Fonction sd_prod pour la macro INCLUDE
+ Fonction sd_prod pour la macro INCLUDE
"""
if pfd_file==None: return
if hasattr(self,'old_context_fichier_init' ):
toClean=True
for concept in self.old_context_fichier_init.values():
- #self.jdc.delete_concept(concept)
listeADeTruire.append(concept)
self.jdc_aux=None
self.contexte_fichier_init={}
- #self.reevalue_sd_jdc()
self.jdc.reset_context()
self.fichier_ini=pfd_file
try:
print('before PFExtractGeneratorLoadLineandTransfoDico')
- # MachineDico, LoadDico, LineDico, TransfoDico, MotorDico = PFExtractGeneratorLoadLineandTransfoDico(pfd_file, PF_path,Python3_path)
MachineDico, LoadDico, LineDico, TransfoDico, MotorDico = PFExtractGeneratorLoadLineandTransfoDico(pfd_file, PF_path,Python3_path)
-
print('after extract')
except :
if self.jdc.appli is not None:
-Starting time: 0.002446; Monte Carlo Size : 10.000000; Starting time: 0.293662; Monte Carlo Size : 10.000000; Starting time: 0.001656; Monte Carlo Size : 10.000000; Starting time: 0.249637; Monte Carlo Size : 2.000000; Starting time: 0.001503; Monte Carlo Size : 3.000000; Starting time: 0.001179; Monte Carlo Size : 10.000000; Starting time: 0.001271; Monte Carlo Size : 10.000000; Starting time: 0.300779; Monte Carlo Size : 10.000000; Starting time: 0.001302; Monte Carlo Size : 10.000000; Starting time: 0.237096; Monte Carlo Size : 750.000000; Starting time: 0.304474; Monte Carlo Size : 10.000000; Starting time: 0.238076; Monte Carlo Size : 10.000000; Starting time: 0.185095; Monte Carlo Size : 10.000000; Starting time: 0.225074; Monte Carlo Size : 10.000000; Starting time: 0.006847; Monte Carlo Size : 10.000000; Starting time: 0.008662; Monte Carlo Size : 10.000000; Starting time: 0.281258; Monte Carlo Size : 10.000000; Starting time: 0.006176; Monte Carlo Size : 10.000000; Starting time: 0.320835; Monte Carlo Size : 10.000000; Starting time: 0.008815; Monte Carlo Size : 10.000000; Starting time: 0.005938; Monte Carlo Size : 10.000000; Starting time: 0.006103; Monte Carlo Size : 20.000000; Starting time: 0.008669; Monte Carlo Size : 20.000000;
\ No newline at end of file
+Starting time: 0.002446; Monte Carlo Size : 10.000000; Starting time: 0.293662; Monte Carlo Size : 10.000000; Starting time: 0.001656; Monte Carlo Size : 10.000000; Starting time: 0.249637; Monte Carlo Size : 2.000000; Starting time: 0.001503; Monte Carlo Size : 3.000000; Starting time: 0.001179; Monte Carlo Size : 10.000000; Starting time: 0.001271; Monte Carlo Size : 10.000000; Starting time: 0.300779; Monte Carlo Size : 10.000000; Starting time: 0.001302; Monte Carlo Size : 10.000000; Starting time: 0.237096; Monte Carlo Size : 750.000000; Starting time: 0.304474; Monte Carlo Size : 10.000000; Starting time: 0.238076; Monte Carlo Size : 10.000000; Starting time: 0.185095; Monte Carlo Size : 10.000000; Starting time: 0.225074; Monte Carlo Size : 10.000000; Starting time: 0.006847; Monte Carlo Size : 10.000000; Starting time: 0.008662; Monte Carlo Size : 10.000000; Starting time: 0.281258; Monte Carlo Size : 10.000000; Starting time: 0.006176; Monte Carlo Size : 10.000000; Starting time: 0.320835; Monte Carlo Size : 10.000000; Starting time: 0.008815; Monte Carlo Size : 10.000000; Starting time: 0.005938; Monte Carlo Size : 10.000000; Starting time: 0.006103; Monte Carlo Size : 20.000000; Starting time: 0.008669; Monte Carlo Size : 20.000000; Starting time: 0.388910; Monte Carlo Size : 10.000000; Starting time: 0.006206; Monte Carlo Size : 10.000000; Starting time: 0.089172; Monte Carlo Size : 10.000000; Starting time: 0.008701; Monte Carlo Size : 10.000000; Starting time: 0.635387; Monte Carlo Size : 10.000000; Starting time: 0.161781; Monte Carlo Size : 10.000000; Starting time: 0.006213; Monte Carlo Size : 10.000000; Starting time: 0.005910; Monte Carlo Size : 10.000000; Starting time: 0.007659; Monte Carlo Size : 10.000000; Starting time: 0.007824; Monte Carlo Size : 10.000000; Starting time: 0.006322; Monte Carlo Size : 5.000000; Starting time: 0.005984; Monte Carlo Size : 6.000000; Starting time: 0.005932; Monte Carlo Size : 6.000000; Starting time: 0.005939; Monte Carlo Size : 6.000000; Starting time: 0.006617; Monte Carlo Size : 6.000000; Starting time: 0.006071; Monte Carlo Size : 6.000000; Starting time: 0.094942; Monte Carlo Size : 6.000000; Starting time: 0.006779; Monte Carlo Size : 6.000000; Starting time: 0.005969; Monte Carlo Size : 6.000000; Starting time: 0.012818; Monte Carlo Size : 6.000000; Starting time: 0.009155; Monte Carlo Size : 6.000000; Starting time: 0.022845; Monte Carlo Size : 6.000000; Starting time: 0.154829; Monte Carlo Size : 10.000000; Starting time: 0.319019; Monte Carlo Size : 6.000000; Starting time: 0.692187; Monte Carlo Size : 6.000000; Starting time: 0.005742; Monte Carlo Size : 6.000000; Starting time: 0.006014; Monte Carlo Size : 6.000000; Starting time: 0.189341; Monte Carlo Size : 6.000000; Starting time: 0.258081; Monte Carlo Size : 6.000000; Starting time: 0.006084; Monte Carlo Size : 6.000000; Starting time: 0.887862; Monte Carlo Size : 6.000000; Starting time: 0.005848; Monte Carlo Size : 6.000000; Starting time: 0.009089; Monte Carlo Size : 6.000000; Starting time: 0.010174; Monte Carlo Size : 6.000000; Starting time: 0.005965; Monte Carlo Size : 6.000000; Starting time: 0.144982; Monte Carlo Size : 5.000000; Starting time: 0.001871; Monte Carlo Size : 5.000000; Starting time: 0.297407; Monte Carlo Size : 5.000000; Starting time: 0.001171; Monte Carlo Size : 10.000000; Starting time: 0.001427; Monte Carlo Size : 10.000000; Starting time: 0.004446; Monte Carlo Size : 10.000000; Starting time: 0.003990; Monte Carlo Size : 10.000000;
\ No newline at end of file
-C:\Users\H92579\Desktop\Ile Maurice_bug_nbScenario/Maurice_2017_CoalSeasonJour.pfd
-C:\Program Files\DIgSILENT\PowerFactory 2017 SP1\Python/3.5
-C:\Python35
+C:/Users/H92579/Documents/Formation_PF/ex_PFD/Modele_Corse_PSEN_peak_good.pfd
+C:/Program Files/DIgSILENT/PowerFactory 2017 SP1/Python/3.5
+C:/Python35
-C:\Users\H92579\Desktop\Ile Maurice_bug_nbScenario/N_20190319_09h16m37\package0_N_20190319_09h16m37
+C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33\package0_N_20190529_09h33m33
def cleanName (name) :
# ---------------------
# remplace les caracteres speciaux definis dans dictSpecialCharacters
-# de la chaine name passe en argument et retourne une chaine nettoyee
+# de la chaine name passee en argument et retourne une chaine nettoyee
# prefixe la chaine d un _ si la chaine commence par un chiffre
newName = name
with open('Data_for_interface', 'rb') as fichier:#prendre les donnees dans fichier pickle
mon_depickler = pickle.Unpickler(fichier)
data_file = mon_depickler.load()
- # def convert(data):#traitement Unicode
- # # if isinstance(data, basestring):
- # if isinstance(data, str):
- # return str(data)
- # elif isinstance(data, collections.Mapping):
- # return dict(map(convert, data.iteritems()))
- # elif isinstance(data, collections.Iterable):
- # return type(data)(map(convert, data))
- # else:
- # return data
- # data = convert(data_file)
- #####################################
+
def convert_keys_to_string(dictionary):
"""Recursively converts dictionary keys to strings."""
if not isinstance(dictionary, dict):
return dictionary
return dict((str(k), convert_keys_to_string(v)) for k, v in dictionary.items())
- data = convert_keys_to_string(data_file)
- BusDico=data['BusDico']
+ data = convert_keys_to_string(data_file)
+ BusDico = data['BusDico']
MachineDico = data['MachineDico']
- LoadDico = data['LoadDico']
- LineDico = data['LineDico']
- TfoDico = data['TransfoDico']
+ LoadDico = data['LoadDico']
+ LineDico = data['LineDico']
+ TfoDico = data['TransfoDico']
# MotorDico = data['MotorDico']
bus_kv=[]
for bus in BusDico:
bus_kv.append(bus[1])
- Options.BusBase=bus_kv
+
+ Options.BusBase = bus_kv
+
bus_list={}
for bus in BusDico:
bus_list[bus[2]]=bus[1]
Options.BusBaseList=bus_list
BusList = []
+
for item in bus_kv:
if item not in BusList:
BusList.append(item)
BusList = sorted(BusList)
+
for line in LineDico.keys():
kv = bus_list[LineDico[line]['FROMNAME']]
Options.LinesBaseList[line]=kv
__str__=info
-JdC = JDC_CATA ( code = 'PSEN',
+JdC = JDC_CATA ( code = 'PSEN_N1',
execmodul = None,
regles = ( AU_MOINS_UN ( 'CASE_SELECTION', 'CONTINGENCY_SELECTION' ),
PRESENT_PRESENT ( 'CONTINGENCY_SELECTION','CONTINGENCY_OPTIONS' ),
--- /dev/null
+# -*- coding: iso-8859-1 -*-
+# Copyright (C) 2007-2013 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# --------------------------------------------------
+# debut entete
+# --------------------------------------------------
+
+#from Accas import ASSD, JDC_CATA, AU_MOINS_UN, PROC, SIMP, FACT, OPER, MACRO, BLOC, A_VALIDATOR
+from Accas import *
+import opsPSEN_N1_PF
+import pn
+#
+#class loi ( ASSD ) : pass
+#class variable ( ASSD ) : pass
+class sd_charge ( ASSD ) : pass
+class sd_generateur ( ASSD ) : pass
+class sd_ligne ( ASSD ) : pass
+class sd_transfo ( ASSD ) : pass
+class sd_moteur ( ASSD ) : pass
+#
+
+# import types
+class Tuple:
+ def __init__(self,ntuple):
+ self.ntuple=ntuple
+
+ def __convert__(self,valeur):
+ import types
+ if type(valeur) == types.StringType:
+ return None
+ if len(valeur) != self.ntuple:
+ return None
+ return valeur
+
+ def info(self):
+ return "Tuple de %s elements" % self.ntuple
+
+ __repr__=info
+ __str__=info
+
+JdC = JDC_CATA ( code = 'PSEN',
+ execmodul = None,
+ regles = ( AU_MOINS_UN ( 'CASE_SELECTION', 'CONTINGENCY_PROCESSING' ),
+ AU_MOINS_UN ( 'CONTINGENCY_SELECTION','N_PROCESSING_OPTIONS','CONTINGENCY_PROCESSING' ),
+ PRESENT_PRESENT ( 'CONTINGENCY_SELECTION','CONTINGENCY_OPTIONS' ),
+ PRESENT_PRESENT ( 'CONTINGENCY_PROCESSING','CONTINGENCY_OPTIONS' ),
+ # AU_MOINS_UN ( 'SIMULATION' ),
+ # AU_PLUS_UN ( 'PSSE_PARAMETERS' ),
+ AU_PLUS_UN ( 'CASE_SELECTION' ),
+ AU_PLUS_UN ( 'CONTINGENCY_OPTIONS' ),
+ AU_PLUS_UN ( 'CONTINGENCY_SELECTION' ),
+ AU_PLUS_UN ( 'CONTINGENCY_PROCESSING' ),
+ AU_PLUS_UN ( 'N_PROCESSING_OPTIONS' ),
+ # AU_PLUS_UN ( 'N_1_LINES' ),
+ # AU_PLUS_UN ( 'N_1_LOADS' ),
+ # AU_PLUS_UN ( 'N_1_TRANSFORMERS' ),
+
+ ),
+ ) # Fin JDC_CATA
+
+MODIFICATION_CATALOGUE = MACRO ( nom = "MODIFICATION_CATALOGUE",
+ sd_prod = pn.modification_catalogue,
+ op_init= pn.modification_catalogue2,
+ op=None,
+ UIinfo={"groupes":("CACHE")},
+ Fonction=SIMP(statut='o', typ='TXM', into=['ajoutDefinitionMC']),
+ Etape=SIMP(statut='o', typ='TXM',),
+ Genea=SIMP(statut='o', typ='TXM', min=0, max='**'),
+ NomSIMP=SIMP(statut='o', typ='TXM',),
+ TypeSIMP=SIMP(statut='o', typ='TXM',),
+ PhraseArguments=SIMP(statut='o', typ='TXM',),)
+
+
+# --------------------------------------------------
+# fin entete
+# --------------------------------------------------
+## TODO : RUN
+CASE_SELECTION = MACRO ( nom = "CASE_SELECTION",
+ sd_prod = opsPSEN_N1_PF.INCLUDE,
+ op_init = opsPSEN_N1_PF.INCLUDE_context,
+ fichier_ini = 1,
+ op = None,
+ fr = "Sélectionnez les cas à analyser",
+ ang = 'Select the cases to analyze',
+ PF_path = SIMP(statut="o",typ='Repertoire',defaut=r'C:\Program Files\DIgSILENT\PowerFactory 2017 SP1\Python\3.5'),
+ Python3_path=SIMP(statut="o",typ='Repertoire',defaut=r'C:\Python35'),
+ PSEN_results_folder = SIMP(statut="o", typ="Repertoire"),
+ PSEN_results_csvfile = SIMP(statut='o', typ = ('Fichier', 'CSV file (*.csv);;All Files (*)',),),
+ PSEN_results_csvfile_cleaned = SIMP ( statut = "o",typ=bool,defaut=False,),
+ DecimalSeparator = SIMP(statut="o",typ='TXM',into=[',','.'],defaut='.',),
+
+ BusesList = SIMP(statut = 'f', typ = 'R', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
+ LinesList = SIMP(statut = 'f', typ = 'R', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
+ TransformersList = SIMP(statut = 'f', typ = 'TXM', min = 0, max = '**', defaut = (), homo = 'SansOrdreNiDoublon'),
+ MaxDepth = SIMP(statut = 'o', typ = 'I', defaut = 5),
+ OutputNewCsv = SIMP ( statut = "o",typ=bool,defaut=False,),
+ NewCsvFile = SIMP(statut='o',typ='TXM', defaut='CleanedData.csv'),
+ )
+N_PROCESSING_OPTIONS = PROC ( nom = 'N_PROCESSING_OPTIONS',
+ op = None,
+ ang = "Select whether the program should be displaying data about the different categories.\nThe values displayed will be the min, max, and mean of each item, plus a chart.",
+ Output_bus_values = SIMP(statut = 'o', typ = bool, defaut = True),
+ Output_lines_values = SIMP(statut = 'o', typ = bool, defaut = True),
+ Output_transformer_values = SIMP(statut = 'o', typ = bool, defaut = True),
+ Threshold_selection_for_the_treated_cases = FACT(
+ statut = 'f',
+ Branches = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
+ Transformers = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
+ High_voltage = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
+ Low_voltage = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
+ ),
+ )
+
+
+Ordre_Des_Commandes = ('CASE_SELECTION' , 'N_PROCESSING_OPTIONS' )
+Classement_Commandes_Ds_Arbre = ('CASE_SELECTION' , 'N_PROCESSING_OPTIONS')
+
+TEXTE_NEW_JDC = "CASE_SELECTION(); N_PROCESSING_OPTIONS(); "
\ No newline at end of file
)
-N_PROCESSING_OPTIONS = PROC ( nom = 'N_PROCESSING_OPTIONS',
- op = None,
- ang = "Select whether the program should be displaying data about the different categories.\nThe values displayed will be the min, max, and mean of each item, plus a chart.",
- Output_bus_values = SIMP(statut = 'o', typ = bool, defaut = True),
- Output_lines_values = SIMP(statut = 'o', typ = bool, defaut = True),
- Output_transformer_values = SIMP(statut = 'o', typ = bool, defaut = True),
- Threshold_selection_for_the_treated_cases = FACT(
- statut = 'f',
- Branches = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
- Transformers = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
- High_voltage = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
- Low_voltage = SIMP(statut="o",typ=Tuple(3),defaut=(0,0,0),validators=VerifTypeTuple(('R','R','R'),),),
- ),
- )
-
-
CONTINGENCY_OPTIONS = PROC (nom = 'CONTINGENCY_OPTIONS',
op = None,
)
-Ordre_Des_Commandes = ('CASE_SELECTION' , 'N_PROCESSING_OPTIONS' , 'CONTINGENCY_SELECTION', 'CONTINGENCY_OPTIONS' ,'CONTINGENCY_PROCESSING',)
-Classement_Commandes_Ds_Arbre = ('CASE_SELECTION' , 'N_PROCESSING_OPTIONS' , 'CONTINGENCY_SELECTION', 'CONTINGENCY_OPTIONS' ,'CONTINGENCY_PROCESSING',)
+Ordre_Des_Commandes = ('CASE_SELECTION' , 'CONTINGENCY_SELECTION' , 'CONTINGENCY_OPTIONS' , 'CONTINGENCY_PROCESSING')
+Classement_Commandes_Ds_Arbre = ('CASE_SELECTION' , 'CONTINGENCY_SELECTION' , 'CONTINGENCY_OPTIONS' , 'CONTINGENCY_PROCESSING')
+
+TEXTE_NEW_JDC = "CASE_SELECTION(); CONTINGENCY_SELECTION(); CONTINGENCY_OPTIONS(); CONTINGENCY_PROCESSING(); "
\ No newline at end of file
import win32com.client as win32
import os
+from dicoN1 import Dico
import Options
import pdb
# Add a chart tab and draw it with the values of the previously written sheet
chart = excel.Charts.Add()
try:
- chart.ChartType =74 # constants.xlXYScatterSmooth
+ chart.ChartType =74 # Definit le type de graphique
except:
pass
- chart.SeriesCollection(1).Name = 'Average'
- chart.SeriesCollection(2).Name = 'Min'
- chart.SeriesCollection(3).Name = 'Max'
+ markersize = 4 # Definit la taille des markers
+ markerstyle = 8 # Definit le style des marqueurs (8 = rond)
+
+ chart.SeriesCollection(1).Name = 'Average'
+ chart.SeriesCollection(1).MarkerStyle = markerstyle # Applique la taille des markers
+ chart.SeriesCollection(1).MarkerSize = markersize # Applique le style des marqueurs
+
+ chart.SeriesCollection(2).Name = 'Min'
+ chart.SeriesCollection(2).MarkerStyle = markerstyle # Applique la taille des markers
+ chart.SeriesCollection(2).MarkerSize = markersize # Applique le style des marqueurs
- #chart.Name = 'Average ' + sheet.Name + ' load'
+ chart.SeriesCollection(3).Name = 'Max'
+ chart.SeriesCollection(3).MarkerStyle = markerstyle # Applique la taille des markers
+ chart.SeriesCollection(3).MarkerSize = markersize # Applique le style des marqueurs
+
if sheet.Name != "Bus":
chart.Name = 'Average ' + sheet.Name + ' load'
+
+ chart.HasTitle = True # Cree le champs de titre du graphe
+ chart.ChartTitle.Text = chart.Name # Definit le titre du graphe
+
+ chart.Axes(1).HasTitle = True # Cree le champs de titre de l'axe des abscisses
+ chart.Axes(1).AxisTitle.Caption = "Case" # Definit le titre de l'axe des abscisses
+
+ chart.Axes(2).HasTitle = True # Cree le champs de titre de l'axe des ordonnees
+ chart.Axes(2).AxisTitle.Caption = "Loading (%)" # Definit le titre de l'axe des ordonnees
+
else:
chart.Name = 'Average ' + sheet.Name + ' voltage'
+
+ chart.HasTitle = True # Cree le champs de titre du graphe
+ chart.ChartTitle.Text = chart.Name # Definit le titre du graphe
+
+ chart.Axes(1).HasTitle = True # Cree le champs de titre de l'axe des abscisses
+ chart.Axes(1).AxisTitle.Caption = "Case" # Definit le titre de l'axe des abscisses
+
+ chart.Axes(2).HasTitle = True # Cree le champs de titre de l'axe des ordonnees
+ chart.Axes(2).AxisTitle.Caption = "Voltage (p.u.)" # Definit le titre de l'axe des ordonnees
def outputChart(wb):
# Sorting data by mean, to draw readable charts
sheet.Cells(1, 4).Value = 'Case id'
for i in range(len(Options.TransfoStorage)):
sheet.Cells(i + 2, 4).Value = Options.TransfoStorage[i][3]
+
+ """
+ BLOC 122-142
+ On traite les cas ou l'utilisateur n'a pas selectionnne l'option Threshold. Cette information se retrouve dans le Dico présent dans le script dicoN1.py
+ On distingue 2 cas, l'utilisateur a deja lance une Post Calculation Analysis precedemment ou non
+
+ BLOC 146-166
+ Inversement, on traite les cas ou l'utilisateur a selectionnne l'option Threshold.
+ On distingue 2 cas, l'utilisateur a deja lance une Post Calculation Analysis precedemment ou non
+ """
+
+ if len(Dico['N_PROCESSING_OPTIONS'])==3: # L'utilisateur n'a pas selectionne l'option Threshold dans PSEN
+
+ if not os.path.isfile(os.path.join(Options.FolderList[0],'N_Processed.xlsx')): # Premiere simulation de l'utilisateur, il n'y pas de fichier N_Processed deja existant
+
+ fileName = Options.FolderList[0] + '/N_Processed.xlsx'
+
+ fileW = open(Options.FolderList[0]+'/iteration.txt', 'w') # On crée un fichier externe qui compte le nombre de Data Processing déjà effectué par l'utilisateur
+ fileW.write(str(1))
+ fileW.close()
- fileName = os.path.join(Options.FolderList[0], 'N_Processed.xlsx' )
+ else: # N-ieme simulation de l'utilisateur, il y a deja un fichier N_Processed existant
+
+ fileR = open (Options.FolderList[0]+'/iteration.txt', 'r') # On lit le fichier iteration.txt crée lors du premier Data Processing
+ compteur = int(fileR.read())
+ fileR.close()
+
+ fileName = Options.FolderList[0] + '/N_Processed_' + str(compteur) + '.xlsx'
+
+ fileW = open(Options.FolderList[0]+'/iteration.txt', 'w') # On incrémente le fichier iteration.txt crée lors du premier Data Processing
+ fileW.write(str(compteur + 1))
+ fileW.close()
+
+
+
+ else: # L'utilisateur a selectionne l'option Threshold dans PSEN
+
+ if not os.path.isfile(os.path.join(Options.FolderList[0],'N_Processed_Threshold.xlsx')): # Premiere simulation de l'utilisateur, il n'y pas de fichier N_Processed deja existant
+
+ fileName = Options.FolderList[0] + '/N_Processed_Threshold.xlsx'
+
+ fileW = open(Options.FolderList[0]+'/iteration_Threshold.txt', 'w')
+ fileW.write(str(1))
+ fileW.close()
+
+ else:
+
+ fileR = open (Options.FolderList[0]+'/iteration_Threshold.txt', 'r') # N-ieme simulation de l'utilisateur, il y a deja un fichier N_Processed existant
+ compteur_Threshold = int(fileR.read())
+ fileR.close()
+
+ fileName = Options.FolderList[0] + '/N_Processed_Threshold_' + str(compteur_Threshold) + '.xlsx'
+
+ fileW = open(Options.FolderList[0]+'/iteration_Threshold.txt', 'w')
+ fileW.write(str(compteur_Threshold + 1))
+ fileW.close()
+
+
fileName = fileName.replace("/","\\")
wb.SaveAs(fileName)
excel.Application.Quit()
## processedData : tableau de retour
## name : nom du fichier csv
-
-
- if ' flows ' in name.lower() and ' loadshed ' not in name.lower() and ' voltage ' not in name.lower():
- column_start = 4
- elif ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- column_start = 6
- elif ' loadshed ' in name.lower() and ' flows ' not in name.lower() and ' voltage ' not in name.lower():
- column_start = 2
-
+ if ' flows ' in name.lower() and ' loadshed ' not in name.lower() and ' voltage ' not in name.lower():
+ column_start = 4
+ elif ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ column_start = 6
+ elif ' loadshed ' in name.lower() and ' flows ' not in name.lower() and ' voltage ' not in name.lower():
+ column_start = 2
+
# Remove worthless columns, such as "None" or "Bus"
- if 'None' in Options.selectedDoubleCol[str(name)]:
- Options.selectedDoubleCol[str(name)].remove('None')
- if 'None' in Options.selectedDoubleRow[str(name)]:
- Options.selectedDoubleRow[str(name)].remove('None')
- if 'Contingency' in Options.selectedDoubleCol[str(name)]:
- Options.selectedDoubleCol[str(name)].remove('Contingency')
- if 'Branch' in Options.selectedDoubleRow[str(name)]:
- Options.selectedDoubleRow[str(name)].remove('Branch')
- if 'Bus' in Options.selectedDoubleRow[str(name)]:
- Options.selectedDoubleRow[str(name)].remove('Bus')
+ if 'None' in Options.selectedDoubleCol[str(name)]:
+ Options.selectedDoubleCol[str(name)].remove('None')
+ if 'None' in Options.selectedDoubleRow[str(name)]:
+ Options.selectedDoubleRow[str(name)].remove('None')
+ if 'Contingency' in Options.selectedDoubleCol[str(name)]:
+ Options.selectedDoubleCol[str(name)].remove('Contingency')
+ if 'Branch' in Options.selectedDoubleRow[str(name)]:
+ Options.selectedDoubleRow[str(name)].remove('Branch')
+ if 'Bus' in Options.selectedDoubleRow[str(name)]:
+ Options.selectedDoubleRow[str(name)].remove('Bus')
+
# Getting the max and min of each category to calculate the color
- if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
- Val_min = Options.Vmin[0]
- Val_max = Options.Vmax[0]
- elif ' flows ' in name.lower() and ' loadshed ' not in name.lower() and ' voltage ' not in name.lower():
- Val_min = 0
- elif ' loadshed ' in name.lower() and ' flows ' not in name.lower() and ' voltage ' not in name.lower():
- Val_min= -10000000
- Val_max = 0
-
- liste_de_bus = Options.selectedDoubleCol[str(name)]
- liste_de_contingences = Options.selectedDoubleRow[str(name)]
-
- processedData[0].append('Component / Contingency')
- for bus in liste_de_bus:
- processedData[0].append(bus)
-
- for contingency in liste_de_contingences:
- liste = [contingency]
- for n in range(len(liste_de_bus)):
- liste.append('')
- processedData.append(liste)
-
- for ligne in data:
- if ligne[0] not in liste_de_bus:
- continue
- if ligne[1] not in liste_de_contingences:
- continue
- j = liste_de_bus.index(ligne[0])+1
- i = liste_de_contingences.index(ligne[1])+1
+ if ' voltage ' in name.lower() and ' loadshed ' not in name.lower() and ' flows ' not in name.lower():
+ Val_min = Options.Vmin[0]
+ Val_max = Options.Vmax[0]
+ elif ' flows ' in name.lower() and ' loadshed ' not in name.lower() and ' voltage ' not in name.lower():
+ Val_min = 0
+ elif ' loadshed ' in name.lower() and ' flows ' not in name.lower() and ' voltage ' not in name.lower():
+ Val_min= -10000000
+ Val_max = 0
+
+ liste_de_bus = Options.selectedDoubleCol[str(name)]
+ liste_de_contingences = Options.selectedDoubleRow[str(name)]
+
+ processedData[0].append('Component / Contingency')
+
+ for bus in liste_de_bus:
+ processedData[0].append(bus)
+ print('ok1')
+ for contingency in liste_de_contingences:
+ print('ok2')
+ liste = [contingency]
+ for n in range(len(liste_de_bus)):
+ print('ok3')
+ liste.append('')
+ processedData.append(liste)
+ print('ok4')
+
+ print(processedData)
+ print(data)
+ print(data[0])
+ for ligne in data:
+ if ligne[0] not in liste_de_bus:
+ continue
+ if ligne[1] not in liste_de_contingences:
+ continue
+ j = liste_de_bus.index(ligne[0])+1
+ i = liste_de_contingences.index(ligne[1])+1
- processedData[i][j]=ligne[column_start]
-
- return processedData
\ No newline at end of file
+ processedData[i][j]=ligne[column_start]
+
+
+ return processedData
\ No newline at end of file
-PSSE_PATH = [r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN"]
+PSSE_PATH = [r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN"]
PSSPY_PATH = [r"C:\Program Files (x86)\PTI\PSSE33\PSSBIN"]
# Variables for the N-1 processing
-selectedDoubleRow = {} # Dict of all items selected for a double entry array. key = sheet name, value = row
-selectedDoubleCol = {} # Dict of all items selected for a double entry array. key = sheet name, value = column
+selectedDoubleRow = {} # Dict of all items selected for a double entry array. key = sheet name, value = row
+selectedDoubleCol = {} # Dict of all items selected for a double entry array. key = sheet name, value = column
-sheets = [] # List of the input's sheet names
-lines = {} # List of the input's lines
-lines2 = {} # List of the input's lines - second cell
+sheets = [] # List of the input's sheet names
+lines = {} # List of the input's lines
+lines2 = {} # List of the input's lines - second cell
# N-k variables
-CustomContingencies = [] # list of lists: each element is a list of the contingencies to treat
-ContFullListWidget = None # Better handling of widget
-SelectedItemsList = None # Same
+CustomContingencies = [] # list of lists: each element is a list of the contingencies to treat
+ContFullListWidget = None # Better handling of widget
+SelectedItemsList = None # Same
-csvPSENresults = ''
-AlreadyCleaned = False #if PSEN results csv file has already been "cleaned" then some of the headers are different.
-csvCleanedFileName = ''
+csvPSENresults = ''
+AlreadyCleaned = False # if PSEN results csv file has already been "cleaned" then some of the headers are different.
+csvCleanedFileName = ''
csvFileName = ''
outFileName = ''
# of Display.py), those parameters are stored as lists, and converted
# to their rightful types at the beginning of the Run.run() function.
-AvgLineLoad = [0]
-AvgLineLoadPercent = [0]
+AvgLineLoad = [0]
+AvgLineLoadPercent = [0]
-AvgTransfoLoad = [0]
+AvgTransfoLoad = [0]
AvgTransfoLoadPercent = [0]
-AvgLowVoltage = [0]
-AvgLowVoltagePercent = [0]
+AvgLowVoltage = [0]
+AvgLowVoltagePercent = [0]
-AvgHighVoltage = [0]
+AvgHighVoltage = [0]
AvgHighVoltagePercent = [0]
-NCasesfromFile = [0]
-CaseNamesfromFile = []
-CsvFiles = []
+NCasesfromFile = [0]
+CaseNamesfromFile = []
+CsvFiles = []
CaseSelectionMode = ['']
-RecursiveDepth = 0
+RecursiveDepth = 0
-OutputNCSV = False
+OutputNCSV = False
-OutputNValues = [True,True,True] # Output the min, max & SD of [Buses, Lines, Transfos]
+OutputNValues = [True,True,True] # Output the min, max & SD of [Buses, Lines, Transfos]
-DecimalSeparator = ["."] #whether the decimal place is denoted with a comma or a point
+DecimalSeparator = ["."] # whether the decimal place is denoted with a comma or a point
# Automatic line detection
-TrueLines = [] # Stores all interesting lines
+TrueLines = [] # Stores all interesting lines
RadialLines = []
-LinesDic = []
+LinesDic = []
+
# Area, Bus, lines and transfo selection by nominal value
-SortByArea = [False]
-BusAreaList = {}
-SelectedAreas = []
-
-BusByNom = [False]
-BusBaseList = {}
-BusBase = []
-SelectedBusBase = []
-
-LinesByNom = [False]
-LinesBaseList = {}
-LinesBase = []
-LineAreaList = {}
-SelectedLinesBase = []
-
-TransfoByNom = [False]
-TransfoBaseList = {}
-TransfoBase = []
-TransfoAreaList = {}
-SelectedTransfoBase = [] # Might not work
+SortByArea = [False]
+BusAreaList = {}
+SelectedAreas = []
+
+BusByNom = [False]
+BusBaseList = {}
+BusBase = []
+SelectedBusBase = []
+
+LinesByNom = [False]
+LinesBaseList = {}
+LinesBase = []
+LineAreaList = {}
+SelectedLinesBase = []
+
+TransfoByNom = [False]
+TransfoBaseList = {}
+TransfoBase = []
+TransfoAreaList = {}
+SelectedTransfoBase = [] # Might not work
+
# Selected items for automatic N-1 processing
-AutoN1Melange = []
-AutoN1Bus = []
-AutoN1Gen = []
-AutoN1Lines = []
+AutoN1Melange = []
+AutoN1Bus = []
+AutoN1Gen = []
+AutoN1Lines = []
AutoN1Transfos = []
AutoN1AreaSort = []
+
# Selected items for automatic N-2 processing
-AutoN2Melange = []
-AutoN2Bus = []
-AutoN2Gen = []
-AutoN2Lines = []
+AutoN2Melange = []
+AutoN2Bus = []
+AutoN2Gen = []
+AutoN2Lines = []
AutoN2Transfos = []
AutoN2AreaSort = []
-GenBaseList = {} # for N-k contingencies
+GenBaseList = {} # for N-k contingencies
+
# Thresholds
-Thresholds = False
-BranchThreshold = [0, 0, 0]
-TransfoThreshold = [0, 0, 0]
+Thresholds = False
+BranchThreshold = [0, 0, 0]
+TransfoThreshold = [0, 0, 0]
HighVoltageThreshold = [0, 0, 0]
-LowVoltageThreshold = [0, 0, 0]
+LowVoltageThreshold = [0, 0, 0]
###
IsolatedGenList = []
-CaseIDStorage = []
-TotalStorage = [] # All interesting data
-ColsStorage = []
-NamesStorage = []
-LinesStorage = [] # Mean, min, max, case no
-TotalLinesStorage = [] # All data
-TransfoStorage = []
+CaseIDStorage = []
+TotalStorage = [] # All interesting data
+ColsStorage = []
+NamesStorage = []
+LinesStorage = [] # Mean, min, max, case no
+TotalLinesStorage = [] # All data
+TransfoStorage = []
TotalTransfoStorage = []
-BusStorage = []
-TotalBusStorage = []
+BusStorage = []
+TotalBusStorage = []
+
# PSEN output folder
FolderList = ['']
-OutFolder = ['']
-
-#contingency options
-Vmin = [0.90]
-Vmax = [1.10]
-ContRate = ['a'] #'a' or 'b'
-#flowlimit = [100] #percentage of max MVA flow to be reported (vs. ContRate)
-flowlimitlines = [120]
+OutFolder = ['']
+
+
+# Contingency options
+Vmin = [0.90]
+Vmax = [1.10]
+ContRate = ['a'] #'a' or 'b'
+flowlimitlines = [120]
flowlimittransfos = [120]
-Tolerance = [0.5] # mismatch tolerance mw and mvar
-TripLines = [True]
-TripTransfos = [True]
-TripGenerators = [True]
-TripBuses = [False]
-IsolatedGen = [True]
-
-#input sav options
-GetSavsfromFolder = [False] #find all sav files in input folder (if False, construct list from number of cases, below)
-GetSavsfromFile = [True] #construct SavFileList from input csv file with header
-Ncases = [1000] #Sav file list = [["]Case_1.sav", "Case_2.sav", ... ,"Case_Ncases.sav"]
-
-#output options
-TrNoGSUorGNDOutput = [False]
-TestBusName = [False] #Sort out bus names starting with 'F' + int or 'S' + int
-ReportSpaces = [False] #add empty lines between each bus or line with contingency problems
-RepeatComponentAllLines = [True] #rewrite overloaded or over/undervoltage component on each line for each contingency that causes it
-MultipleContingencyReport = [False] #output PSSE multiple contingency report to python Shell
-WriteIndivExcels = [False] #write an Excel file for the results of each case file
-
-#load flow and contingency options
-AdjTaps = [1] # 0 = lock, 1 = stepping, 2 = direct
-AdjDCtaps = [1] # 0 disable, 1 enable
-SolutionMethod = [1] # 0 = FDNS, 1 = FNSL, 2 = optimized FDNS
-AdjSwitchedShunts = [0] # 0 = disable, 1 = enable, 2 = enable continuous mode
-DispatchMode = [1] # 0 - disable, 1 = subsystem machines(reserve), 2 = subsystem machines(pmax), 3 = subsystem machines(inertia), 4 = subsystem machines(droop)
-DispatchAreaList = [] #list of areas from which generators will be used to correct post-contingency active power imbalances
-FlatStart = [0] # 0 = False, 1 = True (Just for Load Flow)
-VarLimits = [99] # apply var limits on iteration x, -1 = do not apply var limits)
+Tolerance = [0.5] # mismatch tolerance mw and mvar
+TripLines = [True]
+TripTransfos = [True]
+TripGenerators = [True]
+TripBuses = [False]
+IsolatedGen = [True]
+
+
+# Input sav options
+GetSavsfromFolder = [False] # find all sav files in input folder (if False, construct list from number of cases, below)
+GetSavsfromFile = [True] # construct SavFileList from input csv file with header
+Ncases = [1000] # Sav file list = [["]Case_1.sav", "Case_2.sav", ... ,"Case_Ncases.sav"]
+
+
+# Output options
+TrNoGSUorGNDOutput = [False]
+TestBusName = [False] # Sort out bus names starting with 'F' + int or 'S' + int
+ReportSpaces = [False] # add empty lines between each bus or line with contingency problems
+RepeatComponentAllLines = [True] # rewrite overloaded or over/undervoltage component on each line for each contingency that causes it
+MultipleContingencyReport = [False] # output PSSE multiple contingency report to python Shell
+WriteIndivExcels = [False] # write an Excel file for the results of each case file
+
+
+# Load flow and contingency options
+AdjTaps = [1] # 0 = lock, 1 = stepping, 2 = direct
+AdjDCtaps = [1] # 0 disable, 1 enable
+SolutionMethod = [1] # 0 = FDNS, 1 = FNSL, 2 = optimized FDNS
+AdjSwitchedShunts = [0] # 0 = disable, 1 = enable, 2 = enable continuous mode
+DispatchMode = [1] # 0 - disable, 1 = subsystem machines(reserve), 2 = subsystem machines(pmax), 3 = subsystem machines(inertia), 4 = subsystem machines(droop)
+DispatchAreaList = [] # list of areas from which generators will be used to correct post-contingency active power imbalances
+FlatStart = [0] # 0 = False, 1 = True (Just for Load Flow)
+VarLimits = [99] # apply var limits on iteration x, -1 = do not apply var limits)
ret[name][1].append(data)
h.close()
return ret
-
+
def processXLS(dico):
print('je suis dans processor')
-
+
UpdateProcessorOptions(dico)
indexes = {}
toGather = {}
# Now we process the gathered data depending on the required calculus
processedData = {}
-
+
for name in sheets:
print('apres select')
processedData[name] = [[]]
-
+
processedData[name] = Compute.createDoubleArray(totalData[name], processedData[name], name)
+
xlsToOutput(processedData[name])
+
except KeyError:
print("error dans ecriture acc results")
pass
+
def processXLS_out(dico):
print("error dans ecriture acc results")
pass
- xlsToOutput(processedData)
+ xlsToOutput(processedData)
def gatherXlsData(wb, sheets, data, totalData):
for name in sheets:
pass
return False
-
+
def xlsToOutput(data):
- ACCCresultsfolder = os.path.dirname(Options.csvFileName)
- filename = os.path.join(ACCCresultsfolder,"ACCCresults_processed.xlsx")
- workbook = xlsxwriter.Workbook(filename)
- worksheet = workbook.add_worksheet()
- row = 0
+ ACCCresultsfolder = os.path.dirname(Options.csvFileName)
+ filename = os.path.join(ACCCresultsfolder,"ACCCresults_processed.xlsx")
+ workbook = xlsxwriter.Workbook(filename)
+ worksheet = workbook.add_worksheet()
+ row = 0
- for colonne in data:
- col=0
- for cellule in colonne:
- worksheet.write(col, row, cellule)
- col = col+1
- row = row+1
- workbook.close()
+ for colonne in data:
+ col=0
+ for cellule in colonne:
+ worksheet.write(col, row, cellule)
+ col = col+1
+ row = row+1
+ workbook.close()
def xlsToCsv(indexes, data): #if too much data to be written to xls file, output a csv
from dicoProcessor import dico
- processXLS(dico)
+ processXLS(dico)
def run(dico):
- print dico
- # if len(dico)>1:
- # return
- # else:
- # continue
+
resetAll()
UpdateOptions(dico)
start_time = time.clock()
break
break
- MachineDico, LoadDico, LineDico, TransfoDico, MotorDico = PFExtractGeneratorLoadLineandTransfoDico(0, 0, CaseFile,
- PF_path, Python3_path)# creer Data_for_interface file
+ MachineDico, LoadDico, LineDico, TransfoDico, MotorDico = PFExtractGeneratorLoadLineandTransfoDico(0, 0, CaseFile,PF_path, Python3_path)# creer Data_for_interface file
UpdateOptions(dico)
PF_PATH = Options.PF_PATH[0]
nn = int(''.join(ele for ele in study.loc_name if ele.isdigit())) # cas number
fScen = app.GetProjectFolder('scen') # Dossier contient triggers
- #pdb.set_trace()
+
scenario = fScen.GetChildren(1, 'Case_'+str(nn)+'.IntScenario', 1)
scenario[0].Activate()
opf = app.GetFromStudyCase('ComOpf')
Qsetpoints.append(LSscale*Q_setpoint)
for it,load in enumerate(loads_base):
-# try: #disactivate triggers if there are any
-# loadPscale = load[6].GetChildren(1, 'plini.Charef', 1)
-# loadQscale = load[6].GetChildren(1, 'qlini.Charef', 1)
-# loadPscale[0].outserv = 1
-# loadQscale[0].outserv = 1
-# except:
-# pass
+
load[6].plini = Psetpoints[it]
load[6].qlini = Qsetpoints[it]
-# #check to see if loads properly initialized
-# all_inputs_base1 = read_pfd(app, prj.loc_name, 1)
-# load_base = all_inputs_base1[4]
-# print([l[1] for l in loads_base])
-# print([l[1] for l in load_base])
-# print('')
-# for ind in range(len(load_base)):
-# l0 = loads_base[ind]
-# l1 = load_base[ind]
-# if abs(l0[1]-l1[1])<0.01 and abs(l0[2]-l1[2])<0.01:
-# pass
-# else:
-# print("loads not saved correctly after load-shedding")
- #pdb.set_trace()
all_inputs_base1 = read_pfd_simple(app, prj.loc_name)
plants_base = all_inputs_base1[0]
transf_base = all_inputs_base[2]
plants_base = all_inputs_base[3]
transf3_base = all_inputs_base[7]
- # buses_base ; lines_base; transf_base; plants_base; transf3_bas
-
-
-
- # settriger_iter = studycase.GetChildren(1, 'set_iteration.SetTrigger', 1)[0]
- # settriger_iter.Activate()
- # compy = studycase.GetContents('comp0.ComPython', 0)[0]
- # compy.Execute()
# Automatic N-2
ldf.iopt_noinit=0
ldf.iPbalancing = Ops['DispatchMode']
- #set active power of synchronous generators
- #all_inputs_base1 = read_pfd_simple(app, prj.loc_name)
- #plants_base = all_inputs_base1[0]
- #all_inputs3 = read_pfd(app, prj.loc_name, recal=0)
- #plants_base = all_inputs3[3]
-
-
-# for plant in plants_base:
-# try:
-# print(plant[2],plant[3])
-# plant[11].pgini = plant[3]
-# except:
-# plant[11].pgini_a = plant[3]
-
-
- # ldf.iopt_lim = Ops['VarLimits'] # reactive power limit
- # ldf.iopt_plim = Ops['ActiveLimits'] # active power limit
- # ldf.iopt_limScale = 1 # scale factor
- # ldf.iopt_noinit = Ops['FlatStart'] # no initialisation load flow
+
# Run Contingency Analysis
err = cntana.Execute()
if (err!=0):
print('Error: Power Factory Contingency Analysis ended in error. Network probably does not converge for load-flows.')
- resFile = study.GetContents('Contingency Analysis*.ElmRes', 1)[0]
+ resFile = study.GetContents('Analyse de contingences*.ElmRes', 1)[0]
+
+ # try:
+ # resFile = study.GetContents('Contingency Analysis*.ElmRes', 1)[0]
+ # resFile = study.GetContents('Analyse de contingences*.ElmRes', 1)[0]
+ # except:
+ # pass
+
app.PrintPlain(resFile)
resFile.Load()
nbrow = resFile.GetNumberOfRows()
Voltages[bus[3]][cntname]=val
for line in lines_base:
- #aa=[frombus_number,tobus_number,currentA,pourcent,pourcent,pourcent,flowP,flowQ,frombus_name,tobus_name,idline,line]
+ #aa=[frombus_number,tobus_number,currentA,pourcent,pourcent,pourcent,flowP,flowQ,frombus_name,tobus_name,idline,line]
#Flows[line[12]]={}
col = resFile.FindColumn(line[11], 'c:loading')
for row in range(1,nbrow-1):
--- /dev/null
+# -*- coding: utf-8 -*-
+"""
+Created on Wed May 29 15:00:00 2019
+
+@author: H92579
+"""
+import os
+import sys
+
+
+
+PF_PATH = r'C:\Program Files\DIgSILENT\PowerFactory 2017 SP1\Python\3.5'
+NetworkFile = r'C:\Users\H92579\Documents\PSEN_simu\ResultatSimu\N_20190529_09h33m33\package0_N_20190529_09h33m33/AllCase.pfd'
+
+(filepath, filename) = os.path.split(NetworkFile)
+sys.path.append(PF_PATH)
+os.environ['PATH'] += ';' + os.path.dirname(os.path.dirname(PF_PATH)) + ';'
+
+
+import powerfactory
+
+app = powerfactory.GetApplication()
+user = app.GetCurrentUser()
+study = app.GetActiveStudyCase()
+
+ComImp = user.CreateObject('ComPFDIMPORT')
+app.SetWriteCacheEnabled(1) # Disable consistency check
+ComImp.g_file = NetworkFile
+ComImp.g_target = user # Project is imported under the user account
+err = ComImp.Execute() # Execute command starts the import process
+app.SetWriteCacheEnabled(0) # Enable consistency check
+
+prjs = user.GetContents('*.IntPrj')
+prjs.sort(key=lambda x: x.gnrl_modif, reverse=True)
+prj = prjs[0]
+prj.Activate()
+
+resFile = study.GetContents('Contingency Analysis*.ElmRes', 1)[0]
\ No newline at end of file
--- /dev/null
+# -*- coding: utf-8 -*-
+"""
+Created on Mon Jun 3 09:19:43 2019
+
+@author: H92579
+
+"""
+import os
+
+folder = r'C:\Users\H92579\Documents\PSEN_simu\ResultatSimu\N_20190529_09h33m33'
+
+try:
+ with open(os.path.join(folder,'N2_Processed.xlsx')): pass
+except IOError:
+ print('Erreur! Le fichier n a pas pu être ouvert')
+
+filew = open(os.path.dirname(os.path.realpath(__file__))+'/iteration.txt', 'w')
+filew.write(str(0))
+filew.close()
+
+fichier = open (os.path.dirname(os.path.realpath(__file__))+'/iteration.txt', 'r')
+compteur=fichier.read()
+fichier.close()
+
+filew = open(os.path.dirname(os.path.realpath(__file__))+'/iteration.txt', 'w')
+filew.write(str(1))
+filew.close()
\ No newline at end of file
else:
print('CONTINGENCY_PROCESSING ', key)
- return
-# for key in dico.keys():
-# atraiter=dico[key]
-# for key2 in atraiter.keys():
-# param = atraiter[key2]
-# Optionsparam=DicoTraduction[key][key2]
-# setattr(Options, Optionsparam,param)
\ No newline at end of file
+ return
\ No newline at end of file
-Dico ={'CONTINGENCY_SELECTION': {'N1TransformersList': [], 'TripLines': True, 'csv_file': 'X:/Small Grid PSSE/Results/N_20181023_09h45m10/cont.csv', 'N1LinesList': ['90.0'], 'N1BusesList': ['90.0'], 'SelectionMethod': 'CaseSelectionFromFile', 'case_name': 'test', 'TripBuses': False, 'N1AreaList': ['1'], 'TripTransfos': False, 'TripGenerators': False}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'X:/Small Grid PSSE/Results/N_20181023_09h45m10/simulationDClog_complete_09h45m10.csv', 'DecimalSeparator': '.', 'NewCsvFile': 'CleanedData.csv', 'PSSPY_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSPY27', 'BusesList': ['90.0'], 'PSEN_results_csvfile_cleaned': False, 'MaxDepth': 5, 'LinesList': ['30.0', '90.0'], 'PSSE_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSBIN', 'PSEN_results_folder': 'X:/Small Grid PSSE/Results/N_20181023_09h45m10', 'OutputNewCsv': False, 'AreaList': ['1']}, 'CONTINGENCY_OPTIONS': {'SolutionMethod': '1 - FNSL', 'AdjustSwitchedShunts': '0 - Disable', 'Vmin': 0.99, 'FlowLimitTransformers': 100, 'Tolerance': 0.5, 'VarLimits': 99, 'FlowLimitLines': 90, 'FlatStart': False, 'AdjustDCtaps': '0 - Disable', 'output_file_format': 'csv', 'AdjustTaps': '1 - Stepping', 'Vmax': 1.01, 'ContingencyRate': 'a', 'DispatchMode': '1 - Reserve'}}
\ No newline at end of file
+Dico ={'CONTINGENCY_SELECTION': {'TripLines': True, 'csv_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33/Test.csv', 'SelectionMethod': 'CaseSelectionFromFile', 'case_name': 'trois_cas', 'TripTransfos': False, 'TripGenerators': True}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33/simulationDClog_complete_09h33m33.csv', 'DecimalSeparator': ',', 'MaxDepth': 5, 'NewCsvFile': 'CleanedData.csv', 'PSEN_results_csvfile_cleaned': False, 'Python3_path': 'C:/Python35', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5', 'LinesList': ['90.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33', 'OutputNewCsv': False, 'BusesList': ['90.0']}, 'CONTINGENCY_OPTIONS': {'ActiveLimits': True, 'Vmin': 0.95, 'FlowLimitTransformers': 100, 'AdjustTaps': False, 'VarLimits': True, 'FlowLimitLines': 100, 'FlatStart': False, 'AdjustShunts': False, 'Vmax': 1.05, 'output_file_format': 'xls', 'DispatchMode': 'ReferenceMachine'}}
\ No newline at end of file
-Dico ={'CONTINGENCY_PROCESSING': {'XLS_file': 'X:/Small Grid PSSE/Results/N_20181023_09h45m10/ACCCresults/test Voltage 0.csv', "'Component_List_For_test Voltage 0'": ['CITYC90', 'HYDRO90', 'NDIESEL'], 'TabList': ['test Voltage 0'], "'Contingency_List_For_test Voltage 0'": ['NDIESEL__HYDRO90__LI1', 'CITYC90__SOLAR90__LI1', 'NDIESELG3__NDIESEL__TR1', 'NDIESEL__CITYB90__LI1', 'NDIESEL__CITYB90__LI2', 'CITYC90__HYDRO90__LI1', 'NDIESELG2__NDIESEL__TR1', 'CITYB90__CITYC90__LI1', 'CITYC90__CITYC30__TR1', 'NDIESELG1__NDIESEL__TR1', 'HYDRO30__HYDRO90__TR2', 'HYDRO30__HYDRO90__TR1', 'NDIESELG4__NDIESEL__TR1', 'HYDRO30__HYDRO90__TR3', 'HYDRO90__SOLAR90__LI1', 'ODIESEL__NDIESEL__TR1']}, 'CONTINGENCY_SELECTION': {'N1TransformersList': [], 'TripLines': True, 'csv_file': 'X:/Small Grid PSSE/Results/N_20181023_09h45m10/cont.csv', 'N1LinesList': ['90.0'], 'N1BusesList': ['90.0'], 'SelectionMethod': 'CaseSelectionFromFile', 'case_name': 'test', 'TripBuses': False, 'N1AreaList': ['1'], 'TripTransfos': False, 'TripGenerators': False}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'X:/Small Grid PSSE/Results/N_20181023_09h45m10/simulationDClog_complete_09h45m10.csv', 'DecimalSeparator': '.', 'NewCsvFile': 'CleanedData.csv', 'PSSPY_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSPY27', 'BusesList': ['90.0'], 'PSEN_results_csvfile_cleaned': False, 'MaxDepth': 5, 'LinesList': ['30.0', '90.0'], 'PSSE_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSBIN', 'PSEN_results_folder': 'X:/Small Grid PSSE/Results/N_20181023_09h45m10', 'OutputNewCsv': False, 'AreaList': ['1']}, 'CONTINGENCY_OPTIONS': {'SolutionMethod': '1 - FNSL', 'AdjustSwitchedShunts': '0 - Disable', 'Vmin': 0.99, 'FlowLimitTransformers': 100, 'Tolerance': 0.5, 'VarLimits': 99, 'FlowLimitLines': 90, 'FlatStart': False, 'AdjustDCtaps': '0 - Disable', 'output_file_format': 'csv', 'AdjustTaps': '1 - Stepping', 'Vmax': 1.01, 'ContingencyRate': 'a', 'DispatchMode': '1 - Reserve'}}
\ No newline at end of file
+Dico ={'CONTINGENCY_PROCESSING': {'XLS_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33/ACCCresults.xls', 'TabList': ['MinAvgVolt Voltage 0'], "'Contingency_List_For_MinAvgVolt Voltage 0'": ['FURIANI_ZI_OLETTA', 'VAZ_G11 [Vazzio]', 'VAZ_G5 [Vazzio]', 'CORTE_MOROSAGLIA', 'VAZ_G4 [Vazzio]', 'TOLLA_G2 [Tolla]', 'CORSCIA_SOVENZIA', 'LORETO_SAGONE', 'VAZ_G1 [Vazzio]', 'CASTIRLA_CORSICA', 'CASAMOZZA_MOROSAGLIA', 'VAZ_G10 [Vazzio]', 'RIZZANESE1 [Propriano]', 'OCANA_VAZZIO', 'VAZ_G12 [Vazzio]', 'CORTE_OCANA', 'RIZZANESE2 [Propriano]', 'VAZ_G2 [Vazzio]', 'SOVENZ_G [Sovenzia]', 'ILE_ROUSSE_ZI_OLETTA', 'VAZ_G6 [Vazzio]', 'CALDANICCIA_OCANA', 'PRORIANO_PO_VO', 'BONIFACCIO_PO_VO2', 'PROPRIANO_ZSSS6', 'SAGONE_SOVENZIA', 'VAZ_G3 [Vazzio]', 'PIETROSELLA_PROPRIANO', 'Vazzio_TAC [Vazzio]', 'CORTE_SAMPOLO', 'GHISONACCIA_STE_LUCIE', 'TOLLA_G1 [Tolla]', 'FURIANI_LUCCIANA2', 'CORSICA_G [Corsica]', 'OCANA_ZSSS6', 'FURIANI_LUCCIANA1', 'BASTIA_FURIANI2', 'BASTIA_FURIANI1', 'TOLLA_G3 [Tolla]', 'PO_VO_STE_LUCIE', 'ASPRETTO_LORETTO', 'ASPRETTO_VAZZIO', 'SAMPO_G2 [Sampolo]', 'PONT_VANNA [Ocana]', 'OCANA_PIETROSELLA', 'OCA_G2 [Ocana]', 'OCA_G1 [Ocana]', 'OCA_G3 [Ocana]', 'Caldanicci_PV [Caldanicci]', 'CASTI_G2 [Castirla]', 'CASTI_G1 [Castirla]', 'SAMPO_G1 [Sampolo]', 'CASTIRLA_ILE_ROUSSE', 'LUCCIANA_HTB_2 [Lucciana]', 'CASAMOZZA_TAGLIO', 'CERVIONE_TAGLIO', 'BONIFACCIO_PO_VO1', 'CERVIONE_GHISONACCIA', 'Corte_PV [Corte]', 'Loretto_PV [Loretto]', 'LORETO_VAZZIO', 'LUCCIANA_HTB [Lucciana]', 'PROPRIA_BT [Propriano]'], "'Component_List_For_MinAvgVolt Voltage 0'": ['Castirla_Castirla', 'Corsica_Corsica', 'Vazzio_Vazzio', 'Pietrosella_Pietrosella', 'Aspretto_Aspretto', 'IleRousse_IleRousse', 'Oletta_Oletta', 'Caldanicci_Caldanicci', 'Sagone_Sagone', 'SainteMarieSicche_SainteMarieSicche', 'Ocana_Ocana', 'Sovenzia_Sovenzia', 'Loretto_Loretto']}, 'CONTINGENCY_SELECTION': {'TripTransfos': False, 'TripLines': True, 'AvgLowVoltage': 1, 'SelectionMethod': 'SelectWorstCases', 'TripGenerators': True}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33/simulationDClog_complete_09h33m33.csv', 'DecimalSeparator': ',', 'MaxDepth': 5, 'NewCsvFile': 'CleanedData.csv', 'PSEN_results_csvfile_cleaned': False, 'Python3_path': 'C:/Python35', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5', 'LinesList': ['90.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33', 'OutputNewCsv': False, 'BusesList': ['90.0']}, 'CONTINGENCY_OPTIONS': {'ActiveLimits': True, 'Vmin': 0.95, 'FlowLimitTransformers': 100, 'AdjustTaps': False, 'VarLimits': True, 'FlowLimitLines': 100, 'FlatStart': False, 'AdjustShunts': False, 'Vmax': 1.05, 'output_file_format': 'xls', 'DispatchMode': 'ReferenceMachine'}}
\ No newline at end of file
# dico = {'XLS_file': 'X:/Etudes/DEWA_SOLAR/DEWA_2020/tir8/Results/N_20180319_14h06m36/ACCCresults - save/FiveHundred Voltage 0_save.csv', 'TabList': ['FiveHundred Voltage 0_save'], 'Contingency_List_For_FiveHundred__Voltage__0_save': ['Contingency', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR4__3WNDTR4', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR3__3WNDTR3', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR2__3WNDTR2', 'HCCP_PH1_ST1__HSYANCOAL__TRT1'], "'Contingency_List_For_FiveHundred Voltage 0_save'": ['Contingency', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR4__3WNDTR4', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR3__3WNDTR3', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR2__3WNDTR2', 'HCCP_PH1_ST1__HSYANCOAL__TRT1'], 'Component_List_For_FiveHundred__Voltage__0_save': ['Bus', 'SKLN', 'MSJA']}
+dico = {'CONTINGENCY_PROCESSING': {'XLS_file': 'X:/Etudes/DEWA_SOLAR/DEWA_2020/tir8/Results/N_20180319_14h06m36/ACCCresults - save/FiveHundred Voltage 0.csv', 'TabList': ['FiveHundred Voltage 0'], "'Component_List_For_FiveHundred Voltage 0'": ['SKLN', 'MSJA'], "'Contingency_List_For_FiveHundred Voltage 0'": ['MUSH_400_KV__MUSH_132_KV__MUSH_TR4__3WNDTR4', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR3__3WNDTR3', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR2__3WNDTR2', 'HCCP_PH1_ST1__HSYANCOAL__TRT1']}, 'CONTINGENCY_SELECTION': {'N1TransformersList': [], 'TripLines': True, 'N1LinesList': [], 'N1BusesList': [], 'TripBuses': False, 'N1AreaList': [], 'TripTransfos': True, 'TripGenerators': True}, 'CASE_SELECTION': {'NewCsvFile': 'CleanedData.csv', 'DecimalSeparator': '.', 'PSSPY_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSPY27', 'PSEN_results_csvfile_cleaned': False, 'MaxDepth': 5, 'PSSE_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSBIN', 'OutputNewCsv': False}, 'CONTINGENCY_OPTIONS': {'SolutionMethod': '1 - FNSL', 'AdjustSwitchedShunts': '0 - Disable', 'Vmin': 0.9, 'FlowLimitTransformers':120, 'Tolerance': 0.5, 'VarLimits': 99, 'FlowLimitLines': 120, 'FlatStart': False, 'AdjustDCtaps': '0 - Disable', 'output_file_format': 'xls', 'AdjustTaps': '1 - Stepping', 'Vmax': 1.1, 'ContingencyRate': 'a', 'DispatchMode': '1 - Reserve'}, 'N_PROCESSING_OPTIONS': {'Output_bus_values': True, 'Output_transformer_values': True, 'Output_lines_values': True}}
+
# {'XLS_file': 'X:/Etudes/DEWA_SOLAR/DEWA_2020/tir8/Results/N_20180319_14h06m36/ACCCresults - save/FiveHundred Voltage 0_save.c
# KV__MUSH_132_KV__MUSH_TR3__3WNDTR3', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR2__3WNDTR2', 'HCCP_PH1_ST1__HSYANCOAL__TRT1'], 'Compon
# ent_List_For_FiveHundred__Voltage__0_save': ['Bus', 'SKLN', 'MSJA']}
-dico = {'CONTINGENCY_PROCESSING': {'XLS_file': 'X:/Etudes/DEWA_SOLAR/DEWA_2020/tir8/Results/N_20180319_14h06m36/ACCCresults - save/FiveHundred Voltage 0.csv', 'TabList': ['FiveHundred Voltage 0'], "'Component_List_For_FiveHundred Voltage 0'": ['SKLN', 'MSJA'], "'Contingency_List_For_FiveHundred Voltage 0'": ['MUSH_400_KV__MUSH_132_KV__MUSH_TR4__3WNDTR4', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR3__3WNDTR3', 'MUSH_400_KV__MUSH_132_KV__MUSH_TR2__3WNDTR2', 'HCCP_PH1_ST1__HSYANCOAL__TRT1']}, 'CONTINGENCY_SELECTION': {'N1TransformersList': [], 'TripLines': True, 'N1LinesList': [], 'N1BusesList': [], 'TripBuses': False, 'N1AreaList': [], 'TripTransfos': True, 'TripGenerators': True}, 'CASE_SELECTION': {'NewCsvFile': 'CleanedData.csv', 'DecimalSeparator': '.', 'PSSPY_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSPY27', 'PSEN_results_csvfile_cleaned': False, 'MaxDepth': 5, 'PSSE_path': 'C:\\Program Files (x86)\\PTI\\PSSE34\\PSSBIN', 'OutputNewCsv': False}, 'CONTINGENCY_OPTIONS': {'SolutionMethod': '1 - FNSL', 'AdjustSwitchedShunts': '0 - Disable', 'Vmin': 0.9, 'FlowLimitTransformers':120, 'Tolerance': 0.5, 'VarLimits': 99, 'FlowLimitLines': 120, 'FlatStart': False, 'AdjustDCtaps': '0 - Disable', 'output_file_format': 'xls', 'AdjustTaps': '1 - Stepping', 'Vmax': 1.1, 'ContingencyRate': 'a', 'DispatchMode': '1 - Reserve'}, 'N_PROCESSING_OPTIONS': {'Output_bus_values': True, 'Output_transformer_values': True, 'Output_lines_values': True}}
\ No newline at end of file
+
+# dico ={'CONTINGENCY_PROCESSING': {"'Component_List_For_MinAvgVolt Flows 0'": ['Aspretto_Aspretto_Vazzio_Vazzio_ASPRETTO_VAZZIO__LI'], 'XLS_file': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33/ACCCresults.xls', "'Component_List_For_MinAvgVolt Voltage 0'": ['Castirla_Castirla'], "'Contingency_List_For_MinAvgVolt Flows 0'": ['LUCCIANA_HTB_2 [Lucciana]'], "'Contingency_List_For_MinAvgVolt Voltage 0'": ['FURIANI_ZI_OLETTA'], 'TabList': ['MinAvgVolt Flows 0', 'MinAvgVolt Voltage 0']}, 'CONTINGENCY_SELECTION': {'TripTransfos': False, 'TripLines': True, 'AvgLowVoltage': 1, 'SelectionMethod': 'SelectWorstCases', 'TripGenerators': True}, 'CASE_SELECTION': {'TransformersList': [], 'PSEN_results_csvfile': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33/simulationDClog_complete_09h33m33.csv', 'DecimalSeparator': ',', 'MaxDepth': 5, 'NewCsvFile': 'CleanedData.csv', 'PSEN_results_csvfile_cleaned': False, 'Python3_path': 'C:/Python35', 'PF_path': 'C:\\Program Files\\DIgSILENT\\PowerFactory 2017 SP1\\Python\\3.5', 'LinesList': ['90.0'], 'PSEN_results_folder': 'C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33', 'OutputNewCsv': False, 'BusesList': ['90.0']}, 'CONTINGENCY_OPTIONS': {'ActiveLimits': True, 'Vmin': 0.95, 'FlowLimitTransformers': 100, 'AdjustTaps': False, 'VarLimits': True, 'FlowLimitLines': 100, 'FlatStart': False, 'AdjustShunts': False, 'Vmax': 1.05, 'output_file_format': 'xls', 'DispatchMode': 'ReferenceMachine'}}
PF_path=_path[1].replace('\n','')
MachineDico, LoadDico, LineDico, TransfoDico, MotorDico,BusDico = PFExtractData(pfd_file,PF_path)
+
Data={}
-Data['MachineDico']=MachineDico
-Data['LoadDico']=LoadDico
-Data['LineDico']=LineDico
-Data['TransfoDico']=TransfoDico
-Data['MotorDico']=MotorDico
-Data['BusDico']=BusDico
-# Data=[MachineDico, LoadDico, LineDico, TransfoDico, MotorDico]
+Data['MachineDico'] = MachineDico
+Data['LoadDico'] = LoadDico
+Data['LineDico'] = LineDico
+Data['TransfoDico'] = TransfoDico
+Data['MotorDico'] = MotorDico
+Data['BusDico'] = BusDico
+
import pickle
# print('=========='+str(pickle.HIGHEST_PROTOCOL)+'=========')
with open('Data_for_interface', 'wb') as fichier:
try:
- MachineDico, LoadDico, LineDico, TransfoDico, MotorDico = PFExtractGeneratorLoadLineandTransfoDico(
- 0, 0, CaseFile, PF_path, Python3_path)
+ MachineDico, LoadDico, LineDico, TransfoDico, MotorDico = PFExtractGeneratorLoadLineandTransfoDico(0, 0, CaseFile, PF_path, Python3_path)
BusList, LinesList, TransfosList,BusDico = getNominalkV(CaseFile)
print(exc_type, exc_tb.tb_lineno)
- #self.jdc.ajoutMC(e,'TransfosList',listeTuple)
-
def INCLUDE_context(self,d):
catalogues=(
('PSEN_N1','PSSE_Process contingency calculation and analysis',os.path.join(repIni,'PSEN_Cata_Contingency.py'),'ProcessOutputs','python'),
('PSEN_N1','PSSE_Post Calculation Analysis',os.path.join(repIni,'PSEN_Cata_DataProcessing.py'),'ProcessOutputs','python'),
- ('PSEN_N1','PF_Process contingency calculation and analysis AND Post Calculation Analysis',os.path.join(repIni,'PSEN_Cata_N1_PF.py'),'ProcessOutputs','python'),
+ ('PSEN_N1','PF_Process contingency calculation and analysis',os.path.join(repIni,'PSEN_Cata_N1_PF.py'),'ProcessOutputs','python'),
+ ('PSEN_N1','PF_Post Calculation Analysis',os.path.join(repIni,'PSEN_Cata_DataProcessing_PF.py'),'ProcessOutputs','python'),
)
--- /dev/null
+C:/Users/H92579/Documents/PSEN_simu/ResultatSimu/N_20190529_09h33m33\package0_N_20190529_09h33m33\BaseCase.pfd
+C:\Program Files\DIgSILENT\PowerFactory 2017 SP1\Python\3.5
+C:/Python35