# Optimization with Yalmip [closed]

I would like to solve in Matlab the following optimization problem

$$\begin{array}{ll} \text{maximize} & \bigg\| \displaystyle\sum_{l=1}^{2}\alpha_l \int_{\tau_{m+l-1}}^{\alpha_1\tau_m+\alpha_2\tau_{m+1}}e^{J(h-s)} \mathrm{d}s \bigg\|\\ \text{subject to} & \alpha_1+\alpha_2=1\\ & \alpha_1, \alpha_2 \geq 0\end{array}$$

Is it possible to solve this problem with Yalmip in Matlab? (Maybe solving the integral first)

Thanks for the tips!

The integral does not depend on the variable $\alpha_l$, so the objective is weird as the integral can be moved outside the sum, which then is equal to 1.

Anyhow,

tau1 = 1;
tau2 = 2;
J = 3;
h = 4;
alpha = sdpvar(2,1);
from = tau1;
to = alpha(1)*tau1 + alpha(2)*tau2;

Objective = 0;
for i = 1:2
Objective = Objective + exp(J*h)*(-1)*[exp(to)-exp(from)]);
end
optimize([alpha >= 0, sum(alpha) == 1], abs(Objective))