GithubHelp home page GithubHelp logo

nrel-sienna / oldexamples.jl Goto Github PK

View Code? Open in Web Editor NEW
37.0 37.0 22.0 7.33 MB

Examples of how to use the modeling capabilities developed under the Scalable Integrated Infrastructure Planning Initiative at NREL.

Home Page: https://www.nrel.gov/analysis/siip.html

License: BSD 3-Clause "New" or "Revised" License

Julia 100.00%
julia nrel powersystems siip tutorials

oldexamples.jl's People

Contributors

bwbush avatar claytonpbarrows avatar daniel-thom avatar jd-lara avatar kdheepak avatar rodrigomha avatar sourabhdalvi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

oldexamples.jl's Issues

Interface to export Jupyter files to users' folder

File permissions in 4_PowerSimulationsDynamics_examples set to read only, causing an error when attempting to write to log file. Simple chmod fix, however would be nice if it worked out of the box.

I did not check other tutorials.

Clean up items

I am opening this issue to keep track of the usage clean up items as we develop the example for PSY 1.0

  • Pass time-series metadata directly when adding forecasts to the system

Making examples self contained

Several examples, specially the PSI ones, depend on previous code and include calls like this one:

pkgpath = dirname(dirname(pathof(SIIPExamples)))
include(
    joinpath(pkgpath, "test", "3_PowerSimulations_examples", "01_operations_problems.jl"),
)

we should make the scripts independent and not rely on calling another script in the test folder to run.

LoadError in script/3_PowerSimulations_examples/08_US-system-simulations.jl

The offending line is https://github.com/NREL-SIIP/SIIPExamples.jl/blob/master/script/3_PowerSimulations_examples/08_US-system-simulations.jl#L87

Full traceback:

ERROR: LoadError: MethodError: no method matching get_base_power(::ProblemResults)
Closest candidates are:
  get_base_power(::PowerSimulations.SimulationProblemResults) at /home/dolsen/.julia/packages/PowerGraphics/3Fcgj/src/plot_data.jl:309
  get_base_power(::System) at /home/dolsen/.julia/packages/PowerGraphics/3Fcgj/src/plot_data.jl:308
Stacktrace:
 [1] plot_fuel(::PlotlyBase.Plot{Array{PlotlyBase.GenericTrace{Dict{Symbol,Any}},1},PlotlyBase.Layout{Dict{Symbol,Any}},Array{PlotlyBase.PlotlyFrame,1}}, ::ProblemResults; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/dolsen/.julia/packages/PowerGraphics/3Fcgj/src/call_plots.jl:275
 [2] plot_fuel(::PlotlyBase.Plot{Array{PlotlyBase.GenericTrace{Dict{Symbol,Any}},1},PlotlyBase.Layout{Dict{Symbol,Any}},Array{PlotlyBase.PlotlyFrame,1}}, ::ProblemResults) at /home/dolsen/.julia/packages/PowerGraphics/3Fcgj/src/call_plots.jl:252
 [3] plot_fuel(::ProblemResults; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /home/dolsen/.julia/packages/PowerGraphics/3Fcgj/src/call_plots.jl:248
 [4] plot_fuel(::ProblemResults) at /home/dolsen/.julia/packages/PowerGraphics/3Fcgj/src/call_plots.jl:248
 [5] top-level scope at /home/dolsen/repos/SIIPExamples.jl/script/3_PowerSimulations_examples/08_US-system-simulations.jl:87

Running Julia 1.5.1, using an environment as instantiated by Project.toml.

Split SIIP Examples into the corresponding repo and deprecate

Looks like the amount of cases we want to showcase in this repo has become impossible to maintain. We should consider moving the code to the respective package repositories for easier maintenance and also testing with the changes each package implements.

Local timezone error while running `1_operations_problems.ipynb` in Binder

I tried running the SIIP Example notebooks in the binder. However, I encounter an error when PowerModels tries to activate Memento. Specifically the error is as follows

ERROR: LoadError: InitError: Failed to find local time zone
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] localzone() at /srv/julia/pkg/packages/TimeZones/cAGJs/src/local.jl:154
 [3] DefaultFormatter at /srv/julia/pkg/packages/Memento/oMnS1/src/formatters.jl:35 [inlined]
 [4] config!(::Memento.Logger, ::String; fmt::String, levels::Dict{AbstractString,Int64}, colorized::Bool, recursive::Bool, substitute::Bool, propagate::Bool) at /srv/julia/pkg/packages/Memento/oMnS1/src/config.jl:39
 [5] config! at /srv/julia/pkg/packages/Memento/oMnS1/src/config.jl:36 [inlined]
 [6] #config!#72 at /srv/julia/pkg/packages/Memento/oMnS1/src/config.jl:28 [inlined]
 [7] config! at /srv/julia/pkg/packages/Memento/oMnS1/src/config.jl:28 [inlined]
 [8] #config!#71 at /srv/julia/pkg/packages/Memento/oMnS1/src/config.jl:25 [inlined]
 [9] config! at /srv/julia/pkg/packages/Memento/oMnS1/src/config.jl:25 [inlined]
 [10] __init__() at /srv/julia/pkg/packages/Memento/oMnS1/src/Memento.jl:64
 [11] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:697
 [12] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:781
 [13] _require(::Base.PkgId) at ./loading.jl:1006
 [14] require(::Base.PkgId) at ./loading.jl:927
 [15] require(::Module, ::Symbol) at ./loading.jl:922
 [16] include(::Module, ::String) at ./Base.jl:377
 [17] top-level scope at none:2
 [18] eval at ./boot.jl:331 [inlined]
 [19] eval(::Expr) at ./client.jl:449
 [20] top-level scope at ./none:3
during initialization of module Memento
in expression starting at /srv/julia/pkg/packages/PowerModels/72tBz/src/PowerModels.jl:6

I don't get this error when I try to run the same notebook locally from the terminal. I understand that PowerModels is not a part of SIIP, so consequently, I apologize if this is not the correct place for the issue.

ORCA not working with binder

in binder:

plotlyjs()

Unable to load WebIO. Please make sure WebIO works for your Jupyter client. For troubleshooting, please see the WebIO/IJulia documentation.
InitError: IOError: could not spawn `/srv/julia/pkg/artifacts/a42f5c72a500a8683c08a5e818d27a104fc9cd5a/bin/orca server --port=7982 --graph-only`: no such file or directory (ENOENT)
during initialization of module ORCA

Stacktrace:
 [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at ./process.jl:99
 [2] #550 at ./process.jl:112 [inlined]
 [3] setup_stdios(::Base.var"#550#551"{Cmd}, ::Array{Any,1}) at ./process.jl:196
 [4] _spawn at ./process.jl:111 [inlined]
 [5] open(::Cmd, ::Base.DevNull; write::Bool, read::Bool) at ./process.jl:370
 [6] open at ./process.jl:361 [inlined] (repeats 2 times)
 [7] restart_server() at /srv/julia/pkg/packages/ORCA/jdK40/src/ORCA.jl:84
 [8] __init__() at /srv/julia/pkg/packages/ORCA/jdK40/src/ORCA.jl:94
 [9] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:697
 [10] _require_search_from_serialized(::Base.PkgId, ::String) at ./loading.jl:781
 [11] _require(::Base.PkgId) at ./loading.jl:1006
 [12] require(::Base.PkgId) at ./loading.jl:927
 [13] require(::Module, ::Symbol) at ./loading.jl:922
 [14] top-level scope at /srv/julia/pkg/packages/Plots/LWw1t/src/backends.jl:490
 [15] eval at ./boot.jl:331 [inlined]
 [16] _initialize_backend(::Plots.PlotlyJSBackend) at /srv/julia/pkg/packages/Plots/LWw1t/src/backends.jl:489
 [17] backend at /srv/julia/pkg/packages/Plots/LWw1t/src/backends.jl:174 [inlined]
 [18] plotlyjs(; kw::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /srv/julia/pkg/packages/Plots/LWw1t/src/backends.jl:31
 [19] plotlyjs() at /srv/julia/pkg/packages/Plots/LWw1t/src/backends.jl:31
 [20] top-level scope at In[6]:1

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

UndefVarError: ExponentialLoad not defined

I try to run the "02_line_dynamics.jl" in SIIPExamples.jl\script\4_PowerSimulationsDynamics_examples
see the following code in 02_line_dynamics.jl

code block in 02_line_dynamics.jl

#Now, we construct the simulation:

#Time span of our simulation
tspan = (0.0, 30.0)

#Define Simulation
sim = PSD.Simulation(
ResidualModel, #Type of model used
threebus_sys, #system
pwd(), #folder to output results
tspan, #time span
Ybus_change, #Type of perturbation
)

Error message

Error: ResidualModel failed to build
│ exception =
│ UndefVarError: ExponentialLoad not defined
│ Stacktrace:
│ [1] (::PowerSimulationsDynamics.var"#11#12")(x::PowerLoad)
│ @ PowerSimulationsDynamics C:\julia_package\PowerSimulationsDynamics.jl\src\base\device_wrapper.jl:335
│ [2] filter(f::PowerSimulationsDynamics.var"#11#12", a::Vector{ElectricLoad})
│ @ Base .\array.jl:2484
│ [3] PowerSimulationsDynamics.StaticLoadWrapper(bus::Bus, loads::Vector{ElectricLoad}, bus_ix::Int64)
│ @ PowerSimulationsDynamics C:\julia_package\PowerSimulationsDynamics.jl\src\base\device_wrapper.jl:335
│ [4] _construct_load_wrapper(lookup::Dict{Int64, Int64}, map_bus_load::Dict{Bus, Vector{ElectricLoad}})
│ @ PowerSimulationsDynamics C:\julia_package\PowerSimulationsDynamics.jl\src\base\simulation_inputs.jl:253
│ [5] _wrap_loads(sys::System, lookup::Dict{Int64, Int64})
│ @ PowerSimulationsDynamics C:\julia_package\PowerSimulationsDynamics.jl\src\base\simulation_inputs.jl:242
│ [6] macro expansion
│ @ C:\julia_package\PowerSimulationsDynamics.jl\src\base\simulation_inputs.jl:47 [inlined]
│ [7] macro expansion
│ @ C:\Users\wayne.julia\packages\TimerOutputs\nDhDw\src\TimerOutput.jl:236 [inlined]
│ [8] PowerSimulationsDynamics.SimulationInputs(sys::System, #unused#::Type{ReferenceBus})
│ @ PowerSimulationsDynamics C:\julia_package\PowerSimulationsDynamics.jl\src\base\simulation_inputs.jl:46
│ [9] PowerSimulationsDynamics.SimulationInputs(#unused#::Type{ResidualModel}, sys::System, frequency_reference::Type)
│ @ PowerSimulationsDynamics C:\julia_package\PowerSimulationsDynamics.jl\src\base\simulation_inputs.jl:137
│ [10] _build_inputs!(sim::Simulation{ResidualModel}, frequency_reference::Type)
...
│ @ IJulia C:\Users\wayne.julia\packages\IJulia\AQu2H\src\eventloop.jl:8
│ [34] (::IJulia.var"#15#18")()
│ @ IJulia .\task.jl:423
└ @ PowerSimulationsDynamics C:\julia_package\PowerSimulationsDynamics.jl\src\base\simulation.jl:422

proper components not removed when building modified_RTS_GMLC_DA_sys in script/3_PowerSimulations_examples/01_operations_problems.jl

I'm occasionally getting errors with initial conditions when I expand on this example to include more days.

When I load in:
sys = build_system(PSITestSystems, "modified_RTS_GMLC_DA_sys")
The following components still exist (even though they're supposedly removed in line 3357 in PowerSystemCaseBuilder.jl/scr/system_library.jl. It looks like it's inside another loop where it shouldn't be.):
names = [ "114_SYNC_COND_1", "314_SYNC_COND_1", "313_STORAGE_1", "214_SYNC_COND_1", "212_CSP_1", ]

Test:

using PowerSystemCaseBuilder
using PowerSystems
const PSY = PowerSystems

sys = build_system(PSITestSystems, "modified_RTS_GMLC_DA_sys")
PSY.get_components(PSY.Generator, sys, x -> x.name == "114_SYNC_COND_1")

missing data file

02_line_dynamics.jl example is missing the threebus_sys.json data file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.