# [Mathematical Modeling] Linear Programming

2022-08-06 08:52:56 The constraints of the problem are denoted as s.t.(即subject to).

Since the above objective function and constraints are both linear functions,It is called a linear programming problem.

## matlab求解线性规划问题

matlabSpecifies the standard form of linear programming Matlab中求解线性规划的命令为

``````[x,fval]linprog(f,A,b)
[x,fval]linprog(f,A,b,Aeq,beq)
[x,fval]linprog(f,A,b,Aeq,beq,lb,ub)
``````   ``````clc,clear;
f = [2; 3; -5];
a = [-2 5 -1; 1 3 1];
b = [-10; 12];
aeq = [1 1 1];
beq = 7;
lb = zeros(3, 1);
%//f取-fmeans negated minimum value
[x, fval] = linprog(-f, a, b, aeq, beq, lb);
fprintf('x1=%.4f, x2=%.4f, x3=%.4f\nz=%.4f\n', x, -fval);
``````

## can be transformed into a linear programming problem     ## 多目标规划问题 1）Determine a maximum risk rate,So you can put the risk rate into the constraints,rather than as an objective function 2）Determine a minimal gain,So you can put the benefits into the constraints,rather than as an objective function 3)Attach weights to different goals 