How to solve the nonlinear optimization problem.

2 Ansichten (letzte 30 Tage)
Rajkumar Verma
Rajkumar Verma am 6 Jun. 2020
Kommentiert: Rajkumar Verma am 8 Jun. 2020
Hello friends,
How can I solve the attached nonlinear optimization problem.

Akzeptierte Antwort

Alan Weiss
Alan Weiss am 7 Jun. 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 Kommentare
Alan Weiss
Alan Weiss am 8 Jun. 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 am 8 Jun. 2020
Thanks. It is perfectely working.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by