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.

3 件のコメント

Torsten
Torsten 2018 年 10 月 8 日
0 < e(i) < 1 for 1 <= i <= 10 ?
CN_218
CN_218 2018 年 10 月 8 日
Yes
Torsten
Torsten 2018 年 10 月 9 日
Then v(i) = a(i)/b(i)^(1/e(i)) for 1 <= i <= 10.

サインインしてコメントする。

回答 (1 件)

Alan Weiss
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

製品

リリース

R2018a

質問済み:

2018 年 10 月 6 日

コメント済み:

2018 年 10 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by