From 6aa3bf99dbd4187c83167dec18ebe974421d57bc Mon Sep 17 00:00:00 2001 From: Georgey Date: Wed, 5 Jul 2017 11:44:38 +0530 Subject: Updated help folder --- help/en_US/scilab_en_US_help/linprog.html | 138 ++++++++++++++++++------------ 1 file changed, 82 insertions(+), 56 deletions(-) (limited to 'help/en_US/scilab_en_US_help/linprog.html') diff --git a/help/en_US/scilab_en_US_help/linprog.html b/help/en_US/scilab_en_US_help/linprog.html index 0ecb1ba..c3310e2 100644 --- a/help/en_US/scilab_en_US_help/linprog.html +++ b/help/en_US/scilab_en_US_help/linprog.html @@ -12,11 +12,11 @@
- << fminunc + << intqpipopt - FOSSEE Optimization Toolbox + FOSSEE Optimization Toolbox @@ -29,7 +29,7 @@ - FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > linprog + FOSSEE Optimization Toolbox >> FOSSEE Optimization Toolbox > linprog

linprog

@@ -45,77 +45,90 @@ xopt = linprog(file,param) [xopt,fopt,exitflag,output,lambda] = linprog( ... )
-

Parameters

+

Input Parameters

c : -

a vector of double, contains coefficients of the variables in the objective

+

A vector of doubles, containing the coefficients of the variables in the objective function.

A : -

a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.

+

A matrix of doubles, containing the coefficients of linear inequality constraints of size (m X n) where 'm' is the number of linear inequality constraints.

b : -

a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.

+

A vector of doubles, related to 'A' and containing the the Right hand side equation of the linear inequality constraints of size (m X 1).

Aeq : -

a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.

+

A matrix of doubles, containing the coefficients of linear equality constraints of size (m1 X n) where 'm1' is the number of linear equality constraints.

beq : -

a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.

+

A vector of doubles, related to 'Aeq' and containing the the Right hand side equation of the linear equality constraints of size (m1 X 1).

lb : -

Lower bounds, specified as a vector or array of double. lb represents the lower bounds elementwise in lb ≤ x ≤ ub.

+

A vector of doubles, containing the lower bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of variables.

ub : -

Upper bounds, specified as a vector or array of double. ub represents the upper bounds elementwise in lb ≤ x ≤ ub.

+

A vector of doubles, containing the upper bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of variables.

options : -

a list containing the parameters to be set.

+

A list, containing the option for user to specify. See below for details.

file : -

a string describing the path to the mps file.

-
xopt : -

a vector of double, the computed solution of the optimization problem.

+

A string describing the path to the mps file.

+

Outputs

+
xopt : +

A vector of doubles, containing the computed solution of the optimization problem.

fopt : -

a double, the value of the function at x.

-
status : -

status flag returned from symphony. See below for details.

+

A double, containing the the function value at x.

+
exitflaf : +

An integer, containing the flag which denotes the reason for termination of algorithm. See below for details.

output : -

The output data structure contains detailed information about the optimization process. See below for details.

+

A structure, containing the information about the optimization. See below for details.

lambda : -

The structure consist of the Lagrange multipliers at the solution of problem. See below for details.

+

A structure, containing the Lagrange multipliers of lower bound, upper bound and constraints at the optimized point. See below for details.

+ +

Description

-

OSI-CLP is used for solving the linear programming problems, OSI-CLP is a library written in C++. -Search the minimum of a constrained linear programming problem specified by :

-

-

The routine calls Clp for solving the linear programming problem, Clp is a library written in C++.

-

The options allows the user to set various parameters of the Optimization problem. -It should be defined as type "list" and contains the following fields. In the current version it only contains maxiter. -

  • Syntax : options= list("MaxIter", [---]);
  • -
  • MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
  • -
  • Default Values : options = list("MaxIter", [3000]);

-

The exitflag allows to know the status of the optimization which is given back by CLP. -

  • exitflag=0 : Optimal Solution Found
  • -
  • exitflag=1 : Primal Infeasible
  • -
  • exitflag=2 : Dual Infeasible
  • -
  • exitflag=3 : Maximum Number of Iterations Exceeded. Output may not be optimal.
  • -
  • exitflag=4 : Solution Abandoned
  • -
  • exitflag=5 : Primal objective limit reached.
  • -
  • exitflag=6 : Dual objective limit reached.

-

The output data structure contains detailed informations about the optimization process. -It has type "struct" and contains the following fields. -

  • output.iterations: The number of iterations performed during the search
  • +

    Search the minimum of a constrained linear programming problem specified by :

    +

    +

    OSI-CLP, an optimization library written in C++, is used for solving the linear programming problems.

    +

    Options

    +The options allow the user to set various parameters of the Optimization problem. The syntax for the options is given by:

    +

    options= list("MaxIter", [---], "CpuTime", [---], "GradObj", ---, "Hessian", ---, "GradCon", ---);

    +

    The options should be defined as type "list" and consist of the following fields: +

    • MaxIter : A Scalar, specifying the Maximum Number of iterations that the solver should take.

    +

    The default values for the various items are given as:

    +

    options = list("MaxIter", [3000], "CpuTime", [600]);

    + +

    The exitflag allows the user to know the status of the optimization which is returned by Ipopt. The values it can take and what they indicate is described below: +

    • 0 : Optimal Solution Found
    • +
    • 1 : Primal Infeasible
    • +
    • 2 : Dual Infeasible
    • +
    • 3 : Maximum Number of Iterations Exceeded. Output may not be optimal.
    • +
    • 4 : Solution Abandoned
    • +
    • 5 : Primal objective limit reached.
    • +
    • 6 : Dual objective limit reached.

    + +

    The output data structure contains detailed information about the optimization process. +It is of type "struct" and contains the following fields. +

    • output.Iterations: The number of iterations performed.
    • output.constrviolation: The max-norm of the constraint violation.

    -

    The lambda data structure contains the Lagrange multipliers at the end -of optimization. In the current version the values are returned only when the the solution is optimal. +

    The lambda data structure contains the Lagrange multipliers at the end of optimization. In the current version the values are returned only when the the solution is optimal. It has type "struct" and contains the following fields.

    • lambda.lower: The Lagrange multipliers for variable lower bounds.
    • lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
    • lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.

-

Examples

-
//Optimal problems
-//Linear program, linear inequality constraints
+

A few examples displaying the various functionalities of linprog have been provided below. You will find a series of problems and the appropriate code snippets to solve them.

+

Example

+

Here we solve a simple objective function, subjected to six linear inequality constraints.

+

Find x in R^2 such that it minimizes:

+

+

+
//Example 1: Linear program, linear inequality constraints
 c=[-1,-1/3]'
 A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
 b=[2,1,2,1,-1,2]
 [xopt,fopt,exitflag,output,lambda]=linprog(c, A, b)
 // Press ENTER to continue
-

Examples

-
//Linear program with Linear Inequalities and Equalities`
+

Example

+

Here we build up on the previous example by adding linear equality constraints. +We add the following constraints to the problem specified above:

+

+

+
//Example 2: Linear program with Linear Inequalities and Equalities`
 c=[-1,-1/3]'
 A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
 b=[2,1,2,1,-1,2]
@@ -124,8 +137,11 @@ It has type "struct" and contains the following fields.
 [xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq)
 // Press ENTER to continue
-

Examples

-
//Linear program with all constraint types
+

Example

+

In this example, we proceed to add the upper and lower bounds to the objective function.

+

+

+
//Example 3: Linear program with all constraint types
 c=[-1,-1/3]'
 A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
 b=[2,1,2,1,-1,2]
@@ -135,9 +151,11 @@ It has type "struct" and contains the following fields.
 ub=[1.5,1.25]
 [xopt,fopt,exitflag,output,lambda]=linprog(c, A, b, Aeq, beq, lb, ub)
 // Press ENTER to continue
+

Example

-

Examples

-
//Primal Infeasible Problem
+   

Primal Infeasible Problems: Find x in R^3 such that it minimizes:

+

+

//Example 4: Primal Infeasible Problem
 c=[-1,-1,-1]'
 A=[1,2,-1]
 b=[-4]
@@ -148,8 +166,12 @@ It has type "struct" and contains the following fields.
 [xopt,fopt,exitflag,output,lambda]= linprog(c,A,b,Aeq,beq,lb,ub)
 // Press ENTER to continue
-

Examples

-
//Dual Infeasible Problem
+

Example

+ +

Unbounded Problems: Find x in R^3 such that it minimizes:

+

+

+
//Example 5: Unbounded Problem
 c=[3,5,-7]'
 A=[-1,-1,4;1,1,4]
 b=[-8,5]
@@ -160,11 +182,15 @@ It has type "struct" and contains the following fields.
 [xopt,fopt,exitflag,output,lambda]= linprog(c,A,b,Aeq,beq,lb,ub)
 // Press ENTER to continue
-

Examples

+

Example

filepath = get_absolute_file_path('linprog.dem.sce');
 filepath = filepath + "exmip1.mps"
 [xopt,fopt,exitflag,output,lambda] =linprog(filepath)
+ + + +

Authors

  • Bhanu Priya Sayal, Guru Pradeep Reddy

@@ -174,11 +200,11 @@ It has type "struct" and contains the following fields.
Report an issue
- << fminunc + << intqpipopt - FOSSEE Optimization Toolbox + FOSSEE Optimization Toolbox -- cgit