**TOMLAB /QUICKGUIDE**- Contents
- 1 QuickGuide Overview
- 2 LP Problem
- 3 MILP Problem
- 4 QP Problem
- 5 MIQP Problem
- 6 MIQQ Problem
- 7 NLP Problem
- 8 LPCON Problem
- 9 QPCON Problem
- 10 MINLP Problem
- 11 LLS Problem
- 12 MILLS Problem
- 13 NLLS Problem
- 14 GLB Problem
- 15 GLC Problem
- 16 SDP Problem
- 17 BMI Problem
- 18 MINIMAX Problem
- 19 MINIMAXLIN Problem
- 20 L1 Problem
- 21 L1LIN Problem
- 22 LINRAT Problem
- 23 GOAL Problem
- 24 SIM Problem
- 25 GP Problem
- 26 LCP Problem
- 27 QCP Problem
- 28 MCP Problem
- 29 EXP Problem
- 30 MAD Problem
- 31 Important Information

In the main function where TOMLAB is called do:

Prob = *Assign(...); Prob.user.a = a; Prob.user.b = b; Result = tomRun('solver', Prob, 1);If for example the objective function needs the additional variables a and b do the following in the file:

function f = myobjective(x, Prob) a = Prob.user.a; b = Prob.user.b; f = sum(x)*a + sum(x.^3)*b;

See for example the minlpQG problem and use the following code:

minlpQG Prob.ConsDiff = 1; Result = tomRun('npsol', Prob, 1); Prob.ConsDiff = 11; Result = tomRun('npsol', Prob, 1);As can be seen only 43 constraint evaluations are done for the second run with NPSOL. The reason being that the solver (numerical differentiation routines) can see which variables to perturb at the same time from the

clear all Prob = probInit('lp_prob', 1); R = tomRun('minos', Prob, 1); R = tomRun('minos', Prob, 1);The first run may report a solution time around 0.3 seconds, while the second run shows that the real time spent on optimization is less than 0.01 seconds. When evaluating different solver solutions, all tests need to be run at least twice (more recommended).

There are ways to avoid the extra overhead associated with the driver routines

clear all Prob = probInit('lp_prob', 1); Prob = ProbCheck(Prob, 'minos'); R = minosTL(Prob); PrintResult(R);This is especially important when recursively calling the solver.

Warm start is commonly used when doing recursive calls. Several of the TOMLAB solvers support warm start.

clear all Prob = probInit('lp_prob', 1); R = tomRun('minos', Prob, 1); Prob = WarmDefSOL('minos', Prob, R); R = tomRun('minos', Prob, 1);Similar code will work for MINOS (also LP-, QP-MINOS), SNOPT, SQOPT, NPSOL, NLSSOL, LPOPT, QPOPT, LSSOL.

When running the TOMLAB /MINLP solvers the following code is needed. Observe that only BQPD and filterSQP can be warm started, while miqpBB and minlpBB accept a starting point.

clear all Prob = probInit('con_prob', 10); R = tomRun('filterSQP', Prob, 1); Prob = WarmDefDUNDEE('filterSQP', Prob, R); R = tomRun('filterSQP', Prob, 1);It is also possible to warm start TOMLAB /CPLEX for LP problems (only simplex solvers). When doing this one has to supply a basis. See 'help cplex' for more information.

The global solvers in the TOMLAB Base Module and TOMLAB /CGO are easily warm started. One simply sets

clear all Prob = probInit('con_prob', 10); Prob.SOL.optPar(1) = 111111; % Major print level Prob.SOL.optPar(2) = 10; % Minor print level Prob.SOL.optPar(13) = 3; % Verify level Prob.SOL.PrintFile = 'snoptP.txt'; % SNOPT print file name Prob.SOL.SummFile = 'snoptS.txt'; % SNOPT summary file name R = tomRun('snopt', Prob, 1);The print file

`/tomlab/optim`

. These routines can be used for quick testing
of the TOMLAB capabilities when problems are setup for use with
optimization toolbox. In general, the routines should be avoided as
unnecessary overhead is introduced from the format conversion. If
one has embedded calls they should be used as is.