フィルターのクリア

Non linear optimization using MATLAB

2 ビュー (過去 30 日間)
Naseer Khan
Naseer Khan 2017 年 12 月 29 日
コメント済み: Brendan Hamm 2018 年 1 月 3 日
I have following question on Non linear optimization that came to my lab exam. I am trying to solve it but it is giving wrong answer.
Following is my objfun.m
function f = objfun(x)
f = 0.6224*x(1)*x(3)*x(4)+(1.7781*x(2)^2.0)*x(3)+(3.1661*x(1)^2.0)*x(4)+(19.84*x(1)^2.0)*x(3);
end
Following is my confun.m
function [c, ceq] = confun(x)
%Nonlinear inequality constraints
c = 1296000-(4/3)*pi*(x(3)^3.0)-pi*(x(3)^2.0)*x(4);
% Nonlinear equality constraints
ceq = [];
Following is my main file that calls both files
LB=[10,10,0.0625,0.0625];
UB=[200,200,6.1875,6.1875];
A=[-1,0,0.0193,0;0,-1,0.00954,0;0,0,0,1];
b=[0,0,240];
Aeq=[];
beq=[];
x0 = [0.5,0.5,10.221,11.334]; % Make a starting guess at the solution
%options = optimoptions(@fmincon,'Algorithm','sqp');
[x,fval] = fmincon(@objfun,x0,A,b,Aeq,beq,LB,UB,@confun,options);
My Solution
10.0000 10.0000 6.1875 6.1875
My solution is nowhere nearer to the given answer and the issue lies in initial guess?
On stackoverflow when I put this question which I have now deleted somebody commented that there is typo in question and constraints on x1,x2 and x3,x4 are reversed. I too agree with that as the solution given in position x3 and x4 have far greater values than the one allowed in the constraints.
But sill I am not being able to find the solution?

回答 (1 件)

Brendan Hamm
Brendan Hamm 2017 年 12 月 29 日
There is clearly an issue with the question as the provided solution does not provide a valid answer to the problem. That being said, the solution that was provided with the question is not correct and you cannot expect to get that answer. I would raise the question with your professor so that hopefully they can correct the issue. Maybe the objective function is also not correct?
  5 件のコメント
Naseer Khan
Naseer Khan 2017 年 12 月 30 日
@Brendan Hamm I have made changes as you suggested but still my solution is far far away. I guess my bounds are not ok and so is not my initial guess.
Brendan Hamm
Brendan Hamm 2018 年 1 月 3 日
As I mentioned before, the solution provided does not satisfy the constraints, so there is little one can do to figure out the problem.
Also, if you wish to put files on here, upload them directly Using the Attach button. I will not follow links to other locations.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNonlinear Optimization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by