Linear Programming
lineprog(A,B,C), a function for linear programming and calculates the minimum value in linear objective function under linear constraints.
The problem needs to be converted to the following standard form when getting parameters:
Target function:
Linear inequality constraints:
Here are how to solve simple linear programming problems defined by linear inequalities:
A |
|
1 |
[[2,1],[1,1],[0,1]] |
2 |
[[10,0],[8,0],[7,0]] |
3 |
[[-4,-3],[0,0],[0,0]] |
4 |
=lineprog(A1,A2,A3) |
A1 Input coefficient matrix A
A2 Input constraints matrix B, zeros are added to the matrix for ease of computation.
A3 Input objective function matrix C, zeros are added to the matrix for ease of computation.
A4 Solve the minimum of the objective function, output the extreme value and the extreme point coordinates.
Note: the extreme value is the first value of the first subsequence multiplied by -1, the extreme point coordinate is the first n values in the second subsequence, and n is the x quantity
As shown in the figure, the extreme value is -26, and the coordinate of the extreme value point is (2.0,6.0).
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_SPL
SPL Learning Material 👉 https://c.scudata.com
SPL Source Code and Package 👉 https://github.com/SPLWare/esProc
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProc_SPL