How to solve the nonlinear optimization problem.

2 visualizaciones (últimos 30 días)
Rajkumar Verma
Rajkumar Verma el 6 de Jun. de 2020
Comentada: Rajkumar Verma el 8 de Jun. de 2020
Hello friends,
How can I solve the attached nonlinear optimization problem.

Respuesta aceptada

Alan Weiss
Alan Weiss el 7 de Jun. de 2020
This looks like a job for fmincon. Variables x (3-D) and t = x(4).
Objective function t = x(4).
Lower bound lb = [0,0,0,-Inf].
Linear constraint Aeq = [1 1 1 0], beq = 1.
Nonlinear constraint function as you have, with c(x) = a three-element vector F(x) - x(4). ceq = [].
I would take the initial point something like x0 = [1 1 1 30]/3.
Is that clear enough?
Alan Weiss
MATLAB mathematical toolbox documentation
  3 comentarios
Alan Weiss
Alan Weiss el 8 de Jun. de 2020
I'm sorry, but I do not understand your code. Maybe you did it right, but what you wrote doesn't make sense to me. It should look like this:
lb = [0,0,0,-Inf];
Aeq = [1 1 1 0];
beq = 1;
x0 = [1 1 1 30]/3;
fun = @ObjectiveFunction;
Nonlcon = @NLcon;
A = [];
b = [];
ub = [];
[X, FVAL] = fmincon(fun, x0, A, b, Aeq, beq, lb, ub, Nonlcon)
function f = ObjectiveFunction(x)
f = x(4);
end
function [C, Ceq] = NLcon(x)
C(1)= (0.3*((1-((0.5422)^x(1))*((0.4142)^x(2))*((0.6818)^x(3)))/(1+((0.5422)^x(1))*((0.4142)^x(2))*((0.6818)^x(3))))+0.7*((1-((0.1892)^x(1))*((0.0905)^x(2))*((0.5422)^x(3)))/(1+((0.1892)^x(1))*((0.0905)^x(2))*((0.5422)^x(3)))))-x(4);
C(2)= (0.3*((1-((0.1892)^x(1))*((0.5422)^x(2))*((0.2968)^x(3)))/(1+((0.1892)^x(1))*((0.5422)^x(2))*((0.2968)^x(3))))+0.7*((1-((0.0905)^x(1))*((0.4142)^x(2))*((0.0905)^x(3)))/(1+((0.0905)^x(1))*((0.4142)^x(2))*((0.0905)^x(3)))))-x(4);
C(3)= (0.3*((1-((0.4142)^x(1))*((0.8340)^x(2))*((0.5422)^x(3)))/(1+((0.4142)^x(1))*((0.8340)^x(2))*((0.5422)^x(3))))+0.7*((1-((0.0905)^x(1))*((0.0905)^x(2))*((0.1892)^x(3)))/(1+((0.0905)^x(1))*((0.0905)^x(2))*((0.1892)^x(3)))))-x(4);
Ceq= [];
end
That ran for me without error.
Alan Weiss
MATLAB mathematical toolbox documentation
Rajkumar Verma
Rajkumar Verma el 8 de Jun. de 2020
Thanks. It is perfectely working.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Solver Outputs and Iterative Display en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by