Skip to content

Instantly share code, notes, and snippets.

View jmmauricio's full-sized avatar

Juan Manuel Mauricio jmmauricio

View GitHub Profile
@jmmauricio
jmmauricio / PF_DigSILENT_short_circuit_bus.py
Last active February 28, 2023 10:22
Power Factory DigSILENT python short circuit at bus
buses = app.GetCalcRelevantObjects("*.ElmTerm")
events_folder = app.GetFromStudyCase('IntEvt'); # to get events folder
evt1 = events_folder.CreateObject('EvtShc', 'short circuit'); # generator switch event is created here
evt1[0].p_target = buses[1] # event target is the 1 bus
evt1[0].time = 1.0 # short circuit starts at t=1 s
evt1[0].i_shc = 0
@jmmauricio
jmmauricio / pf_ds_py_run_save_9bus_sys
Created June 13, 2015 18:41
PowerFactory DigSILENT Python Script to load flow, set variables to save, set event, initialize, run and save results to a txt file
import sys
sys.path.append(r"C:\DigSILENT15p1p7\python")
# import PowerFactory module
import powerfactory
# start PowerFactory in engine mode
app = powerfactory.GetApplication()
user = app.GetCurrentUser()
set Sloads,BusBars,allBars,OldMons;
object Ldf;
double X;
object busbar,result;
string nombre;
allBars = AllRelevant('*.ElmTerm');
!Ldf = GetCaseCommand('ComLdf');
fopen('test.txt','w',0);
@jmmauricio
jmmauricio / Installing debian enviroment
Last active August 29, 2015 14:14
How to install debian enviroment
sudo apt-get install gfortran libopenblas-dev liblapack-dev
sudo apt-get install python-dev
sudo apt-get scipy
sudo apt-get install git
virtualbox
==========
@jmmauricio
jmmauricio / file.rb
Created January 24, 2015 18:45
GitHub · Build software better, together.
https://github.com/