Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mapping of meta data for variable bounds #590

Merged
merged 1 commit into from
Jul 21, 2022

Conversation

svigerske
Copy link
Member

Mapping from full x to x without fixed vars was not taken into account.

@danieloliveira56 I think this should fix the issue with the variable names for variable bounds that you reported to GAMS support.
It looks to me like when going from full x to the reduced x (fixed variables removed), things were ok and that's why we got

initial x unscaled[    1]{y}= 0.0000000000000000e+00
initial x unscaled[    2]{z}= 0.0000000000000000e+00
initial x unscaled[    3]{w}= 0.0000000000000000e+00

But for the lower variable bounds (x_L), both the mapping from full x to the reduced x and then from the reduced x to the variables with lower bound needs to be taken into account. But only the latter was used in the code. (same for x_U)

So here I change it to use pos_idx (full x -> reduced x) and pos_idxL (reduced x -> x_L).
I now get

DenseVector "original x_L unscaled" with 3 elements:
original x_L unscaled[    1]{y}=-2.0000000000000000e+00
original x_L unscaled[    2]{z}=-3.0000000000000000e+00
original x_L unscaled[    3]{w}=-4.0000000000000000e+00
DenseVector "original x_U unscaled" with 3 elements:
original x_U unscaled[    1]{y}= 2.0000000000000000e+00
original x_U unscaled[    2]{z}= 3.0000000000000000e+00
original x_U unscaled[    3]{w}= 4.0000000000000000e+00

As you are an expert on this kind of Ipopt code (#570), I thought I may ask you to have another look. :)

@svigerske svigerske self-assigned this Jul 20, 2022
@danieloliveira56
Copy link
Contributor

Hi Stefan,

Yes, the variable naming for my model makes sense now.
I see the exact same output for x_L and x_U with holdfixed=0 and 1.

Looks good to me, thank you!

@svigerske
Copy link
Member Author

Thank you. I'll put this into Ipopt 3.14.9 and GAMS 40.1.0.

- mapping from full x to x without fixed vars was not taken into account
@svigerske svigerske merged commit 278d295 into stable/3.14 Jul 21, 2022
@svigerske svigerske deleted the fix-varbound-meta branch July 21, 2022 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants