MATLAB: How to use linprog solver for some values of variables needs to have equal value

linprog constant variables

How i could use linprog to solve this problem. My objective and constraint have this form.
Objective Pa – -> max
A x + B y = a
C x + Pa*D <= b
and Pa >=0
I don't want to use nonlinear constraint or need to know any other function (without using nonlinear constraint) to get the optimized value for Pa
A = [-1 1 0 0 0
1 -2 1 0 0
0 1 -2 1 0
0 0 1 -2 1
0 0 0 1 -1 ]
B = [-1 0; 0 0; 0 0; 0 0; 0 -1]'
a = [0 0 0 0 0]'
C = [ 1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
-1 0 0 0 0
0 -1 0 0 0
0 0 -1 0 0
0 0 0 -1 0
0 0 0 0 -1]
D = [4.50, 0.90, 2.70, 0.90, 4.50, 4.50, 0.90, 2.70, 0.90, 4.50]'
b = [3.00, 3.00, 3.00, 3.00, 3.00 6.00, 6.00, 6.00, 6.00, 6.00]'

Best Answer

A = [-1 1 0 0 0
1 -2 1 0 0
0 1 -2 1 0
0 0 1 -2 1
0 0 0 1 -1 ];
B = [-1 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 -1];
a = [0 0 0 0 0].';
C = [ 1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
-1 0 0 0 0
0 -1 0 0 0
0 0 -1 0 0
0 0 0 -1 0
0 0 0 0 -1];
D = [4.50, 0.90, 2.70, 0.90, 4.50, 4.50, 0.90, 2.70, 0.90, 4.50].';
b = [3.00, 3.00, 3.00, 3.00, 3.00 6.00, 6.00, 6.00, 6.00, 6.00].';
Aeq=[A, B, zeros(5,1)]
beq=a
Aineq=[C,zeros(10,5), D]
bineq=b
f=[zeros(10,1);-1]
lb=[-Inf*ones(10,1);0]
ub=[Inf*ones(11,1)]
x=linprog(f,Aineq,bineq,Aeq,beq,lb,ub)