Breakthrough-Energy / REISE.jl

Renewable Energy Integration Simulation Engine
https://breakthrough-energy.github.io/docs/
MIT License
30 stars 22 forks source link

feat: add demand flexibility cost #150

Closed dongqi-wu closed 3 years ago

dongqi-wu commented 3 years ago

Pull Request doc

Purpose

Update demand flexibility cost code in #135 to accommodate the changes in #142. Consolidate comments from @lanesmith Respond to comments in PR #147 (closed accidentally)

What the code is doing

Testing

The code is setup on a local computer and uses a ERCOT sub-system to reduce computation time The code is tested using dummy input files (shared in slack channel) and when inputs files are missing The results with/without the cost input files are checked and compared Various testing are performed using interval length and interval number ranging from 1 to 3

Where to look

Usage Example/Visuals

N/A

Time estimate

~15 min for people that are familiar with the previous version in #147

dongqi-wu commented 3 years ago

@danielolsen @lanesmith Sorry I somehow accidentally closed the last PR (it seems git was asking me to pull the head before I push my interactive rebase, then I might have pushed a version that is exactly the same as the head which caused the last PR to close..) I have addressed the comments from #147, please check this version.

BainanXia commented 3 years ago

I've read through the code which makes sense to me. Just curious how do we resolve the issue @lanesmith mentioned during last meeting: set_objective_coefficient works on a toy JuMP model but throws following error when calling it in loop.jl?

JULIA: MathOptInterface.ModifyObjectiveNotAllowed{MathOptInterface.ScalarCoefficientChange{Int64}}: Modifying the objective function with MathOptInterface.ScalarCoefficientChange{Int64}(MathOptInterface.VariableIndex(195001), 5) cannot be performed. You may want to use a `CachingOptimizer` in `AUTOMATIC` mode or you may need to call `reset_optimizer` before doing this operation if the `CachingOptimizer` is in `MANUAL` mode.
lanesmith commented 3 years ago

I've read through the code which makes sense to me. Just curious how do we resolve the issue @lanesmith mentioned during last meeting: set_objective_coefficient works on a toy JuMP model but throws following error when calling it in loop.jl?

JULIA: MathOptInterface.ModifyObjectiveNotAllowed{MathOptInterface.ScalarCoefficientChange{Int64}}: Modifying the objective function with MathOptInterface.ScalarCoefficientChange{Int64}(MathOptInterface.VariableIndex(195001), 5) cannot be performed. You may want to use a `CachingOptimizer` in `AUTOMATIC` mode or you may need to call `reset_optimizer` before doing this operation if the `CachingOptimizer` is in `MANUAL` mode.

When I tested on the new laptop with a new environment, the implementation that we had for loop.jl seemed to work. I'm not sure what might have caused the problem for me in the past, but perhaps it was an older JuMP version? I'm not confident that was the problem though as the Project.toml file should have been up-to-date on my end

danielolsen commented 3 years ago

When I tested on the new laptop with a new environment, the implementation that we had for loop.jl seemed to work. I'm not sure what might have caused the problem for me in the past, but perhaps it was an older JuMP version? I'm not confident that was the problem though as the Project.toml file should have been up-to-date on my end

By default, bug-fix versions are not pinned, so if we specified an older version of JuMP, that should not prevent a newer, compatible bug-fix version from being installed instead.

BainanXia commented 3 years ago

I've read through the code which makes sense to me. Just curious how do we resolve the issue @lanesmith mentioned during last meeting: set_objective_coefficient works on a toy JuMP model but throws following error when calling it in loop.jl?

JULIA: MathOptInterface.ModifyObjectiveNotAllowed{MathOptInterface.ScalarCoefficientChange{Int64}}: Modifying the objective function with MathOptInterface.ScalarCoefficientChange{Int64}(MathOptInterface.VariableIndex(195001), 5) cannot be performed. You may want to use a `CachingOptimizer` in `AUTOMATIC` mode or you may need to call `reset_optimizer` before doing this operation if the `CachingOptimizer` is in `MANUAL` mode.

When I tested on the new laptop with a new environment, the implementation that we had for loop.jl seemed to work. I'm not sure what might have caused the problem for me in the past, but perhaps it was an older JuMP version? I'm not confident that was the problem though as the Project.toml file should have been up-to-date on my end

Aha, glad to hear it is resolved magically.