# JuMP whit PATHSolver

**URL:** https://discourse.julialang.org/t/jump-whit-pathsolver/105347
**Category:** Optimization (Mathematical)
**Tags:** jump, complementarity, path
**Created:** [October 24, 2023, 12:58pm UTC](https://discourse.julialang.org/t/jump-whit-pathsolver/105347 "2023-10-24T12:58:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sjhon](https://avatars.discourse-cdn.com/v4/letter/s/b19c9b/32.png) [@sjhon](https://discourse.julialang.org/u/sjhon)
#### Post date: [October 24, 2023, 12:58pm UTC](https://discourse.julialang.org/t/jump-whit-pathsolver/105347/1 "2023-10-24T12:58:11Z")

</div>

I am trying to define this variable T:

using JuMP  
import PATHSolver  
@variable(modelo, 0 \<= T[ω = 1:5] \<= (ω-1)\*0.25, start = 1)

Defined with this restriction:

@constraint(modelo, [ω = 1:5], (c[ω]\*(1-α)-s)_Y[ω] -(B_Q[ω]_β+β^2_T[ω]\*B) ⟂ T[ω])

The problem is that I want to define the variable T such that in the current period it has to be greater than or equal to the previous one, and it cannot be greater than the previous period by more than 0.25.

However, with the current variable definition I have, it’s not working because I might get a result like this:  
T = [0,0,0.5,0.75,1]

Which would be incorrect.

---

<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 24, 2023, 8:59pm UTC](https://discourse.julialang.org/t/jump-whit-pathsolver/105347/2 "2023-10-24T20:59:01Z")

</div>

PATh is a solver for mixed-complementarity problems, so you can’t write explicit constraints like `T[1] <= T[2]`.

You need to reformulate it by adding a new dual variable:

```plaintext
@variable(model, μ[2:5] >= 0)
@connstraint(model, [ω in 2:5], T[ω] - T[ω-1] ⟂ μ[ω])

```
