필터 지우기
필터 지우기

Problem-based optimization: Initial guess for only one variable

조회 수: 3 (최근 30일)
b999
b999 2023년 10월 25일
댓글: Walter Roberson 2023년 10월 26일
Hello,
I have a optimization problem with the problem-based approach and I am defining a few variables
A = ones(50,10);
a = optimvar("a",size(A),"Type","integer","LowerBound",0,"UpperBound",2);
b = optimvar("b",size(a),"Type","integer","LowerBound",0,"UpperBound",2);
c = optimvar("c",size(a),"Type","integer","LowerBound",0,"UpperBound",2);
Now I want to make an initial guess for only a, because I can't guess values for b and c. I tried it like this, but it doesn't work:
initial_guess = ...;
x0 = struct('a', initial_guess, 'b', [], 'c', []);
...
solution = solve(prob, x0);
It says, that b and c can't be empty. But I don't know how to implemnt it in another way.
Is there a possibilty to make a guess for only one variable?
(If I am defining b and c e.g. as zeros, the guess is infeasable)
  댓글 수: 2
Fabio Freschi
Fabio Freschi 2023년 10월 25일
Why don't you set your b and c variables in the middle of the range? In your case 1?
b999
b999 2023년 10월 25일
Because I have a lot of constraints besides the variables, which are not fulfilled then.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2023년 10월 25일
there are only 3^3 different possibilities. Run them each in turn hardcoding one particular a, b, c possibility. Take the best of the 27 results as the solution.
  댓글 수: 2
b999
b999 2023년 10월 25일
It is an easy example to show my problem. The Size of the Variables could be 50x10 or more and there are more than three variables. The a,b and c is just an example. I can't try taht many possibilities
Walter Roberson
Walter Roberson 2023년 10월 26일
Is there a possibilty to make a guess for only one variable?
NO.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by