« Previous « Start » Next »

6  Setting solver and options

The solver options can be set in options.*. See help ezsolve for more information.

The following code exemplifies some basic settings:

 options.solver = 'knitro'; % Change the solver
 options.type   = 'lpcon';  % Set the problem type to avoid identification
                            % Nonlinear problem with linear objective

It is also possible to gain complete control over the solver by bypassing the ezsolve command and converting the problem to a standard TOMLAB Prob structure.

The following code will, for example, run vanDerPol (it is possible to edit the example directly of course), then convert the problem and run it with ALG 3 (SLQP) in KNITRO, and finally extract the standard solution.

 Prob = sym2prob(objective, {cbox, cbnd, ceq}, x0, options);
 Prob.KNITRO.options.ALG = 3;
 Result = tomRun('knitro', Prob, 1);
 solution = getSolution(Result);

« Previous « Start » Next »