limits of Optimization variable can be another variable in problem based optimization?

조회 수: 2 (최근 30일)
I have optimization variable named PbattV1 in problem based optimization
Pmax1=10;
PbattV1 = optimvar('PbattV1',N,'LowerBound',0,'UpperBound',Pmax1);
As per optimvar help, Pmax1 (UpperBound) should be scalar. Now i want to change Pmax1= 10*a
where 'a' is another variable 0<a<1, is it possible to do it in problem based optimization and define 'a ' is a nother optimal variable ?
  댓글 수: 1
Matt J
Matt J 2022년 8월 9일
As per optimvar help, Pmax1 (UpperBound) should be scalar
No, it doesn't have to be a scalar. It must be a constant, however.

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

채택된 답변

Matt J
Matt J 2022년 8월 9일
편집: Matt J 2022년 8월 9일
No, you must use a linear inequality constraint:
PbattV1 = optimvar('PbattV1',N,'LowerBound',0);
prob.Constraints.conName=(PbattV1<=10*a);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by