Linear Programming with Nonlinear Programming Solvers

버전 1.0 (20.1 KB) 작성자: John Hedengren
Similar interface to linprog but solution with nonlinear programming solvers such as IPOPT
다운로드 수: 696
업데이트 날짜: 2015/2/9

라이선스 보기

apm_linprog Linear programming.
y = apm_linprog(f,A,b,Aeq,beq,LB,UB,X0) writes a linear programming model in APMonitor Modeling Language and attempts to solve the linear programming problem:
min f'*x subject to: A*x <= b, Aeq*x = beq
x

lb and ub are a set of lower and upper bounds on the design variables, x, so that the solution is in the range lb <= x <= ub. Use empty matrices for any of the arguments. Set lb(i) = -1e20 if x(i) has no lower limit and set ub(i) = 1e20 if x(i) has no upper limit. x0 is the initial guess and starting point to x. This is similar to the Matlab linprog solver but uses different solvers such as IPOPT, APOPT, and BPOPT to solve the LP. Additional nonlinear constraints can be added to the lp.apm model for nonlinear programming solution with support for possible mixed-integer variables.

The solution is returned in the structure y with y.names (variable names), y.values (variable values), y.nvar (number of variables), and y.x (a structure containing each variable and value).

Example usage is below:

clear all; close all; clc
addpath('apm')

% example Linear program
f = [-5; -4; -6];
A = [1 -1 1
3 2 4
3 2 0];
b = [20; 42; 30];
Aeq = [];
beq = [];
lb = zeros(3,1);
ub = [];
x0 = [];

% generate and solve APMonitor LP model
y1 = apm_linprog(f,A,b,Aeq,beq,lb,ub,x0);

% compare solution to linprog (MATLAB)
y2 = linprog(f,A,b,Aeq,beq,lb,ub,x0);

disp('Validate Results with MATLAB linprog')
for i = 1:max(size(f)),
disp(['x[' int2str(i) ']: ' num2str(y1.values(i)) ' = ' num2str(y2(i))])
end

인용 양식

John Hedengren (2024). Linear Programming with Nonlinear Programming Solvers (https://www.mathworks.com/matlabcentral/fileexchange/49595-linear-programming-with-nonlinear-programming-solvers), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2014b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Linear Programming and Mixed-Integer Linear Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0