Formulating Matrix in Linear Programing (Optimization problem)

조회 수: 3 (최근 30일)
Kamaan Geoffrey Jalo
Kamaan Geoffrey Jalo 2023년 1월 4일
댓글: Matt J 2023년 1월 5일
Please can someone help me on how i can build a matrix (in Matlab) of 1 column and 10 rows from these formular?
O.F = Xv1(Cv1+d1+d2......+d10) - Xa1(Ca1+d1/2+d2/2.......+d10/2) -Y0(d1+d2......+d10) +.........Xv10(Cv10+d1+d2......+d10)- Xa10(Ca10+d1/2+d2/2....d10/2) -Y0(d1+d2......+d10)
this is my code but i am not geting the right colum vector, instead i keep getting a single scalar quantity instead of a matrix.
Ca_c = ca; the coefficient of each Xa and Xv
for j= 1:t_slice
cxa1 = Ca_c*cv(1)*ones(t_slice,1);
end
for j= 1:t_slice
cxa2 = Ca_c*ca(2)*ones(t_slice,1);
end
for j= 1:t_slice
cxa3 = Ca_c*ca(3)*ones(t_slice,1);
end
for j= 1:t_slice
cxa4 = Ca_c*ca(4)*ones(t_slice,1);
end

답변 (1개)

Matt J
Matt J 2023년 1월 5일
You haven't explained which variables are your unknowns, and which are problem constants. Regardless, you do not have to build matrices if it is cumbersome for you. You can instead formulate the linear program using the Problem-Based Set-up.
  댓글 수: 2
Kamaan Geoffrey Jalo
Kamaan Geoffrey Jalo 2023년 1월 5일
Thank you for your response, the unknown variables are Xa1 ........Xa10 and Xv1......Xv10.
Thank you
Matt J
Matt J 2023년 1월 5일
You are quite welcome.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Nonlinear Optimization에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by