LinRatSolve: Difference between revisions
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
==Calling Syntax== | ==Calling Syntax== | ||
< | <source lang="matlab"> | ||
Result=linRatSolve(Prob,PriLev) | Result=linRatSolve(Prob,PriLev) | ||
</ | </source> | ||
==Inputs== | ==Inputs== |
Latest revision as of 08:13, 16 January 2012
Purpose
Finds a linearly constrained solution of a function of the ratio of two linear functions with the use of any suitable TOMLAB solver. Binary and integer variables are not supported.
linRatSolve solves problems of the type:
where , and .
Calling Syntax
Result=linRatSolve(Prob,PriLev)
Inputs
Prob | Structure Prob. Prob must be defined. Best is to use Prob = lpAssign(.....), if using the TQ format. Prob.QP.c1/c2 matrices should then be set (Prob.QP.c ignored). | |
PriLev | Print level in linRatSolve.
= 0 Silent except for error messages. > 0 Print summary information about problem transformation. Calls PrintResult with specified PriLev. = 2 Standard output from PrintResult (default). | |
Extra fields used in Prob: | ||
SolverRat | Name of the TOMLAB solver. Valid names are: cplex, minos, snopt, xa and more. See SolverList('lp'); | |
QP.c1 | The numerator in the objective. | |
QP.c2 | The denominator in the objective. | |
z1_L | Lower bound for z1 (default 1e-5). See description below |
Outputs
Result | Structure with results from optimization. Output depends on the solver used.
The fields x_k, f_k, x_0, xState, bState, v_k are transformed back to match the original problem. The output in Result.Prob is the result after linRatSolve transformed the problem, i.e. the altered Prob structure |
Description
The linear ratio problem is solved by linRatSolve by rewriting the problem as a linear constrained optimization problem. n+1 variables z1 and z2(2:n+1) are needed, stored as x(1:n+1). The n original variables are removed so one more variable exists in the final problem.
The problem then becomes:
where .
OBSERVE the denominator c2x must always be positive. It is normally a good a idea to run the problem with both signs (multiply each side by -1).