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

[FEATURE] Avoid giving an initial solution when variables and constraints are created #481

Open
joanvendrell opened this issue Dec 11, 2024 · 0 comments
Labels

Comments

@joanvendrell
Copy link

I'm using PMD with some commercial solvers, specifically Knitro from Artelys, and even that I do not initiate any value on the variables, the solver is detecting as if an initial point was given. Revising the code, this is happening because a start value of 0 is given to the variables by default. See for example in variable_mc_bus_voltage_magnitude_only:

start = _PMD.comp_start_value(ref(pm, nw, :bus, i), ["vm_start", "vm"], t, 1.0)

The expected behavior in my opinion should be to avoid this "start" flag to be initialized if the user does not specify any initial value. This is specially useful in custom initial point definition as you do not want undefined variables to be 0, you just want to leave them undefined.

My suggestions are:

1- Either modify each function adding a conditional if the initialization is desired or not and using JuMP.set_start_value instead of start flag, as it is done in some functions such as variable_mc_bus_voltage.

2- Or just erase any initial point after defining the variables using

variables = JuMP.all_variables(pm.model) 
for var in variables 
     JuMP.set_start_value(var, nothing) 
end

I guess the option 2 is the least intrusive and time expensive in the code as it does not imply to modify every single function, but to establish a generic method.

Example of Knitro with no initialization:
Captura de pantalla 2024-12-11 a les 10 10 39 a  m

Example of Knitro with default initial points erased (option 2):
Captura de pantalla 2024-12-11 a les 10 10 59 a  m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants