How to solve this optimization problems for different values of lambda>0?

2 次查看(过去 30 天)
Dear All,
How can I solve the attached optimization problem for different values ​​of.
  2 个评论
Rajkumar Verma
Rajkumar Verma 2020-7-27
I have tried with this code by taking lambda=2. But system is showing error (Unable to perform assignment because dot indexing is not supported for variables of this type.)
lb = [0 0 0 0];
Aeq = [1 1 1 0];
beq = 1;
x0 = [1 1 1 4] / 3;
fun = @ObjectiveFunction;
Nonlcon = @NLcon;
A = [];
b = [];
ub = [];
[X, FVAL] = fmincon (fun, x0, A, b, t, Aeq, beq, lb, ub, Nonlcon)
function f = ObjectiveFunction (x)
f =-(x(4));
end
function [C, Ceq] = NLcon (x)
C(1)= -(((((4)^2)*x(1)+((4)^2)*x(2)+((3.4)^2)*x(3))^(1/2))-x(4));
C(2)= -(((((4)^2)*x(1)+((2.6)^2)*x(2)+((6)^2)*x(3))^(1/2))-x(4));
C(3)= -(((((3)^2)*x(1)+((5.9)^2)*x(2)+((4)^2)*x(3))^(1/2))-x(4));
C(4)= -(((((3)^2)*x(1)+((4)^2)*x(2)+((4)^2)*x(3))^(1/2))-x(4));
C(5)= -(((((4.3)^2)*x(1)+((0)^2)*x(2)+((4)^2)*x(3))^(1/2))-x(4));
Ceq= [];
end

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Nonlinear Optimization 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by