This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PowerSystems | |
const PSY = PowerSystems; | |
# Getting data for the YBus | |
pm_dict = PowerSystems.parse_file(joinpath(MATPOWER_DIR, "case5.m")); | |
ps_dict = PowerSystems.pm2ps_dict(pm_dict); | |
Buses, Generators, Storages, Branches, Loads, Shunts, Services = PowerSystems.ps_dict2ps_struct(ps_dict); | |
# Getting PTDF calculated | |
Ybus = PSY.build_ybus(length(Buses), Branches) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of modeling a 2-state synchronous machine in Julia with DifferentialEquations.jl | |
Uses a simple statement inside of the function to make the step change, this can be improved with callbacks | |
Refer to Power System Modelling and Scripting for the equations | |
""" | |
using DifferentialEquations | |
using NLsolve | |
using Plots | |
###### Machine Parameter Struct ###### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP | |
using Ipopt | |
using Random | |
ipopt_optimizer = with_optimizer(Ipopt.Optimizer, print_level = 5) | |
lb_noise = rand(10); | |
ub_noise = rand(10); | |
lb = -2 .- lb_noise | |
ub = 2 .+ ub_noise |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP | |
using Gurobi | |
using Random | |
Gurobi_optimizer = with_optimizer(Gurobi.Optimizer) | |
# Generate Data | |
data_ub = rand(100) .+ 1 | |
data_lb = rand(100) .- 1 | |
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##########Function Defs################### | |
function obtain_raw_data(base_dir::String, sha::String) | |
data_path = joinpath(base_dir,"raw_input_data") | |
ispath(data_path) && rm(data_path, recursive = true) | |
mkpath(data_path) | |
if Sys.iswindows() | |
POWERSYSTEMSTESTDATA_URL = "https://github.com/GridMod/RTS-GMLC/archive/$(sha).zip" | |
else | |
POWERSYSTEMSTESTDATA_URL = "https://github.com/GridMod/RTS-GMLC/archive/$(sha).tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using JuMP | |
using Ipopt | |
m = Model(Ipopt.Optimizer); | |
# Indexes | |
I = 1:2 | |
J = 1:2 | |
#Variables | |
@variable(m, x[i in I] >= 0) | |
# Parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Internal error: encountered unexpected error in runtime: | |
StackOverflowError() | |
intersect at /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c:0 | |
intersect_invariant at /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c:2742 | |
intersect at /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c:3002 | |
intersect_tuple at /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c:2642 [inlined] | |
intersect at /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c:2958 | |
intersect_unionall_ at /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c:2491 | |
intersect_unionall at /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c:2539 | |
intersect at /Users/julia/buildbot/worker/package_macos64/build/src/subtype.c:0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PowerSystems | |
const PSY = PowerSystems | |
using PowerSystems: UtilsData | |
using PowerSimulations | |
const PSI = PowerSimulations | |
using Dates | |
using TimeSeries | |
using Random | |
using Cbc | |
using GLPK |
OlderNewer