Optimization of objective function with integrals where a bound is an optimization variable
이전 댓글 표시
I am attempting to maximize an objective function with integrals where the integrals' upper bounds are also the choice variables. e.g. I would like to maximize the following by choice of a 10x1 vector v
[int_0^v(1) (a(1)/(v(1))^(e(1)) dv(1) - b(1)*v(1)] + [int_0^v(2) (a(2)/(v(2))^(e(2)) dv(2) - b(2)*v(2)] + ... + [int_0^v(10) (a(10)/(v(10))^(e(10)) dv(10) - b(10)*v(10)]
My code is:
n=10;
a=rand(n,1);
b=rand(n,1)*3;
e=rand(n,1)*(-1);
prob= optimproblem('ObjectiveSense','max');
v=optimvar('v',n,1,'LowerBound',0);
series=int((a./v).^(e),0,v) -b.*v;
expand=sum(series);
prob.Objective=expand;
showproblem(prob)
sol=solve(prob);
sol.v
I receive the error "optim.internal.problemdef.Rdivide.getRdivideOperator Division by an OptimizationVariable not supported."
However, I also don't believe that I can use the 'int' function form optimization variables either, so I may be going about the problem entirely incorrectly.
답변 (1개)
Alan Weiss
2018년 10월 8일
0 개 추천
Currently, the problem-based approach, using optimproblem and the like, is only for linear or quadratic objective functions with linear constraints. To use Optimization Toolbox™ solvers, you will have to formulate your problem using the solver-based approach.
Alan Weiss
MATLAB mathematical toolbox documentation
카테고리
도움말 센터 및 File Exchange에서 Choose a Solver에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!