~~Correct.~~ I didn’t read clearly enough.

No, both would. `@constraint(model, 0.9 <= x <= 1)`

adds a `ScalarAffineFunction`

-in-`Interval`

constraint.

~~Correct.~~ I didn’t read clearly enough.

No, both would. `@constraint(model, 0.9 <= x <= 1)`

adds a `ScalarAffineFunction`

-in-`Interval`

constraint.

But I imagine the order is also important: `fix`

ing before adding the constraints will result in an error/infeasibility?

Oops. I didn’t read your question enough. Both result in infeasibilities.

1 Like

So `fix`

only applies to the bounds declared with the variable

1 Like

Yes. You can set variable bounds one of two ways:

```
@variable(model, l <= x <= u)
```

or

```
@variable(model, x)
set_lower_bound(x, l)
set_upper_bound(x, u)
```

1 Like

I am watching your educational video

Thank you

and I have another question please

If I want to validate my ACOPF results, can I use Power World Simulator for example to do so

Is it a good choice ?

I have been watching lecture now on convex relaxation and it explained to me the main concept so now how can I do convex relaxation for my problem…Do I have to write the code of SDP for example or can I use certain solver instead

I would start with one of the simplest convex relaxations. That is the SOC relaxation in the W space. The idea is, defined new voltage product variables W^R_{i,j} + i*W^I_{i,j}, which will represent the complex voltage products V_i * V_j. You go through your model and make these replacements,

|V_i||V_i| \rightarrow W_{ii} \\
|V_i||V_j| cos(\theta_i - \theta_j) \rightarrow W^R_{ij} \\
|V_i||V_j| sin(\theta_i - \theta_j) \rightarrow W^I_{ij}

You then add this constraint,

(W^R_{ij})^2 + (W^I_{ij})^2 \leq W^R_{ii}*W^I_{ii}

As a refrence implementation here is how AC and SOC models are constructed in PowerModels,

1 Like

Aha ,so I want to use the AC OPF then switch to the rectangular or maybe I will do both in parallel…so

I used Couenne with ACOPF formulations through AmplNLWriter and I got “INFEASIBLE”

Although with the same model and equations with Ipopt, a local solution was found

could it be something with the couenne or my model ?!

That sounds like a tolerance issue. Under the hood, Couenne is using Ipopt to solve the continuous problems.