I have developed a "mixed (non-) linear programming software package", which is described as follows: (I'm sorry that some of them can't be displayed in Word)
This software package mainly has two programs, one is to deal with mixed linear programming, and the other is to deal with nonlinearity.
1. mixed linear programming
2. Mixed nonlinear programming problem
The independent variables are the upper and lower bounds of the vector, which are the coefficient matrix and constant terms of linear constraints, the coefficient matrix and constant terms of inequality constraints in linear constraints, and the equality constraints and inequality constraints in nonlinear constraints. Is a discrete non-integer variable with a range of, is an integer variable, and the rest are continuous variables.
We can use the array of xstatus to set the state of discrete or integer variables, where xstatus( 1,:) is the subscript of discrete or integer variables in independent variables; The value of each element in xstatus(2,:) is 1 or 2. If it is 1, the independent variable of the corresponding column in xstatus is an integer variable; if it is 2, the variable of the corresponding column in xstatus is a discrete variable. The serial number of the range of discrete variables in the corresponding column. If the variable is an integer, the value is zero. So it can be expressed as:
Here are four examples to illustrate, and the rest will be discussed later.
Example 1. All variables are integers.
Modify them separately in two programs.
isAllInteger = 1;
There is no need to set the range of other discrete variables.
Example 2. X2, X4 and X7 are integers, and the rest are continuous variables.
Modify them separately in two programs.
isAllInteger = 0;
Revise as follows:
The format of calling "checkIntDisc" in the main program becomes "checkIntDisc (..., xstatus)".
Example 3. X2, X4, x4 are integers, x3, x7, x9 are taken from D 1 set, and the rest are continuous variables.
Modify them separately in two programs.
isAllInteger = 0;
Revise as follows:
The format of calling "checkIntDisc" in the main program becomes "checkintdisc (..., xstatus, d 1)".
Example 4. X2 and x4 are integers, x3 and x9 are taken from D 1 set, x7 is taken as D2, and the rest are continuous variables.
Modify them separately in two programs.
isAllInteger = 0;
Revise as follows:
The format of calling "checkIntDisc" in the main program becomes "checkintdisc (..., xstatus, d 1, d2)".
Specific steps of using two programs:
Add the path "\ ..." and use "File/Set Path ..." in Matlab environment.
According to your actual problem, follow the following six steps to modify a series of parameters and files.
The 1) parameter is given by the requirements of the function fmincom.m
a,B,Aeq,Beq,LB,UB,X0
2) 'obj_fun.m' is the target function source file.
3) 'nl_con_fun.m' is the source file of nonlinear constraints (excluding integer or discrete requirements).
4) Set whether all components are integer requirements.
isAllInteger = 1; All components are integers.
IsAllInteger=0 Not all components are integers.
5) Modify the range parameter d1-dm of discrete variables.
D 1=[2.5,3,4,6,8, 10, 12, 16]; % discrete demand x( 1), x(2), x(3)
D2=[2.5,3,4,6,8, 10, 12.2, 16.6]; Discrete demand percentage
If necessary, modify "checkintdisc (..., xstatus, d 1)" to "checkintdisc (..., xstatus, d 1, ..., dm)".
6) the modified array
Details: Fafa :spjin@whut.edu.cn.