Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
Dear All,
How can I solve the attached optimization problem for different values ​​of.
  2 Commenti
Rajkumar Verma
Rajkumar Verma il 27 Lug 2020
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

Accedi per commentare.

Risposte (0)

Prodotti


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by