Optimization problem with lower and upper bounded constraints
5 views (last 30 days)
Show older comments
Anthony Sirico
on 1 Dec 2021
Commented: Walter Roberson
on 1 Dec 2021
maximize:x0.063x4x7 −5.04x1 −0.035x2 −10x3 −3.36x5
subject to: x5 = 1.22x4 −x1
x6 = (98000 x3x4)/(x9 + 1000x3)
x8 = (x2 + x5)/x1
(99/100)x4 ≤x1(1.12 + 0.13167x8 −0.00667x28) ≤(100/99)x4
(99/100)x7 ≤86.35 + 1.098x8 −0.038x28 + 0.325(x6 −89) ≤(100/99)x7
(9/10)x9 ≤35.82 −0.222x10 ≤(10/9)x9
(99/100)x10 ≤−133 + 3x7 ≤(100/99)x10
[0,0,0,0,0,85,90,3,0.01,145] ≤x
x≤[2000,16000,120,5000,2000,93,95,12,4,162]
How do I represent constraints 4 through 6? This is what i have so far:
clc; clear
x = optimvar('x',10,'UpperBound',[2000;16000;120;5000;2000;93;95;12;4;162],"LowerBound",[0;0;0;0;0;85;90;3;0.01;145]);
prob = optimproblem("Objective",0.063*x(4)*x(7)-5.04*x(1)-0.035*x(2)-10*x(3)-3.36*x(5),"ObjectiveSense","maximize")
prob.Constraints.c1 = x(5) == 1.22*x(4)-x(1);
prob.Constraints.c2 = x(6) == 9800* x(3)/(x(4)*x(9)+1000*x(3));
prob.Constraints.c3 = x(8) == (x(2)+x(5))/x(1);
show(prob)
0 Comments
Accepted Answer
Walter Roberson
on 1 Dec 2021
clc; clear
x = optimvar('x',10,'UpperBound',[2000;16000;120;5000;2000;93;95;12;4;162],"LowerBound",[0;0;0;0;0;85;90;3;0.01;145]);
prob = optimproblem("Objective",0.063*x(4)*x(7)-5.04*x(1)-0.035*x(2)-10*x(3)-3.36*x(5),"ObjectiveSense","maximize")
prob.Constraints.c1 = x(5) == 1.22*x(4)-x(1);
prob.Constraints.c2 = x(6) == 9800* x(3)/(x(4)*x(9)+1000*x(3));
prob.Constraints.c3 = x(8) == (x(2)+x(5))/x(1);
prob.Constraints.c4 = (99/100)*x(4) <= x(1)*(1.12 + 0.1367*x(8) - 0.00667*x(2)*x(8));
prob.Constraints.c5 = x(1)*(1.12 + 0.1367*x(8) - 0.00667*x(2)*x(8)) <= (100/99)*x(4);
prob.Constraints.c6 = (99/100)*x(7) <= 86.35 + 1.098*x(8) - 0.038*x(2)*x(8) + 0.325*(x(6)-89);
prob.Constraints.c7 = 86.35 + 1.098*x(8) - 0.038*x(2)*x(8) + 0.325*(x(6)-89) <= (100/99)*x(7);
show(prob)
and so on.
I had to guess about what x28 was; I coded it as x(2)*x(8)
2 Comments
Walter Roberson
on 1 Dec 2021
Yes, split the range inequality into two inequalities.
The x28 cannot be x^2 because x is a vector. Perhaps it is a clumsy x(8)^2
More Answers (0)
See Also
Categories
Find more on Get Started with Optimization Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!