Optimization problem with lower and upper bounded constraints
5 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2021-12-1
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 个评论
Walter Roberson
2021-12-1
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!