中国高校课件下载中心 》 教学资源 》 大学文库

上海交通大学:《线性规划与非线性规划》教学资源_Matlab优化函数_linprog

文档信息
资源类别:文库
文档格式:PDF
文档页数:7
文件大小:35.41KB
团购合买:点击进入团购
内容简介
上海交通大学:《线性规划与非线性规划》教学资源_Matlab优化函数_linprog
刷新页面文档预览

linprog

linprog

Purpose ● Solve a linear programming problem ·min f'x such that 。A·X≤b 。Aeg·X=beg ·Ib≤X≤ub where f,x,b,beg,Ib,and ub are vectors and A and Aeg are matrices

Purpose • Solve a linear programming problem • min fTx such that • A · x≤ b • Aeq · x = beq • lb ≤ x ≤ ub • where f, x, b, beq, lb, and ub are vectors and A and Aeq are matrices

Syntax .x linprog(f,A,b,Aeq,beq) .x linprog(f,A,b,Aeq,beq,lb,ub) .x linprog(f,A,b,Aeg,beq,lb,ub,x0) .x linprog(f,A,b,Aeg,beq,lb,ub,x0,options) 。[x,fval=linprog(.…) [x,fval,exitflag]linprog(...) [x,fval,exitflag,output]linprog(...) [x,fval,exitflag,output,lambda]=linprog(...)

Syntax • x = linprog(f,A,b,Aeq,beq) • x = linprog(f,A,b,Aeq,beq,lb,ub) • x = linprog(f,A,b,Aeq,beq,lb,ub,x0) • x = linprog(f,A,b,Aeq,beq,lb,ub,x0,options) • [x,fval] = linprog(...) • [x,fval,exitflag] = linprog(...) • [x,fval,exitflag,output] = linprog(...) • [x,fval,exitflag,output,lambda] = linprog(...)

Description linprog solves linear programming problems. x linprog(f,A,b)solves min f*x such that A*x <=b. x linprog(f,A,b,Aeg,beg)solves the problem above while additionally satisfying the equality constraints Aeq*x beq.Set A=[]and b=[]if no inequalities exist. x linprog(f,A,b,Aeq,beg,lb,ub)defines a set of lower and upper bounds on the design variables,x,so that the solution is always in the range lb <=x <ub.Set Aeq=[]and beq=[]if no equalities exist

Description linprog solves linear programming problems. • x = linprog(f,A,b) solves min f'*x such that A*x <= b. • x = linprog(f,A,b,Aeq,beq) solves the problem above while additionally satisfying the equality constraints Aeq*x = beq. Set A=[] and b=[] if no inequalities exist. • x = linprog(f,A,b,Aeq,beq,lb,ub) defines a set of lower and upper bounds on the design variables, x, so that the solution is always in the range lb <= x <= ub. Set Aeq=[] and beq=[] if no equalities exist

Description [x,fval]linprog(...)returns the value of the objective function fun at the solution x: fval f*x. [x,lambda,exitflag]linprog(...)returns a value exitflag that describes the exit condition. [x,lambda,exitflag,output]linprog(...) returns a structure output that contains information about the optimization

Description • [x,fval] = linprog(...) returns the value of the objective function fun at the solution x: fval = f'*x. • [x,lambda,exitflag] = linprog(...) returns a value exitflag that describes the exit condition. • [x,lambda,exitflag,output] = linprog(...) returns a structure output that contains information about the optimization

Example min f ()=-5x1-4x2-6X3 subject to X1-X2+X3≤20 3X1+2X2+4x3≤42 3X1+2X2≤30 0≤X1,0≤2,0≤X3 First.enter the coefficients f=[-5;-4;-6]; A=[1-11 324 320]: b=[20;42;30] lb zeros(3,1);

Example • min f ( x ) = –5 x 1 – 4 x2 – 6 x3 subject to x 1 – x2 + x3 ≤ 20 3 x 1 + 2 x2+ 4 x3 ≤ 42 3 x 1 + 2 x2 ≤ 30 0 ≤ x 1, 0 ≤ x2 , 0 ≤ x3 • First, enter the coefficients f = [-5; -4; -6]; A = [1 -1 1 3 2 4 3 2 0]; b = [20; 42; 30]; lb = zeros(3,1);

Example Next,call a linear programming routine: [x,fval,exitflag]linprog(f,A,b,[][,lb); Entering x,fval gets: X= 0.0000 15.0000 3.0000 fval=

Example • Next, call a linear programming routine: [x,fval,exitflag] = linprog(f,A,b,[],[],lb); • Entering x, fval gets: x = 0.0000 15.0000 3.0000 fval=

已到末页,全文结束
刷新页面下载完整文档
VIP每日下载上限内不扣除下载券和下载次数;
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
相关文档