Switching model parameters for optimization problem
이전 댓글 표시
Hi everyone,
I am currently working on a classic quadratic optimization problem, which I solved with
sol = quadprog(H,f,A,b,Aeq,beq,lb,ub,x0,options)
The solution is a state of energy trajectory subject to the differential equation given below:

The state of energy dynamics are formulated as equality constraints (
,
), so I can use them for the quadprog solver.
My issue here is that the battery efficiency η switches between two values (
,
) according to the sign of the input/output
. My current solution is only based on
, no matter which sign
has, because I wasn't sure how to put such an "if-statement" in the solver.
How can I consider this in my optimization formulation? Can I still use quadprog or do I have to use some other methods?
Best Regards
Sean
댓글 수: 2
It is not at all clear how the inputs to quadprog were derived from the parameters of your differential equation, or what the quadprog output represents. Why can't you invoke quadprog on two separatetwo sub-problems, one for each possible value of the switch?
Sean Shugar
2021년 4월 26일
답변 (1개)
I'm assuming x is unknown and u is known. Wouldn't it then just be,
Ppos=(u>=0);
Bu=nan(size(u)); %the vector B*u
Bu(Ppos)=u(Ppos)*eta;
Bu(~Ppos)=u(~Ppos)/eta;
카테고리
도움말 센터 및 File Exchange에서 Quadratic Programming and Cone Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!