Skip to content

Commit

Permalink
Adding N-2 contingencies
Browse files Browse the repository at this point in the history
  • Loading branch information
michel2323 committed Jan 30, 2023
1 parent c7ee8c1 commit 4747d0f
Show file tree
Hide file tree
Showing 9 changed files with 16,667 additions and 0 deletions.
20 changes: 20 additions & 0 deletions create_n-2.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using DelimitedFiles

incase = ARGS[1]
input = "$incase.Ctgs"
outcase = "$(incase)_2"
output = "$(outcase).Ctgs"
ctgs = DelimitedFiles.readdlm(input)

newctgs = Vector{Vector{Int64}}()
for (i, ctg) in enumerate(ctgs)
for j in 1:i-1
push!(newctgs, [ctg, ctgs[j]])
end
end

run(Cmd(`cp $(incase).m $(outcase).m`))
run(Cmd(`cp $(incase).Pd $(outcase).Pd`))
run(Cmd(`cp $(incase).Qd $(outcase).Qd`))

DelimitedFiles.writedlm(output, newctgs, " ")
Loading

0 comments on commit 4747d0f

Please sign in to comment.