# JuMP: Multiplicative parameters for LP

**URL:** <https://discourse.julialang.org/t/jump-multiplicative-parameters-for-lp/94192>\
**Category:** Optimization (Mathematical)\
**Created:** [February 7, 2023, 8:56am UTC](https://discourse.julialang.org/t/jump-multiplicative-parameters-for-lp/94192 "2023-02-07T08:56:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sstroemer](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Post date:** [February 7, 2023, 8:56am UTC](https://discourse.julialang.org/t/jump-multiplicative-parameters-for-lp/94192/1 "2023-02-07T08:56:48Z")

</div>

I’m trying to rework how “model parameters” work in my model. I know that

```julia
using JuMP
import HiGHS

model = direct_model(HiGHS.Optimizer())

p = @variable(model)
fix(p, 1.0; force=true)

x = @variable(model)
@constraint(model, x >= p)

@objective(model, Min, x + 0)

optimize!(model)
fix(p, 10.0; force=true)
optimize!(model)

```

works for a “somewhat low” overhead parametric RHS.

On the other hand, `p * x` obviously creates a `QuadExpr`, which prevents using it for the LHS. Is there any similar trick that comes at less performance loss than going for `ParametricOptInterface.jl` or `ParameterJuMP.jl`?

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [February 7, 2023, 10:50am UTC](https://discourse.julialang.org/t/jump-multiplicative-parameters-for-lp/94192/2 "2023-02-07T10:50:57Z")

</div>

You may be interested in this part of the JuMP manual: [Modify a variable coefficient](https://jump.dev/JuMP.jl/stable/manual/constraints/#Modify-a-variable-coefficient).

---

<div class="post-metadata">

**Author:** ![sstroemer](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Post date:** [February 7, 2023, 11:00am UTC](https://discourse.julialang.org/t/jump-multiplicative-parameters-for-lp/94192/3 "2023-02-07T11:00:30Z")

</div>

Thanks @jd-foster! Unfortunately I know about this, and while it is the “perfect solution” from a performance point of view, it is not really usable for large scale models - without significant “manual” work (that I was hoping to overcome with some other approach).

Consider the case of a variable (with my coefficient) being added to another expression that is then added - together with other expressions - to a constraint. It’s hard to find out - afterwards - what the contribution of my initial coefficient was (given the fact, that the same variable could occur in multiple of those expressions)… ☹ Also, “knowing the variable” it is not immediately clear in which constraints it ended up.

---

<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:** [February 7, 2023, 7:52pm UTC](https://discourse.julialang.org/t/jump-multiplicative-parameters-for-lp/94192/4 "2023-02-07T19:52:45Z")

</div>

No, there are no multiplicative parameters in JuMP. As you’ve seen, we’ve had two attempts at introducing them (ParameterJuMP and ParametricOptInterface, but they both have issues with performance overhead).
