# Modifying hotstart of a variable

**URL:** <https://discourse.julialang.org/t/modifying-hotstart-of-a-variable/29609>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [October 7, 2019, 5:23pm UTC](https://discourse.julialang.org/t/modifying-hotstart-of-a-variable/29609 "2019-10-07T17:23:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gobs](https://avatars.discourse-cdn.com/v4/letter/g/bc8723/32.png) [@gobs](https://discourse.julialang.org/u/gobs)\
**Post date:** [October 7, 2019, 5:23pm UTC](https://discourse.julialang.org/t/modifying-hotstart-of-a-variable/29609/1 "2019-10-07T17:23:47Z")

</div>

I would like to modify the hot start of a variable. I’ve given an minimum working example below:

```julia
using JuMP, Gurobi, Ipopt

m = Model(with_optimizer(Ipopt.Optimizer))
@variable(m, x, start = 0) # hot start
@constraint(m, -x <= 0)
@constraint(m, x <= 4*pi)
@NLobjective(m, Min, sin(x))

optimize!(m) # Assume this didn't work, let's try again

@variable(m, x, start = pi) # JuMP complains about redefining variables

```

Obviously I could just rerun my model, but this is silly - there must be a better way of doing this?

---

<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:** [October 7, 2019, 6:22pm UTC](https://discourse.julialang.org/t/modifying-hotstart-of-a-variable/29609/2 "2019-10-07T18:22:48Z")

</div>

See the docs: [Variables · JuMP](https://www.juliaopt.org/JuMP.jl/v0.20.0/variables/#Start-values-1)

Note that

```nohighlight
optimize!(m) # Assume this didn't work, let's try again

@variable(m, x, start = pi) # JuMP complains about redefining variables

```

is indeed trying to make a new variable called `x`. It is **not** updating the old variable `x`, hence JuMP’s complaint.
