Closed Alexandertj1996 closed 2 years ago
Hi
Im trying to solve the following model
MIPModel() %>% add_variable(Y[i], i = 1:48, type = "continuous") %>% set_bounds(Y[i], lb = 0, ub = 1, i = 1:48) %>% add_variable(X[i], i = 1:48, type = "continuous") %>% set_bounds(X[i], lb = 0, ub = 1, i = 1:48) %>% add_variable(B[i], i = 1:48, type = "continuous") %>% set_bounds(B[i], lb = 0, ub = 1, i = 1:48) %>% set_objective(sum_expr(X[i] * results_M314S103$x[i] + B[i] * results_M314S103$x[i], i = 1:48), sense = "min") %>% add_constraint(sum_expr(B[i], i = 1:48)-sum_expr(B[i] * Y[i]) <= UB, i = 1:48) %>% add_constraint(sum_expr(B[i], i = 1:48)-sum_expr(B[i] * Y[i]) >= LB, i = 1:48) %>% solve_model(with_ROI("glpk", verbose = TRUE))
results is a df with 48 values in x. UB and LB is some predefined values.
When i run the code i get the error:
Error in `not_supported()`: ! Operation not supported Backtrace: 1. base::source(...) 16. ompr:::`*.AbstractLinearFunction`(X[i], results_M314S103$x[i]) 17. ompr:::multiply.LinearTerm(x, y) 18. ompr:::not_supported()
I hope someone is able to help me.
add_constraint(sum_expr(B[i], i = 1:48)-sum_expr(B[i] * Y[i]) <= UB, i = 1:48) %>% add_constraint(sum_expr(B[i], i = 1:48)-sum_expr(B[i] * Y[i]) >= LB, i = 1:48) %>%
B[i] * Y[i] are non-linear terms.
B[i] * Y[i]
Hi
Im trying to solve the following model
results is a df with 48 values in x. UB and LB is some predefined values.
When i run the code i get the error:
I hope someone is able to help me.