# How to optimize multiple times in a run

**URL:** <https://discourse.julialang.org/t/how-to-optimize-multiple-times-in-a-run/75118>\
**Category:** Optimization (Mathematical)\
**Tags:** question, jump, optimization\
**Created:** [January 24, 2022, 1:32pm UTC](https://discourse.julialang.org/t/how-to-optimize-multiple-times-in-a-run/75118 "2022-01-24T13:32:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [January 24, 2022, 7:28pm UTC](https://discourse.julialang.org/t/how-to-optimize-multiple-times-in-a-run/75118/2 "2022-01-24T19:28:51Z")

</div>

Hi @Anjinsan,

This tutorial should point you in the right direction: [Power Systems · JuMP](https://jump.dev/JuMP.jl/stable/tutorials/applications/power_systems)

If it’s only the data that is changing between periods, you can update the model in-place. Otherwise, write a function that takes in the current state of the system, formulates and solves a problem, and then returns the new state of the system.

You should also check out other projects like [https://github.com/NREL-SIIP/PowerSimulations.jl](https://github.com/NREL-SIIP/PowerSimulations.jl) and [https://github.com/NREL-SIIP/PowerSystems.jl](https://github.com/NREL-SIIP/PowerSystems.jl). They already have a lot of tooling to help solve least-cost dispatch problems, along with a range of other things.

Here’s a tutorial to get started:  
[https://nrel-siip.github.io/PowerSystems.jl/stable/modeler\_guide/generated\_modeling\_with\_JuMP/](https://nrel-siip.github.io/PowerSystems.jl/stable/modeler_guide/generated_modeling_with_JuMP/)

---

_[View the full topic](https://discourse.julialang.org/t/how-to-optimize-multiple-times-in-a-run/75118)._
