Equality and inequality constraint
Mostrar comentarios más antiguos
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?
13 comentarios
Walter Roberson
el 14 de Sept. de 2019
How are you running your model? And what do you mean by a single dot solution?
Rendra Hakim hafyan
el 14 de Sept. de 2019
Rendra Hakim hafyan
el 14 de Sept. de 2019
Walter Roberson
el 14 de Sept. de 2019
Sorry, my partner would be pretty upset if I got out of bed at 02:30 to paste in all the code to experiment with.
Rendra Hakim hafyan
el 14 de Sept. de 2019
Walter Roberson
el 14 de Sept. de 2019
It is the middle of the night in North America and to test your code I would need to go over to my office (it is too complicated for command line remote access from my cell phone)
My working assumption is that your constraints are either wrong or very restrictive.
Rendra Hakim hafyan
el 14 de Sept. de 2019
John D'Errico
el 14 de Sept. de 2019
Editada: John D'Errico
el 14 de Sept. de 2019
Remember that many of the people who might be willing or able to help you are now asleep here in North America, and it is late at night for those in Europe too. Worse, this is on a weekend, so some people might not be religiously checking in. Asking for immediate help is far too demanding.
I looked quickly at your code however, and I don't understand your question. What is a single dot solution? What does that mean to you?
It looks like you have what is basically a set of three objectives, each of which seems to be quadratic in the three unknowns. You have upper and lower bounds on the variables, however the bounds seem to be surprisingly tight. So I might wonder if any solution exists at all, since you also have two inequality constraints, and an equality constraint.
You are using an optimizer, GAMULTIOBJ, so that seems logical. Your objective is composed of three sub-objectives. They are NPV, which stands for Net Present Value, perhaps? TDI, which indicates what? And what is GWP?
I might wonder if you really want to minimize net present value. But you did put a minus sign in front of that term, so maybe you handled that aspect properly.
And what do the variables X(1), X(2), and X(3) indicate?
Asking someone to check your work on a problem where we are not even given any explanation of what the variables mean? Sigh. It is you who know where those equations came from, and how they were derived, and what the variables mean.
Relax. Be patient. But it would help if you were to be more forthcoming to answer some of the questions I have brought up.
Rendra Hakim hafyan
el 14 de Sept. de 2019
Walter Roberson
el 14 de Sept. de 2019
In your constraints,
c = [-2.368+0.0043*X(1)+6.637*X(2)+X(1)*X(2)*0.214+X(1)^2*-0.00000267+X(2)^2*-4.667-8;...
-41.589 -0.0062*X(1)+105.272*X(3)+X(1)*X(3)*0.312+X(1)^2*-0.000016+X(3)^2*-66.667-20];
The first of those lines has one expression in the row. The second of those two lines has two expressions in the row. That would generate an error, preventing more than one iteration.
-41.589 -0.0062*X(1)etc
is not subtraction: it is -41.589 as one element, and -0.0062*X(1)etc as a second element. Spaces matter in [] lists. Either remove the space before -0.0062*X(1)etc or else put a space after the -, making -41.589 - 0.0062*X(1)etc
Walter Roberson
el 14 de Sept. de 2019
I turn out to be the latest-working North American volunteer, but especially after 06:00 UTC (01:00 Central time) I am increasingly likely to work from bed on my cell phone. On weekdays, the regular European and Indian volunteers start coming online about 08:00 UTC but historically they are a bit irregular until about 10:00 UTC. Between about 06:00 UTC and 09:00 UTC on weekdays the regular volunteers tend not to be around, or tend to be me working extra late (and getting too tired for complex answers) or working on my cell phone from bed.
John D'Errico
el 14 de Sept. de 2019
I think Walter has a good point here. That it only executes one function evaluation, because the constraint function fails due to a syntax error. Fix that, and then try again.
Rendra Hakim hafyan
el 15 de Sept. de 2019
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Solver Outputs and Iterative Display en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
