Skip to content

Parallel dynamic simulations #177

Answered by jd-lara
espenfb asked this question in Q&A
Jan 21, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

@espenfb a prototype of what you want to achieve would look like this (I haven't tested the code, this is just a barebones for explanation.

addprocs()
@everywhere using PowerSimulationsDynamics
@everywhere using Sundials

function run_simulation(fault_line::String, output_folder)
    perturbation_trip = BranchTrip(1.0, Line, fault_line)
    sim_folder = joinpath(output_folder, fault_line)
    sim = Simulation(ResidualModel, SYSTEM, sim_folder, tspan, perturbation_trip)
    status = execute!(sim, IDA(), dtmax = 0.02, enable_progress_bar = false)
    if status == SIMULATION_FINALIZED
        results = read_results(sim)
        CUSTOM_FUNCTION_TO_GRAB_RESULTS_AND_SAVE()
    end
     return s…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@espenfb
Comment options

Comment options

You must be logged in to vote
1 reply
@espenfb
Comment options

Answer selected by jd-lara
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants