Professional Documents
Culture Documents
DET hw3
DET hw3
Scanned by CamScanner
))1
>> cvx_begin
variables x1(6) x2(6) x3(6) x4(6)
>> A=[3,12,5,8,3,10;4,10,11,12,7,2;4,14,3,31,9,15;2,7,1,1,3,10]
A=
3 12
3 10
4 10 11 12
4 14
3 31
9 15
3 10
>> x1>=0
>> x2>=0
>> x3>=0
>> x4>=0
>> cvx_end
b*y
c*x
b*y
IPM
Post
))3
>> cvx_begin
>> variables a b c d z(61)
>> minimize sum(z)
>> subject to
>> z>=((a*(x.^3)+b*(x.^2)+c*x+d)-y)
>> z>=-((a*(x.^3)+b*(x.^2)+c*x+d)-y)
>> cvx_end
b*y
c*x
b*y
IPM
Post
)
>> cvx_begin
>> variables a b c d z
>> minimize z
>> z>=((a*(x.^3)+b*(x.^2)+c*x+d)-y)
>> z>=-((a*(x.^3)+b*(x.^2)+c*x+d)-y)
>> cvx_end
b*y
c*x
b*y
IPM
Post
:cvx ) 4
>> cvx_begin
>> variables x1(4) x2(4) x3(4)
>> minimize 42*(x1(1))+50*(x1(2))+2*(x1(1)-x1(3))+30*(x2(1))+45*(x2(2))+2*(x2(1)-x2(3))+36*(x3(1))+32*(x3(2))+2*(x3(1)-x3(3))
>> subject to
>> 90*(x1(3))+40*(x2(3))+20*(x3(3))>=1400
30*(x1(3))+60*(x2(3))+80*(x3(3))>=1260
10*(x1(3))+50*(x2(3))+20*(x3(3))>=1050
>> 90*x1(4)+40*x2(4)+20*x3(4)>=1400
30*(x1(4))+60*(x2(4))+80*(x3(4))>=1260
10*(x1(4))+50*(x2(4))+20*(x3(4))>=1050
x1(1)>=x1(3)
x2(1)>=x2(3)
x3(1)>=x3(3)
x1(2)+(x1(1)-x1(3))>=x1(4)
x2(2)+(x2(1)-x2(3))>=x2(4)
x3(2)+(x3(1)-x3(3))>=x3(4)
x1>=0
x2>=0
x3>=0
>> cvx_end
b*y
c*x
b*y
IPM
Post
Status: Solved
Optimal value (cvx_optval): +1804.63