# Disassociate parameter or variable from a model in JuMP

**URL:** <https://discourse.julialang.org/t/disassociate-parameter-or-variable-from-a-model-in-jump/60851>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [May 10, 2021, 5:05am UTC](https://discourse.julialang.org/t/disassociate-parameter-or-variable-from-a-model-in-jump/60851 "2021-05-10T05:05:48Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [May 10, 2021, 8:11pm UTC](https://discourse.julialang.org/t/disassociate-parameter-or-variable-from-a-model-in-jump/60851/5 "2021-05-10T20:11:45Z")

</div>

Take a read of the first post in [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757). It has some advice on how to write a good post on construct a minimal working example.

> There is nothing equivalent for `NLparameter` right?

No. [Certain base functions on JuMP constraints not implemented for NLconstraints. · Issue #2355 · jump-dev/JuMP.jl · GitHub](https://github.com/jump-dev/JuMP.jl/issues/2355)

> because these variables appear in equations such as the objective

You can delete variables that appear in objectives and constraints.

> I am still confused as the number of variables is decreasing, but the Names registered in the model is not.

Looks like you found a bug 😄. I don’t know how we missed this one for so long… I’ll open an issue.

```Julia
julia> model = Model()
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.

julia> @variable(model, x)
x

julia> model
A JuMP Model
Feasibility problem with:
Variable: 1
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.
Names registered in the model: x

julia> delete(model, x)

julia> model[:x]
noname

julia> model
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.
Names registered in the model: x

```

---

_[View the full topic](https://discourse.julialang.org/t/disassociate-parameter-or-variable-from-a-model-in-jump/60851)._
