How to Use 'linprog' ?

2 次查看(过去 30 天)
Asanga
Asanga 2014-9-30
Hello! I have a objective function similar to following,
constraints
1. x1(t) and x2(t) are know from 1 to 24.
2. x3(t),x4(t) >= 0
3. if x3(t) > 0, x4(t) = 0
4. if x4(t) > 0, x3(t) = 0
5. z(t+1) = z(t) + a*x3(t) - a*x4(t) ; z(1)=0
6. 0 <= z(t) <=1
I tried 'linprog' to solve this problem. I used two matrices containing x1(t) and x2(t) data and tried to use a 'for' loop to solve this problem.
Also, I tried to use 'if' statement for constraint 3,4,5,6. But still I am getting errors and unrealastic answers.
Can I use for loop, if, etc to create constraints while using [x,fval] = linprog (f,A,b,Aeq,beq)
Thanks

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Nonlinear Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by