필터 지우기
필터 지우기

Equality and inequality constraint

조회 수: 2 (최근 30일)
Rendra Hakim hafyan
Rendra Hakim hafyan 2019년 5월 21일
편집: Matt J 2019년 5월 21일
Dear All,
Currently, I am doing an integrated biorefinery process of two chemical production.
This is my objective function
p(1) = -(21655.11+61.8*x(1)-906.31*x(2)+9.34*x(2)^2)-(5924.55 -2.16*x(1)...
+ 142.75*x(3)+ 0.42*x(1)*x(3)- 0.0648*x(1)^2-0.911*x(3)^2); %% NPV
p(2) = (278.15+2.30*x(1)-6.38*x(2)+0.017*x(1)*x(2)-0.008*x(1)^2+0.075*x(2)^2)...
-(6.62+0.036*x(1)+0.21*x(3)+0.00016*x(1)*x(3)-0.00012*x(1)^2-0.0012*x(3)^2); %%TDI
p(3) =(9906.56+1660.70*x(1)-345.99*x(2)+0.941*x(1)*x(2)+0.1776*x(1)^2+3.13*x(2)^2)...
+(44362.18+25.12*x(1)^2+15.214466275*x(3)^2); %% GWP
Constraint
function [c,c_eq] = constraints(x)
c = [14.22-0.54*x(2)+0.003*x(1)*x(2)+0.005*x(2)^2-10;...
-40.52-0.022*x(1)+1.03*x(3)+0.0032*x(1)*x(3)-0.0067*x(3)^2-15]; %% This is a constraint of demand
c_eq = [(((14.22-0.54*x(2)+0.003*x(1)*x(2)+0.005*x(2)^2)/x(2))*100)-(((40.52-0.022*x(1)+1.03*x(3)+0.0032*x(1)*x(3)-0.0067*x(3)^2)/x(3))*100)- (0.3*x(1))]; %% Then this is constraint of Total glucose consumption
end
I encounter a difficulty to run my model as it only shows single dot solution. would you like to check whether there is a mistake on my model?
  댓글 수: 2
Matt J
Matt J 2019년 5월 21일
편집: Matt J 2019년 5월 21일
We need to see what optimization solver you ran, and how you did so.
As a preliminary remark, though, the fact that you have a nonlinear constraint probably means you ran fmincon, but your objective function returns 3 results p1,p2,p3 instead of only one, so it is not clear what exactly you are minimizing.
Rendra Hakim hafyan
Rendra Hakim hafyan 2019년 5월 21일
편집: Matt J 2019년 5월 21일
Ah sorry. I run the MOO using genetic algorithm
Objective function
Maximize p1
Minimize p2 & p3
Constraint
actually, I got two inequality constraint which were for demand constraint and one equality constraint for glucose consumption where two processes must be equal 30% of x1 (I already stated there)
This is my maind code.
% Optimize with gamultiobj
options = optimoptions('gamultiobj','Display','iter',...
'MaxGeneration',250,...
'PopulationSize',50,...
'CrossoverFraction',0.8,...
'MigrationFraction',0.01,...
'PlotFcn',@gaplotpareto);
fitness =@Biorefinery;
nvars = 3;
LB = [50 49 76];
UB = [100 56 82];
ConsFcn =@constraints;
[x,fval] = gamultiobj(fitness, nvars,[],[],[],[],LB,UB,ConsFcn,options);
% Plot results
pareto front
figure(1);
scatter3(fval(:,1),fval(:,2),fval(:,3),'o');
xlabel('NPV ($Million)');
ylabel('TDI');
zlabel('GWP (kg CO2-eq)');

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by